hyperv_net.h 31 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058
  1. /*
  2. *
  3. * Copyright (c) 2011, 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. * K. Y. Srinivasan <kys@microsoft.com>
  22. *
  23. */
  24. #ifndef _HYPERV_NET_H
  25. #define _HYPERV_NET_H
  26. #include <linux/list.h>
  27. #include <linux/hyperv.h>
  28. /* Fwd declaration */
  29. struct hv_netvsc_packet;
  30. /* Represent the xfer page packet which contains 1 or more netvsc packet */
  31. struct xferpage_packet {
  32. struct list_head list_ent;
  33. /* # of netvsc packets this xfer packet contains */
  34. u32 count;
  35. };
  36. /* The number of pages which are enough to cover jumbo frame buffer. */
  37. #define NETVSC_PACKET_MAXPAGE 4
  38. /*
  39. * Represent netvsc packet which contains 1 RNDIS and 1 ethernet frame
  40. * within the RNDIS
  41. */
  42. struct hv_netvsc_packet {
  43. /* Bookkeeping stuff */
  44. struct list_head list_ent;
  45. struct hv_device *device;
  46. bool is_data_pkt;
  47. /*
  48. * Valid only for receives when we break a xfer page packet
  49. * into multiple netvsc packets
  50. */
  51. struct xferpage_packet *xfer_page_pkt;
  52. union {
  53. struct {
  54. u64 recv_completion_tid;
  55. void *recv_completion_ctx;
  56. void (*recv_completion)(void *context);
  57. } recv;
  58. struct {
  59. u64 send_completion_tid;
  60. void *send_completion_ctx;
  61. void (*send_completion)(void *context);
  62. } send;
  63. } completion;
  64. /* This points to the memory after page_buf */
  65. void *extension;
  66. u32 total_data_buflen;
  67. /* Points to the send/receive buffer where the ethernet frame is */
  68. u32 page_buf_cnt;
  69. struct hv_page_buffer page_buf[NETVSC_PACKET_MAXPAGE];
  70. };
  71. struct netvsc_device_info {
  72. unsigned char mac_adr[6];
  73. bool link_state; /* 0 - link up, 1 - link down */
  74. int ring_size;
  75. };
  76. /* Interface */
  77. int netvsc_device_add(struct hv_device *device, void *additional_info);
  78. int netvsc_device_remove(struct hv_device *device);
  79. int netvsc_send(struct hv_device *device,
  80. struct hv_netvsc_packet *packet);
  81. void netvsc_linkstatus_callback(struct hv_device *device_obj,
  82. unsigned int status);
  83. int netvsc_recv_callback(struct hv_device *device_obj,
  84. struct hv_netvsc_packet *packet);
  85. int rndis_filter_open(struct hv_device *dev);
  86. int rndis_filter_close(struct hv_device *dev);
  87. int rndis_filter_device_add(struct hv_device *dev,
  88. void *additional_info);
  89. void rndis_filter_device_remove(struct hv_device *dev);
  90. int rndis_filter_receive(struct hv_device *dev,
  91. struct hv_netvsc_packet *pkt);
  92. int rndis_filter_send(struct hv_device *dev,
  93. struct hv_netvsc_packet *pkt);
  94. #define NVSP_INVALID_PROTOCOL_VERSION ((u32)0xFFFFFFFF)
  95. #define NVSP_PROTOCOL_VERSION_1 2
  96. #define NVSP_MIN_PROTOCOL_VERSION NVSP_PROTOCOL_VERSION_1
  97. #define NVSP_MAX_PROTOCOL_VERSION NVSP_PROTOCOL_VERSION_1
  98. enum {
  99. NVSP_MSG_TYPE_NONE = 0,
  100. /* Init Messages */
  101. NVSP_MSG_TYPE_INIT = 1,
  102. NVSP_MSG_TYPE_INIT_COMPLETE = 2,
  103. NVSP_VERSION_MSG_START = 100,
  104. /* Version 1 Messages */
  105. NVSP_MSG1_TYPE_SEND_NDIS_VER = NVSP_VERSION_MSG_START,
  106. NVSP_MSG1_TYPE_SEND_RECV_BUF,
  107. NVSP_MSG1_TYPE_SEND_RECV_BUF_COMPLETE,
  108. NVSP_MSG1_TYPE_REVOKE_RECV_BUF,
  109. NVSP_MSG1_TYPE_SEND_SEND_BUF,
  110. NVSP_MSG1_TYPE_SEND_SEND_BUF_COMPLETE,
  111. NVSP_MSG1_TYPE_REVOKE_SEND_BUF,
  112. NVSP_MSG1_TYPE_SEND_RNDIS_PKT,
  113. NVSP_MSG1_TYPE_SEND_RNDIS_PKT_COMPLETE,
  114. /*
  115. * This should be set to the number of messages for the version with
  116. * the maximum number of messages.
  117. */
  118. NVSP_NUM_MSG_PER_VERSION = 9,
  119. };
  120. enum {
  121. NVSP_STAT_NONE = 0,
  122. NVSP_STAT_SUCCESS,
  123. NVSP_STAT_FAIL,
  124. NVSP_STAT_PROTOCOL_TOO_NEW,
  125. NVSP_STAT_PROTOCOL_TOO_OLD,
  126. NVSP_STAT_INVALID_RNDIS_PKT,
  127. NVSP_STAT_BUSY,
  128. NVSP_STAT_MAX,
  129. };
  130. struct nvsp_message_header {
  131. u32 msg_type;
  132. };
  133. /* Init Messages */
  134. /*
  135. * This message is used by the VSC to initialize the channel after the channels
  136. * has been opened. This message should never include anything other then
  137. * versioning (i.e. this message will be the same for ever).
  138. */
  139. struct nvsp_message_init {
  140. u32 min_protocol_ver;
  141. u32 max_protocol_ver;
  142. } __packed;
  143. /*
  144. * This message is used by the VSP to complete the initialization of the
  145. * channel. This message should never include anything other then versioning
  146. * (i.e. this message will be the same for ever).
  147. */
  148. struct nvsp_message_init_complete {
  149. u32 negotiated_protocol_ver;
  150. u32 max_mdl_chain_len;
  151. u32 status;
  152. } __packed;
  153. union nvsp_message_init_uber {
  154. struct nvsp_message_init init;
  155. struct nvsp_message_init_complete init_complete;
  156. } __packed;
  157. /* Version 1 Messages */
  158. /*
  159. * This message is used by the VSC to send the NDIS version to the VSP. The VSP
  160. * can use this information when handling OIDs sent by the VSC.
  161. */
  162. struct nvsp_1_message_send_ndis_version {
  163. u32 ndis_major_ver;
  164. u32 ndis_minor_ver;
  165. } __packed;
  166. /*
  167. * This message is used by the VSC to send a receive buffer to the VSP. The VSP
  168. * can then use the receive buffer to send data to the VSC.
  169. */
  170. struct nvsp_1_message_send_receive_buffer {
  171. u32 gpadl_handle;
  172. u16 id;
  173. } __packed;
  174. struct nvsp_1_receive_buffer_section {
  175. u32 offset;
  176. u32 sub_alloc_size;
  177. u32 num_sub_allocs;
  178. u32 end_offset;
  179. } __packed;
  180. /*
  181. * This message is used by the VSP to acknowledge a receive buffer send by the
  182. * VSC. This message must be sent by the VSP before the VSP uses the receive
  183. * buffer.
  184. */
  185. struct nvsp_1_message_send_receive_buffer_complete {
  186. u32 status;
  187. u32 num_sections;
  188. /*
  189. * The receive buffer is split into two parts, a large suballocation
  190. * section and a small suballocation section. These sections are then
  191. * suballocated by a certain size.
  192. */
  193. /*
  194. * For example, the following break up of the receive buffer has 6
  195. * large suballocations and 10 small suballocations.
  196. */
  197. /*
  198. * | Large Section | | Small Section |
  199. * ------------------------------------------------------------
  200. * | | | | | | | | | | | | | | | | | |
  201. * | |
  202. * LargeOffset SmallOffset
  203. */
  204. struct nvsp_1_receive_buffer_section sections[1];
  205. } __packed;
  206. /*
  207. * This message is sent by the VSC to revoke the receive buffer. After the VSP
  208. * completes this transaction, the vsp should never use the receive buffer
  209. * again.
  210. */
  211. struct nvsp_1_message_revoke_receive_buffer {
  212. u16 id;
  213. };
  214. /*
  215. * This message is used by the VSC to send a send buffer to the VSP. The VSC
  216. * can then use the send buffer to send data to the VSP.
  217. */
  218. struct nvsp_1_message_send_send_buffer {
  219. u32 gpadl_handle;
  220. u16 id;
  221. } __packed;
  222. /*
  223. * This message is used by the VSP to acknowledge a send buffer sent by the
  224. * VSC. This message must be sent by the VSP before the VSP uses the sent
  225. * buffer.
  226. */
  227. struct nvsp_1_message_send_send_buffer_complete {
  228. u32 status;
  229. /*
  230. * The VSC gets to choose the size of the send buffer and the VSP gets
  231. * to choose the sections size of the buffer. This was done to enable
  232. * dynamic reconfigurations when the cost of GPA-direct buffers
  233. * decreases.
  234. */
  235. u32 section_size;
  236. } __packed;
  237. /*
  238. * This message is sent by the VSC to revoke the send buffer. After the VSP
  239. * completes this transaction, the vsp should never use the send buffer again.
  240. */
  241. struct nvsp_1_message_revoke_send_buffer {
  242. u16 id;
  243. };
  244. /*
  245. * This message is used by both the VSP and the VSC to send a RNDIS message to
  246. * the opposite channel endpoint.
  247. */
  248. struct nvsp_1_message_send_rndis_packet {
  249. /*
  250. * This field is specified by RNIDS. They assume there's two different
  251. * channels of communication. However, the Network VSP only has one.
  252. * Therefore, the channel travels with the RNDIS packet.
  253. */
  254. u32 channel_type;
  255. /*
  256. * This field is used to send part or all of the data through a send
  257. * buffer. This values specifies an index into the send buffer. If the
  258. * index is 0xFFFFFFFF, then the send buffer is not being used and all
  259. * of the data was sent through other VMBus mechanisms.
  260. */
  261. u32 send_buf_section_index;
  262. u32 send_buf_section_size;
  263. } __packed;
  264. /*
  265. * This message is used by both the VSP and the VSC to complete a RNDIS message
  266. * to the opposite channel endpoint. At this point, the initiator of this
  267. * message cannot use any resources associated with the original RNDIS packet.
  268. */
  269. struct nvsp_1_message_send_rndis_packet_complete {
  270. u32 status;
  271. };
  272. union nvsp_1_message_uber {
  273. struct nvsp_1_message_send_ndis_version send_ndis_ver;
  274. struct nvsp_1_message_send_receive_buffer send_recv_buf;
  275. struct nvsp_1_message_send_receive_buffer_complete
  276. send_recv_buf_complete;
  277. struct nvsp_1_message_revoke_receive_buffer revoke_recv_buf;
  278. struct nvsp_1_message_send_send_buffer send_send_buf;
  279. struct nvsp_1_message_send_send_buffer_complete send_send_buf_complete;
  280. struct nvsp_1_message_revoke_send_buffer revoke_send_buf;
  281. struct nvsp_1_message_send_rndis_packet send_rndis_pkt;
  282. struct nvsp_1_message_send_rndis_packet_complete
  283. send_rndis_pkt_complete;
  284. } __packed;
  285. union nvsp_all_messages {
  286. union nvsp_message_init_uber init_msg;
  287. union nvsp_1_message_uber v1_msg;
  288. } __packed;
  289. /* ALL Messages */
  290. struct nvsp_message {
  291. struct nvsp_message_header hdr;
  292. union nvsp_all_messages msg;
  293. } __packed;
  294. /* #define NVSC_MIN_PROTOCOL_VERSION 1 */
  295. /* #define NVSC_MAX_PROTOCOL_VERSION 1 */
  296. #define NETVSC_RECEIVE_BUFFER_SIZE (1024*1024) /* 1MB */
  297. #define NETVSC_RECEIVE_BUFFER_ID 0xcafe
  298. #define NETVSC_RECEIVE_SG_COUNT 1
  299. /* Preallocated receive packets */
  300. #define NETVSC_RECEIVE_PACKETLIST_COUNT 256
  301. #define NETVSC_PACKET_SIZE 2048
  302. /* Per netvsc channel-specific */
  303. struct netvsc_device {
  304. struct hv_device *dev;
  305. atomic_t num_outstanding_sends;
  306. bool destroy;
  307. /*
  308. * List of free preallocated hv_netvsc_packet to represent receive
  309. * packet
  310. */
  311. struct list_head recv_pkt_list;
  312. spinlock_t recv_pkt_list_lock;
  313. /* Receive buffer allocated by us but manages by NetVSP */
  314. void *recv_buf;
  315. u32 recv_buf_size;
  316. u32 recv_buf_gpadl_handle;
  317. u32 recv_section_cnt;
  318. struct nvsp_1_receive_buffer_section *recv_section;
  319. /* Used for NetVSP initialization protocol */
  320. struct completion channel_init_wait;
  321. struct nvsp_message channel_init_pkt;
  322. struct nvsp_message revoke_packet;
  323. /* unsigned char HwMacAddr[HW_MACADDR_LEN]; */
  324. struct net_device *ndev;
  325. /* Holds rndis device info */
  326. void *extension;
  327. };
  328. /* Status codes */
  329. #ifndef STATUS_SUCCESS
  330. #define STATUS_SUCCESS (0x00000000L)
  331. #endif
  332. #ifndef STATUS_UNSUCCESSFUL
  333. #define STATUS_UNSUCCESSFUL (0xC0000001L)
  334. #endif
  335. #ifndef STATUS_PENDING
  336. #define STATUS_PENDING (0x00000103L)
  337. #endif
  338. #ifndef STATUS_INSUFFICIENT_RESOURCES
  339. #define STATUS_INSUFFICIENT_RESOURCES (0xC000009AL)
  340. #endif
  341. #ifndef STATUS_BUFFER_OVERFLOW
  342. #define STATUS_BUFFER_OVERFLOW (0x80000005L)
  343. #endif
  344. #ifndef STATUS_NOT_SUPPORTED
  345. #define STATUS_NOT_SUPPORTED (0xC00000BBL)
  346. #endif
  347. #define RNDIS_STATUS_SUCCESS (STATUS_SUCCESS)
  348. #define RNDIS_STATUS_PENDING (STATUS_PENDING)
  349. #define RNDIS_STATUS_NOT_RECOGNIZED (0x00010001L)
  350. #define RNDIS_STATUS_NOT_COPIED (0x00010002L)
  351. #define RNDIS_STATUS_NOT_ACCEPTED (0x00010003L)
  352. #define RNDIS_STATUS_CALL_ACTIVE (0x00010007L)
  353. #define RNDIS_STATUS_ONLINE (0x40010003L)
  354. #define RNDIS_STATUS_RESET_START (0x40010004L)
  355. #define RNDIS_STATUS_RESET_END (0x40010005L)
  356. #define RNDIS_STATUS_RING_STATUS (0x40010006L)
  357. #define RNDIS_STATUS_CLOSED (0x40010007L)
  358. #define RNDIS_STATUS_WAN_LINE_UP (0x40010008L)
  359. #define RNDIS_STATUS_WAN_LINE_DOWN (0x40010009L)
  360. #define RNDIS_STATUS_WAN_FRAGMENT (0x4001000AL)
  361. #define RNDIS_STATUS_MEDIA_CONNECT (0x4001000BL)
  362. #define RNDIS_STATUS_MEDIA_DISCONNECT (0x4001000CL)
  363. #define RNDIS_STATUS_HARDWARE_LINE_UP (0x4001000DL)
  364. #define RNDIS_STATUS_HARDWARE_LINE_DOWN (0x4001000EL)
  365. #define RNDIS_STATUS_INTERFACE_UP (0x4001000FL)
  366. #define RNDIS_STATUS_INTERFACE_DOWN (0x40010010L)
  367. #define RNDIS_STATUS_MEDIA_BUSY (0x40010011L)
  368. #define RNDIS_STATUS_MEDIA_SPECIFIC_INDICATION (0x40010012L)
  369. #define RNDIS_STATUS_WW_INDICATION RDIA_SPECIFIC_INDICATION
  370. #define RNDIS_STATUS_LINK_SPEED_CHANGE (0x40010013L)
  371. #define RNDIS_STATUS_NOT_RESETTABLE (0x80010001L)
  372. #define RNDIS_STATUS_SOFT_ERRORS (0x80010003L)
  373. #define RNDIS_STATUS_HARD_ERRORS (0x80010004L)
  374. #define RNDIS_STATUS_BUFFER_OVERFLOW (STATUS_BUFFER_OVERFLOW)
  375. #define RNDIS_STATUS_FAILURE (STATUS_UNSUCCESSFUL)
  376. #define RNDIS_STATUS_RESOURCES (STATUS_INSUFFICIENT_RESOURCES)
  377. #define RNDIS_STATUS_CLOSING (0xC0010002L)
  378. #define RNDIS_STATUS_BAD_VERSION (0xC0010004L)
  379. #define RNDIS_STATUS_BAD_CHARACTERISTICS (0xC0010005L)
  380. #define RNDIS_STATUS_ADAPTER_NOT_FOUND (0xC0010006L)
  381. #define RNDIS_STATUS_OPEN_FAILED (0xC0010007L)
  382. #define RNDIS_STATUS_DEVICE_FAILED (0xC0010008L)
  383. #define RNDIS_STATUS_MULTICAST_FULL (0xC0010009L)
  384. #define RNDIS_STATUS_MULTICAST_EXISTS (0xC001000AL)
  385. #define RNDIS_STATUS_MULTICAST_NOT_FOUND (0xC001000BL)
  386. #define RNDIS_STATUS_REQUEST_ABORTED (0xC001000CL)
  387. #define RNDIS_STATUS_RESET_IN_PROGRESS (0xC001000DL)
  388. #define RNDIS_STATUS_CLOSING_INDICATING (0xC001000EL)
  389. #define RNDIS_STATUS_NOT_SUPPORTED (STATUS_NOT_SUPPORTED)
  390. #define RNDIS_STATUS_INVALID_PACKET (0xC001000FL)
  391. #define RNDIS_STATUS_OPEN_LIST_FULL (0xC0010010L)
  392. #define RNDIS_STATUS_ADAPTER_NOT_READY (0xC0010011L)
  393. #define RNDIS_STATUS_ADAPTER_NOT_OPEN (0xC0010012L)
  394. #define RNDIS_STATUS_NOT_INDICATING (0xC0010013L)
  395. #define RNDIS_STATUS_INVALID_LENGTH (0xC0010014L)
  396. #define RNDIS_STATUS_INVALID_DATA (0xC0010015L)
  397. #define RNDIS_STATUS_BUFFER_TOO_SHORT (0xC0010016L)
  398. #define RNDIS_STATUS_INVALID_OID (0xC0010017L)
  399. #define RNDIS_STATUS_ADAPTER_REMOVED (0xC0010018L)
  400. #define RNDIS_STATUS_UNSUPPORTED_MEDIA (0xC0010019L)
  401. #define RNDIS_STATUS_GROUP_ADDRESS_IN_USE (0xC001001AL)
  402. #define RNDIS_STATUS_FILE_NOT_FOUND (0xC001001BL)
  403. #define RNDIS_STATUS_ERROR_READING_FILE (0xC001001CL)
  404. #define RNDIS_STATUS_ALREADY_MAPPED (0xC001001DL)
  405. #define RNDIS_STATUS_RESOURCE_CONFLICT (0xC001001EL)
  406. #define RNDIS_STATUS_NO_CABLE (0xC001001FL)
  407. #define RNDIS_STATUS_INVALID_SAP (0xC0010020L)
  408. #define RNDIS_STATUS_SAP_IN_USE (0xC0010021L)
  409. #define RNDIS_STATUS_INVALID_ADDRESS (0xC0010022L)
  410. #define RNDIS_STATUS_VC_NOT_ACTIVATED (0xC0010023L)
  411. #define RNDIS_STATUS_DEST_OUT_OF_ORDER (0xC0010024L)
  412. #define RNDIS_STATUS_VC_NOT_AVAILABLE (0xC0010025L)
  413. #define RNDIS_STATUS_CELLRATE_NOT_AVAILABLE (0xC0010026L)
  414. #define RNDIS_STATUS_INCOMPATABLE_QOS (0xC0010027L)
  415. #define RNDIS_STATUS_AAL_PARAMS_UNSUPPORTED (0xC0010028L)
  416. #define RNDIS_STATUS_NO_ROUTE_TO_DESTINATION (0xC0010029L)
  417. #define RNDIS_STATUS_TOKEN_RING_OPEN_ERROR (0xC0011000L)
  418. /* Object Identifiers used by NdisRequest Query/Set Information */
  419. /* General Objects */
  420. #define RNDIS_OID_GEN_SUPPORTED_LIST 0x00010101
  421. #define RNDIS_OID_GEN_HARDWARE_STATUS 0x00010102
  422. #define RNDIS_OID_GEN_MEDIA_SUPPORTED 0x00010103
  423. #define RNDIS_OID_GEN_MEDIA_IN_USE 0x00010104
  424. #define RNDIS_OID_GEN_MAXIMUM_LOOKAHEAD 0x00010105
  425. #define RNDIS_OID_GEN_MAXIMUM_FRAME_SIZE 0x00010106
  426. #define RNDIS_OID_GEN_LINK_SPEED 0x00010107
  427. #define RNDIS_OID_GEN_TRANSMIT_BUFFER_SPACE 0x00010108
  428. #define RNDIS_OID_GEN_RECEIVE_BUFFER_SPACE 0x00010109
  429. #define RNDIS_OID_GEN_TRANSMIT_BLOCK_SIZE 0x0001010A
  430. #define RNDIS_OID_GEN_RECEIVE_BLOCK_SIZE 0x0001010B
  431. #define RNDIS_OID_GEN_VENDOR_ID 0x0001010C
  432. #define RNDIS_OID_GEN_VENDOR_DESCRIPTION 0x0001010D
  433. #define RNDIS_OID_GEN_CURRENT_PACKET_FILTER 0x0001010E
  434. #define RNDIS_OID_GEN_CURRENT_LOOKAHEAD 0x0001010F
  435. #define RNDIS_OID_GEN_DRIVER_VERSION 0x00010110
  436. #define RNDIS_OID_GEN_MAXIMUM_TOTAL_SIZE 0x00010111
  437. #define RNDIS_OID_GEN_PROTOCOL_OPTIONS 0x00010112
  438. #define RNDIS_OID_GEN_MAC_OPTIONS 0x00010113
  439. #define RNDIS_OID_GEN_MEDIA_CONNECT_STATUS 0x00010114
  440. #define RNDIS_OID_GEN_MAXIMUM_SEND_PACKETS 0x00010115
  441. #define RNDIS_OID_GEN_VENDOR_DRIVER_VERSION 0x00010116
  442. #define RNDIS_OID_GEN_NETWORK_LAYER_ADDRESSES 0x00010118
  443. #define RNDIS_OID_GEN_TRANSPORT_HEADER_OFFSET 0x00010119
  444. #define RNDIS_OID_GEN_MACHINE_NAME 0x0001021A
  445. #define RNDIS_OID_GEN_RNDIS_CONFIG_PARAMETER 0x0001021B
  446. #define RNDIS_OID_GEN_XMIT_OK 0x00020101
  447. #define RNDIS_OID_GEN_RCV_OK 0x00020102
  448. #define RNDIS_OID_GEN_XMIT_ERROR 0x00020103
  449. #define RNDIS_OID_GEN_RCV_ERROR 0x00020104
  450. #define RNDIS_OID_GEN_RCV_NO_BUFFER 0x00020105
  451. #define RNDIS_OID_GEN_DIRECTED_BYTES_XMIT 0x00020201
  452. #define RNDIS_OID_GEN_DIRECTED_FRAMES_XMIT 0x00020202
  453. #define RNDIS_OID_GEN_MULTICAST_BYTES_XMIT 0x00020203
  454. #define RNDIS_OID_GEN_MULTICAST_FRAMES_XMIT 0x00020204
  455. #define RNDIS_OID_GEN_BROADCAST_BYTES_XMIT 0x00020205
  456. #define RNDIS_OID_GEN_BROADCAST_FRAMES_XMIT 0x00020206
  457. #define RNDIS_OID_GEN_DIRECTED_BYTES_RCV 0x00020207
  458. #define RNDIS_OID_GEN_DIRECTED_FRAMES_RCV 0x00020208
  459. #define RNDIS_OID_GEN_MULTICAST_BYTES_RCV 0x00020209
  460. #define RNDIS_OID_GEN_MULTICAST_FRAMES_RCV 0x0002020A
  461. #define RNDIS_OID_GEN_BROADCAST_BYTES_RCV 0x0002020B
  462. #define RNDIS_OID_GEN_BROADCAST_FRAMES_RCV 0x0002020C
  463. #define RNDIS_OID_GEN_RCV_CRC_ERROR 0x0002020D
  464. #define RNDIS_OID_GEN_TRANSMIT_QUEUE_LENGTH 0x0002020E
  465. #define RNDIS_OID_GEN_GET_TIME_CAPS 0x0002020F
  466. #define RNDIS_OID_GEN_GET_NETCARD_TIME 0x00020210
  467. /* These are connection-oriented general OIDs. */
  468. /* These replace the above OIDs for connection-oriented media. */
  469. #define RNDIS_OID_GEN_CO_SUPPORTED_LIST 0x00010101
  470. #define RNDIS_OID_GEN_CO_HARDWARE_STATUS 0x00010102
  471. #define RNDIS_OID_GEN_CO_MEDIA_SUPPORTED 0x00010103
  472. #define RNDIS_OID_GEN_CO_MEDIA_IN_USE 0x00010104
  473. #define RNDIS_OID_GEN_CO_LINK_SPEED 0x00010105
  474. #define RNDIS_OID_GEN_CO_VENDOR_ID 0x00010106
  475. #define RNDIS_OID_GEN_CO_VENDOR_DESCRIPTION 0x00010107
  476. #define RNDIS_OID_GEN_CO_DRIVER_VERSION 0x00010108
  477. #define RNDIS_OID_GEN_CO_PROTOCOL_OPTIONS 0x00010109
  478. #define RNDIS_OID_GEN_CO_MAC_OPTIONS 0x0001010A
  479. #define RNDIS_OID_GEN_CO_MEDIA_CONNECT_STATUS 0x0001010B
  480. #define RNDIS_OID_GEN_CO_VENDOR_DRIVER_VERSION 0x0001010C
  481. #define RNDIS_OID_GEN_CO_MINIMUM_LINK_SPEED 0x0001010D
  482. #define RNDIS_OID_GEN_CO_GET_TIME_CAPS 0x00010201
  483. #define RNDIS_OID_GEN_CO_GET_NETCARD_TIME 0x00010202
  484. /* These are connection-oriented statistics OIDs. */
  485. #define RNDIS_OID_GEN_CO_XMIT_PDUS_OK 0x00020101
  486. #define RNDIS_OID_GEN_CO_RCV_PDUS_OK 0x00020102
  487. #define RNDIS_OID_GEN_CO_XMIT_PDUS_ERROR 0x00020103
  488. #define RNDIS_OID_GEN_CO_RCV_PDUS_ERROR 0x00020104
  489. #define RNDIS_OID_GEN_CO_RCV_PDUS_NO_BUFFER 0x00020105
  490. #define RNDIS_OID_GEN_CO_RCV_CRC_ERROR 0x00020201
  491. #define RNDIS_OID_GEN_CO_TRANSMIT_QUEUE_LENGTH 0x00020202
  492. #define RNDIS_OID_GEN_CO_BYTES_XMIT 0x00020203
  493. #define RNDIS_OID_GEN_CO_BYTES_RCV 0x00020204
  494. #define RNDIS_OID_GEN_CO_BYTES_XMIT_OUTSTANDING 0x00020205
  495. #define RNDIS_OID_GEN_CO_NETCARD_LOAD 0x00020206
  496. /* These are objects for Connection-oriented media call-managers. */
  497. #define RNDIS_OID_CO_ADD_PVC 0xFF000001
  498. #define RNDIS_OID_CO_DELETE_PVC 0xFF000002
  499. #define RNDIS_OID_CO_GET_CALL_INFORMATION 0xFF000003
  500. #define RNDIS_OID_CO_ADD_ADDRESS 0xFF000004
  501. #define RNDIS_OID_CO_DELETE_ADDRESS 0xFF000005
  502. #define RNDIS_OID_CO_GET_ADDRESSES 0xFF000006
  503. #define RNDIS_OID_CO_ADDRESS_CHANGE 0xFF000007
  504. #define RNDIS_OID_CO_SIGNALING_ENABLED 0xFF000008
  505. #define RNDIS_OID_CO_SIGNALING_DISABLED 0xFF000009
  506. /* 802.3 Objects (Ethernet) */
  507. #define RNDIS_OID_802_3_PERMANENT_ADDRESS 0x01010101
  508. #define RNDIS_OID_802_3_CURRENT_ADDRESS 0x01010102
  509. #define RNDIS_OID_802_3_MULTICAST_LIST 0x01010103
  510. #define RNDIS_OID_802_3_MAXIMUM_LIST_SIZE 0x01010104
  511. #define RNDIS_OID_802_3_MAC_OPTIONS 0x01010105
  512. #define NDIS_802_3_MAC_OPTION_PRIORITY 0x00000001
  513. #define RNDIS_OID_802_3_RCV_ERROR_ALIGNMENT 0x01020101
  514. #define RNDIS_OID_802_3_XMIT_ONE_COLLISION 0x01020102
  515. #define RNDIS_OID_802_3_XMIT_MORE_COLLISIONS 0x01020103
  516. #define RNDIS_OID_802_3_XMIT_DEFERRED 0x01020201
  517. #define RNDIS_OID_802_3_XMIT_MAX_COLLISIONS 0x01020202
  518. #define RNDIS_OID_802_3_RCV_OVERRUN 0x01020203
  519. #define RNDIS_OID_802_3_XMIT_UNDERRUN 0x01020204
  520. #define RNDIS_OID_802_3_XMIT_HEARTBEAT_FAILURE 0x01020205
  521. #define RNDIS_OID_802_3_XMIT_TIMES_CRS_LOST 0x01020206
  522. #define RNDIS_OID_802_3_XMIT_LATE_COLLISIONS 0x01020207
  523. /* Remote NDIS message types */
  524. #define REMOTE_NDIS_PACKET_MSG 0x00000001
  525. #define REMOTE_NDIS_INITIALIZE_MSG 0x00000002
  526. #define REMOTE_NDIS_HALT_MSG 0x00000003
  527. #define REMOTE_NDIS_QUERY_MSG 0x00000004
  528. #define REMOTE_NDIS_SET_MSG 0x00000005
  529. #define REMOTE_NDIS_RESET_MSG 0x00000006
  530. #define REMOTE_NDIS_INDICATE_STATUS_MSG 0x00000007
  531. #define REMOTE_NDIS_KEEPALIVE_MSG 0x00000008
  532. #define REMOTE_CONDIS_MP_CREATE_VC_MSG 0x00008001
  533. #define REMOTE_CONDIS_MP_DELETE_VC_MSG 0x00008002
  534. #define REMOTE_CONDIS_MP_ACTIVATE_VC_MSG 0x00008005
  535. #define REMOTE_CONDIS_MP_DEACTIVATE_VC_MSG 0x00008006
  536. #define REMOTE_CONDIS_INDICATE_STATUS_MSG 0x00008007
  537. /* Remote NDIS message completion types */
  538. #define REMOTE_NDIS_INITIALIZE_CMPLT 0x80000002
  539. #define REMOTE_NDIS_QUERY_CMPLT 0x80000004
  540. #define REMOTE_NDIS_SET_CMPLT 0x80000005
  541. #define REMOTE_NDIS_RESET_CMPLT 0x80000006
  542. #define REMOTE_NDIS_KEEPALIVE_CMPLT 0x80000008
  543. #define REMOTE_CONDIS_MP_CREATE_VC_CMPLT 0x80008001
  544. #define REMOTE_CONDIS_MP_DELETE_VC_CMPLT 0x80008002
  545. #define REMOTE_CONDIS_MP_ACTIVATE_VC_CMPLT 0x80008005
  546. #define REMOTE_CONDIS_MP_DEACTIVATE_VC_CMPLT 0x80008006
  547. /*
  548. * Reserved message type for private communication between lower-layer host
  549. * driver and remote device, if necessary.
  550. */
  551. #define REMOTE_NDIS_BUS_MSG 0xff000001
  552. /* Defines for DeviceFlags in struct rndis_initialize_complete */
  553. #define RNDIS_DF_CONNECTIONLESS 0x00000001
  554. #define RNDIS_DF_CONNECTION_ORIENTED 0x00000002
  555. #define RNDIS_DF_RAW_DATA 0x00000004
  556. /* Remote NDIS medium types. */
  557. #define RNDIS_MEDIUM_802_3 0x00000000
  558. #define RNDIS_MEDIUM_802_5 0x00000001
  559. #define RNDIS_MEDIUM_FDDI 0x00000002
  560. #define RNDIS_MEDIUM_WAN 0x00000003
  561. #define RNDIS_MEDIUM_LOCAL_TALK 0x00000004
  562. #define RNDIS_MEDIUM_ARCNET_RAW 0x00000006
  563. #define RNDIS_MEDIUM_ARCNET_878_2 0x00000007
  564. #define RNDIS_MEDIUM_ATM 0x00000008
  565. #define RNDIS_MEDIUM_WIRELESS_WAN 0x00000009
  566. #define RNDIS_MEDIUM_IRDA 0x0000000a
  567. #define RNDIS_MEDIUM_CO_WAN 0x0000000b
  568. /* Not a real medium, defined as an upper-bound */
  569. #define RNDIS_MEDIUM_MAX 0x0000000d
  570. /* Remote NDIS medium connection states. */
  571. #define RNDIS_MEDIA_STATE_CONNECTED 0x00000000
  572. #define RNDIS_MEDIA_STATE_DISCONNECTED 0x00000001
  573. /* Remote NDIS version numbers */
  574. #define RNDIS_MAJOR_VERSION 0x00000001
  575. #define RNDIS_MINOR_VERSION 0x00000000
  576. /* NdisInitialize message */
  577. struct rndis_initialize_request {
  578. u32 req_id;
  579. u32 major_ver;
  580. u32 minor_ver;
  581. u32 max_xfer_size;
  582. };
  583. /* Response to NdisInitialize */
  584. struct rndis_initialize_complete {
  585. u32 req_id;
  586. u32 status;
  587. u32 major_ver;
  588. u32 minor_ver;
  589. u32 dev_flags;
  590. u32 medium;
  591. u32 max_pkt_per_msg;
  592. u32 max_xfer_size;
  593. u32 pkt_alignment_factor;
  594. u32 af_list_offset;
  595. u32 af_list_size;
  596. };
  597. /* Call manager devices only: Information about an address family */
  598. /* supported by the device is appended to the response to NdisInitialize. */
  599. struct rndis_co_address_family {
  600. u32 address_family;
  601. u32 major_ver;
  602. u32 minor_ver;
  603. };
  604. /* NdisHalt message */
  605. struct rndis_halt_request {
  606. u32 req_id;
  607. };
  608. /* NdisQueryRequest message */
  609. struct rndis_query_request {
  610. u32 req_id;
  611. u32 oid;
  612. u32 info_buflen;
  613. u32 info_buf_offset;
  614. u32 dev_vc_handle;
  615. };
  616. /* Response to NdisQueryRequest */
  617. struct rndis_query_complete {
  618. u32 req_id;
  619. u32 status;
  620. u32 info_buflen;
  621. u32 info_buf_offset;
  622. };
  623. /* NdisSetRequest message */
  624. struct rndis_set_request {
  625. u32 req_id;
  626. u32 oid;
  627. u32 info_buflen;
  628. u32 info_buf_offset;
  629. u32 dev_vc_handle;
  630. };
  631. /* Response to NdisSetRequest */
  632. struct rndis_set_complete {
  633. u32 req_id;
  634. u32 status;
  635. };
  636. /* NdisReset message */
  637. struct rndis_reset_request {
  638. u32 reserved;
  639. };
  640. /* Response to NdisReset */
  641. struct rndis_reset_complete {
  642. u32 status;
  643. u32 addressing_reset;
  644. };
  645. /* NdisMIndicateStatus message */
  646. struct rndis_indicate_status {
  647. u32 status;
  648. u32 status_buflen;
  649. u32 status_buf_offset;
  650. };
  651. /* Diagnostic information passed as the status buffer in */
  652. /* struct rndis_indicate_status messages signifying error conditions. */
  653. struct rndis_diagnostic_info {
  654. u32 diag_status;
  655. u32 error_offset;
  656. };
  657. /* NdisKeepAlive message */
  658. struct rndis_keepalive_request {
  659. u32 req_id;
  660. };
  661. /* Response to NdisKeepAlive */
  662. struct rndis_keepalive_complete {
  663. u32 req_id;
  664. u32 status;
  665. };
  666. /*
  667. * Data message. All Offset fields contain byte offsets from the beginning of
  668. * struct rndis_packet. All Length fields are in bytes. VcHandle is set
  669. * to 0 for connectionless data, otherwise it contains the VC handle.
  670. */
  671. struct rndis_packet {
  672. u32 data_offset;
  673. u32 data_len;
  674. u32 oob_data_offset;
  675. u32 oob_data_len;
  676. u32 num_oob_data_elements;
  677. u32 per_pkt_info_offset;
  678. u32 per_pkt_info_len;
  679. u32 vc_handle;
  680. u32 reserved;
  681. };
  682. /* Optional Out of Band data associated with a Data message. */
  683. struct rndis_oobd {
  684. u32 size;
  685. u32 type;
  686. u32 class_info_offset;
  687. };
  688. /* Packet extension field contents associated with a Data message. */
  689. struct rndis_per_packet_info {
  690. u32 size;
  691. u32 type;
  692. u32 per_pkt_info_offset;
  693. };
  694. /* Format of Information buffer passed in a SetRequest for the OID */
  695. /* OID_GEN_RNDIS_CONFIG_PARAMETER. */
  696. struct rndis_config_parameter_info {
  697. u32 parameter_name_offset;
  698. u32 parameter_name_length;
  699. u32 parameter_type;
  700. u32 parameter_value_offset;
  701. u32 parameter_value_length;
  702. };
  703. /* Values for ParameterType in struct rndis_config_parameter_info */
  704. #define RNDIS_CONFIG_PARAM_TYPE_INTEGER 0
  705. #define RNDIS_CONFIG_PARAM_TYPE_STRING 2
  706. /* CONDIS Miniport messages for connection oriented devices */
  707. /* that do not implement a call manager. */
  708. /* CoNdisMiniportCreateVc message */
  709. struct rcondis_mp_create_vc {
  710. u32 req_id;
  711. u32 ndis_vc_handle;
  712. };
  713. /* Response to CoNdisMiniportCreateVc */
  714. struct rcondis_mp_create_vc_complete {
  715. u32 req_id;
  716. u32 dev_vc_handle;
  717. u32 status;
  718. };
  719. /* CoNdisMiniportDeleteVc message */
  720. struct rcondis_mp_delete_vc {
  721. u32 req_id;
  722. u32 dev_vc_handle;
  723. };
  724. /* Response to CoNdisMiniportDeleteVc */
  725. struct rcondis_mp_delete_vc_complete {
  726. u32 req_id;
  727. u32 status;
  728. };
  729. /* CoNdisMiniportQueryRequest message */
  730. struct rcondis_mp_query_request {
  731. u32 req_id;
  732. u32 request_type;
  733. u32 oid;
  734. u32 dev_vc_handle;
  735. u32 info_buflen;
  736. u32 info_buf_offset;
  737. };
  738. /* CoNdisMiniportSetRequest message */
  739. struct rcondis_mp_set_request {
  740. u32 req_id;
  741. u32 request_type;
  742. u32 oid;
  743. u32 dev_vc_handle;
  744. u32 info_buflen;
  745. u32 info_buf_offset;
  746. };
  747. /* CoNdisIndicateStatus message */
  748. struct rcondis_indicate_status {
  749. u32 ndis_vc_handle;
  750. u32 status;
  751. u32 status_buflen;
  752. u32 status_buf_offset;
  753. };
  754. /* CONDIS Call/VC parameters */
  755. struct rcondis_specific_parameters {
  756. u32 parameter_type;
  757. u32 parameter_length;
  758. u32 parameter_lffset;
  759. };
  760. struct rcondis_media_parameters {
  761. u32 flags;
  762. u32 reserved1;
  763. u32 reserved2;
  764. struct rcondis_specific_parameters media_specific;
  765. };
  766. struct rndis_flowspec {
  767. u32 token_rate;
  768. u32 token_bucket_size;
  769. u32 peak_bandwidth;
  770. u32 latency;
  771. u32 delay_variation;
  772. u32 service_type;
  773. u32 max_sdu_size;
  774. u32 minimum_policed_size;
  775. };
  776. struct rcondis_call_manager_parameters {
  777. struct rndis_flowspec transmit;
  778. struct rndis_flowspec receive;
  779. struct rcondis_specific_parameters call_mgr_specific;
  780. };
  781. /* CoNdisMiniportActivateVc message */
  782. struct rcondis_mp_activate_vc_request {
  783. u32 req_id;
  784. u32 flags;
  785. u32 dev_vc_handle;
  786. u32 media_params_offset;
  787. u32 media_params_length;
  788. u32 call_mgr_params_offset;
  789. u32 call_mgr_params_length;
  790. };
  791. /* Response to CoNdisMiniportActivateVc */
  792. struct rcondis_mp_activate_vc_complete {
  793. u32 req_id;
  794. u32 status;
  795. };
  796. /* CoNdisMiniportDeactivateVc message */
  797. struct rcondis_mp_deactivate_vc_request {
  798. u32 req_id;
  799. u32 flags;
  800. u32 dev_vc_handle;
  801. };
  802. /* Response to CoNdisMiniportDeactivateVc */
  803. struct rcondis_mp_deactivate_vc_complete {
  804. u32 req_id;
  805. u32 status;
  806. };
  807. /* union with all of the RNDIS messages */
  808. union rndis_message_container {
  809. struct rndis_packet pkt;
  810. struct rndis_initialize_request init_req;
  811. struct rndis_halt_request halt_req;
  812. struct rndis_query_request query_req;
  813. struct rndis_set_request set_req;
  814. struct rndis_reset_request reset_req;
  815. struct rndis_keepalive_request keep_alive_req;
  816. struct rndis_indicate_status indicate_status;
  817. struct rndis_initialize_complete init_complete;
  818. struct rndis_query_complete query_complete;
  819. struct rndis_set_complete set_complete;
  820. struct rndis_reset_complete reset_complete;
  821. struct rndis_keepalive_complete keep_alive_complete;
  822. struct rcondis_mp_create_vc co_miniport_create_vc;
  823. struct rcondis_mp_delete_vc co_miniport_delete_vc;
  824. struct rcondis_indicate_status co_indicate_status;
  825. struct rcondis_mp_activate_vc_request co_miniport_activate_vc;
  826. struct rcondis_mp_deactivate_vc_request co_miniport_deactivate_vc;
  827. struct rcondis_mp_create_vc_complete co_miniport_create_vc_complete;
  828. struct rcondis_mp_delete_vc_complete co_miniport_delete_vc_complete;
  829. struct rcondis_mp_activate_vc_complete co_miniport_activate_vc_complete;
  830. struct rcondis_mp_deactivate_vc_complete
  831. co_miniport_deactivate_vc_complete;
  832. };
  833. /* Remote NDIS message format */
  834. struct rndis_message {
  835. u32 ndis_msg_type;
  836. /* Total length of this message, from the beginning */
  837. /* of the sruct rndis_message, in bytes. */
  838. u32 msg_len;
  839. /* Actual message */
  840. union rndis_message_container msg;
  841. };
  842. struct rndis_filter_packet {
  843. void *completion_ctx;
  844. void (*completion)(void *context);
  845. struct rndis_message msg;
  846. };
  847. /* Handy macros */
  848. /* get the size of an RNDIS message. Pass in the message type, */
  849. /* struct rndis_set_request, struct rndis_packet for example */
  850. #define RNDIS_MESSAGE_SIZE(msg) \
  851. (sizeof(msg) + (sizeof(struct rndis_message) - \
  852. sizeof(union rndis_message_container)))
  853. /* get pointer to info buffer with message pointer */
  854. #define MESSAGE_TO_INFO_BUFFER(msg) \
  855. (((unsigned char *)(msg)) + msg->info_buf_offset)
  856. /* get pointer to status buffer with message pointer */
  857. #define MESSAGE_TO_STATUS_BUFFER(msg) \
  858. (((unsigned char *)(msg)) + msg->status_buf_offset)
  859. /* get pointer to OOBD buffer with message pointer */
  860. #define MESSAGE_TO_OOBD_BUFFER(msg) \
  861. (((unsigned char *)(msg)) + msg->oob_data_offset)
  862. /* get pointer to data buffer with message pointer */
  863. #define MESSAGE_TO_DATA_BUFFER(msg) \
  864. (((unsigned char *)(msg)) + msg->per_pkt_info_offset)
  865. /* get pointer to contained message from NDIS_MESSAGE pointer */
  866. #define RNDIS_MESSAGE_PTR_TO_MESSAGE_PTR(rndis_msg) \
  867. ((void *) &rndis_msg->msg)
  868. /* get pointer to contained message from NDIS_MESSAGE pointer */
  869. #define RNDIS_MESSAGE_RAW_PTR_TO_MESSAGE_PTR(rndis_msg) \
  870. ((void *) rndis_msg)
  871. #define __struct_bcount(x)
  872. #define RNDIS_HEADER_SIZE (sizeof(struct rndis_message) - \
  873. sizeof(union rndis_message_container))
  874. #define NDIS_PACKET_TYPE_DIRECTED 0x00000001
  875. #define NDIS_PACKET_TYPE_MULTICAST 0x00000002
  876. #define NDIS_PACKET_TYPE_ALL_MULTICAST 0x00000004
  877. #define NDIS_PACKET_TYPE_BROADCAST 0x00000008
  878. #define NDIS_PACKET_TYPE_SOURCE_ROUTING 0x00000010
  879. #define NDIS_PACKET_TYPE_PROMISCUOUS 0x00000020
  880. #define NDIS_PACKET_TYPE_SMT 0x00000040
  881. #define NDIS_PACKET_TYPE_ALL_LOCAL 0x00000080
  882. #define NDIS_PACKET_TYPE_GROUP 0x00000100
  883. #define NDIS_PACKET_TYPE_ALL_FUNCTIONAL 0x00000200
  884. #define NDIS_PACKET_TYPE_FUNCTIONAL 0x00000400
  885. #define NDIS_PACKET_TYPE_MAC_FRAME 0x00000800
  886. #endif /* _HYPERV_NET_H */