Commit | Line | Data |
---|---|---|
565e7dc8 HJ |
1 | /* |
2 | * | |
3 | * Copyright (c) 2009, Microsoft Corporation. | |
4 | * | |
5 | * This program is free software; you can redistribute it and/or modify it | |
6 | * under the terms and conditions of the GNU General Public License, | |
7 | * version 2, as published by the Free Software Foundation. | |
8 | * | |
9 | * This program is distributed in the hope it will be useful, but WITHOUT | |
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |
12 | * more details. | |
13 | * | |
14 | * You should have received a copy of the GNU General Public License along with | |
15 | * this program; if not, write to the Free Software Foundation, Inc., 59 Temple | |
16 | * Place - Suite 330, Boston, MA 02111-1307 USA. | |
17 | * | |
18 | * Authors: | |
19 | * Haiyang Zhang <haiyangz@microsoft.com> | |
20 | * Hank Janssen <hjanssen@microsoft.com> | |
21 | * | |
22 | */ | |
23 | ||
565e7dc8 HJ |
24 | #ifndef _RNDIS_H_ |
25 | #define _RNDIS_H_ | |
26 | ||
454f18a9 BP |
27 | /* Status codes */ |
28 | ||
565e7dc8 HJ |
29 | |
30 | #ifndef STATUS_SUCCESS | |
88a3716f | 31 | #define STATUS_SUCCESS (0x00000000L) |
565e7dc8 HJ |
32 | #endif |
33 | ||
34 | #ifndef STATUS_UNSUCCESSFUL | |
88a3716f | 35 | #define STATUS_UNSUCCESSFUL (0xC0000001L) |
565e7dc8 HJ |
36 | #endif |
37 | ||
38 | #ifndef STATUS_PENDING | |
88a3716f | 39 | #define STATUS_PENDING (0x00000103L) |
565e7dc8 HJ |
40 | #endif |
41 | ||
42 | #ifndef STATUS_INSUFFICIENT_RESOURCES | |
88a3716f | 43 | #define STATUS_INSUFFICIENT_RESOURCES (0xC000009AL) |
565e7dc8 HJ |
44 | #endif |
45 | ||
46 | #ifndef STATUS_BUFFER_OVERFLOW | |
88a3716f | 47 | #define STATUS_BUFFER_OVERFLOW (0x80000005L) |
565e7dc8 HJ |
48 | #endif |
49 | ||
50 | #ifndef STATUS_NOT_SUPPORTED | |
88a3716f | 51 | #define STATUS_NOT_SUPPORTED (0xC00000BBL) |
565e7dc8 HJ |
52 | #endif |
53 | ||
88a3716f GKH |
54 | #define RNDIS_STATUS_SUCCESS (STATUS_SUCCESS) |
55 | #define RNDIS_STATUS_PENDING (STATUS_PENDING) | |
56 | #define RNDIS_STATUS_NOT_RECOGNIZED (0x00010001L) | |
57 | #define RNDIS_STATUS_NOT_COPIED (0x00010002L) | |
58 | #define RNDIS_STATUS_NOT_ACCEPTED (0x00010003L) | |
59 | #define RNDIS_STATUS_CALL_ACTIVE (0x00010007L) | |
60 | ||
61 | #define RNDIS_STATUS_ONLINE (0x40010003L) | |
62 | #define RNDIS_STATUS_RESET_START (0x40010004L) | |
63 | #define RNDIS_STATUS_RESET_END (0x40010005L) | |
64 | #define RNDIS_STATUS_RING_STATUS (0x40010006L) | |
65 | #define RNDIS_STATUS_CLOSED (0x40010007L) | |
66 | #define RNDIS_STATUS_WAN_LINE_UP (0x40010008L) | |
67 | #define RNDIS_STATUS_WAN_LINE_DOWN (0x40010009L) | |
68 | #define RNDIS_STATUS_WAN_FRAGMENT (0x4001000AL) | |
69 | #define RNDIS_STATUS_MEDIA_CONNECT (0x4001000BL) | |
70 | #define RNDIS_STATUS_MEDIA_DISCONNECT (0x4001000CL) | |
71 | #define RNDIS_STATUS_HARDWARE_LINE_UP (0x4001000DL) | |
72 | #define RNDIS_STATUS_HARDWARE_LINE_DOWN (0x4001000EL) | |
73 | #define RNDIS_STATUS_INTERFACE_UP (0x4001000FL) | |
74 | #define RNDIS_STATUS_INTERFACE_DOWN (0x40010010L) | |
75 | #define RNDIS_STATUS_MEDIA_BUSY (0x40010011L) | |
76 | #define RNDIS_STATUS_MEDIA_SPECIFIC_INDICATION (0x40010012L) | |
77 | #define RNDIS_STATUS_WW_INDICATION RDIA_SPECIFIC_INDICATION | |
78 | #define RNDIS_STATUS_LINK_SPEED_CHANGE (0x40010013L) | |
79 | ||
80 | #define RNDIS_STATUS_NOT_RESETTABLE (0x80010001L) | |
81 | #define RNDIS_STATUS_SOFT_ERRORS (0x80010003L) | |
82 | #define RNDIS_STATUS_HARD_ERRORS (0x80010004L) | |
83 | #define RNDIS_STATUS_BUFFER_OVERFLOW (STATUS_BUFFER_OVERFLOW) | |
84 | ||
85 | #define RNDIS_STATUS_FAILURE (STATUS_UNSUCCESSFUL) | |
86 | #define RNDIS_STATUS_RESOURCES (STATUS_INSUFFICIENT_RESOURCES) | |
87 | #define RNDIS_STATUS_CLOSING (0xC0010002L) | |
88 | #define RNDIS_STATUS_BAD_VERSION (0xC0010004L) | |
89 | #define RNDIS_STATUS_BAD_CHARACTERISTICS (0xC0010005L) | |
90 | #define RNDIS_STATUS_ADAPTER_NOT_FOUND (0xC0010006L) | |
91 | #define RNDIS_STATUS_OPEN_FAILED (0xC0010007L) | |
92 | #define RNDIS_STATUS_DEVICE_FAILED (0xC0010008L) | |
93 | #define RNDIS_STATUS_MULTICAST_FULL (0xC0010009L) | |
94 | #define RNDIS_STATUS_MULTICAST_EXISTS (0xC001000AL) | |
95 | #define RNDIS_STATUS_MULTICAST_NOT_FOUND (0xC001000BL) | |
96 | #define RNDIS_STATUS_REQUEST_ABORTED (0xC001000CL) | |
97 | #define RNDIS_STATUS_RESET_IN_PROGRESS (0xC001000DL) | |
98 | #define RNDIS_STATUS_CLOSING_INDICATING (0xC001000EL) | |
99 | #define RNDIS_STATUS_NOT_SUPPORTED (STATUS_NOT_SUPPORTED) | |
100 | #define RNDIS_STATUS_INVALID_PACKET (0xC001000FL) | |
101 | #define RNDIS_STATUS_OPEN_LIST_FULL (0xC0010010L) | |
102 | #define RNDIS_STATUS_ADAPTER_NOT_READY (0xC0010011L) | |
103 | #define RNDIS_STATUS_ADAPTER_NOT_OPEN (0xC0010012L) | |
104 | #define RNDIS_STATUS_NOT_INDICATING (0xC0010013L) | |
105 | #define RNDIS_STATUS_INVALID_LENGTH (0xC0010014L) | |
106 | #define RNDIS_STATUS_INVALID_DATA (0xC0010015L) | |
107 | #define RNDIS_STATUS_BUFFER_TOO_SHORT (0xC0010016L) | |
108 | #define RNDIS_STATUS_INVALID_OID (0xC0010017L) | |
109 | #define RNDIS_STATUS_ADAPTER_REMOVED (0xC0010018L) | |
110 | #define RNDIS_STATUS_UNSUPPORTED_MEDIA (0xC0010019L) | |
111 | #define RNDIS_STATUS_GROUP_ADDRESS_IN_USE (0xC001001AL) | |
112 | #define RNDIS_STATUS_FILE_NOT_FOUND (0xC001001BL) | |
113 | #define RNDIS_STATUS_ERROR_READING_FILE (0xC001001CL) | |
114 | #define RNDIS_STATUS_ALREADY_MAPPED (0xC001001DL) | |
115 | #define RNDIS_STATUS_RESOURCE_CONFLICT (0xC001001EL) | |
116 | #define RNDIS_STATUS_NO_CABLE (0xC001001FL) | |
117 | ||
118 | #define RNDIS_STATUS_INVALID_SAP (0xC0010020L) | |
119 | #define RNDIS_STATUS_SAP_IN_USE (0xC0010021L) | |
120 | #define RNDIS_STATUS_INVALID_ADDRESS (0xC0010022L) | |
121 | #define RNDIS_STATUS_VC_NOT_ACTIVATED (0xC0010023L) | |
122 | #define RNDIS_STATUS_DEST_OUT_OF_ORDER (0xC0010024L) | |
123 | #define RNDIS_STATUS_VC_NOT_AVAILABLE (0xC0010025L) | |
124 | #define RNDIS_STATUS_CELLRATE_NOT_AVAILABLE (0xC0010026L) | |
125 | #define RNDIS_STATUS_INCOMPATABLE_QOS (0xC0010027L) | |
126 | #define RNDIS_STATUS_AAL_PARAMS_UNSUPPORTED (0xC0010028L) | |
127 | #define RNDIS_STATUS_NO_ROUTE_TO_DESTINATION (0xC0010029L) | |
128 | ||
129 | #define RNDIS_STATUS_TOKEN_RING_OPEN_ERROR (0xC0011000L) | |
565e7dc8 | 130 | |
454f18a9 | 131 | /* Object Identifiers used by NdisRequest Query/Set Information */ |
454f18a9 | 132 | /* General Objects */ |
88a3716f GKH |
133 | #define RNDIS_OID_GEN_SUPPORTED_LIST 0x00010101 |
134 | #define RNDIS_OID_GEN_HARDWARE_STATUS 0x00010102 | |
135 | #define RNDIS_OID_GEN_MEDIA_SUPPORTED 0x00010103 | |
136 | #define RNDIS_OID_GEN_MEDIA_IN_USE 0x00010104 | |
137 | #define RNDIS_OID_GEN_MAXIMUM_LOOKAHEAD 0x00010105 | |
138 | #define RNDIS_OID_GEN_MAXIMUM_FRAME_SIZE 0x00010106 | |
139 | #define RNDIS_OID_GEN_LINK_SPEED 0x00010107 | |
140 | #define RNDIS_OID_GEN_TRANSMIT_BUFFER_SPACE 0x00010108 | |
141 | #define RNDIS_OID_GEN_RECEIVE_BUFFER_SPACE 0x00010109 | |
142 | #define RNDIS_OID_GEN_TRANSMIT_BLOCK_SIZE 0x0001010A | |
143 | #define RNDIS_OID_GEN_RECEIVE_BLOCK_SIZE 0x0001010B | |
144 | #define RNDIS_OID_GEN_VENDOR_ID 0x0001010C | |
145 | #define RNDIS_OID_GEN_VENDOR_DESCRIPTION 0x0001010D | |
146 | #define RNDIS_OID_GEN_CURRENT_PACKET_FILTER 0x0001010E | |
147 | #define RNDIS_OID_GEN_CURRENT_LOOKAHEAD 0x0001010F | |
148 | #define RNDIS_OID_GEN_DRIVER_VERSION 0x00010110 | |
149 | #define RNDIS_OID_GEN_MAXIMUM_TOTAL_SIZE 0x00010111 | |
150 | #define RNDIS_OID_GEN_PROTOCOL_OPTIONS 0x00010112 | |
151 | #define RNDIS_OID_GEN_MAC_OPTIONS 0x00010113 | |
152 | #define RNDIS_OID_GEN_MEDIA_CONNECT_STATUS 0x00010114 | |
153 | #define RNDIS_OID_GEN_MAXIMUM_SEND_PACKETS 0x00010115 | |
154 | #define RNDIS_OID_GEN_VENDOR_DRIVER_VERSION 0x00010116 | |
155 | #define RNDIS_OID_GEN_NETWORK_LAYER_ADDRESSES 0x00010118 | |
156 | #define RNDIS_OID_GEN_TRANSPORT_HEADER_OFFSET 0x00010119 | |
157 | #define RNDIS_OID_GEN_MACHINE_NAME 0x0001021A | |
158 | #define RNDIS_OID_GEN_RNDIS_CONFIG_PARAMETER 0x0001021B | |
159 | ||
160 | #define RNDIS_OID_GEN_XMIT_OK 0x00020101 | |
161 | #define RNDIS_OID_GEN_RCV_OK 0x00020102 | |
162 | #define RNDIS_OID_GEN_XMIT_ERROR 0x00020103 | |
163 | #define RNDIS_OID_GEN_RCV_ERROR 0x00020104 | |
164 | #define RNDIS_OID_GEN_RCV_NO_BUFFER 0x00020105 | |
165 | ||
166 | #define RNDIS_OID_GEN_DIRECTED_BYTES_XMIT 0x00020201 | |
167 | #define RNDIS_OID_GEN_DIRECTED_FRAMES_XMIT 0x00020202 | |
168 | #define RNDIS_OID_GEN_MULTICAST_BYTES_XMIT 0x00020203 | |
169 | #define RNDIS_OID_GEN_MULTICAST_FRAMES_XMIT 0x00020204 | |
170 | #define RNDIS_OID_GEN_BROADCAST_BYTES_XMIT 0x00020205 | |
171 | #define RNDIS_OID_GEN_BROADCAST_FRAMES_XMIT 0x00020206 | |
172 | #define RNDIS_OID_GEN_DIRECTED_BYTES_RCV 0x00020207 | |
173 | #define RNDIS_OID_GEN_DIRECTED_FRAMES_RCV 0x00020208 | |
174 | #define RNDIS_OID_GEN_MULTICAST_BYTES_RCV 0x00020209 | |
175 | #define RNDIS_OID_GEN_MULTICAST_FRAMES_RCV 0x0002020A | |
176 | #define RNDIS_OID_GEN_BROADCAST_BYTES_RCV 0x0002020B | |
177 | #define RNDIS_OID_GEN_BROADCAST_FRAMES_RCV 0x0002020C | |
178 | ||
179 | #define RNDIS_OID_GEN_RCV_CRC_ERROR 0x0002020D | |
180 | #define RNDIS_OID_GEN_TRANSMIT_QUEUE_LENGTH 0x0002020E | |
181 | ||
182 | #define RNDIS_OID_GEN_GET_TIME_CAPS 0x0002020F | |
183 | #define RNDIS_OID_GEN_GET_NETCARD_TIME 0x00020210 | |
454f18a9 BP |
184 | |
185 | /* These are connection-oriented general OIDs. */ | |
186 | /* These replace the above OIDs for connection-oriented media. */ | |
88a3716f GKH |
187 | #define RNDIS_OID_GEN_CO_SUPPORTED_LIST 0x00010101 |
188 | #define RNDIS_OID_GEN_CO_HARDWARE_STATUS 0x00010102 | |
189 | #define RNDIS_OID_GEN_CO_MEDIA_SUPPORTED 0x00010103 | |
190 | #define RNDIS_OID_GEN_CO_MEDIA_IN_USE 0x00010104 | |
191 | #define RNDIS_OID_GEN_CO_LINK_SPEED 0x00010105 | |
192 | #define RNDIS_OID_GEN_CO_VENDOR_ID 0x00010106 | |
193 | #define RNDIS_OID_GEN_CO_VENDOR_DESCRIPTION 0x00010107 | |
194 | #define RNDIS_OID_GEN_CO_DRIVER_VERSION 0x00010108 | |
195 | #define RNDIS_OID_GEN_CO_PROTOCOL_OPTIONS 0x00010109 | |
196 | #define RNDIS_OID_GEN_CO_MAC_OPTIONS 0x0001010A | |
197 | #define RNDIS_OID_GEN_CO_MEDIA_CONNECT_STATUS 0x0001010B | |
198 | #define RNDIS_OID_GEN_CO_VENDOR_DRIVER_VERSION 0x0001010C | |
199 | #define RNDIS_OID_GEN_CO_MINIMUM_LINK_SPEED 0x0001010D | |
200 | ||
201 | #define RNDIS_OID_GEN_CO_GET_TIME_CAPS 0x00010201 | |
202 | #define RNDIS_OID_GEN_CO_GET_NETCARD_TIME 0x00010202 | |
454f18a9 BP |
203 | |
204 | /* These are connection-oriented statistics OIDs. */ | |
88a3716f GKH |
205 | #define RNDIS_OID_GEN_CO_XMIT_PDUS_OK 0x00020101 |
206 | #define RNDIS_OID_GEN_CO_RCV_PDUS_OK 0x00020102 | |
207 | #define RNDIS_OID_GEN_CO_XMIT_PDUS_ERROR 0x00020103 | |
208 | #define RNDIS_OID_GEN_CO_RCV_PDUS_ERROR 0x00020104 | |
209 | #define RNDIS_OID_GEN_CO_RCV_PDUS_NO_BUFFER 0x00020105 | |
565e7dc8 HJ |
210 | |
211 | ||
88a3716f GKH |
212 | #define RNDIS_OID_GEN_CO_RCV_CRC_ERROR 0x00020201 |
213 | #define RNDIS_OID_GEN_CO_TRANSMIT_QUEUE_LENGTH 0x00020202 | |
214 | #define RNDIS_OID_GEN_CO_BYTES_XMIT 0x00020203 | |
215 | #define RNDIS_OID_GEN_CO_BYTES_RCV 0x00020204 | |
216 | #define RNDIS_OID_GEN_CO_BYTES_XMIT_OUTSTANDING 0x00020205 | |
217 | #define RNDIS_OID_GEN_CO_NETCARD_LOAD 0x00020206 | |
454f18a9 BP |
218 | |
219 | /* These are objects for Connection-oriented media call-managers. */ | |
88a3716f GKH |
220 | #define RNDIS_OID_CO_ADD_PVC 0xFF000001 |
221 | #define RNDIS_OID_CO_DELETE_PVC 0xFF000002 | |
222 | #define RNDIS_OID_CO_GET_CALL_INFORMATION 0xFF000003 | |
223 | #define RNDIS_OID_CO_ADD_ADDRESS 0xFF000004 | |
224 | #define RNDIS_OID_CO_DELETE_ADDRESS 0xFF000005 | |
225 | #define RNDIS_OID_CO_GET_ADDRESSES 0xFF000006 | |
226 | #define RNDIS_OID_CO_ADDRESS_CHANGE 0xFF000007 | |
227 | #define RNDIS_OID_CO_SIGNALING_ENABLED 0xFF000008 | |
228 | #define RNDIS_OID_CO_SIGNALING_DISABLED 0xFF000009 | |
454f18a9 BP |
229 | |
230 | /* 802.3 Objects (Ethernet) */ | |
88a3716f GKH |
231 | #define RNDIS_OID_802_3_PERMANENT_ADDRESS 0x01010101 |
232 | #define RNDIS_OID_802_3_CURRENT_ADDRESS 0x01010102 | |
233 | #define RNDIS_OID_802_3_MULTICAST_LIST 0x01010103 | |
234 | #define RNDIS_OID_802_3_MAXIMUM_LIST_SIZE 0x01010104 | |
235 | #define RNDIS_OID_802_3_MAC_OPTIONS 0x01010105 | |
236 | ||
237 | #define NDIS_802_3_MAC_OPTION_PRIORITY 0x00000001 | |
238 | ||
239 | #define RNDIS_OID_802_3_RCV_ERROR_ALIGNMENT 0x01020101 | |
240 | #define RNDIS_OID_802_3_XMIT_ONE_COLLISION 0x01020102 | |
241 | #define RNDIS_OID_802_3_XMIT_MORE_COLLISIONS 0x01020103 | |
242 | ||
243 | #define RNDIS_OID_802_3_XMIT_DEFERRED 0x01020201 | |
244 | #define RNDIS_OID_802_3_XMIT_MAX_COLLISIONS 0x01020202 | |
245 | #define RNDIS_OID_802_3_RCV_OVERRUN 0x01020203 | |
246 | #define RNDIS_OID_802_3_XMIT_UNDERRUN 0x01020204 | |
247 | #define RNDIS_OID_802_3_XMIT_HEARTBEAT_FAILURE 0x01020205 | |
248 | #define RNDIS_OID_802_3_XMIT_TIMES_CRS_LOST 0x01020206 | |
249 | #define RNDIS_OID_802_3_XMIT_LATE_COLLISIONS 0x01020207 | |
454f18a9 BP |
250 | |
251 | /* Remote NDIS message types */ | |
88a3716f GKH |
252 | #define REMOTE_NDIS_PACKET_MSG 0x00000001 |
253 | #define REMOTE_NDIS_INITIALIZE_MSG 0x00000002 | |
254 | #define REMOTE_NDIS_HALT_MSG 0x00000003 | |
255 | #define REMOTE_NDIS_QUERY_MSG 0x00000004 | |
256 | #define REMOTE_NDIS_SET_MSG 0x00000005 | |
257 | #define REMOTE_NDIS_RESET_MSG 0x00000006 | |
258 | #define REMOTE_NDIS_INDICATE_STATUS_MSG 0x00000007 | |
259 | #define REMOTE_NDIS_KEEPALIVE_MSG 0x00000008 | |
260 | ||
261 | #define REMOTE_CONDIS_MP_CREATE_VC_MSG 0x00008001 | |
262 | #define REMOTE_CONDIS_MP_DELETE_VC_MSG 0x00008002 | |
263 | #define REMOTE_CONDIS_MP_ACTIVATE_VC_MSG 0x00008005 | |
264 | #define REMOTE_CONDIS_MP_DEACTIVATE_VC_MSG 0x00008006 | |
265 | #define REMOTE_CONDIS_INDICATE_STATUS_MSG 0x00008007 | |
565e7dc8 | 266 | |
454f18a9 | 267 | /* Remote NDIS message completion types */ |
88a3716f GKH |
268 | #define REMOTE_NDIS_INITIALIZE_CMPLT 0x80000002 |
269 | #define REMOTE_NDIS_QUERY_CMPLT 0x80000004 | |
270 | #define REMOTE_NDIS_SET_CMPLT 0x80000005 | |
271 | #define REMOTE_NDIS_RESET_CMPLT 0x80000006 | |
272 | #define REMOTE_NDIS_KEEPALIVE_CMPLT 0x80000008 | |
565e7dc8 | 273 | |
88a3716f GKH |
274 | #define REMOTE_CONDIS_MP_CREATE_VC_CMPLT 0x80008001 |
275 | #define REMOTE_CONDIS_MP_DELETE_VC_CMPLT 0x80008002 | |
276 | #define REMOTE_CONDIS_MP_ACTIVATE_VC_CMPLT 0x80008005 | |
277 | #define REMOTE_CONDIS_MP_DEACTIVATE_VC_CMPLT 0x80008006 | |
565e7dc8 | 278 | |
88a3716f GKH |
279 | /* |
280 | * Reserved message type for private communication between lower-layer host | |
281 | * driver and remote device, if necessary. | |
282 | */ | |
283 | #define REMOTE_NDIS_BUS_MSG 0xff000001 | |
454f18a9 | 284 | |
9f33d054 | 285 | /* Defines for DeviceFlags in struct rndis_initialize_complete */ |
88a3716f GKH |
286 | #define RNDIS_DF_CONNECTIONLESS 0x00000001 |
287 | #define RNDIS_DF_CONNECTION_ORIENTED 0x00000002 | |
288 | #define RNDIS_DF_RAW_DATA 0x00000004 | |
454f18a9 BP |
289 | |
290 | /* Remote NDIS medium types. */ | |
88a3716f GKH |
291 | #define RNdisMedium802_3 0x00000000 |
292 | #define RNdisMedium802_5 0x00000001 | |
293 | #define RNdisMediumFddi 0x00000002 | |
294 | #define RNdisMediumWan 0x00000003 | |
295 | #define RNdisMediumLocalTalk 0x00000004 | |
296 | #define RNdisMediumArcnetRaw 0x00000006 | |
297 | #define RNdisMediumArcnet878_2 0x00000007 | |
298 | #define RNdisMediumAtm 0x00000008 | |
299 | #define RNdisMediumWirelessWan 0x00000009 | |
300 | #define RNdisMediumIrda 0x0000000a | |
301 | #define RNdisMediumCoWan 0x0000000b | |
302 | /* Not a real medium, defined as an upper-bound */ | |
303 | #define RNdisMediumMax 0x0000000d | |
454f18a9 BP |
304 | |
305 | ||
306 | /* Remote NDIS medium connection states. */ | |
88a3716f GKH |
307 | #define RNdisMediaStateConnected 0x00000000 |
308 | #define RNdisMediaStateDisconnected 0x00000001 | |
454f18a9 BP |
309 | |
310 | /* Remote NDIS version numbers */ | |
88a3716f GKH |
311 | #define RNDIS_MAJOR_VERSION 0x00000001 |
312 | #define RNDIS_MINOR_VERSION 0x00000000 | |
565e7dc8 | 313 | |
454f18a9 | 314 | |
88a3716f | 315 | /* NdisInitialize message */ |
9f33d054 | 316 | struct rndis_initialize_request { |
88a3716f GKH |
317 | u32 RequestId; |
318 | u32 MajorVersion; | |
319 | u32 MinorVersion; | |
320 | u32 MaxTransferSize; | |
9f33d054 | 321 | }; |
565e7dc8 | 322 | |
88a3716f | 323 | /* Response to NdisInitialize */ |
9f33d054 | 324 | struct rndis_initialize_complete { |
88a3716f GKH |
325 | u32 RequestId; |
326 | u32 Status; | |
327 | u32 MajorVersion; | |
328 | u32 MinorVersion; | |
329 | u32 DeviceFlags; | |
330 | u32 Medium; | |
331 | u32 MaxPacketsPerMessage; | |
332 | u32 MaxTransferSize; | |
333 | u32 PacketAlignmentFactor; | |
334 | u32 AFListOffset; | |
335 | u32 AFListSize; | |
9f33d054 | 336 | }; |
565e7dc8 | 337 | |
88a3716f GKH |
338 | /* Call manager devices only: Information about an address family */ |
339 | /* supported by the device is appended to the response to NdisInitialize. */ | |
9f33d054 | 340 | struct rndis_co_address_family { |
88a3716f GKH |
341 | u32 AddressFamily; |
342 | u32 MajorVersion; | |
343 | u32 MinorVersion; | |
9f33d054 | 344 | }; |
565e7dc8 | 345 | |
88a3716f | 346 | /* NdisHalt message */ |
9f33d054 | 347 | struct rndis_halt_request { |
88a3716f | 348 | u32 RequestId; |
9f33d054 | 349 | }; |
565e7dc8 | 350 | |
454f18a9 | 351 | /* NdisQueryRequest message */ |
9f33d054 | 352 | struct rndis_query_request { |
88a3716f GKH |
353 | u32 RequestId; |
354 | u32 Oid; | |
355 | u32 InformationBufferLength; | |
356 | u32 InformationBufferOffset; | |
357 | u32 DeviceVcHandle; | |
9f33d054 | 358 | }; |
565e7dc8 | 359 | |
88a3716f | 360 | /* Response to NdisQueryRequest */ |
9f33d054 | 361 | struct rndis_query_complete { |
88a3716f GKH |
362 | u32 RequestId; |
363 | u32 Status; | |
364 | u32 InformationBufferLength; | |
365 | u32 InformationBufferOffset; | |
9f33d054 | 366 | }; |
565e7dc8 | 367 | |
88a3716f | 368 | /* NdisSetRequest message */ |
9f33d054 | 369 | struct rndis_set_request { |
88a3716f GKH |
370 | u32 RequestId; |
371 | u32 Oid; | |
372 | u32 InformationBufferLength; | |
373 | u32 InformationBufferOffset; | |
374 | u32 DeviceVcHandle; | |
9f33d054 | 375 | }; |
565e7dc8 | 376 | |
88a3716f | 377 | /* Response to NdisSetRequest */ |
9f33d054 | 378 | struct rndis_set_complete { |
88a3716f GKH |
379 | u32 RequestId; |
380 | u32 Status; | |
9f33d054 | 381 | }; |
565e7dc8 | 382 | |
88a3716f | 383 | /* NdisReset message */ |
9f33d054 | 384 | struct rndis_reset_request { |
88a3716f | 385 | u32 Reserved; |
9f33d054 | 386 | }; |
565e7dc8 | 387 | |
88a3716f | 388 | /* Response to NdisReset */ |
9f33d054 | 389 | struct rndis_reset_complete { |
88a3716f GKH |
390 | u32 Status; |
391 | u32 AddressingReset; | |
9f33d054 | 392 | }; |
565e7dc8 | 393 | |
88a3716f | 394 | /* NdisMIndicateStatus message */ |
9f33d054 | 395 | struct rndis_indicate_status { |
88a3716f GKH |
396 | u32 Status; |
397 | u32 StatusBufferLength; | |
398 | u32 StatusBufferOffset; | |
9f33d054 | 399 | }; |
565e7dc8 | 400 | |
88a3716f | 401 | /* Diagnostic information passed as the status buffer in */ |
9f33d054 | 402 | /* struct rndis_indicate_status messages signifying error conditions. */ |
462eeeca | 403 | struct rndis_diagnostic_info { |
88a3716f GKH |
404 | u32 DiagStatus; |
405 | u32 ErrorOffset; | |
462eeeca | 406 | }; |
565e7dc8 | 407 | |
88a3716f | 408 | /* NdisKeepAlive message */ |
9f33d054 | 409 | struct rndis_keepalive_request { |
88a3716f | 410 | u32 RequestId; |
9f33d054 | 411 | }; |
565e7dc8 | 412 | |
454f18a9 | 413 | /* Response to NdisKeepAlive */ |
9f33d054 | 414 | struct rndis_keepalive_complete { |
88a3716f GKH |
415 | u32 RequestId; |
416 | u32 Status; | |
9f33d054 | 417 | }; |
565e7dc8 | 418 | |
88a3716f GKH |
419 | /* |
420 | * Data message. All Offset fields contain byte offsets from the beginning of | |
9f33d054 | 421 | * struct rndis_packet. All Length fields are in bytes. VcHandle is set |
88a3716f GKH |
422 | * to 0 for connectionless data, otherwise it contains the VC handle. |
423 | */ | |
9f33d054 | 424 | struct rndis_packet { |
88a3716f GKH |
425 | u32 DataOffset; |
426 | u32 DataLength; | |
427 | u32 OOBDataOffset; | |
428 | u32 OOBDataLength; | |
429 | u32 NumOOBDataElements; | |
430 | u32 PerPacketInfoOffset; | |
431 | u32 PerPacketInfoLength; | |
432 | u32 VcHandle; | |
433 | u32 Reserved; | |
9f33d054 | 434 | }; |
565e7dc8 | 435 | |
88a3716f | 436 | /* Optional Out of Band data associated with a Data message. */ |
9f33d054 | 437 | struct rndis_oobd { |
88a3716f GKH |
438 | u32 Size; |
439 | u32 Type; | |
440 | u32 ClassInformationOffset; | |
9f33d054 | 441 | }; |
565e7dc8 | 442 | |
88a3716f | 443 | /* Packet extension field contents associated with a Data message. */ |
9f33d054 | 444 | struct rndis_per_packet_info { |
88a3716f GKH |
445 | u32 Size; |
446 | u32 Type; | |
447 | u32 PerPacketInformationOffset; | |
9f33d054 | 448 | }; |
565e7dc8 | 449 | |
88a3716f GKH |
450 | /* Format of Information buffer passed in a SetRequest for the OID */ |
451 | /* OID_GEN_RNDIS_CONFIG_PARAMETER. */ | |
9f33d054 | 452 | struct rndis_config_parameter_info { |
88a3716f GKH |
453 | u32 ParameterNameOffset; |
454 | u32 ParameterNameLength; | |
455 | u32 ParameterType; | |
456 | u32 ParameterValueOffset; | |
457 | u32 ParameterValueLength; | |
9f33d054 | 458 | }; |
565e7dc8 | 459 | |
9f33d054 | 460 | /* Values for ParameterType in struct rndis_config_parameter_info */ |
565e7dc8 HJ |
461 | #define RNDIS_CONFIG_PARAM_TYPE_INTEGER 0 |
462 | #define RNDIS_CONFIG_PARAM_TYPE_STRING 2 | |
463 | ||
88a3716f GKH |
464 | /* CONDIS Miniport messages for connection oriented devices */ |
465 | /* that do not implement a call manager. */ | |
565e7dc8 | 466 | |
88a3716f | 467 | /* CoNdisMiniportCreateVc message */ |
462eeeca | 468 | struct rcondis_mp_create_vc { |
88a3716f GKH |
469 | u32 RequestId; |
470 | u32 NdisVcHandle; | |
462eeeca | 471 | }; |
565e7dc8 | 472 | |
88a3716f | 473 | /* Response to CoNdisMiniportCreateVc */ |
462eeeca | 474 | struct rcondis_mp_create_vc_complete { |
88a3716f GKH |
475 | u32 RequestId; |
476 | u32 DeviceVcHandle; | |
477 | u32 Status; | |
462eeeca | 478 | }; |
565e7dc8 | 479 | |
88a3716f | 480 | /* CoNdisMiniportDeleteVc message */ |
462eeeca | 481 | struct rcondis_mp_delete_vc { |
88a3716f GKH |
482 | u32 RequestId; |
483 | u32 DeviceVcHandle; | |
462eeeca | 484 | }; |
565e7dc8 | 485 | |
88a3716f | 486 | /* Response to CoNdisMiniportDeleteVc */ |
462eeeca | 487 | struct rcondis_mp_delete_vc_complete { |
88a3716f GKH |
488 | u32 RequestId; |
489 | u32 Status; | |
462eeeca | 490 | }; |
565e7dc8 | 491 | |
88a3716f | 492 | /* CoNdisMiniportQueryRequest message */ |
462eeeca | 493 | struct rcondis_mp_query_request { |
88a3716f GKH |
494 | u32 RequestId; |
495 | u32 RequestType; | |
496 | u32 Oid; | |
497 | u32 DeviceVcHandle; | |
498 | u32 InformationBufferLength; | |
499 | u32 InformationBufferOffset; | |
462eeeca | 500 | }; |
565e7dc8 | 501 | |
88a3716f | 502 | /* CoNdisMiniportSetRequest message */ |
462eeeca | 503 | struct rcondis_mp_set_request { |
88a3716f GKH |
504 | u32 RequestId; |
505 | u32 RequestType; | |
506 | u32 Oid; | |
507 | u32 DeviceVcHandle; | |
508 | u32 InformationBufferLength; | |
509 | u32 InformationBufferOffset; | |
462eeeca | 510 | }; |
565e7dc8 | 511 | |
88a3716f | 512 | /* CoNdisIndicateStatus message */ |
462eeeca | 513 | struct rcondis_indicate_status { |
88a3716f GKH |
514 | u32 NdisVcHandle; |
515 | u32 Status; | |
516 | u32 StatusBufferLength; | |
517 | u32 StatusBufferOffset; | |
462eeeca | 518 | }; |
565e7dc8 | 519 | |
88a3716f | 520 | /* CONDIS Call/VC parameters */ |
462eeeca | 521 | struct rcondis_specific_parameters { |
88a3716f GKH |
522 | u32 ParameterType; |
523 | u32 ParameterLength; | |
524 | u32 ParameterOffset; | |
462eeeca | 525 | }; |
565e7dc8 | 526 | |
462eeeca | 527 | struct rcondis_media_parameters { |
88a3716f GKH |
528 | u32 Flags; |
529 | u32 Reserved1; | |
530 | u32 Reserved2; | |
462eeeca GKH |
531 | struct rcondis_specific_parameters MediaSpecific; |
532 | }; | |
565e7dc8 | 533 | |
462eeeca | 534 | struct rndis_flowspec { |
88a3716f GKH |
535 | u32 TokenRate; |
536 | u32 TokenBucketSize; | |
537 | u32 PeakBandwidth; | |
538 | u32 Latency; | |
539 | u32 DelayVariation; | |
540 | u32 ServiceType; | |
541 | u32 MaxSduSize; | |
542 | u32 MinimumPolicedSize; | |
462eeeca | 543 | }; |
565e7dc8 | 544 | |
462eeeca GKH |
545 | struct rcondis_call_manager_parameters { |
546 | struct rndis_flowspec Transmit; | |
547 | struct rndis_flowspec Receive; | |
548 | struct rcondis_specific_parameters CallMgrSpecific; | |
549 | }; | |
565e7dc8 | 550 | |
88a3716f | 551 | /* CoNdisMiniportActivateVc message */ |
462eeeca | 552 | struct rcondis_mp_activate_vc_request { |
88a3716f GKH |
553 | u32 RequestId; |
554 | u32 Flags; | |
555 | u32 DeviceVcHandle; | |
556 | u32 MediaParamsOffset; | |
557 | u32 MediaParamsLength; | |
558 | u32 CallMgrParamsOffset; | |
559 | u32 CallMgrParamsLength; | |
462eeeca | 560 | }; |
565e7dc8 | 561 | |
88a3716f | 562 | /* Response to CoNdisMiniportActivateVc */ |
462eeeca | 563 | struct rcondis_mp_activate_vc_complete { |
88a3716f GKH |
564 | u32 RequestId; |
565 | u32 Status; | |
462eeeca | 566 | }; |
565e7dc8 | 567 | |
88a3716f | 568 | /* CoNdisMiniportDeactivateVc message */ |
462eeeca | 569 | struct rcondis_mp_deactivate_vc_request { |
88a3716f GKH |
570 | u32 RequestId; |
571 | u32 Flags; | |
572 | u32 DeviceVcHandle; | |
462eeeca | 573 | }; |
565e7dc8 | 574 | |
88a3716f | 575 | /* Response to CoNdisMiniportDeactivateVc */ |
462eeeca | 576 | struct rcondis_mp_deactivate_vc_complete { |
88a3716f GKH |
577 | u32 RequestId; |
578 | u32 Status; | |
462eeeca | 579 | }; |
565e7dc8 HJ |
580 | |
581 | ||
454f18a9 | 582 | /* union with all of the RNDIS messages */ |
9f33d054 GKH |
583 | union rndis_message_container { |
584 | struct rndis_packet Packet; | |
585 | struct rndis_initialize_request InitializeRequest; | |
586 | struct rndis_halt_request HaltRequest; | |
587 | struct rndis_query_request QueryRequest; | |
588 | struct rndis_set_request SetRequest; | |
589 | struct rndis_reset_request ResetRequest; | |
590 | struct rndis_keepalive_request KeepaliveRequest; | |
591 | struct rndis_indicate_status IndicateStatus; | |
592 | struct rndis_initialize_complete InitializeComplete; | |
593 | struct rndis_query_complete QueryComplete; | |
594 | struct rndis_set_complete SetComplete; | |
595 | struct rndis_reset_complete ResetComplete; | |
596 | struct rndis_keepalive_complete KeepaliveComplete; | |
462eeeca GKH |
597 | struct rcondis_mp_create_vc CoMiniportCreateVc; |
598 | struct rcondis_mp_delete_vc CoMiniportDeleteVc; | |
599 | struct rcondis_indicate_status CoIndicateStatus; | |
600 | struct rcondis_mp_activate_vc_request CoMiniportActivateVc; | |
601 | struct rcondis_mp_deactivate_vc_request CoMiniportDeactivateVc; | |
602 | struct rcondis_mp_create_vc_complete CoMiniportCreateVcComplete; | |
603 | struct rcondis_mp_delete_vc_complete CoMiniportDeleteVcComplete; | |
604 | struct rcondis_mp_activate_vc_complete CoMiniportActivateVcComplete; | |
605 | struct rcondis_mp_deactivate_vc_complete CoMiniportDeactivateVcComplete; | |
9f33d054 | 606 | }; |
565e7dc8 | 607 | |
454f18a9 | 608 | /* Remote NDIS message format */ |
9f33d054 | 609 | struct rndis_message { |
88a3716f | 610 | u32 NdisMessageType; |
454f18a9 | 611 | |
88a3716f | 612 | /* Total length of this message, from the beginning */ |
9f33d054 | 613 | /* of the sruct rndis_message, in bytes. */ |
88a3716f | 614 | u32 MessageLength; |
565e7dc8 | 615 | |
88a3716f | 616 | /* Actual message */ |
9f33d054 GKH |
617 | union rndis_message_container Message; |
618 | }; | |
565e7dc8 | 619 | |
454f18a9 BP |
620 | /* Handy macros */ |
621 | ||
622 | /* get the size of an RNDIS message. Pass in the message type, */ | |
9f33d054 | 623 | /* struct rndis_set_request, struct rndis_packet for example */ |
88a3716f | 624 | #define RNDIS_MESSAGE_SIZE(Message) \ |
0686e4f4 | 625 | (sizeof(Message) + (sizeof(struct rndis_message) - \ |
9f33d054 | 626 | sizeof(union rndis_message_container))) |
565e7dc8 | 627 | |
454f18a9 | 628 | /* get pointer to info buffer with message pointer */ |
88a3716f GKH |
629 | #define MESSAGE_TO_INFO_BUFFER(Message) \ |
630 | (((unsigned char *)(Message)) + Message->InformationBufferOffset) | |
565e7dc8 | 631 | |
454f18a9 | 632 | /* get pointer to status buffer with message pointer */ |
88a3716f GKH |
633 | #define MESSAGE_TO_STATUS_BUFFER(Message) \ |
634 | (((unsigned char *)(Message)) + Message->StatusBufferOffset) | |
565e7dc8 | 635 | |
454f18a9 | 636 | /* get pointer to OOBD buffer with message pointer */ |
88a3716f GKH |
637 | #define MESSAGE_TO_OOBD_BUFFER(Message) \ |
638 | (((unsigned char *)(Message)) + Message->OOBDataOffset) | |
565e7dc8 | 639 | |
454f18a9 | 640 | /* get pointer to data buffer with message pointer */ |
88a3716f GKH |
641 | #define MESSAGE_TO_DATA_BUFFER(Message) \ |
642 | (((unsigned char *)(Message)) + Message->PerPacketInfoOffset) | |
565e7dc8 | 643 | |
454f18a9 | 644 | /* get pointer to contained message from NDIS_MESSAGE pointer */ |
88a3716f GKH |
645 | #define RNDIS_MESSAGE_PTR_TO_MESSAGE_PTR(RndisMessage) \ |
646 | ((void *) &RndisMessage->Message) | |
565e7dc8 | 647 | |
454f18a9 | 648 | /* get pointer to contained message from NDIS_MESSAGE pointer */ |
88a3716f GKH |
649 | #define RNDIS_MESSAGE_RAW_PTR_TO_MESSAGE_PTR(RndisMessage) \ |
650 | ((void *) RndisMessage) | |
565e7dc8 | 651 | |
454f18a9 | 652 | #endif /* _RNDIS_H_ */ |