Merge branch 'move-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/davej...
[linux-2.6/next.git] / drivers / staging / hv / rndis.h
blob014de047b86dd6f7204fcd29b21eb6adba1a29c4
1 /*
3 * Copyright (c) 2009, Microsoft Corporation.
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.
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.
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.
18 * Authors:
19 * Haiyang Zhang <haiyangz@microsoft.com>
20 * Hank Janssen <hjanssen@microsoft.com>
24 #ifndef _RNDIS_H_
25 #define _RNDIS_H_
27 /* Status codes */
30 #ifndef STATUS_SUCCESS
31 #define STATUS_SUCCESS (0x00000000L)
32 #endif
34 #ifndef STATUS_UNSUCCESSFUL
35 #define STATUS_UNSUCCESSFUL (0xC0000001L)
36 #endif
38 #ifndef STATUS_PENDING
39 #define STATUS_PENDING (0x00000103L)
40 #endif
42 #ifndef STATUS_INSUFFICIENT_RESOURCES
43 #define STATUS_INSUFFICIENT_RESOURCES (0xC000009AL)
44 #endif
46 #ifndef STATUS_BUFFER_OVERFLOW
47 #define STATUS_BUFFER_OVERFLOW (0x80000005L)
48 #endif
50 #ifndef STATUS_NOT_SUPPORTED
51 #define STATUS_NOT_SUPPORTED (0xC00000BBL)
52 #endif
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)
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)
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)
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)
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)
129 #define RNDIS_STATUS_TOKEN_RING_OPEN_ERROR (0xC0011000L)
131 /* Object Identifiers used by NdisRequest Query/Set Information */
132 /* General Objects */
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
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
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
179 #define RNDIS_OID_GEN_RCV_CRC_ERROR 0x0002020D
180 #define RNDIS_OID_GEN_TRANSMIT_QUEUE_LENGTH 0x0002020E
182 #define RNDIS_OID_GEN_GET_TIME_CAPS 0x0002020F
183 #define RNDIS_OID_GEN_GET_NETCARD_TIME 0x00020210
185 /* These are connection-oriented general OIDs. */
186 /* These replace the above OIDs for connection-oriented media. */
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
201 #define RNDIS_OID_GEN_CO_GET_TIME_CAPS 0x00010201
202 #define RNDIS_OID_GEN_CO_GET_NETCARD_TIME 0x00010202
204 /* These are connection-oriented statistics OIDs. */
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
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
219 /* These are objects for Connection-oriented media call-managers. */
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
230 /* 802.3 Objects (Ethernet) */
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
237 #define NDIS_802_3_MAC_OPTION_PRIORITY 0x00000001
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
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
251 /* Remote NDIS message types */
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
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
267 /* Remote NDIS message completion types */
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
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
280 * Reserved message type for private communication between lower-layer host
281 * driver and remote device, if necessary.
283 #define REMOTE_NDIS_BUS_MSG 0xff000001
285 /* Defines for DeviceFlags in struct rndis_initialize_complete */
286 #define RNDIS_DF_CONNECTIONLESS 0x00000001
287 #define RNDIS_DF_CONNECTION_ORIENTED 0x00000002
288 #define RNDIS_DF_RAW_DATA 0x00000004
290 /* Remote NDIS medium types. */
291 #define RNDIS_MEDIUM_802_3 0x00000000
292 #define RNDIS_MEDIUM_802_5 0x00000001
293 #define RNDIS_MEDIUM_FDDI 0x00000002
294 #define RNDIS_MEDIUM_WAN 0x00000003
295 #define RNDIS_MEDIUM_LOCAL_TALK 0x00000004
296 #define RNDIS_MEDIUM_ARCNET_RAW 0x00000006
297 #define RNDIS_MEDIUM_ARCNET_878_2 0x00000007
298 #define RNDIS_MEDIUM_ATM 0x00000008
299 #define RNDIS_MEDIUM_WIRELESS_WAN 0x00000009
300 #define RNDIS_MEDIUM_IRDA 0x0000000a
301 #define RNDIS_MEDIUM_CO_WAN 0x0000000b
302 /* Not a real medium, defined as an upper-bound */
303 #define RNDIS_MEDIUM_MAX 0x0000000d
306 /* Remote NDIS medium connection states. */
307 #define RNDIS_MEDIA_STATE_CONNECTED 0x00000000
308 #define RNDIS_MEDIA_STATE_DISCONNECTED 0x00000001
310 /* Remote NDIS version numbers */
311 #define RNDIS_MAJOR_VERSION 0x00000001
312 #define RNDIS_MINOR_VERSION 0x00000000
315 /* NdisInitialize message */
316 struct rndis_initialize_request {
317 u32 req_id;
318 u32 major_ver;
319 u32 minor_ver;
320 u32 max_xfer_size;
323 /* Response to NdisInitialize */
324 struct rndis_initialize_complete {
325 u32 req_id;
326 u32 status;
327 u32 major_ver;
328 u32 minor_ver;
329 u32 dev_flags;
330 u32 medium;
331 u32 max_pkt_per_msg;
332 u32 max_xfer_size;
333 u32 pkt_alignment_factor;
334 u32 af_list_offset;
335 u32 af_list_size;
338 /* Call manager devices only: Information about an address family */
339 /* supported by the device is appended to the response to NdisInitialize. */
340 struct rndis_co_address_family {
341 u32 address_family;
342 u32 major_ver;
343 u32 minor_ver;
346 /* NdisHalt message */
347 struct rndis_halt_request {
348 u32 req_id;
351 /* NdisQueryRequest message */
352 struct rndis_query_request {
353 u32 req_id;
354 u32 oid;
355 u32 info_buflen;
356 u32 info_buf_offset;
357 u32 dev_vc_handle;
360 /* Response to NdisQueryRequest */
361 struct rndis_query_complete {
362 u32 req_id;
363 u32 status;
364 u32 info_buflen;
365 u32 info_buf_offset;
368 /* NdisSetRequest message */
369 struct rndis_set_request {
370 u32 req_id;
371 u32 oid;
372 u32 info_buflen;
373 u32 info_buf_offset;
374 u32 dev_vc_handle;
377 /* Response to NdisSetRequest */
378 struct rndis_set_complete {
379 u32 req_id;
380 u32 status;
383 /* NdisReset message */
384 struct rndis_reset_request {
385 u32 reserved;
388 /* Response to NdisReset */
389 struct rndis_reset_complete {
390 u32 status;
391 u32 addressing_reset;
394 /* NdisMIndicateStatus message */
395 struct rndis_indicate_status {
396 u32 status;
397 u32 status_buflen;
398 u32 status_buf_offset;
401 /* Diagnostic information passed as the status buffer in */
402 /* struct rndis_indicate_status messages signifying error conditions. */
403 struct rndis_diagnostic_info {
404 u32 diag_status;
405 u32 error_offset;
408 /* NdisKeepAlive message */
409 struct rndis_keepalive_request {
410 u32 req_id;
413 /* Response to NdisKeepAlive */
414 struct rndis_keepalive_complete {
415 u32 req_id;
416 u32 status;
420 * Data message. All Offset fields contain byte offsets from the beginning of
421 * struct rndis_packet. All Length fields are in bytes. VcHandle is set
422 * to 0 for connectionless data, otherwise it contains the VC handle.
424 struct rndis_packet {
425 u32 data_offset;
426 u32 data_len;
427 u32 oob_data_offset;
428 u32 oob_data_len;
429 u32 num_oob_data_elements;
430 u32 per_pkt_info_offset;
431 u32 per_pkt_info_len;
432 u32 vc_handle;
433 u32 reserved;
436 /* Optional Out of Band data associated with a Data message. */
437 struct rndis_oobd {
438 u32 size;
439 u32 type;
440 u32 class_info_offset;
443 /* Packet extension field contents associated with a Data message. */
444 struct rndis_per_packet_info {
445 u32 size;
446 u32 type;
447 u32 per_pkt_info_offset;
450 /* Format of Information buffer passed in a SetRequest for the OID */
451 /* OID_GEN_RNDIS_CONFIG_PARAMETER. */
452 struct rndis_config_parameter_info {
453 u32 parameter_name_offset;
454 u32 parameter_name_length;
455 u32 parameter_type;
456 u32 parameter_value_offset;
457 u32 parameter_value_length;
460 /* Values for ParameterType in struct rndis_config_parameter_info */
461 #define RNDIS_CONFIG_PARAM_TYPE_INTEGER 0
462 #define RNDIS_CONFIG_PARAM_TYPE_STRING 2
464 /* CONDIS Miniport messages for connection oriented devices */
465 /* that do not implement a call manager. */
467 /* CoNdisMiniportCreateVc message */
468 struct rcondis_mp_create_vc {
469 u32 req_id;
470 u32 ndis_vc_handle;
473 /* Response to CoNdisMiniportCreateVc */
474 struct rcondis_mp_create_vc_complete {
475 u32 req_id;
476 u32 dev_vc_handle;
477 u32 status;
480 /* CoNdisMiniportDeleteVc message */
481 struct rcondis_mp_delete_vc {
482 u32 req_id;
483 u32 dev_vc_handle;
486 /* Response to CoNdisMiniportDeleteVc */
487 struct rcondis_mp_delete_vc_complete {
488 u32 req_id;
489 u32 status;
492 /* CoNdisMiniportQueryRequest message */
493 struct rcondis_mp_query_request {
494 u32 req_id;
495 u32 request_type;
496 u32 oid;
497 u32 dev_vc_handle;
498 u32 info_buflen;
499 u32 info_buf_offset;
502 /* CoNdisMiniportSetRequest message */
503 struct rcondis_mp_set_request {
504 u32 req_id;
505 u32 request_type;
506 u32 oid;
507 u32 dev_vc_handle;
508 u32 info_buflen;
509 u32 info_buf_offset;
512 /* CoNdisIndicateStatus message */
513 struct rcondis_indicate_status {
514 u32 ndis_vc_handle;
515 u32 status;
516 u32 status_buflen;
517 u32 status_buf_offset;
520 /* CONDIS Call/VC parameters */
521 struct rcondis_specific_parameters {
522 u32 parameter_type;
523 u32 parameter_length;
524 u32 parameter_lffset;
527 struct rcondis_media_parameters {
528 u32 flags;
529 u32 reserved1;
530 u32 reserved2;
531 struct rcondis_specific_parameters media_specific;
534 struct rndis_flowspec {
535 u32 token_rate;
536 u32 token_bucket_size;
537 u32 peak_bandwidth;
538 u32 latency;
539 u32 delay_variation;
540 u32 service_type;
541 u32 max_sdu_size;
542 u32 minimum_policed_size;
545 struct rcondis_call_manager_parameters {
546 struct rndis_flowspec transmit;
547 struct rndis_flowspec receive;
548 struct rcondis_specific_parameters call_mgr_specific;
551 /* CoNdisMiniportActivateVc message */
552 struct rcondis_mp_activate_vc_request {
553 u32 req_id;
554 u32 flags;
555 u32 dev_vc_handle;
556 u32 media_params_offset;
557 u32 media_params_length;
558 u32 call_mgr_params_offset;
559 u32 call_mgr_params_length;
562 /* Response to CoNdisMiniportActivateVc */
563 struct rcondis_mp_activate_vc_complete {
564 u32 req_id;
565 u32 status;
568 /* CoNdisMiniportDeactivateVc message */
569 struct rcondis_mp_deactivate_vc_request {
570 u32 req_id;
571 u32 flags;
572 u32 dev_vc_handle;
575 /* Response to CoNdisMiniportDeactivateVc */
576 struct rcondis_mp_deactivate_vc_complete {
577 u32 req_id;
578 u32 status;
582 /* union with all of the RNDIS messages */
583 union rndis_message_container {
584 struct rndis_packet pkt;
585 struct rndis_initialize_request init_req;
586 struct rndis_halt_request halt_req;
587 struct rndis_query_request query_req;
588 struct rndis_set_request set_req;
589 struct rndis_reset_request reset_req;
590 struct rndis_keepalive_request keep_alive_req;
591 struct rndis_indicate_status indicate_status;
592 struct rndis_initialize_complete init_complete;
593 struct rndis_query_complete query_complete;
594 struct rndis_set_complete set_complete;
595 struct rndis_reset_complete reset_complete;
596 struct rndis_keepalive_complete keep_alive_complete;
597 struct rcondis_mp_create_vc co_miniport_create_vc;
598 struct rcondis_mp_delete_vc co_miniport_delete_vc;
599 struct rcondis_indicate_status co_indicate_status;
600 struct rcondis_mp_activate_vc_request co_miniport_activate_vc;
601 struct rcondis_mp_deactivate_vc_request co_miniport_deactivate_vc;
602 struct rcondis_mp_create_vc_complete co_miniport_create_vc_complete;
603 struct rcondis_mp_delete_vc_complete co_miniport_delete_vc_complete;
604 struct rcondis_mp_activate_vc_complete co_miniport_activate_vc_complete;
605 struct rcondis_mp_deactivate_vc_complete
606 co_miniport_deactivate_vc_complete;
609 /* Remote NDIS message format */
610 struct rndis_message {
611 u32 ndis_msg_type;
613 /* Total length of this message, from the beginning */
614 /* of the sruct rndis_message, in bytes. */
615 u32 msg_len;
617 /* Actual message */
618 union rndis_message_container msg;
621 /* Handy macros */
623 /* get the size of an RNDIS message. Pass in the message type, */
624 /* struct rndis_set_request, struct rndis_packet for example */
625 #define RNDIS_MESSAGE_SIZE(msg) \
626 (sizeof(msg) + (sizeof(struct rndis_message) - \
627 sizeof(union rndis_message_container)))
629 /* get pointer to info buffer with message pointer */
630 #define MESSAGE_TO_INFO_BUFFER(msg) \
631 (((unsigned char *)(msg)) + msg->info_buf_offset)
633 /* get pointer to status buffer with message pointer */
634 #define MESSAGE_TO_STATUS_BUFFER(msg) \
635 (((unsigned char *)(msg)) + msg->status_buf_offset)
637 /* get pointer to OOBD buffer with message pointer */
638 #define MESSAGE_TO_OOBD_BUFFER(msg) \
639 (((unsigned char *)(msg)) + msg->oob_data_offset)
641 /* get pointer to data buffer with message pointer */
642 #define MESSAGE_TO_DATA_BUFFER(msg) \
643 (((unsigned char *)(msg)) + msg->per_pkt_info_offset)
645 /* get pointer to contained message from NDIS_MESSAGE pointer */
646 #define RNDIS_MESSAGE_PTR_TO_MESSAGE_PTR(rndis_msg) \
647 ((void *) &rndis_msg->msg)
649 /* get pointer to contained message from NDIS_MESSAGE pointer */
650 #define RNDIS_MESSAGE_RAW_PTR_TO_MESSAGE_PTR(rndis_msg) \
651 ((void *) rndis_msg)
653 #endif /* _RNDIS_H_ */