hyperv_net.h 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221
  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, see <http://www.gnu.org/licenses/>.
  16. *
  17. * Authors:
  18. * Haiyang Zhang <haiyangz@microsoft.com>
  19. * Hank Janssen <hjanssen@microsoft.com>
  20. * K. Y. Srinivasan <kys@microsoft.com>
  21. *
  22. */
  23. #ifndef _HYPERV_NET_H
  24. #define _HYPERV_NET_H
  25. #include <linux/list.h>
  26. #include <linux/hyperv.h>
  27. #include <linux/rndis.h>
  28. /* RSS related */
  29. #define OID_GEN_RECEIVE_SCALE_CAPABILITIES 0x00010203 /* query only */
  30. #define OID_GEN_RECEIVE_SCALE_PARAMETERS 0x00010204 /* query and set */
  31. #define NDIS_OBJECT_TYPE_RSS_CAPABILITIES 0x88
  32. #define NDIS_OBJECT_TYPE_RSS_PARAMETERS 0x89
  33. #define NDIS_RECEIVE_SCALE_CAPABILITIES_REVISION_2 2
  34. #define NDIS_RECEIVE_SCALE_PARAMETERS_REVISION_2 2
  35. struct ndis_obj_header {
  36. u8 type;
  37. u8 rev;
  38. u16 size;
  39. } __packed;
  40. /* ndis_recv_scale_cap/cap_flag */
  41. #define NDIS_RSS_CAPS_MESSAGE_SIGNALED_INTERRUPTS 0x01000000
  42. #define NDIS_RSS_CAPS_CLASSIFICATION_AT_ISR 0x02000000
  43. #define NDIS_RSS_CAPS_CLASSIFICATION_AT_DPC 0x04000000
  44. #define NDIS_RSS_CAPS_USING_MSI_X 0x08000000
  45. #define NDIS_RSS_CAPS_RSS_AVAILABLE_ON_PORTS 0x10000000
  46. #define NDIS_RSS_CAPS_SUPPORTS_MSI_X 0x20000000
  47. #define NDIS_RSS_CAPS_HASH_TYPE_TCP_IPV4 0x00000100
  48. #define NDIS_RSS_CAPS_HASH_TYPE_TCP_IPV6 0x00000200
  49. #define NDIS_RSS_CAPS_HASH_TYPE_TCP_IPV6_EX 0x00000400
  50. struct ndis_recv_scale_cap { /* NDIS_RECEIVE_SCALE_CAPABILITIES */
  51. struct ndis_obj_header hdr;
  52. u32 cap_flag;
  53. u32 num_int_msg;
  54. u32 num_recv_que;
  55. u16 num_indirect_tabent;
  56. } __packed;
  57. /* ndis_recv_scale_param flags */
  58. #define NDIS_RSS_PARAM_FLAG_BASE_CPU_UNCHANGED 0x0001
  59. #define NDIS_RSS_PARAM_FLAG_HASH_INFO_UNCHANGED 0x0002
  60. #define NDIS_RSS_PARAM_FLAG_ITABLE_UNCHANGED 0x0004
  61. #define NDIS_RSS_PARAM_FLAG_HASH_KEY_UNCHANGED 0x0008
  62. #define NDIS_RSS_PARAM_FLAG_DISABLE_RSS 0x0010
  63. /* Hash info bits */
  64. #define NDIS_HASH_FUNC_TOEPLITZ 0x00000001
  65. #define NDIS_HASH_IPV4 0x00000100
  66. #define NDIS_HASH_TCP_IPV4 0x00000200
  67. #define NDIS_HASH_IPV6 0x00000400
  68. #define NDIS_HASH_IPV6_EX 0x00000800
  69. #define NDIS_HASH_TCP_IPV6 0x00001000
  70. #define NDIS_HASH_TCP_IPV6_EX 0x00002000
  71. #define NDIS_RSS_INDIRECTION_TABLE_MAX_SIZE_REVISION_2 (128 * 4)
  72. #define NDIS_RSS_HASH_SECRET_KEY_MAX_SIZE_REVISION_2 40
  73. #define ITAB_NUM 128
  74. #define HASH_KEYLEN NDIS_RSS_HASH_SECRET_KEY_MAX_SIZE_REVISION_2
  75. extern u8 netvsc_hash_key[];
  76. struct ndis_recv_scale_param { /* NDIS_RECEIVE_SCALE_PARAMETERS */
  77. struct ndis_obj_header hdr;
  78. /* Qualifies the rest of the information */
  79. u16 flag;
  80. /* The base CPU number to do receive processing. not used */
  81. u16 base_cpu_number;
  82. /* This describes the hash function and type being enabled */
  83. u32 hashinfo;
  84. /* The size of indirection table array */
  85. u16 indirect_tabsize;
  86. /* The offset of the indirection table from the beginning of this
  87. * structure
  88. */
  89. u32 indirect_taboffset;
  90. /* The size of the hash secret key */
  91. u16 hashkey_size;
  92. /* The offset of the secret key from the beginning of this structure */
  93. u32 kashkey_offset;
  94. u32 processor_masks_offset;
  95. u32 num_processor_masks;
  96. u32 processor_masks_entry_size;
  97. };
  98. /* Fwd declaration */
  99. struct ndis_tcp_ip_checksum_info;
  100. /*
  101. * Represent netvsc packet which contains 1 RNDIS and 1 ethernet frame
  102. * within the RNDIS
  103. */
  104. struct hv_netvsc_packet {
  105. /* Bookkeeping stuff */
  106. u32 status;
  107. bool is_data_pkt;
  108. bool xmit_more; /* from skb */
  109. bool cp_partial; /* partial copy into send buffer */
  110. u16 vlan_tci;
  111. u16 q_idx;
  112. struct vmbus_channel *channel;
  113. u64 send_completion_tid;
  114. void *send_completion_ctx;
  115. void (*send_completion)(void *context);
  116. u32 send_buf_index;
  117. /* This points to the memory after page_buf */
  118. struct rndis_message *rndis_msg;
  119. u32 rmsg_size; /* RNDIS header and PPI size */
  120. u32 rmsg_pgcnt; /* page count of RNDIS header and PPI */
  121. u32 total_data_buflen;
  122. /* Points to the send/receive buffer where the ethernet frame is */
  123. void *data;
  124. u32 page_buf_cnt;
  125. struct hv_page_buffer *page_buf;
  126. };
  127. struct netvsc_device_info {
  128. unsigned char mac_adr[ETH_ALEN];
  129. bool link_state; /* 0 - link up, 1 - link down */
  130. int ring_size;
  131. };
  132. enum rndis_device_state {
  133. RNDIS_DEV_UNINITIALIZED = 0,
  134. RNDIS_DEV_INITIALIZING,
  135. RNDIS_DEV_INITIALIZED,
  136. RNDIS_DEV_DATAINITIALIZED,
  137. };
  138. struct rndis_device {
  139. struct netvsc_device *net_dev;
  140. enum rndis_device_state state;
  141. bool link_state;
  142. bool link_change;
  143. atomic_t new_req_id;
  144. spinlock_t request_lock;
  145. struct list_head req_list;
  146. unsigned char hw_mac_adr[ETH_ALEN];
  147. };
  148. /* Interface */
  149. int netvsc_device_add(struct hv_device *device, void *additional_info);
  150. int netvsc_device_remove(struct hv_device *device);
  151. int netvsc_send(struct hv_device *device,
  152. struct hv_netvsc_packet *packet);
  153. void netvsc_linkstatus_callback(struct hv_device *device_obj,
  154. struct rndis_message *resp);
  155. void netvsc_xmit_completion(void *context);
  156. int netvsc_recv_callback(struct hv_device *device_obj,
  157. struct hv_netvsc_packet *packet,
  158. struct ndis_tcp_ip_checksum_info *csum_info);
  159. void netvsc_channel_cb(void *context);
  160. int rndis_filter_open(struct hv_device *dev);
  161. int rndis_filter_close(struct hv_device *dev);
  162. int rndis_filter_device_add(struct hv_device *dev,
  163. void *additional_info);
  164. void rndis_filter_device_remove(struct hv_device *dev);
  165. int rndis_filter_receive(struct hv_device *dev,
  166. struct hv_netvsc_packet *pkt);
  167. int rndis_filter_set_packet_filter(struct rndis_device *dev, u32 new_filter);
  168. int rndis_filter_set_device_mac(struct hv_device *hdev, char *mac);
  169. #define NVSP_INVALID_PROTOCOL_VERSION ((u32)0xFFFFFFFF)
  170. #define NVSP_PROTOCOL_VERSION_1 2
  171. #define NVSP_PROTOCOL_VERSION_2 0x30002
  172. #define NVSP_PROTOCOL_VERSION_4 0x40000
  173. #define NVSP_PROTOCOL_VERSION_5 0x50000
  174. enum {
  175. NVSP_MSG_TYPE_NONE = 0,
  176. /* Init Messages */
  177. NVSP_MSG_TYPE_INIT = 1,
  178. NVSP_MSG_TYPE_INIT_COMPLETE = 2,
  179. NVSP_VERSION_MSG_START = 100,
  180. /* Version 1 Messages */
  181. NVSP_MSG1_TYPE_SEND_NDIS_VER = NVSP_VERSION_MSG_START,
  182. NVSP_MSG1_TYPE_SEND_RECV_BUF,
  183. NVSP_MSG1_TYPE_SEND_RECV_BUF_COMPLETE,
  184. NVSP_MSG1_TYPE_REVOKE_RECV_BUF,
  185. NVSP_MSG1_TYPE_SEND_SEND_BUF,
  186. NVSP_MSG1_TYPE_SEND_SEND_BUF_COMPLETE,
  187. NVSP_MSG1_TYPE_REVOKE_SEND_BUF,
  188. NVSP_MSG1_TYPE_SEND_RNDIS_PKT,
  189. NVSP_MSG1_TYPE_SEND_RNDIS_PKT_COMPLETE,
  190. /* Version 2 messages */
  191. NVSP_MSG2_TYPE_SEND_CHIMNEY_DELEGATED_BUF,
  192. NVSP_MSG2_TYPE_SEND_CHIMNEY_DELEGATED_BUF_COMP,
  193. NVSP_MSG2_TYPE_REVOKE_CHIMNEY_DELEGATED_BUF,
  194. NVSP_MSG2_TYPE_RESUME_CHIMNEY_RX_INDICATION,
  195. NVSP_MSG2_TYPE_TERMINATE_CHIMNEY,
  196. NVSP_MSG2_TYPE_TERMINATE_CHIMNEY_COMP,
  197. NVSP_MSG2_TYPE_INDICATE_CHIMNEY_EVENT,
  198. NVSP_MSG2_TYPE_SEND_CHIMNEY_PKT,
  199. NVSP_MSG2_TYPE_SEND_CHIMNEY_PKT_COMP,
  200. NVSP_MSG2_TYPE_POST_CHIMNEY_RECV_REQ,
  201. NVSP_MSG2_TYPE_POST_CHIMNEY_RECV_REQ_COMP,
  202. NVSP_MSG2_TYPE_ALLOC_RXBUF,
  203. NVSP_MSG2_TYPE_ALLOC_RXBUF_COMP,
  204. NVSP_MSG2_TYPE_FREE_RXBUF,
  205. NVSP_MSG2_TYPE_SEND_VMQ_RNDIS_PKT,
  206. NVSP_MSG2_TYPE_SEND_VMQ_RNDIS_PKT_COMP,
  207. NVSP_MSG2_TYPE_SEND_NDIS_CONFIG,
  208. NVSP_MSG2_TYPE_ALLOC_CHIMNEY_HANDLE,
  209. NVSP_MSG2_TYPE_ALLOC_CHIMNEY_HANDLE_COMP,
  210. NVSP_MSG2_MAX = NVSP_MSG2_TYPE_ALLOC_CHIMNEY_HANDLE_COMP,
  211. /* Version 4 messages */
  212. NVSP_MSG4_TYPE_SEND_VF_ASSOCIATION,
  213. NVSP_MSG4_TYPE_SWITCH_DATA_PATH,
  214. NVSP_MSG4_TYPE_UPLINK_CONNECT_STATE_DEPRECATED,
  215. NVSP_MSG4_MAX = NVSP_MSG4_TYPE_UPLINK_CONNECT_STATE_DEPRECATED,
  216. /* Version 5 messages */
  217. NVSP_MSG5_TYPE_OID_QUERY_EX,
  218. NVSP_MSG5_TYPE_OID_QUERY_EX_COMP,
  219. NVSP_MSG5_TYPE_SUBCHANNEL,
  220. NVSP_MSG5_TYPE_SEND_INDIRECTION_TABLE,
  221. NVSP_MSG5_MAX = NVSP_MSG5_TYPE_SEND_INDIRECTION_TABLE,
  222. };
  223. enum {
  224. NVSP_STAT_NONE = 0,
  225. NVSP_STAT_SUCCESS,
  226. NVSP_STAT_FAIL,
  227. NVSP_STAT_PROTOCOL_TOO_NEW,
  228. NVSP_STAT_PROTOCOL_TOO_OLD,
  229. NVSP_STAT_INVALID_RNDIS_PKT,
  230. NVSP_STAT_BUSY,
  231. NVSP_STAT_PROTOCOL_UNSUPPORTED,
  232. NVSP_STAT_MAX,
  233. };
  234. struct nvsp_message_header {
  235. u32 msg_type;
  236. };
  237. /* Init Messages */
  238. /*
  239. * This message is used by the VSC to initialize the channel after the channels
  240. * has been opened. This message should never include anything other then
  241. * versioning (i.e. this message will be the same for ever).
  242. */
  243. struct nvsp_message_init {
  244. u32 min_protocol_ver;
  245. u32 max_protocol_ver;
  246. } __packed;
  247. /*
  248. * This message is used by the VSP to complete the initialization of the
  249. * channel. This message should never include anything other then versioning
  250. * (i.e. this message will be the same for ever).
  251. */
  252. struct nvsp_message_init_complete {
  253. u32 negotiated_protocol_ver;
  254. u32 max_mdl_chain_len;
  255. u32 status;
  256. } __packed;
  257. union nvsp_message_init_uber {
  258. struct nvsp_message_init init;
  259. struct nvsp_message_init_complete init_complete;
  260. } __packed;
  261. /* Version 1 Messages */
  262. /*
  263. * This message is used by the VSC to send the NDIS version to the VSP. The VSP
  264. * can use this information when handling OIDs sent by the VSC.
  265. */
  266. struct nvsp_1_message_send_ndis_version {
  267. u32 ndis_major_ver;
  268. u32 ndis_minor_ver;
  269. } __packed;
  270. /*
  271. * This message is used by the VSC to send a receive buffer to the VSP. The VSP
  272. * can then use the receive buffer to send data to the VSC.
  273. */
  274. struct nvsp_1_message_send_receive_buffer {
  275. u32 gpadl_handle;
  276. u16 id;
  277. } __packed;
  278. struct nvsp_1_receive_buffer_section {
  279. u32 offset;
  280. u32 sub_alloc_size;
  281. u32 num_sub_allocs;
  282. u32 end_offset;
  283. } __packed;
  284. /*
  285. * This message is used by the VSP to acknowledge a receive buffer send by the
  286. * VSC. This message must be sent by the VSP before the VSP uses the receive
  287. * buffer.
  288. */
  289. struct nvsp_1_message_send_receive_buffer_complete {
  290. u32 status;
  291. u32 num_sections;
  292. /*
  293. * The receive buffer is split into two parts, a large suballocation
  294. * section and a small suballocation section. These sections are then
  295. * suballocated by a certain size.
  296. */
  297. /*
  298. * For example, the following break up of the receive buffer has 6
  299. * large suballocations and 10 small suballocations.
  300. */
  301. /*
  302. * | Large Section | | Small Section |
  303. * ------------------------------------------------------------
  304. * | | | | | | | | | | | | | | | | | |
  305. * | |
  306. * LargeOffset SmallOffset
  307. */
  308. struct nvsp_1_receive_buffer_section sections[1];
  309. } __packed;
  310. /*
  311. * This message is sent by the VSC to revoke the receive buffer. After the VSP
  312. * completes this transaction, the vsp should never use the receive buffer
  313. * again.
  314. */
  315. struct nvsp_1_message_revoke_receive_buffer {
  316. u16 id;
  317. };
  318. /*
  319. * This message is used by the VSC to send a send buffer to the VSP. The VSC
  320. * can then use the send buffer to send data to the VSP.
  321. */
  322. struct nvsp_1_message_send_send_buffer {
  323. u32 gpadl_handle;
  324. u16 id;
  325. } __packed;
  326. /*
  327. * This message is used by the VSP to acknowledge a send buffer sent by the
  328. * VSC. This message must be sent by the VSP before the VSP uses the sent
  329. * buffer.
  330. */
  331. struct nvsp_1_message_send_send_buffer_complete {
  332. u32 status;
  333. /*
  334. * The VSC gets to choose the size of the send buffer and the VSP gets
  335. * to choose the sections size of the buffer. This was done to enable
  336. * dynamic reconfigurations when the cost of GPA-direct buffers
  337. * decreases.
  338. */
  339. u32 section_size;
  340. } __packed;
  341. /*
  342. * This message is sent by the VSC to revoke the send buffer. After the VSP
  343. * completes this transaction, the vsp should never use the send buffer again.
  344. */
  345. struct nvsp_1_message_revoke_send_buffer {
  346. u16 id;
  347. };
  348. /*
  349. * This message is used by both the VSP and the VSC to send a RNDIS message to
  350. * the opposite channel endpoint.
  351. */
  352. struct nvsp_1_message_send_rndis_packet {
  353. /*
  354. * This field is specified by RNIDS. They assume there's two different
  355. * channels of communication. However, the Network VSP only has one.
  356. * Therefore, the channel travels with the RNDIS packet.
  357. */
  358. u32 channel_type;
  359. /*
  360. * This field is used to send part or all of the data through a send
  361. * buffer. This values specifies an index into the send buffer. If the
  362. * index is 0xFFFFFFFF, then the send buffer is not being used and all
  363. * of the data was sent through other VMBus mechanisms.
  364. */
  365. u32 send_buf_section_index;
  366. u32 send_buf_section_size;
  367. } __packed;
  368. /*
  369. * This message is used by both the VSP and the VSC to complete a RNDIS message
  370. * to the opposite channel endpoint. At this point, the initiator of this
  371. * message cannot use any resources associated with the original RNDIS packet.
  372. */
  373. struct nvsp_1_message_send_rndis_packet_complete {
  374. u32 status;
  375. };
  376. union nvsp_1_message_uber {
  377. struct nvsp_1_message_send_ndis_version send_ndis_ver;
  378. struct nvsp_1_message_send_receive_buffer send_recv_buf;
  379. struct nvsp_1_message_send_receive_buffer_complete
  380. send_recv_buf_complete;
  381. struct nvsp_1_message_revoke_receive_buffer revoke_recv_buf;
  382. struct nvsp_1_message_send_send_buffer send_send_buf;
  383. struct nvsp_1_message_send_send_buffer_complete send_send_buf_complete;
  384. struct nvsp_1_message_revoke_send_buffer revoke_send_buf;
  385. struct nvsp_1_message_send_rndis_packet send_rndis_pkt;
  386. struct nvsp_1_message_send_rndis_packet_complete
  387. send_rndis_pkt_complete;
  388. } __packed;
  389. /*
  390. * Network VSP protocol version 2 messages:
  391. */
  392. struct nvsp_2_vsc_capability {
  393. union {
  394. u64 data;
  395. struct {
  396. u64 vmq:1;
  397. u64 chimney:1;
  398. u64 sriov:1;
  399. u64 ieee8021q:1;
  400. u64 correlation_id:1;
  401. };
  402. };
  403. } __packed;
  404. struct nvsp_2_send_ndis_config {
  405. u32 mtu;
  406. u32 reserved;
  407. struct nvsp_2_vsc_capability capability;
  408. } __packed;
  409. /* Allocate receive buffer */
  410. struct nvsp_2_alloc_rxbuf {
  411. /* Allocation ID to match the allocation request and response */
  412. u32 alloc_id;
  413. /* Length of the VM shared memory receive buffer that needs to
  414. * be allocated
  415. */
  416. u32 len;
  417. } __packed;
  418. /* Allocate receive buffer complete */
  419. struct nvsp_2_alloc_rxbuf_comp {
  420. /* The NDIS_STATUS code for buffer allocation */
  421. u32 status;
  422. u32 alloc_id;
  423. /* GPADL handle for the allocated receive buffer */
  424. u32 gpadl_handle;
  425. /* Receive buffer ID */
  426. u64 recv_buf_id;
  427. } __packed;
  428. struct nvsp_2_free_rxbuf {
  429. u64 recv_buf_id;
  430. } __packed;
  431. union nvsp_2_message_uber {
  432. struct nvsp_2_send_ndis_config send_ndis_config;
  433. struct nvsp_2_alloc_rxbuf alloc_rxbuf;
  434. struct nvsp_2_alloc_rxbuf_comp alloc_rxbuf_comp;
  435. struct nvsp_2_free_rxbuf free_rxbuf;
  436. } __packed;
  437. enum nvsp_subchannel_operation {
  438. NVSP_SUBCHANNEL_NONE = 0,
  439. NVSP_SUBCHANNEL_ALLOCATE,
  440. NVSP_SUBCHANNEL_MAX
  441. };
  442. struct nvsp_5_subchannel_request {
  443. u32 op;
  444. u32 num_subchannels;
  445. } __packed;
  446. struct nvsp_5_subchannel_complete {
  447. u32 status;
  448. u32 num_subchannels; /* Actual number of subchannels allocated */
  449. } __packed;
  450. struct nvsp_5_send_indirect_table {
  451. /* The number of entries in the send indirection table */
  452. u32 count;
  453. /* The offset of the send indireciton table from top of this struct.
  454. * The send indirection table tells which channel to put the send
  455. * traffic on. Each entry is a channel number.
  456. */
  457. u32 offset;
  458. } __packed;
  459. union nvsp_5_message_uber {
  460. struct nvsp_5_subchannel_request subchn_req;
  461. struct nvsp_5_subchannel_complete subchn_comp;
  462. struct nvsp_5_send_indirect_table send_table;
  463. } __packed;
  464. union nvsp_all_messages {
  465. union nvsp_message_init_uber init_msg;
  466. union nvsp_1_message_uber v1_msg;
  467. union nvsp_2_message_uber v2_msg;
  468. union nvsp_5_message_uber v5_msg;
  469. } __packed;
  470. /* ALL Messages */
  471. struct nvsp_message {
  472. struct nvsp_message_header hdr;
  473. union nvsp_all_messages msg;
  474. } __packed;
  475. #define NETVSC_MTU 65536
  476. #define NETVSC_RECEIVE_BUFFER_SIZE (1024*1024*16) /* 16MB */
  477. #define NETVSC_RECEIVE_BUFFER_SIZE_LEGACY (1024*1024*15) /* 15MB */
  478. #define NETVSC_SEND_BUFFER_SIZE (1024 * 1024 * 15) /* 15MB */
  479. #define NETVSC_INVALID_INDEX -1
  480. #define NETVSC_RECEIVE_BUFFER_ID 0xcafe
  481. #define NETVSC_SEND_BUFFER_ID 0
  482. #define NETVSC_PACKET_SIZE 4096
  483. #define VRSS_SEND_TAB_SIZE 16
  484. #define RNDIS_MAX_PKT_DEFAULT 8
  485. #define RNDIS_PKT_ALIGN_DEFAULT 8
  486. struct multi_send_data {
  487. spinlock_t lock; /* protect struct multi_send_data */
  488. struct hv_netvsc_packet *pkt; /* netvsc pkt pending */
  489. u32 count; /* counter of batched packets */
  490. };
  491. /* The context of the netvsc device */
  492. struct net_device_context {
  493. /* point back to our device context */
  494. struct hv_device *device_ctx;
  495. struct delayed_work dwork;
  496. struct work_struct work;
  497. u32 msg_enable; /* debug level */
  498. };
  499. /* Per netvsc device */
  500. struct netvsc_device {
  501. struct hv_device *dev;
  502. u32 nvsp_version;
  503. atomic_t num_outstanding_sends;
  504. wait_queue_head_t wait_drain;
  505. bool start_remove;
  506. bool destroy;
  507. /* Receive buffer allocated by us but manages by NetVSP */
  508. void *recv_buf;
  509. u32 recv_buf_size;
  510. u32 recv_buf_gpadl_handle;
  511. u32 recv_section_cnt;
  512. struct nvsp_1_receive_buffer_section *recv_section;
  513. /* Send buffer allocated by us */
  514. void *send_buf;
  515. u32 send_buf_size;
  516. u32 send_buf_gpadl_handle;
  517. u32 send_section_cnt;
  518. u32 send_section_size;
  519. unsigned long *send_section_map;
  520. int map_words;
  521. /* Used for NetVSP initialization protocol */
  522. struct completion channel_init_wait;
  523. struct nvsp_message channel_init_pkt;
  524. struct nvsp_message revoke_packet;
  525. /* unsigned char HwMacAddr[HW_MACADDR_LEN]; */
  526. struct net_device *ndev;
  527. struct vmbus_channel *chn_table[NR_CPUS];
  528. u32 send_table[VRSS_SEND_TAB_SIZE];
  529. u32 max_chn;
  530. u32 num_chn;
  531. atomic_t queue_sends[NR_CPUS];
  532. /* Holds rndis device info */
  533. void *extension;
  534. int ring_size;
  535. /* The primary channel callback buffer */
  536. unsigned char *cb_buffer;
  537. /* The sub channel callback buffer */
  538. unsigned char *sub_cb_buf;
  539. struct multi_send_data msd[NR_CPUS];
  540. u32 max_pkt; /* max number of pkt in one send, e.g. 8 */
  541. u32 pkt_align; /* alignment bytes, e.g. 8 */
  542. /* The net device context */
  543. struct net_device_context *nd_ctx;
  544. };
  545. /* NdisInitialize message */
  546. struct rndis_initialize_request {
  547. u32 req_id;
  548. u32 major_ver;
  549. u32 minor_ver;
  550. u32 max_xfer_size;
  551. };
  552. /* Response to NdisInitialize */
  553. struct rndis_initialize_complete {
  554. u32 req_id;
  555. u32 status;
  556. u32 major_ver;
  557. u32 minor_ver;
  558. u32 dev_flags;
  559. u32 medium;
  560. u32 max_pkt_per_msg;
  561. u32 max_xfer_size;
  562. u32 pkt_alignment_factor;
  563. u32 af_list_offset;
  564. u32 af_list_size;
  565. };
  566. /* Call manager devices only: Information about an address family */
  567. /* supported by the device is appended to the response to NdisInitialize. */
  568. struct rndis_co_address_family {
  569. u32 address_family;
  570. u32 major_ver;
  571. u32 minor_ver;
  572. };
  573. /* NdisHalt message */
  574. struct rndis_halt_request {
  575. u32 req_id;
  576. };
  577. /* NdisQueryRequest message */
  578. struct rndis_query_request {
  579. u32 req_id;
  580. u32 oid;
  581. u32 info_buflen;
  582. u32 info_buf_offset;
  583. u32 dev_vc_handle;
  584. };
  585. /* Response to NdisQueryRequest */
  586. struct rndis_query_complete {
  587. u32 req_id;
  588. u32 status;
  589. u32 info_buflen;
  590. u32 info_buf_offset;
  591. };
  592. /* NdisSetRequest message */
  593. struct rndis_set_request {
  594. u32 req_id;
  595. u32 oid;
  596. u32 info_buflen;
  597. u32 info_buf_offset;
  598. u32 dev_vc_handle;
  599. };
  600. /* Response to NdisSetRequest */
  601. struct rndis_set_complete {
  602. u32 req_id;
  603. u32 status;
  604. };
  605. /* NdisReset message */
  606. struct rndis_reset_request {
  607. u32 reserved;
  608. };
  609. /* Response to NdisReset */
  610. struct rndis_reset_complete {
  611. u32 status;
  612. u32 addressing_reset;
  613. };
  614. /* NdisMIndicateStatus message */
  615. struct rndis_indicate_status {
  616. u32 status;
  617. u32 status_buflen;
  618. u32 status_buf_offset;
  619. };
  620. /* Diagnostic information passed as the status buffer in */
  621. /* struct rndis_indicate_status messages signifying error conditions. */
  622. struct rndis_diagnostic_info {
  623. u32 diag_status;
  624. u32 error_offset;
  625. };
  626. /* NdisKeepAlive message */
  627. struct rndis_keepalive_request {
  628. u32 req_id;
  629. };
  630. /* Response to NdisKeepAlive */
  631. struct rndis_keepalive_complete {
  632. u32 req_id;
  633. u32 status;
  634. };
  635. /*
  636. * Data message. All Offset fields contain byte offsets from the beginning of
  637. * struct rndis_packet. All Length fields are in bytes. VcHandle is set
  638. * to 0 for connectionless data, otherwise it contains the VC handle.
  639. */
  640. struct rndis_packet {
  641. u32 data_offset;
  642. u32 data_len;
  643. u32 oob_data_offset;
  644. u32 oob_data_len;
  645. u32 num_oob_data_elements;
  646. u32 per_pkt_info_offset;
  647. u32 per_pkt_info_len;
  648. u32 vc_handle;
  649. u32 reserved;
  650. };
  651. /* Optional Out of Band data associated with a Data message. */
  652. struct rndis_oobd {
  653. u32 size;
  654. u32 type;
  655. u32 class_info_offset;
  656. };
  657. /* Packet extension field contents associated with a Data message. */
  658. struct rndis_per_packet_info {
  659. u32 size;
  660. u32 type;
  661. u32 ppi_offset;
  662. };
  663. enum ndis_per_pkt_info_type {
  664. TCPIP_CHKSUM_PKTINFO,
  665. IPSEC_PKTINFO,
  666. TCP_LARGESEND_PKTINFO,
  667. CLASSIFICATION_HANDLE_PKTINFO,
  668. NDIS_RESERVED,
  669. SG_LIST_PKTINFO,
  670. IEEE_8021Q_INFO,
  671. ORIGINAL_PKTINFO,
  672. PACKET_CANCEL_ID,
  673. NBL_HASH_VALUE = PACKET_CANCEL_ID,
  674. ORIGINAL_NET_BUFLIST,
  675. CACHED_NET_BUFLIST,
  676. SHORT_PKT_PADINFO,
  677. MAX_PER_PKT_INFO
  678. };
  679. struct ndis_pkt_8021q_info {
  680. union {
  681. struct {
  682. u32 pri:3; /* User Priority */
  683. u32 cfi:1; /* Canonical Format ID */
  684. u32 vlanid:12; /* VLAN ID */
  685. u32 reserved:16;
  686. };
  687. u32 value;
  688. };
  689. };
  690. struct ndis_oject_header {
  691. u8 type;
  692. u8 revision;
  693. u16 size;
  694. };
  695. #define NDIS_OBJECT_TYPE_DEFAULT 0x80
  696. #define NDIS_OFFLOAD_PARAMETERS_REVISION_3 3
  697. #define NDIS_OFFLOAD_PARAMETERS_NO_CHANGE 0
  698. #define NDIS_OFFLOAD_PARAMETERS_LSOV2_DISABLED 1
  699. #define NDIS_OFFLOAD_PARAMETERS_LSOV2_ENABLED 2
  700. #define NDIS_OFFLOAD_PARAMETERS_LSOV1_ENABLED 2
  701. #define NDIS_OFFLOAD_PARAMETERS_RSC_DISABLED 1
  702. #define NDIS_OFFLOAD_PARAMETERS_RSC_ENABLED 2
  703. #define NDIS_OFFLOAD_PARAMETERS_TX_RX_DISABLED 1
  704. #define NDIS_OFFLOAD_PARAMETERS_TX_ENABLED_RX_DISABLED 2
  705. #define NDIS_OFFLOAD_PARAMETERS_RX_ENABLED_TX_DISABLED 3
  706. #define NDIS_OFFLOAD_PARAMETERS_TX_RX_ENABLED 4
  707. #define NDIS_TCP_LARGE_SEND_OFFLOAD_V2_TYPE 1
  708. #define NDIS_TCP_LARGE_SEND_OFFLOAD_IPV4 0
  709. #define NDIS_TCP_LARGE_SEND_OFFLOAD_IPV6 1
  710. #define VERSION_4_OFFLOAD_SIZE 22
  711. /*
  712. * New offload OIDs for NDIS 6
  713. */
  714. #define OID_TCP_OFFLOAD_CURRENT_CONFIG 0xFC01020B /* query only */
  715. #define OID_TCP_OFFLOAD_PARAMETERS 0xFC01020C /* set only */
  716. #define OID_TCP_OFFLOAD_HARDWARE_CAPABILITIES 0xFC01020D/* query only */
  717. #define OID_TCP_CONNECTION_OFFLOAD_CURRENT_CONFIG 0xFC01020E /* query only */
  718. #define OID_TCP_CONNECTION_OFFLOAD_HARDWARE_CAPABILITIES 0xFC01020F /* query */
  719. #define OID_OFFLOAD_ENCAPSULATION 0x0101010A /* set/query */
  720. struct ndis_offload_params {
  721. struct ndis_oject_header header;
  722. u8 ip_v4_csum;
  723. u8 tcp_ip_v4_csum;
  724. u8 udp_ip_v4_csum;
  725. u8 tcp_ip_v6_csum;
  726. u8 udp_ip_v6_csum;
  727. u8 lso_v1;
  728. u8 ip_sec_v1;
  729. u8 lso_v2_ipv4;
  730. u8 lso_v2_ipv6;
  731. u8 tcp_connection_ip_v4;
  732. u8 tcp_connection_ip_v6;
  733. u32 flags;
  734. u8 ip_sec_v2;
  735. u8 ip_sec_v2_ip_v4;
  736. struct {
  737. u8 rsc_ip_v4;
  738. u8 rsc_ip_v6;
  739. };
  740. struct {
  741. u8 encapsulated_packet_task_offload;
  742. u8 encapsulation_types;
  743. };
  744. };
  745. struct ndis_tcp_ip_checksum_info {
  746. union {
  747. struct {
  748. u32 is_ipv4:1;
  749. u32 is_ipv6:1;
  750. u32 tcp_checksum:1;
  751. u32 udp_checksum:1;
  752. u32 ip_header_checksum:1;
  753. u32 reserved:11;
  754. u32 tcp_header_offset:10;
  755. } transmit;
  756. struct {
  757. u32 tcp_checksum_failed:1;
  758. u32 udp_checksum_failed:1;
  759. u32 ip_checksum_failed:1;
  760. u32 tcp_checksum_succeeded:1;
  761. u32 udp_checksum_succeeded:1;
  762. u32 ip_checksum_succeeded:1;
  763. u32 loopback:1;
  764. u32 tcp_checksum_value_invalid:1;
  765. u32 ip_checksum_value_invalid:1;
  766. } receive;
  767. u32 value;
  768. };
  769. };
  770. struct ndis_tcp_lso_info {
  771. union {
  772. struct {
  773. u32 unused:30;
  774. u32 type:1;
  775. u32 reserved2:1;
  776. } transmit;
  777. struct {
  778. u32 mss:20;
  779. u32 tcp_header_offset:10;
  780. u32 type:1;
  781. u32 reserved2:1;
  782. } lso_v1_transmit;
  783. struct {
  784. u32 tcp_payload:30;
  785. u32 type:1;
  786. u32 reserved2:1;
  787. } lso_v1_transmit_complete;
  788. struct {
  789. u32 mss:20;
  790. u32 tcp_header_offset:10;
  791. u32 type:1;
  792. u32 ip_version:1;
  793. } lso_v2_transmit;
  794. struct {
  795. u32 reserved:30;
  796. u32 type:1;
  797. u32 reserved2:1;
  798. } lso_v2_transmit_complete;
  799. u32 value;
  800. };
  801. };
  802. #define NDIS_VLAN_PPI_SIZE (sizeof(struct rndis_per_packet_info) + \
  803. sizeof(struct ndis_pkt_8021q_info))
  804. #define NDIS_CSUM_PPI_SIZE (sizeof(struct rndis_per_packet_info) + \
  805. sizeof(struct ndis_tcp_ip_checksum_info))
  806. #define NDIS_LSO_PPI_SIZE (sizeof(struct rndis_per_packet_info) + \
  807. sizeof(struct ndis_tcp_lso_info))
  808. #define NDIS_HASH_PPI_SIZE (sizeof(struct rndis_per_packet_info) + \
  809. sizeof(u32))
  810. /* Total size of all PPI data */
  811. #define NDIS_ALL_PPI_SIZE (NDIS_VLAN_PPI_SIZE + NDIS_CSUM_PPI_SIZE + \
  812. NDIS_LSO_PPI_SIZE + NDIS_HASH_PPI_SIZE)
  813. /* Format of Information buffer passed in a SetRequest for the OID */
  814. /* OID_GEN_RNDIS_CONFIG_PARAMETER. */
  815. struct rndis_config_parameter_info {
  816. u32 parameter_name_offset;
  817. u32 parameter_name_length;
  818. u32 parameter_type;
  819. u32 parameter_value_offset;
  820. u32 parameter_value_length;
  821. };
  822. /* Values for ParameterType in struct rndis_config_parameter_info */
  823. #define RNDIS_CONFIG_PARAM_TYPE_INTEGER 0
  824. #define RNDIS_CONFIG_PARAM_TYPE_STRING 2
  825. /* CONDIS Miniport messages for connection oriented devices */
  826. /* that do not implement a call manager. */
  827. /* CoNdisMiniportCreateVc message */
  828. struct rcondis_mp_create_vc {
  829. u32 req_id;
  830. u32 ndis_vc_handle;
  831. };
  832. /* Response to CoNdisMiniportCreateVc */
  833. struct rcondis_mp_create_vc_complete {
  834. u32 req_id;
  835. u32 dev_vc_handle;
  836. u32 status;
  837. };
  838. /* CoNdisMiniportDeleteVc message */
  839. struct rcondis_mp_delete_vc {
  840. u32 req_id;
  841. u32 dev_vc_handle;
  842. };
  843. /* Response to CoNdisMiniportDeleteVc */
  844. struct rcondis_mp_delete_vc_complete {
  845. u32 req_id;
  846. u32 status;
  847. };
  848. /* CoNdisMiniportQueryRequest message */
  849. struct rcondis_mp_query_request {
  850. u32 req_id;
  851. u32 request_type;
  852. u32 oid;
  853. u32 dev_vc_handle;
  854. u32 info_buflen;
  855. u32 info_buf_offset;
  856. };
  857. /* CoNdisMiniportSetRequest message */
  858. struct rcondis_mp_set_request {
  859. u32 req_id;
  860. u32 request_type;
  861. u32 oid;
  862. u32 dev_vc_handle;
  863. u32 info_buflen;
  864. u32 info_buf_offset;
  865. };
  866. /* CoNdisIndicateStatus message */
  867. struct rcondis_indicate_status {
  868. u32 ndis_vc_handle;
  869. u32 status;
  870. u32 status_buflen;
  871. u32 status_buf_offset;
  872. };
  873. /* CONDIS Call/VC parameters */
  874. struct rcondis_specific_parameters {
  875. u32 parameter_type;
  876. u32 parameter_length;
  877. u32 parameter_lffset;
  878. };
  879. struct rcondis_media_parameters {
  880. u32 flags;
  881. u32 reserved1;
  882. u32 reserved2;
  883. struct rcondis_specific_parameters media_specific;
  884. };
  885. struct rndis_flowspec {
  886. u32 token_rate;
  887. u32 token_bucket_size;
  888. u32 peak_bandwidth;
  889. u32 latency;
  890. u32 delay_variation;
  891. u32 service_type;
  892. u32 max_sdu_size;
  893. u32 minimum_policed_size;
  894. };
  895. struct rcondis_call_manager_parameters {
  896. struct rndis_flowspec transmit;
  897. struct rndis_flowspec receive;
  898. struct rcondis_specific_parameters call_mgr_specific;
  899. };
  900. /* CoNdisMiniportActivateVc message */
  901. struct rcondis_mp_activate_vc_request {
  902. u32 req_id;
  903. u32 flags;
  904. u32 dev_vc_handle;
  905. u32 media_params_offset;
  906. u32 media_params_length;
  907. u32 call_mgr_params_offset;
  908. u32 call_mgr_params_length;
  909. };
  910. /* Response to CoNdisMiniportActivateVc */
  911. struct rcondis_mp_activate_vc_complete {
  912. u32 req_id;
  913. u32 status;
  914. };
  915. /* CoNdisMiniportDeactivateVc message */
  916. struct rcondis_mp_deactivate_vc_request {
  917. u32 req_id;
  918. u32 flags;
  919. u32 dev_vc_handle;
  920. };
  921. /* Response to CoNdisMiniportDeactivateVc */
  922. struct rcondis_mp_deactivate_vc_complete {
  923. u32 req_id;
  924. u32 status;
  925. };
  926. /* union with all of the RNDIS messages */
  927. union rndis_message_container {
  928. struct rndis_packet pkt;
  929. struct rndis_initialize_request init_req;
  930. struct rndis_halt_request halt_req;
  931. struct rndis_query_request query_req;
  932. struct rndis_set_request set_req;
  933. struct rndis_reset_request reset_req;
  934. struct rndis_keepalive_request keep_alive_req;
  935. struct rndis_indicate_status indicate_status;
  936. struct rndis_initialize_complete init_complete;
  937. struct rndis_query_complete query_complete;
  938. struct rndis_set_complete set_complete;
  939. struct rndis_reset_complete reset_complete;
  940. struct rndis_keepalive_complete keep_alive_complete;
  941. struct rcondis_mp_create_vc co_miniport_create_vc;
  942. struct rcondis_mp_delete_vc co_miniport_delete_vc;
  943. struct rcondis_indicate_status co_indicate_status;
  944. struct rcondis_mp_activate_vc_request co_miniport_activate_vc;
  945. struct rcondis_mp_deactivate_vc_request co_miniport_deactivate_vc;
  946. struct rcondis_mp_create_vc_complete co_miniport_create_vc_complete;
  947. struct rcondis_mp_delete_vc_complete co_miniport_delete_vc_complete;
  948. struct rcondis_mp_activate_vc_complete co_miniport_activate_vc_complete;
  949. struct rcondis_mp_deactivate_vc_complete
  950. co_miniport_deactivate_vc_complete;
  951. };
  952. /* Remote NDIS message format */
  953. struct rndis_message {
  954. u32 ndis_msg_type;
  955. /* Total length of this message, from the beginning */
  956. /* of the sruct rndis_message, in bytes. */
  957. u32 msg_len;
  958. /* Actual message */
  959. union rndis_message_container msg;
  960. };
  961. /* Handy macros */
  962. /* get the size of an RNDIS message. Pass in the message type, */
  963. /* struct rndis_set_request, struct rndis_packet for example */
  964. #define RNDIS_MESSAGE_SIZE(msg) \
  965. (sizeof(msg) + (sizeof(struct rndis_message) - \
  966. sizeof(union rndis_message_container)))
  967. /* get pointer to info buffer with message pointer */
  968. #define MESSAGE_TO_INFO_BUFFER(msg) \
  969. (((unsigned char *)(msg)) + msg->info_buf_offset)
  970. /* get pointer to status buffer with message pointer */
  971. #define MESSAGE_TO_STATUS_BUFFER(msg) \
  972. (((unsigned char *)(msg)) + msg->status_buf_offset)
  973. /* get pointer to OOBD buffer with message pointer */
  974. #define MESSAGE_TO_OOBD_BUFFER(msg) \
  975. (((unsigned char *)(msg)) + msg->oob_data_offset)
  976. /* get pointer to data buffer with message pointer */
  977. #define MESSAGE_TO_DATA_BUFFER(msg) \
  978. (((unsigned char *)(msg)) + msg->per_pkt_info_offset)
  979. /* get pointer to contained message from NDIS_MESSAGE pointer */
  980. #define RNDIS_MESSAGE_PTR_TO_MESSAGE_PTR(rndis_msg) \
  981. ((void *) &rndis_msg->msg)
  982. /* get pointer to contained message from NDIS_MESSAGE pointer */
  983. #define RNDIS_MESSAGE_RAW_PTR_TO_MESSAGE_PTR(rndis_msg) \
  984. ((void *) rndis_msg)
  985. #define __struct_bcount(x)
  986. #define RNDIS_HEADER_SIZE (sizeof(struct rndis_message) - \
  987. sizeof(union rndis_message_container))
  988. #define RNDIS_AND_PPI_SIZE (sizeof(struct rndis_message) + NDIS_ALL_PPI_SIZE)
  989. #define NDIS_PACKET_TYPE_DIRECTED 0x00000001
  990. #define NDIS_PACKET_TYPE_MULTICAST 0x00000002
  991. #define NDIS_PACKET_TYPE_ALL_MULTICAST 0x00000004
  992. #define NDIS_PACKET_TYPE_BROADCAST 0x00000008
  993. #define NDIS_PACKET_TYPE_SOURCE_ROUTING 0x00000010
  994. #define NDIS_PACKET_TYPE_PROMISCUOUS 0x00000020
  995. #define NDIS_PACKET_TYPE_SMT 0x00000040
  996. #define NDIS_PACKET_TYPE_ALL_LOCAL 0x00000080
  997. #define NDIS_PACKET_TYPE_GROUP 0x00000100
  998. #define NDIS_PACKET_TYPE_ALL_FUNCTIONAL 0x00000200
  999. #define NDIS_PACKET_TYPE_FUNCTIONAL 0x00000400
  1000. #define NDIS_PACKET_TYPE_MAC_FRAME 0x00000800
  1001. #define INFO_IPV4 2
  1002. #define INFO_IPV6 4
  1003. #define INFO_TCP 2
  1004. #define INFO_UDP 4
  1005. #define TRANSPORT_INFO_NOT_IP 0
  1006. #define TRANSPORT_INFO_IPV4_TCP ((INFO_IPV4 << 16) | INFO_TCP)
  1007. #define TRANSPORT_INFO_IPV4_UDP ((INFO_IPV4 << 16) | INFO_UDP)
  1008. #define TRANSPORT_INFO_IPV6_TCP ((INFO_IPV6 << 16) | INFO_TCP)
  1009. #define TRANSPORT_INFO_IPV6_UDP ((INFO_IPV6 << 16) | INFO_UDP)
  1010. #endif /* _HYPERV_NET_H */