]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - sys/dev/hyperv/netvsc/hv_rndis.h
MFC 296379,296380,296381,296593,296594,296595
[FreeBSD/stable/10.git] / sys / dev / hyperv / netvsc / hv_rndis.h
1 /*-
2  * Copyright (c) 2009-2012 Microsoft Corp.
3  * Copyright (c) 2010-2012 Citrix Inc.
4  * Copyright (c) 2012 NetApp Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice unmodified, this list of conditions, and the following
12  *    disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in the
15  *    documentation and/or other materials provided with the distribution.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  *
28  * $FreeBSD$
29  */
30
31 #ifndef __HV_RNDIS_H__
32 #define __HV_RNDIS_H__
33
34
35 /*
36  * NDIS protocol version numbers
37  */
38 #define NDIS_VERSION_5_0                        0x00050000
39 #define NDIS_VERSION_5_1                        0x00050001
40 #define NDIS_VERSION_6_0                        0x00060000
41 #define NDIS_VERSION_6_1                        0x00060001
42 #define NDIS_VERSION_6_30                       0x0006001e
43
44 #define NDIS_VERSION                            (NDIS_VERSION_5_1)
45
46 /*
47  * Status codes
48  */
49
50 #define STATUS_SUCCESS                          (0x00000000L)
51 #define STATUS_UNSUCCESSFUL                     (0xC0000001L)
52 #define STATUS_PENDING                          (0x00000103L)
53 #define STATUS_INSUFFICIENT_RESOURCES           (0xC000009AL)
54 #define STATUS_BUFFER_OVERFLOW                  (0x80000005L)
55 #define STATUS_NOT_SUPPORTED                    (0xC00000BBL)
56
57 #define RNDIS_STATUS_SUCCESS                    (STATUS_SUCCESS)
58 #define RNDIS_STATUS_PENDING                    (STATUS_PENDING)
59 #define RNDIS_STATUS_NOT_RECOGNIZED             (0x00010001L)
60 #define RNDIS_STATUS_NOT_COPIED                 (0x00010002L)
61 #define RNDIS_STATUS_NOT_ACCEPTED               (0x00010003L)
62 #define RNDIS_STATUS_CALL_ACTIVE                (0x00010007L)
63
64 #define RNDIS_STATUS_ONLINE                     (0x40010003L)
65 #define RNDIS_STATUS_RESET_START                (0x40010004L)
66 #define RNDIS_STATUS_RESET_END                  (0x40010005L)
67 #define RNDIS_STATUS_RING_STATUS                (0x40010006L)
68 #define RNDIS_STATUS_CLOSED                     (0x40010007L)
69 #define RNDIS_STATUS_WAN_LINE_UP                (0x40010008L)
70 #define RNDIS_STATUS_WAN_LINE_DOWN              (0x40010009L)
71 #define RNDIS_STATUS_WAN_FRAGMENT               (0x4001000AL)
72 #define RNDIS_STATUS_MEDIA_CONNECT              (0x4001000BL)
73 #define RNDIS_STATUS_MEDIA_DISCONNECT           (0x4001000CL)
74 #define RNDIS_STATUS_HARDWARE_LINE_UP           (0x4001000DL)
75 #define RNDIS_STATUS_HARDWARE_LINE_DOWN         (0x4001000EL)
76 #define RNDIS_STATUS_INTERFACE_UP               (0x4001000FL)
77 #define RNDIS_STATUS_INTERFACE_DOWN             (0x40010010L)
78 #define RNDIS_STATUS_MEDIA_BUSY                 (0x40010011L)
79 #define RNDIS_STATUS_MEDIA_SPECIFIC_INDICATION  (0x40010012L)
80 #define RNDIS_STATUS_WW_INDICATION        RNDIS_STATUS_MEDIA_SPECIFIC_INDICATION
81 #define RNDIS_STATUS_LINK_SPEED_CHANGE          (0x40010013L)
82
83 #define RNDIS_STATUS_NOT_RESETTABLE             (0x80010001L)
84 #define RNDIS_STATUS_SOFT_ERRORS                (0x80010003L)
85 #define RNDIS_STATUS_HARD_ERRORS                (0x80010004L)
86 #define RNDIS_STATUS_BUFFER_OVERFLOW            (STATUS_BUFFER_OVERFLOW)
87
88 #define RNDIS_STATUS_FAILURE                    (STATUS_UNSUCCESSFUL)
89 #define RNDIS_STATUS_RESOURCES                  (STATUS_INSUFFICIENT_RESOURCES)
90 #define RNDIS_STATUS_CLOSING                    (0xC0010002L)
91 #define RNDIS_STATUS_BAD_VERSION                (0xC0010004L)
92 #define RNDIS_STATUS_BAD_CHARACTERISTICS        (0xC0010005L)
93 #define RNDIS_STATUS_ADAPTER_NOT_FOUND          (0xC0010006L)
94 #define RNDIS_STATUS_OPEN_FAILED                (0xC0010007L)
95 #define RNDIS_STATUS_DEVICE_FAILED              (0xC0010008L)
96 #define RNDIS_STATUS_MULTICAST_FULL             (0xC0010009L)
97 #define RNDIS_STATUS_MULTICAST_EXISTS           (0xC001000AL)
98 #define RNDIS_STATUS_MULTICAST_NOT_FOUND        (0xC001000BL)
99 #define RNDIS_STATUS_REQUEST_ABORTED            (0xC001000CL)
100 #define RNDIS_STATUS_RESET_IN_PROGRESS          (0xC001000DL)
101 #define RNDIS_STATUS_CLOSING_INDICATING         (0xC001000EL)
102 #define RNDIS_STATUS_NOT_SUPPORTED              (STATUS_NOT_SUPPORTED)
103 #define RNDIS_STATUS_INVALID_PACKET             (0xC001000FL)
104 #define RNDIS_STATUS_OPEN_LIST_FULL             (0xC0010010L)
105 #define RNDIS_STATUS_ADAPTER_NOT_READY          (0xC0010011L)
106 #define RNDIS_STATUS_ADAPTER_NOT_OPEN           (0xC0010012L)
107 #define RNDIS_STATUS_NOT_INDICATING             (0xC0010013L)
108 #define RNDIS_STATUS_INVALID_LENGTH             (0xC0010014L)
109 #define RNDIS_STATUS_INVALID_DATA               (0xC0010015L)
110 #define RNDIS_STATUS_BUFFER_TOO_SHORT           (0xC0010016L)
111 #define RNDIS_STATUS_INVALID_OID                (0xC0010017L)
112 #define RNDIS_STATUS_ADAPTER_REMOVED            (0xC0010018L)
113 #define RNDIS_STATUS_UNSUPPORTED_MEDIA          (0xC0010019L)
114 #define RNDIS_STATUS_GROUP_ADDRESS_IN_USE       (0xC001001AL)
115 #define RNDIS_STATUS_FILE_NOT_FOUND             (0xC001001BL)
116 #define RNDIS_STATUS_ERROR_READING_FILE         (0xC001001CL)
117 #define RNDIS_STATUS_ALREADY_MAPPED             (0xC001001DL)
118 #define RNDIS_STATUS_RESOURCE_CONFLICT          (0xC001001EL)
119 #define RNDIS_STATUS_NO_CABLE                   (0xC001001FL)
120
121 #define RNDIS_STATUS_INVALID_SAP                (0xC0010020L)
122 #define RNDIS_STATUS_SAP_IN_USE                 (0xC0010021L)
123 #define RNDIS_STATUS_INVALID_ADDRESS            (0xC0010022L)
124 #define RNDIS_STATUS_VC_NOT_ACTIVATED           (0xC0010023L)
125 #define RNDIS_STATUS_DEST_OUT_OF_ORDER          (0xC0010024L)
126 #define RNDIS_STATUS_VC_NOT_AVAILABLE           (0xC0010025L)
127 #define RNDIS_STATUS_CELLRATE_NOT_AVAILABLE     (0xC0010026L)
128 #define RNDIS_STATUS_INCOMPATABLE_QOS           (0xC0010027L)
129 #define RNDIS_STATUS_AAL_PARAMS_UNSUPPORTED     (0xC0010028L)
130 #define RNDIS_STATUS_NO_ROUTE_TO_DESTINATION    (0xC0010029L)
131
132 #define RNDIS_STATUS_TOKEN_RING_OPEN_ERROR      (0xC0011000L)
133
134
135 /*
136  * Object Identifiers used by NdisRequest Query/Set Information
137  */
138
139 /*
140  * General Objects
141  */
142
143 #define RNDIS_OID_GEN_SUPPORTED_LIST                    0x00010101
144 #define RNDIS_OID_GEN_HARDWARE_STATUS                   0x00010102
145 #define RNDIS_OID_GEN_MEDIA_SUPPORTED                   0x00010103
146 #define RNDIS_OID_GEN_MEDIA_IN_USE                      0x00010104
147 #define RNDIS_OID_GEN_MAXIMUM_LOOKAHEAD                 0x00010105
148 #define RNDIS_OID_GEN_MAXIMUM_FRAME_SIZE                0x00010106
149 #define RNDIS_OID_GEN_LINK_SPEED                        0x00010107
150 #define RNDIS_OID_GEN_TRANSMIT_BUFFER_SPACE             0x00010108
151 #define RNDIS_OID_GEN_RECEIVE_BUFFER_SPACE              0x00010109
152 #define RNDIS_OID_GEN_TRANSMIT_BLOCK_SIZE               0x0001010A
153 #define RNDIS_OID_GEN_RECEIVE_BLOCK_SIZE                0x0001010B
154 #define RNDIS_OID_GEN_VENDOR_ID                         0x0001010C
155 #define RNDIS_OID_GEN_VENDOR_DESCRIPTION                0x0001010D
156 #define RNDIS_OID_GEN_CURRENT_PACKET_FILTER             0x0001010E
157 #define RNDIS_OID_GEN_CURRENT_LOOKAHEAD                 0x0001010F
158 #define RNDIS_OID_GEN_DRIVER_VERSION                    0x00010110
159 #define RNDIS_OID_GEN_MAXIMUM_TOTAL_SIZE                0x00010111
160 #define RNDIS_OID_GEN_PROTOCOL_OPTIONS                  0x00010112
161 #define RNDIS_OID_GEN_MAC_OPTIONS                       0x00010113
162 #define RNDIS_OID_GEN_MEDIA_CONNECT_STATUS              0x00010114
163 #define RNDIS_OID_GEN_MAXIMUM_SEND_PACKETS              0x00010115
164 #define RNDIS_OID_GEN_VENDOR_DRIVER_VERSION             0x00010116
165 #define RNDIS_OID_GEN_NETWORK_LAYER_ADDRESSES           0x00010118
166 #define RNDIS_OID_GEN_TRANSPORT_HEADER_OFFSET           0x00010119
167 #define RNDIS_OID_GEN_MACHINE_NAME                      0x0001021A
168 #define RNDIS_OID_GEN_RNDIS_CONFIG_PARAMETER            0x0001021B
169
170 /*
171  * For receive side scale
172  */
173 /* Query only */
174 #define RNDIS_OID_GEN_RSS_CAPABILITIES                  0x00010203
175 /* Query and set */
176 #define RNDIS_OID_GEN_RSS_PARAMETERS                    0x00010204
177
178 #define RNDIS_OID_GEN_XMIT_OK                           0x00020101
179 #define RNDIS_OID_GEN_RCV_OK                            0x00020102
180 #define RNDIS_OID_GEN_XMIT_ERROR                        0x00020103
181 #define RNDIS_OID_GEN_RCV_ERROR                         0x00020104
182 #define RNDIS_OID_GEN_RCV_NO_BUFFER                     0x00020105
183
184 #define RNDIS_OID_GEN_DIRECTED_BYTES_XMIT               0x00020201
185 #define RNDIS_OID_GEN_DIRECTED_FRAMES_XMIT              0x00020202
186 #define RNDIS_OID_GEN_MULTICAST_BYTES_XMIT              0x00020203
187 #define RNDIS_OID_GEN_MULTICAST_FRAMES_XMIT             0x00020204
188 #define RNDIS_OID_GEN_BROADCAST_BYTES_XMIT              0x00020205
189 #define RNDIS_OID_GEN_BROADCAST_FRAMES_XMIT             0x00020206
190 #define RNDIS_OID_GEN_DIRECTED_BYTES_RCV                0x00020207
191 #define RNDIS_OID_GEN_DIRECTED_FRAMES_RCV               0x00020208
192 #define RNDIS_OID_GEN_MULTICAST_BYTES_RCV               0x00020209
193 #define RNDIS_OID_GEN_MULTICAST_FRAMES_RCV              0x0002020A
194 #define RNDIS_OID_GEN_BROADCAST_BYTES_RCV               0x0002020B
195 #define RNDIS_OID_GEN_BROADCAST_FRAMES_RCV              0x0002020C
196
197 #define RNDIS_OID_GEN_RCV_CRC_ERROR                     0x0002020D
198 #define RNDIS_OID_GEN_TRANSMIT_QUEUE_LENGTH             0x0002020E
199
200 #define RNDIS_OID_GEN_GET_TIME_CAPS                     0x0002020F
201 #define RNDIS_OID_GEN_GET_NETCARD_TIME                  0x00020210
202
203 /*
204  * These are connection-oriented general OIDs.
205  * These replace the above OIDs for connection-oriented media.
206  */
207 #define RNDIS_OID_GEN_CO_SUPPORTED_LIST                 0x00010101
208 #define RNDIS_OID_GEN_CO_HARDWARE_STATUS                0x00010102
209 #define RNDIS_OID_GEN_CO_MEDIA_SUPPORTED                0x00010103
210 #define RNDIS_OID_GEN_CO_MEDIA_IN_USE                   0x00010104
211 #define RNDIS_OID_GEN_CO_LINK_SPEED                     0x00010105
212 #define RNDIS_OID_GEN_CO_VENDOR_ID                      0x00010106
213 #define RNDIS_OID_GEN_CO_VENDOR_DESCRIPTION             0x00010107
214 #define RNDIS_OID_GEN_CO_DRIVER_VERSION                 0x00010108
215 #define RNDIS_OID_GEN_CO_PROTOCOL_OPTIONS               0x00010109
216 #define RNDIS_OID_GEN_CO_MAC_OPTIONS                    0x0001010A
217 #define RNDIS_OID_GEN_CO_MEDIA_CONNECT_STATUS           0x0001010B
218 #define RNDIS_OID_GEN_CO_VENDOR_DRIVER_VERSION          0x0001010C
219 #define RNDIS_OID_GEN_CO_MINIMUM_LINK_SPEED             0x0001010D
220
221 #define RNDIS_OID_GEN_CO_GET_TIME_CAPS                  0x00010201
222 #define RNDIS_OID_GEN_CO_GET_NETCARD_TIME               0x00010202
223
224 /*
225  * These are connection-oriented statistics OIDs.
226  */
227 #define RNDIS_OID_GEN_CO_XMIT_PDUS_OK                   0x00020101
228 #define RNDIS_OID_GEN_CO_RCV_PDUS_OK                    0x00020102
229 #define RNDIS_OID_GEN_CO_XMIT_PDUS_ERROR                0x00020103
230 #define RNDIS_OID_GEN_CO_RCV_PDUS_ERROR                 0x00020104
231 #define RNDIS_OID_GEN_CO_RCV_PDUS_NO_BUFFER             0x00020105
232
233
234 #define RNDIS_OID_GEN_CO_RCV_CRC_ERROR                  0x00020201
235 #define RNDIS_OID_GEN_CO_TRANSMIT_QUEUE_LENGTH          0x00020202
236 #define RNDIS_OID_GEN_CO_BYTES_XMIT                     0x00020203
237 #define RNDIS_OID_GEN_CO_BYTES_RCV                      0x00020204
238 #define RNDIS_OID_GEN_CO_BYTES_XMIT_OUTSTANDING         0x00020205
239 #define RNDIS_OID_GEN_CO_NETCARD_LOAD                   0x00020206
240
241 /*
242  * These are objects for Connection-oriented media call-managers.
243  */
244 #define RNDIS_OID_CO_ADD_PVC                            0xFF000001
245 #define RNDIS_OID_CO_DELETE_PVC                         0xFF000002
246 #define RNDIS_OID_CO_GET_CALL_INFORMATION               0xFF000003
247 #define RNDIS_OID_CO_ADD_ADDRESS                        0xFF000004
248 #define RNDIS_OID_CO_DELETE_ADDRESS                     0xFF000005
249 #define RNDIS_OID_CO_GET_ADDRESSES                      0xFF000006
250 #define RNDIS_OID_CO_ADDRESS_CHANGE                     0xFF000007
251 #define RNDIS_OID_CO_SIGNALING_ENABLED                  0xFF000008
252 #define RNDIS_OID_CO_SIGNALING_DISABLED                 0xFF000009
253
254
255 /*
256  * 802.3 Objects (Ethernet)
257  */
258
259 #define RNDIS_OID_802_3_PERMANENT_ADDRESS               0x01010101
260 #define RNDIS_OID_802_3_CURRENT_ADDRESS                 0x01010102
261 #define RNDIS_OID_802_3_MULTICAST_LIST                  0x01010103
262 #define RNDIS_OID_802_3_MAXIMUM_LIST_SIZE               0x01010104
263 #define RNDIS_OID_802_3_MAC_OPTIONS                     0x01010105
264
265 /*
266  *
267  */
268 #define NDIS_802_3_MAC_OPTION_PRIORITY                  0x00000001
269
270 #define RNDIS_OID_802_3_RCV_ERROR_ALIGNMENT             0x01020101
271 #define RNDIS_OID_802_3_XMIT_ONE_COLLISION              0x01020102
272 #define RNDIS_OID_802_3_XMIT_MORE_COLLISIONS            0x01020103
273
274 #define RNDIS_OID_802_3_XMIT_DEFERRED                   0x01020201
275 #define RNDIS_OID_802_3_XMIT_MAX_COLLISIONS             0x01020202
276 #define RNDIS_OID_802_3_RCV_OVERRUN                     0x01020203
277 #define RNDIS_OID_802_3_XMIT_UNDERRUN                   0x01020204
278 #define RNDIS_OID_802_3_XMIT_HEARTBEAT_FAILURE          0x01020205
279 #define RNDIS_OID_802_3_XMIT_TIMES_CRS_LOST             0x01020206
280 #define RNDIS_OID_802_3_XMIT_LATE_COLLISIONS            0x01020207
281
282
283 /*
284  * RNDIS MP custom OID for test
285  */
286 #define OID_RNDISMP_GET_RECEIVE_BUFFERS                 0xFFA0C90D // Query only
287
288
289 /*
290  * Remote NDIS message types
291  */
292 #define REMOTE_NDIS_PACKET_MSG                          0x00000001
293 #define REMOTE_NDIS_INITIALIZE_MSG                      0x00000002
294 #define REMOTE_NDIS_HALT_MSG                            0x00000003
295 #define REMOTE_NDIS_QUERY_MSG                           0x00000004
296 #define REMOTE_NDIS_SET_MSG                             0x00000005
297 #define REMOTE_NDIS_RESET_MSG                           0x00000006
298 #define REMOTE_NDIS_INDICATE_STATUS_MSG                 0x00000007
299 #define REMOTE_NDIS_KEEPALIVE_MSG                       0x00000008
300
301 #define REMOTE_CONDIS_MP_CREATE_VC_MSG                  0x00008001
302 #define REMOTE_CONDIS_MP_DELETE_VC_MSG                  0x00008002
303 #define REMOTE_CONDIS_MP_ACTIVATE_VC_MSG                0x00008005
304 #define REMOTE_CONDIS_MP_DEACTIVATE_VC_MSG              0x00008006
305 #define REMOTE_CONDIS_INDICATE_STATUS_MSG               0x00008007
306
307 /*
308  * Remote NDIS message completion types
309  */
310 #define REMOTE_NDIS_INITIALIZE_CMPLT                    0x80000002
311 #define REMOTE_NDIS_QUERY_CMPLT                         0x80000004
312 #define REMOTE_NDIS_SET_CMPLT                           0x80000005
313 #define REMOTE_NDIS_RESET_CMPLT                         0x80000006
314 #define REMOTE_NDIS_KEEPALIVE_CMPLT                     0x80000008
315
316 #define REMOTE_CONDIS_MP_CREATE_VC_CMPLT                0x80008001
317 #define REMOTE_CONDIS_MP_DELETE_VC_CMPLT                0x80008002
318 #define REMOTE_CONDIS_MP_ACTIVATE_VC_CMPLT              0x80008005
319 #define REMOTE_CONDIS_MP_DEACTIVATE_VC_CMPLT            0x80008006
320
321 /*
322  * Reserved message type for private communication between lower-layer
323  * host driver and remote device, if necessary.
324  */
325 #define REMOTE_NDIS_BUS_MSG                             0xff000001
326
327 /*
328  * Defines for DeviceFlags in rndis_initialize_complete
329  */
330 #define RNDIS_DF_CONNECTIONLESS                         0x00000001
331 #define RNDIS_DF_CONNECTION_ORIENTED                    0x00000002
332 #define RNDIS_DF_RAW_DATA                               0x00000004
333
334 /*
335  * Remote NDIS medium types.
336  */
337 #define RNDIS_MEDIUM_802_3                              0x00000000
338 #define RNDIS_MEDIUM_802_5                              0x00000001
339 #define RNDIS_MEDIUM_FDDI                               0x00000002
340 #define RNDIS_MEDIUM_WAN                                0x00000003
341 #define RNDIS_MEDIUM_LOCAL_TALK                         0x00000004
342 #define RNDIS_MEDIUM_ARCNET_RAW                         0x00000006
343 #define RNDIS_MEDIUM_ARCNET_878_2                       0x00000007
344 #define RNDIS_MEDIUM_ATM                                0x00000008
345 #define RNDIS_MEDIUM_WIRELESS_WAN                       0x00000009
346 #define RNDIS_MEDIUM_IRDA                               0x0000000a
347 #define RNDIS_MEDIUM_CO_WAN                             0x0000000b
348 /* Not a real medium, defined as an upper bound */
349 #define RNDIS_MEDIUM_MAX                                0x0000000d
350
351 /*
352  * Remote NDIS medium connection states.
353  */
354 #define RNDIS_MEDIA_STATE_CONNECTED                     0x00000000
355 #define RNDIS_MEDIA_STATE_DISCONNECTED                  0x00000001
356
357 /*
358  * Remote NDIS version numbers
359  */
360 #define RNDIS_MAJOR_VERSION                             0x00000001
361 #define RNDIS_MINOR_VERSION                             0x00000000
362
363
364 /*
365  * Remote NDIS offload parameters
366  */
367 #define RNDIS_OBJECT_TYPE_DEFAULT                       0x80
368  
369 #define RNDIS_OFFLOAD_PARAMETERS_REVISION_3             3
370 #define RNDIS_OFFLOAD_PARAMETERS_NO_CHANGE              0
371 #define RNDIS_OFFLOAD_PARAMETERS_LSOV2_DISABLED         1
372 #define RNDIS_OFFLOAD_PARAMETERS_LSOV2_ENABLED          2
373 #define RNDIS_OFFLOAD_PARAMETERS_LSOV1_ENABLED          2
374 #define RNDIS_OFFLOAD_PARAMETERS_RSC_DISABLED           1
375 #define RNDIS_OFFLOAD_PARAMETERS_RSC_ENABLED            2
376 #define RNDIS_OFFLOAD_PARAMETERS_TX_RX_DISABLED         1
377 #define RNDIS_OFFLOAD_PARAMETERS_TX_ENABLED_RX_DISABLED 2
378 #define RNDIS_OFFLOAD_PARAMETERS_RX_ENABLED_TX_DISABLED 3
379 #define RNDIS_OFFLOAD_PARAMETERS_TX_RX_ENABLED          4
380
381 #define RNDIS_TCP_LARGE_SEND_OFFLOAD_V2_TYPE            1
382 #define RNDIS_TCP_LARGE_SEND_OFFLOAD_IPV4               0
383 #define RNDIS_TCP_LARGE_SEND_OFFLOAD_IPV6               1
384
385
386 #define RNDIS_OID_TCP_OFFLOAD_CURRENT_CONFIG            0xFC01020B /* query only */
387 #define RNDIS_OID_TCP_OFFLOAD_PARAMETERS                0xFC01020C /* set only */
388 #define RNDIS_OID_TCP_OFFLOAD_HARDWARE_CAPABILITIES     0xFC01020D/* query only */
389 #define RNDIS_OID_TCP_CONNECTION_OFFLOAD_CURRENT_CONFIG 0xFC01020E /* query only */
390 #define RNDIS_OID_TCP_CONNECTION_OFFLOAD_HARDWARE_CAPABILITIES  0xFC01020F /* query */
391 #define RNDIS_OID_OFFLOAD_ENCAPSULATION                 0x0101010A /* set/query */
392
393 /*
394  * NdisInitialize message
395  */
396 typedef struct rndis_initialize_request_ {
397     /* RNDIS request ID */
398     uint32_t                                request_id;
399     uint32_t                                major_version;
400     uint32_t                                minor_version;
401     uint32_t                                max_xfer_size;
402 } rndis_initialize_request;
403
404 /*
405  * Response to NdisInitialize
406  */
407 typedef struct rndis_initialize_complete_ {
408     /* RNDIS request ID */
409     uint32_t                                request_id;
410     /* RNDIS status */
411     uint32_t                                status;
412     uint32_t                                major_version;
413     uint32_t                                minor_version;
414     uint32_t                                device_flags;
415     /* RNDIS medium */
416     uint32_t                                medium;
417     uint32_t                                max_pkts_per_msg;
418     uint32_t                                max_xfer_size;
419     uint32_t                                pkt_align_factor;
420     uint32_t                                af_list_offset;
421     uint32_t                                af_list_size;
422 } rndis_initialize_complete;
423
424 /*
425  * Call manager devices only: Information about an address family
426  * supported by the device is appended to the response to NdisInitialize.
427  */
428 typedef struct rndis_co_address_family_ {
429     /* RNDIS AF */
430     uint32_t                                address_family;
431     uint32_t                                major_version;
432     uint32_t                                minor_version;
433 } rndis_co_address_family;
434
435 /*
436  * NdisHalt message
437  */
438 typedef struct rndis_halt_request_ {
439     /* RNDIS request ID */
440     uint32_t                                request_id;
441 } rndis_halt_request;
442
443 /*
444  * NdisQueryRequest message
445  */
446 typedef struct rndis_query_request_ {
447     /* RNDIS request ID */
448     uint32_t                                request_id;
449     /* RNDIS OID */
450     uint32_t                                oid;
451     uint32_t                                info_buffer_length;
452     uint32_t                                info_buffer_offset;
453     /* RNDIS handle */
454     uint32_t                                device_vc_handle;
455 } rndis_query_request;
456
457 /*
458  * Response to NdisQueryRequest
459  */
460 typedef struct rndis_query_complete_ {
461     /* RNDIS request ID */
462     uint32_t                                request_id;
463     /* RNDIS status */
464     uint32_t                                status;
465     uint32_t                                info_buffer_length;
466     uint32_t                                info_buffer_offset;
467 } rndis_query_complete;
468
469 /*
470  * NdisSetRequest message
471  */
472 typedef struct rndis_set_request_ {
473     /* RNDIS request ID */
474     uint32_t                                request_id;
475     /* RNDIS OID */
476     uint32_t                                oid;
477     uint32_t                                info_buffer_length;
478     uint32_t                                info_buffer_offset;
479     /* RNDIS handle */
480     uint32_t                                device_vc_handle;
481 } rndis_set_request;
482
483 /*
484  * Response to NdisSetRequest
485  */
486 typedef struct rndis_set_complete_ {
487     /* RNDIS request ID */
488     uint32_t                                request_id;
489     /* RNDIS status */
490     uint32_t                                status;
491 } rndis_set_complete;
492
493 /*
494  * NdisReset message
495  */
496 typedef struct rndis_reset_request_ {
497     uint32_t                                reserved;
498 } rndis_reset_request;
499
500 /*
501  * Response to NdisReset
502  */
503 typedef struct rndis_reset_complete_ {
504     /* RNDIS status */
505     uint32_t                                status;
506     uint32_t                                addressing_reset;
507 } rndis_reset_complete;
508
509 /*
510  * NdisMIndicateStatus message
511  */
512 typedef struct rndis_indicate_status_ {
513     /* RNDIS status */
514     uint32_t                                status;
515     uint32_t                                status_buf_length;
516     uint32_t                                status_buf_offset;
517 } rndis_indicate_status;
518
519 /*
520  * Diagnostic information passed as the status buffer in
521  * rndis_indicate_status messages signifying error conditions.
522  */
523 typedef struct rndis_diagnostic_info_ {
524     /* RNDIS status */
525     uint32_t                                diag_status;
526     uint32_t                                error_offset;
527 } rndis_diagnostic_info;
528
529 /*
530  * NdisKeepAlive message
531  */
532 typedef struct rndis_keepalive_request_ {
533     /* RNDIS request ID */
534     uint32_t                                request_id;
535 } rndis_keepalive_request;
536
537 /*
538  * Response to NdisKeepAlive
539  */  
540 typedef struct rndis_keepalive_complete_ {
541     /* RNDIS request ID */
542     uint32_t                                request_id;
543     /* RNDIS status */
544     uint32_t                                status;
545 } rndis_keepalive_complete;
546
547 /*
548  * Data message. All offset fields contain byte offsets from the beginning
549  * of the rndis_packet structure. All length fields are in bytes.
550  * VcHandle is set to 0 for connectionless data, otherwise it
551  * contains the VC handle.
552  */
553 typedef struct rndis_packet_ {
554     uint32_t                                data_offset;
555     uint32_t                                data_length;
556     uint32_t                                oob_data_offset;
557     uint32_t                                oob_data_length;
558     uint32_t                                num_oob_data_elements;
559     uint32_t                                per_pkt_info_offset;
560     uint32_t                                per_pkt_info_length;
561     /* RNDIS handle */
562     uint32_t                                vc_handle;
563     uint32_t                                reserved;
564 } rndis_packet;
565
566 typedef struct rndis_packet_ex_ {
567     uint32_t                                data_offset;
568     uint32_t                                data_length;
569     uint32_t                                oob_data_offset;
570     uint32_t                                oob_data_length;
571     uint32_t                                num_oob_data_elements;
572     uint32_t                                per_pkt_info_offset;
573     uint32_t                                per_pkt_info_length;
574     /* RNDIS handle */
575     uint32_t                                vc_handle;
576     uint32_t                                reserved;
577     uint64_t                                data_buf_id;
578     uint32_t                                data_buf_offset;
579     uint64_t                                next_header_buf_id;
580     uint32_t                                next_header_byte_offset;
581     uint32_t                                next_header_byte_count;
582 } rndis_packet_ex;
583
584 /*
585  * Optional Out of Band data associated with a Data message.
586  */
587 typedef struct rndis_oobd_ {
588     uint32_t                                size;
589     /* RNDIS class ID */
590     uint32_t                                type;
591     uint32_t                                class_info_offset;
592 } rndis_oobd;
593
594 /*
595  * Packet extension field contents associated with a Data message.
596  */
597 typedef struct rndis_per_packet_info_ {
598     uint32_t                                size;
599     uint32_t                                type;
600     uint32_t                                per_packet_info_offset;
601 } rndis_per_packet_info;
602
603 typedef enum ndis_per_pkt_infotype_ {
604         tcpip_chksum_info,
605         ipsec_info,
606         tcp_large_send_info,
607         classification_handle_info,
608         ndis_reserved,
609         sgl_info,
610         ieee_8021q_info,
611         original_pkt_info,
612         pkt_cancel_id,
613         original_netbuf_list,
614         cached_netbuf_list,
615         short_pkt_padding_info,
616         max_perpkt_info
617 } ndis_per_pkt_infotype;
618
619 #define nbl_hash_value  pkt_cancel_id
620
621 typedef struct ndis_8021q_info_ {
622         union {
623                 struct {
624                         uint32_t   user_pri : 3;  /* User Priority */
625                         uint32_t   cfi      : 1;  /* Canonical Format ID */
626                         uint32_t   vlan_id  : 12;
627                         uint32_t   reserved : 16;
628                 } s1;
629                 uint32_t    value;
630         } u1;
631 } ndis_8021q_info;
632
633 struct ndis_hash_info {
634         uint32_t        hash;
635 } __packed;
636
637 struct rndis_object_header {
638         uint8_t type;
639         uint8_t revision;
640         uint16_t size;
641 };
642
643 typedef struct rndis_offload_params_ {
644         struct rndis_object_header header;
645         uint8_t ipv4_csum;
646         uint8_t tcp_ipv4_csum;
647         uint8_t udp_ipv4_csum;
648         uint8_t tcp_ipv6_csum;
649         uint8_t udp_ipv6_csum;
650         uint8_t lso_v1;
651         uint8_t ip_sec_v1;
652         uint8_t lso_v2_ipv4;
653         uint8_t lso_v2_ipv6;
654         uint8_t tcp_connection_ipv4;
655         uint8_t tcp_connection_ipv6;
656         uint32_t flags;
657         uint8_t ip_sec_v2;
658         uint8_t ip_sec_v2_ipv4;
659         struct {
660                 uint8_t rsc_ipv4;
661                 uint8_t rsc_ipv6;
662         };
663         struct {
664                 uint8_t encapsulated_packet_task_offload;
665                 uint8_t encapsulation_types;
666         };
667
668 } rndis_offload_params;
669
670
671 typedef struct rndis_tcp_ip_csum_info_ {
672         union {
673                 struct {
674                         uint32_t is_ipv4:1;
675                         uint32_t is_ipv6:1;
676                         uint32_t tcp_csum:1;
677                         uint32_t udp_csum:1;
678                         uint32_t ip_header_csum:1;
679                         uint32_t reserved:11;
680                         uint32_t tcp_header_offset:10;
681                 } xmit;
682                 struct {
683                         uint32_t tcp_csum_failed:1;
684                         uint32_t udp_csum_failed:1;
685                         uint32_t ip_csum_failed:1;
686                         uint32_t tcp_csum_succeeded:1;
687                         uint32_t udp_csum_succeeded:1;
688                         uint32_t ip_csum_succeeded:1;
689                         uint32_t loopback:1;
690                         uint32_t tcp_csum_value_invalid:1;
691                         uint32_t ip_csum_value_invalid:1;
692                 } receive;
693                 uint32_t  value;
694         };
695 } rndis_tcp_ip_csum_info;
696
697 typedef struct rndis_tcp_tso_info_ {
698         union {
699                 struct {
700                         uint32_t unused:30;
701                         uint32_t type:1;
702                         uint32_t reserved2:1;
703                 } xmit;
704                 struct {
705                         uint32_t mss:20;
706                         uint32_t tcp_header_offset:10;
707                         uint32_t type:1;
708                         uint32_t reserved2:1;
709                 } lso_v1_xmit;
710                 struct {
711                         uint32_t tcp_payload:30;
712                         uint32_t type:1;
713                         uint32_t reserved2:1;
714                 } lso_v1_xmit_complete;
715                 struct {
716                         uint32_t mss:20;
717                         uint32_t tcp_header_offset:10;
718                         uint32_t type:1;
719                         uint32_t ip_version:1;
720                 } lso_v2_xmit;
721                 struct {
722                         uint32_t reserved:30;
723                         uint32_t type:1;
724                         uint32_t reserved2:1;
725                 } lso_v2_xmit_complete;
726                 uint32_t  value;
727         };
728 } rndis_tcp_tso_info;
729
730 #define RNDIS_HASH_PPI_SIZE     (sizeof(rndis_per_packet_info) + \
731                                 sizeof(struct ndis_hash_info))
732
733 #define RNDIS_VLAN_PPI_SIZE     (sizeof(rndis_per_packet_info) + \
734                                 sizeof(ndis_8021q_info))
735
736 #define RNDIS_CSUM_PPI_SIZE     (sizeof(rndis_per_packet_info) + \
737                                 sizeof(rndis_tcp_ip_csum_info))
738
739 #define RNDIS_TSO_PPI_SIZE      (sizeof(rndis_per_packet_info) + \
740                                 sizeof(rndis_tcp_tso_info))
741
742 /*
743  * Format of Information buffer passed in a SetRequest for the OID
744  * OID_GEN_RNDIS_CONFIG_PARAMETER.
745  */
746 typedef struct rndis_config_parameter_info_ {
747     uint32_t                                parameter_name_offset;
748     uint32_t                                parameter_name_length;
749     uint32_t                                parameter_type;
750     uint32_t                                parameter_value_offset;
751     uint32_t                                parameter_value_length;
752 } rndis_config_parameter_info;
753
754 /*
755  * Values for ParameterType in rndis_config_parameter_info
756  */
757 #define RNDIS_CONFIG_PARAM_TYPE_INTEGER     0
758 #define RNDIS_CONFIG_PARAM_TYPE_STRING      2
759
760
761 /*
762  * CONDIS Miniport messages for connection oriented devices
763  * that do not implement a call manager.
764  */
765
766 /*
767  * CoNdisMiniportCreateVc message
768  */
769 typedef struct rcondis_mp_create_vc_ {
770     /* RNDIS request ID */
771     uint32_t                                request_id;
772     /* RNDIS handle */
773     uint32_t                                ndis_vc_handle;
774 } rcondis_mp_create_vc;
775
776 /*
777  * Response to CoNdisMiniportCreateVc
778  */
779 typedef struct rcondis_mp_create_vc_complete_ {
780     /* RNDIS request ID */
781     uint32_t                                request_id;
782     /* RNDIS handle */
783     uint32_t                                device_vc_handle;
784     /* RNDIS status */
785     uint32_t                                status;
786 } rcondis_mp_create_vc_complete;
787
788 /*
789  * CoNdisMiniportDeleteVc message
790  */
791 typedef struct rcondis_mp_delete_vc_ {
792     /* RNDIS request ID */
793     uint32_t                                request_id;
794     /* RNDIS handle */
795     uint32_t                                device_vc_handle;
796 } rcondis_mp_delete_vc;
797
798 /*
799  * Response to CoNdisMiniportDeleteVc
800  */
801 typedef struct rcondis_mp_delete_vc_complete_ {
802     /* RNDIS request ID */
803     uint32_t                                request_id;
804     /* RNDIS status */
805     uint32_t                                status;
806 } rcondis_mp_delete_vc_complete;
807
808 /*
809  * CoNdisMiniportQueryRequest message
810  */
811 typedef struct rcondis_mp_query_request_ {
812     /* RNDIS request ID */
813     uint32_t                                request_id;
814     /* RNDIS request type */
815     uint32_t                                request_type;
816     /* RNDIS OID */
817     uint32_t                                oid;
818     /* RNDIS handle */
819     uint32_t                                device_vc_handle;
820     uint32_t                                info_buf_length;
821     uint32_t                                info_buf_offset;
822 } rcondis_mp_query_request;
823
824 /*
825  * CoNdisMiniportSetRequest message
826  */
827 typedef struct rcondis_mp_set_request_ {
828     /* RNDIS request ID */
829     uint32_t                                request_id;
830     /* RNDIS request type */
831     uint32_t                                request_type;
832     /* RNDIS OID */
833     uint32_t                                oid;
834     /* RNDIS handle */
835     uint32_t                                device_vc_handle;
836     uint32_t                                info_buf_length;
837     uint32_t                                info_buf_offset;
838 } rcondis_mp_set_request;
839
840 /*
841  * CoNdisIndicateStatus message
842  */
843 typedef struct rcondis_indicate_status_ {
844     /* RNDIS handle */
845     uint32_t                                ndis_vc_handle;
846     /* RNDIS status */
847     uint32_t                                status;
848     uint32_t                                status_buf_length;
849     uint32_t                                status_buf_offset;
850 } rcondis_indicate_status;
851
852 /*
853  * CONDIS Call/VC parameters
854  */
855
856 typedef struct rcondis_specific_parameters_ {
857     uint32_t                                parameter_type;
858     uint32_t                                parameter_length;
859     uint32_t                                parameter_offset;
860 } rcondis_specific_parameters;
861
862 typedef struct rcondis_media_parameters_ {
863     uint32_t                                flags;
864     uint32_t                                reserved1;
865     uint32_t                                reserved2;
866     rcondis_specific_parameters             media_specific;
867 } rcondis_media_parameters;
868
869 typedef struct rndis_flowspec_ {
870     uint32_t                                token_rate;
871     uint32_t                                token_bucket_size;
872     uint32_t                                peak_bandwidth;
873     uint32_t                                latency;
874     uint32_t                                delay_variation;
875     uint32_t                                service_type;
876     uint32_t                                max_sdu_size;
877     uint32_t                                minimum_policed_size;
878 } rndis_flowspec;
879
880 typedef struct rcondis_call_manager_parameters_ {
881     rndis_flowspec                          transmit;
882     rndis_flowspec                          receive;
883     rcondis_specific_parameters             call_mgr_specific;
884 } rcondis_call_manager_parameters;
885
886 /*
887  * CoNdisMiniportActivateVc message
888  */
889 typedef struct rcondis_mp_activate_vc_request_ {
890     /* RNDIS request ID */
891     uint32_t                                request_id;
892     uint32_t                                flags;
893     /* RNDIS handle */
894     uint32_t                                device_vc_handle;
895     uint32_t                                media_params_offset;
896     uint32_t                                media_params_length;
897     uint32_t                                call_mgr_params_offset;
898     uint32_t                                call_mgr_params_length;
899 } rcondis_mp_activate_vc_request;
900
901 /*
902  * Response to CoNdisMiniportActivateVc
903  */
904 typedef struct rcondis_mp_activate_vc_complete_ {
905     /* RNDIS request ID */
906     uint32_t                                request_id;
907     /* RNDIS status */
908     uint32_t                                status;
909 } rcondis_mp_activate_vc_complete;
910
911 /*
912  * CoNdisMiniportDeactivateVc message
913  */
914 typedef struct rcondis_mp_deactivate_vc_request_ {
915     /* RNDIS request ID */
916     uint32_t                                request_id;
917     uint32_t                                flags;
918     /* RNDIS handle */
919     uint32_t                                device_vc_handle;
920 } rcondis_mp_deactivate_vc_request;
921
922 /*
923  * Response to CoNdisMiniportDeactivateVc
924  */
925 typedef struct rcondis_mp_deactivate_vc_complete_ {
926     /* RNDIS request ID */
927     uint32_t                                request_id;
928     /* RNDIS status */
929     uint32_t                                status;
930 } rcondis_mp_deactivate_vc_complete;
931
932 /*
933  * union with all of the RNDIS messages
934  */
935 typedef union rndis_msg_container_ {
936     rndis_packet                            packet;
937     rndis_initialize_request                init_request;
938     rndis_halt_request                      halt_request;
939     rndis_query_request                     query_request;
940     rndis_set_request                       set_request;
941     rndis_reset_request                     reset_request;
942     rndis_keepalive_request                 keepalive_request;
943     rndis_indicate_status                   indicate_status;
944     rndis_initialize_complete               init_complete;
945     rndis_query_complete                    query_complete;
946     rndis_set_complete                      set_complete;
947     rndis_reset_complete                    reset_complete;
948     rndis_keepalive_complete                keepalive_complete;
949     rcondis_mp_create_vc                    co_miniport_create_vc;
950     rcondis_mp_delete_vc                    co_miniport_delete_vc;
951     rcondis_indicate_status                 co_miniport_status;
952     rcondis_mp_activate_vc_request          co_miniport_activate_vc;
953     rcondis_mp_deactivate_vc_request        co_miniport_deactivate_vc;
954     rcondis_mp_create_vc_complete           co_miniport_create_vc_complete;
955     rcondis_mp_delete_vc_complete           co_miniport_delete_vc_complete;
956     rcondis_mp_activate_vc_complete         co_miniport_activate_vc_complete;
957     rcondis_mp_deactivate_vc_complete       co_miniport_deactivate_vc_complete;
958     rndis_packet_ex                         packet_ex;
959 } rndis_msg_container;
960
961 /*
962  * Remote NDIS message format
963  */
964 typedef struct rndis_msg_ {
965     uint32_t                                ndis_msg_type;
966
967     /*
968      * Total length of this message, from the beginning
969      * of the rndis_msg struct, in bytes.
970      */
971     uint32_t                                msg_len;
972
973     /* Actual message */
974     rndis_msg_container                     msg;
975 } rndis_msg;
976
977
978 /*
979  * Handy macros
980  */
981
982 /*
983  * get the size of an RNDIS message. Pass in the message type, 
984  * rndis_set_request, rndis_packet for example
985  */
986 #define RNDIS_MESSAGE_SIZE(message)                             \
987     (sizeof(message) + (sizeof(rndis_msg) - sizeof(rndis_msg_container)))
988
989 /*
990  * get pointer to info buffer with message pointer
991  */
992 #define MESSAGE_TO_INFO_BUFFER(message)                         \
993     (((PUCHAR)(message)) + message->InformationBufferOffset)
994
995 /*
996  * get pointer to status buffer with message pointer
997  */
998 #define MESSAGE_TO_STATUS_BUFFER(message)                       \
999     (((PUCHAR)(message)) + message->StatusBufferOffset)
1000
1001 /*
1002  * get pointer to OOBD buffer with message pointer
1003  */
1004 #define MESSAGE_TO_OOBD_BUFFER(message)                         \
1005     (((PUCHAR)(message)) + message->OOBDataOffset)
1006
1007 /*
1008  * get pointer to data buffer with message pointer
1009  */
1010 #define MESSAGE_TO_DATA_BUFFER(message)                         \
1011     (((PUCHAR)(message)) + message->PerPacketInfoOffset)
1012
1013 /*
1014  * get pointer to contained message from NDIS_MESSAGE pointer
1015  */
1016 #define RNDIS_MESSAGE_PTR_TO_MESSAGE_PTR(rndis_message)         \
1017     ((void *) &rndis_message->Message)
1018
1019 /*
1020  * get pointer to contained message from NDIS_MESSAGE pointer
1021  */
1022 #define RNDIS_MESSAGE_RAW_PTR_TO_MESSAGE_PTR(rndis_message)     \
1023     ((void *) rndis_message)
1024
1025
1026
1027 /*
1028  * Structures used in OID_RNDISMP_GET_RECEIVE_BUFFERS
1029  */
1030
1031 #define RNDISMP_RECEIVE_BUFFER_ELEM_FLAG_VMQ_RECEIVE_BUFFER 0x00000001
1032
1033 typedef struct rndismp_rx_buf_elem_ {
1034     uint32_t                            flags;
1035     uint32_t                            length;
1036     uint64_t                            rx_buf_id;
1037     uint32_t                            gpadl_handle;
1038     void                                *rx_buf;
1039 } rndismp_rx_buf_elem;
1040
1041 typedef struct rndismp_rx_bufs_info_ {
1042     uint32_t                            num_rx_bufs;
1043     rndismp_rx_buf_elem                 rx_buf_elems[1];
1044 } rndismp_rx_bufs_info;
1045
1046
1047
1048 #define RNDIS_HEADER_SIZE (sizeof(rndis_msg) - sizeof(rndis_msg_container))
1049
1050 #define NDIS_PACKET_TYPE_DIRECTED       0x00000001
1051 #define NDIS_PACKET_TYPE_MULTICAST      0x00000002
1052 #define NDIS_PACKET_TYPE_ALL_MULTICAST  0x00000004
1053 #define NDIS_PACKET_TYPE_BROADCAST      0x00000008
1054 #define NDIS_PACKET_TYPE_SOURCE_ROUTING 0x00000010
1055 #define NDIS_PACKET_TYPE_PROMISCUOUS    0x00000020
1056 #define NDIS_PACKET_TYPE_SMT            0x00000040
1057 #define NDIS_PACKET_TYPE_ALL_LOCAL      0x00000080
1058 #define NDIS_PACKET_TYPE_GROUP          0x00000100
1059 #define NDIS_PACKET_TYPE_ALL_FUNCTIONAL 0x00000200
1060 #define NDIS_PACKET_TYPE_FUNCTIONAL     0x00000400
1061 #define NDIS_PACKET_TYPE_MAC_FRAME      0x00000800
1062
1063 /*
1064  * Externs
1065  */
1066 struct hv_vmbus_channel;
1067
1068 int netvsc_recv(struct hv_vmbus_channel *chan,
1069     netvsc_packet *packet, rndis_tcp_ip_csum_info *csum_info);
1070 void netvsc_channel_rollup(struct hv_vmbus_channel *chan);
1071 void netvsc_subchan_callback(struct hn_softc *sc,
1072     struct hv_vmbus_channel *chan);
1073
1074 void* hv_set_rppi_data(rndis_msg *rndis_mesg,
1075     uint32_t rppi_size,
1076     int pkt_type);
1077
1078 void* hv_get_ppi_data(rndis_packet *rpkt, uint32_t type);
1079
1080 #endif  /* __HV_RNDIS_H__ */
1081