10 #define RNDIS_RX_LIST_CNT 1
11 #define RNDIS_TX_LIST_CNT 1
12 #define RNDIS_BUFSZ 1562
14 #define RNDIS_STATUS_BUFFER_OVERFLOW 0x80000005L
15 #define RNDIS_STATUS_FAILURE 0xC0000001L
16 #define RNDIS_STATUS_INVALID_DATA 0xC0010015L
17 #define RNDIS_STATUS_MEDIA_CONNECT 0x4001000BL
18 #define RNDIS_STATUS_MEDIA_DISCONNECT 0x4001000CL
19 #define RNDIS_STATUS_NOT_SUPPORTED 0xC00000BBL
20 #define RNDIS_STATUS_PENDING STATUS_PENDING /* XXX */
21 #define RNDIS_STATUS_RESOURCES 0xC000009AL
22 #define RNDIS_STATUS_SUCCESS 0x00000000L
24 #define OID_GEN_SUPPORTED_LIST 0x00010101
25 #define OID_GEN_HARDWARE_STATUS 0x00010102
26 #define OID_GEN_MEDIA_SUPPORTED 0x00010103
27 #define OID_GEN_MEDIA_IN_USE 0x00010104
28 #define OID_GEN_MAXIMUM_LOOKAHEAD 0x00010105
29 #define OID_GEN_MAXIMUM_FRAME_SIZE 0x00010106
30 #define OID_GEN_LINK_SPEED 0x00010107
31 #define OID_GEN_TRANSMIT_BUFFER_SPACE 0x00010108
32 #define OID_GEN_RECEIVE_BUFFER_SPACE 0x00010109
33 #define OID_GEN_TRANSMIT_BLOCK_SIZE 0x0001010A
34 #define OID_GEN_RECEIVE_BLOCK_SIZE 0x0001010B
35 #define OID_GEN_VENDOR_ID 0x0001010C
36 #define OID_GEN_VENDOR_DESCRIPTION 0x0001010D
37 #define OID_GEN_CURRENT_PACKET_FILTER 0x0001010E
38 #define OID_GEN_CURRENT_LOOKAHEAD 0x0001010F
39 #define OID_GEN_DRIVER_VERSION 0x00010110
40 #define OID_GEN_MAXIMUM_TOTAL_SIZE 0x00010111
41 #define OID_GEN_PROTOCOL_OPTIONS 0x00010112
42 #define OID_GEN_MAC_OPTIONS 0x00010113
43 #define OID_GEN_MEDIA_CONNECT_STATUS 0x00010114
44 #define OID_GEN_MAXIMUM_SEND_PACKETS 0x00010115
45 #define OID_GEN_VENDOR_DRIVER_VERSION 0x00010116
46 #define OID_GEN_SUPPORTED_GUIDS 0x00010117
47 #define OID_GEN_NETWORK_LAYER_ADDRESSES 0x00010118
48 #define OID_GEN_TRANSPORT_HEADER_OFFSET 0x00010119
49 #define OID_GEN_MACHINE_NAME 0x0001021A
50 #define OID_GEN_RNDIS_CONFIG_PARAMETER 0x0001021B
51 #define OID_GEN_VLAN_ID 0x0001021C
53 #define OID_802_3_PERMANENT_ADDRESS 0x01010101
54 #define OID_802_3_CURRENT_ADDRESS 0x01010102
55 #define OID_802_3_MULTICAST_LIST 0x01010103
56 #define OID_802_3_MAXIMUM_LIST_SIZE 0x01010104
57 #define OID_802_3_MAC_OPTIONS 0x01010105
58 #define OID_802_3_RCV_ERROR_ALIGNMENT 0x01020101
59 #define OID_802_3_XMIT_ONE_COLLISION 0x01020102
60 #define OID_802_3_XMIT_MORE_COLLISIONS 0x01020103
61 #define OID_802_3_XMIT_DEFERRED 0x01020201
62 #define OID_802_3_XMIT_MAX_COLLISIONS 0x01020202
63 #define OID_802_3_RCV_OVERRUN 0x01020203
64 #define OID_802_3_XMIT_UNDERRUN 0x01020204
65 #define OID_802_3_XMIT_HEARTBEAT_FAILURE 0x01020205
66 #define OID_802_3_XMIT_TIMES_CRS_LOST 0x01020206
67 #define OID_802_3_XMIT_LATE_COLLISIONS 0x01020207
69 #define RNDIS_MEDIUM_802_3 0x00000000
72 #define RNDIS_DF_CONNECTIONLESS 0x00000001
73 #define RNDIS_DF_CONNECTION_ORIENTED 0x00000002
78 #define REMOTE_NDIS_PACKET_MSG 0x00000001
80 struct urndis_packet_msg
{
83 uint32_t rm_dataoffset
;
85 uint32_t rm_oobdataoffset
;
86 uint32_t rm_oobdatalen
;
87 uint32_t rm_oobdataelements
;
88 uint32_t rm_pktinfooffset
;
89 uint32_t rm_pktinfolen
;
95 * RNDIS control messages
98 struct urndis_comp_hdr
{
105 /* Initialize the device. */
106 #define REMOTE_NDIS_INITIALIZE_MSG 0x00000002
107 #define REMOTE_NDIS_INITIALIZE_CMPLT 0x80000002
109 struct urndis_init_req
{
113 uint32_t rm_ver_major
;
114 uint32_t rm_ver_minor
;
115 uint32_t rm_max_xfersz
;
118 struct urndis_init_comp
{
123 uint32_t rm_ver_major
;
124 uint32_t rm_ver_minor
;
125 uint32_t rm_devflags
;
127 uint32_t rm_pktmaxcnt
;
128 uint32_t rm_pktmaxsz
;
130 uint32_t rm_aflistoffset
;
131 uint32_t rm_aflistsz
;
134 /* Halt the device. No response sent. */
135 #define REMOTE_NDIS_HALT_MSG 0x00000003
137 struct urndis_halt_req
{
143 /* Send a query object. */
144 #define REMOTE_NDIS_QUERY_MSG 0x00000004
145 #define REMOTE_NDIS_QUERY_CMPLT 0x80000004
147 struct urndis_query_req
{
152 uint32_t rm_infobuflen
;
153 uint32_t rm_infobufoffset
;
154 uint32_t rm_devicevchdl
;
157 struct urndis_query_comp
{
162 uint32_t rm_infobuflen
;
163 uint32_t rm_infobufoffset
;
166 /* Send a set object request. */
167 #define REMOTE_NDIS_SET_MSG 0x00000005
168 #define REMOTE_NDIS_SET_CMPLT 0x80000005
170 struct urndis_set_req
{
175 uint32_t rm_infobuflen
;
176 uint32_t rm_infobufoffset
;
177 uint32_t rm_devicevchdl
;
180 struct urndis_set_comp
{
187 #define REMOTE_NDIS_SET_PARAM_NUMERIC 0x00000000
188 #define REMOTE_NDIS_SET_PARAM_STRING 0x00000002
190 struct urndis_set_parameter
{
191 uint32_t rm_nameoffset
;
194 uint32_t rm_valueoffset
;
195 uint32_t rm_valuelen
;
198 /* Perform a soft reset on the device. */
199 #define REMOTE_NDIS_RESET_MSG 0x00000006
200 #define REMOTE_NDIS_RESET_CMPLT 0x80000006
202 struct urndis_reset_req
{
208 struct urndis_reset_comp
{
212 uint32_t rm_adrreset
;
215 /* 802.3 link-state or undefined message error. */
216 #define REMOTE_NDIS_INDICATE_STATUS_MSG 0x00000007
218 /* Keepalive messsage. May be sent by device. */
219 #define REMOTE_NDIS_KEEPALIVE_MSG 0x00000008
220 #define REMOTE_NDIS_KEEPALIVE_CMPLT 0x80000008
222 struct urndis_keepalive_req
{
228 struct urndis_keepalive_comp
{
235 /* packet filter bits used by OID_GEN_CURRENT_PACKET_FILTER */
236 #define RNDIS_PACKET_TYPE_DIRECTED 0x00000001
237 #define RNDIS_PACKET_TYPE_MULTICAST 0x00000002
238 #define RNDIS_PACKET_TYPE_ALL_MULTICAST 0x00000004
239 #define RNDIS_PACKET_TYPE_BROADCAST 0x00000008
240 #define RNDIS_PACKET_TYPE_SOURCE_ROUTING 0x00000010
241 #define RNDIS_PACKET_TYPE_PROMISCUOUS 0x00000020
242 #define RNDIS_PACKET_TYPE_SMT 0x00000040
243 #define RNDIS_PACKET_TYPE_ALL_LOCAL 0x00000080
244 #define RNDIS_PACKET_TYPE_GROUP 0x00001000
245 #define RNDIS_PACKET_TYPE_ALL_FUNCTIONAL 0x00002000
246 #define RNDIS_PACKET_TYPE_FUNCTIONAL 0x00004000
247 #define RNDIS_PACKET_TYPE_MAC_FRAME 0x00008000
250 #define RNDIS_HEADER_OFFSET (sizeof(uint32_t) * 2)
251 #define RNDIS_DATA_OFFSET (sizeof(struct urndis_packet_msg) - \
252 offsetof(struct urndis_packet_msg, \
256 #define UT_WRITE 0x00
258 #define UT_STANDARD 0x00
259 #define UT_CLASS 0x20
260 #define UT_VENDOR 0x40
261 #define UT_DEVICE 0x00
262 #define UT_INTERFACE 0x01
263 #define UT_ENDPOINT 0x02
264 #define UT_OTHER 0x03
266 #define UT_READ_DEVICE (UT_READ | UT_STANDARD | UT_DEVICE)
267 #define UT_READ_INTERFACE (UT_READ | UT_STANDARD | UT_INTERFACE)
268 #define UT_READ_ENDPOINT (UT_READ | UT_STANDARD | UT_ENDPOINT)
269 #define UT_WRITE_DEVICE (UT_WRITE | UT_STANDARD | UT_DEVICE)
270 #define UT_WRITE_INTERFACE (UT_WRITE | UT_STANDARD | UT_INTERFACE)
271 #define UT_WRITE_ENDPOINT (UT_WRITE | UT_STANDARD | UT_ENDPOINT)
272 #define UT_READ_CLASS_DEVICE (UT_READ | UT_CLASS | UT_DEVICE)
273 #define UT_READ_CLASS_INTERFACE (UT_READ | UT_CLASS | UT_INTERFACE)
274 #define UT_READ_CLASS_OTHER (UT_READ | UT_CLASS | UT_OTHER)
275 #define UT_READ_CLASS_ENDPOINT (UT_READ | UT_CLASS | UT_ENDPOINT)
276 #define UT_WRITE_CLASS_DEVICE (UT_WRITE | UT_CLASS | UT_DEVICE)
277 #define UT_WRITE_CLASS_INTERFACE (UT_WRITE | UT_CLASS | UT_INTERFACE)
278 #define UT_WRITE_CLASS_OTHER (UT_WRITE | UT_CLASS | UT_OTHER)
279 #define UT_WRITE_CLASS_ENDPOINT (UT_WRITE | UT_CLASS | UT_ENDPOINT)
280 #define UT_READ_VENDOR_DEVICE (UT_READ | UT_VENDOR | UT_DEVICE)
281 #define UT_READ_VENDOR_INTERFACE (UT_READ | UT_VENDOR | UT_INTERFACE)
282 #define UT_READ_VENDOR_OTHER (UT_READ | UT_VENDOR | UT_OTHER)
283 #define UT_READ_VENDOR_ENDPOINT (UT_READ | UT_VENDOR | UT_ENDPOINT)
284 #define UT_WRITE_VENDOR_DEVICE (UT_WRITE | UT_VENDOR | UT_DEVICE)
285 #define UT_WRITE_VENDOR_INTERFACE (UT_WRITE | UT_VENDOR | UT_INTERFACE)
286 #define UT_WRITE_VENDOR_OTHER (UT_WRITE | UT_VENDOR | UT_OTHER)
287 #define UT_WRITE_VENDOR_ENDPOINT (UT_WRITE | UT_VENDOR | UT_ENDPOINT)
289 #define UR_GET_STATUS 0x00
290 #define UR_CLEAR_FEATURE 0x01
291 #define UR_SET_FEATURE 0x03
292 #define UR_SET_ADDRESS 0x05
293 #define UR_GET_DESCRIPTOR 0x06
294 #define UDESC_DEVICE 0x01
295 #define UDESC_CONFIG 0x02
296 #define UDESC_STRING 0x03
297 #define UDESC_INTERFACE 0x04
298 #define UDESC_ENDPOINT 0x05
299 #define UDESC_DEVICE_QUALIFIER 0x06
300 #define UDESC_OTHER_SPEED_CONFIGURATION 0x07
301 #define UDESC_INTERFACE_POWER 0x08
302 #define UDESC_OTG 0x09
303 #define UDESC_DEBUG 0x0a
304 #define UDESC_CS_DEVICE 0x21
305 #define UDESC_CS_CONFIG 0x22
306 #define UDESC_CS_STRING 0x23
307 #define UDESC_CS_INTERFACE 0x24
308 #define UDESC_CS_ENDPOINT 0x25
309 #define UDESC_HUB 0x29
310 #define UR_SET_DESCRIPTOR 0x07
311 #define UR_GET_CONFIG 0x08
312 #define UR_SET_CONFIG 0x09
313 #define UR_GET_INTERFACE 0x0a
314 #define UR_SET_INTERFACE 0x0b
315 #define UR_SYNCH_FRAME 0x0c