i40e_adminq_cmd.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* Copyright(c) 2013 - 2018 Intel Corporation. */
  3. #ifndef _I40E_ADMINQ_CMD_H_
  4. #define _I40E_ADMINQ_CMD_H_
  5. /* This header file defines the i40e Admin Queue commands and is shared between
  6. * i40e Firmware and Software. Do not change the names in this file to IAVF
  7. * because this file should be diff-able against the i40e version, even
  8. * though many parts have been removed in this VF version.
  9. *
  10. * This file needs to comply with the Linux Kernel coding style.
  11. */
  12. #define I40E_FW_API_VERSION_MAJOR 0x0001
  13. #define I40E_FW_API_VERSION_MINOR_X722 0x0005
  14. #define I40E_FW_API_VERSION_MINOR_X710 0x0007
  15. #define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \
  16. I40E_FW_API_VERSION_MINOR_X710 : \
  17. I40E_FW_API_VERSION_MINOR_X722)
  18. /* API version 1.7 implements additional link and PHY-specific APIs */
  19. #define I40E_MINOR_VER_GET_LINK_INFO_XL710 0x0007
  20. struct i40e_aq_desc {
  21. __le16 flags;
  22. __le16 opcode;
  23. __le16 datalen;
  24. __le16 retval;
  25. __le32 cookie_high;
  26. __le32 cookie_low;
  27. union {
  28. struct {
  29. __le32 param0;
  30. __le32 param1;
  31. __le32 param2;
  32. __le32 param3;
  33. } internal;
  34. struct {
  35. __le32 param0;
  36. __le32 param1;
  37. __le32 addr_high;
  38. __le32 addr_low;
  39. } external;
  40. u8 raw[16];
  41. } params;
  42. };
  43. /* Flags sub-structure
  44. * |0 |1 |2 |3 |4 |5 |6 |7 |8 |9 |10 |11 |12 |13 |14 |15 |
  45. * |DD |CMP|ERR|VFE| * * RESERVED * * |LB |RD |VFC|BUF|SI |EI |FE |
  46. */
  47. /* command flags and offsets*/
  48. #define I40E_AQ_FLAG_DD_SHIFT 0
  49. #define I40E_AQ_FLAG_CMP_SHIFT 1
  50. #define I40E_AQ_FLAG_ERR_SHIFT 2
  51. #define I40E_AQ_FLAG_VFE_SHIFT 3
  52. #define I40E_AQ_FLAG_LB_SHIFT 9
  53. #define I40E_AQ_FLAG_RD_SHIFT 10
  54. #define I40E_AQ_FLAG_VFC_SHIFT 11
  55. #define I40E_AQ_FLAG_BUF_SHIFT 12
  56. #define I40E_AQ_FLAG_SI_SHIFT 13
  57. #define I40E_AQ_FLAG_EI_SHIFT 14
  58. #define I40E_AQ_FLAG_FE_SHIFT 15
  59. #define I40E_AQ_FLAG_DD BIT(I40E_AQ_FLAG_DD_SHIFT) /* 0x1 */
  60. #define I40E_AQ_FLAG_CMP BIT(I40E_AQ_FLAG_CMP_SHIFT) /* 0x2 */
  61. #define I40E_AQ_FLAG_ERR BIT(I40E_AQ_FLAG_ERR_SHIFT) /* 0x4 */
  62. #define I40E_AQ_FLAG_VFE BIT(I40E_AQ_FLAG_VFE_SHIFT) /* 0x8 */
  63. #define I40E_AQ_FLAG_LB BIT(I40E_AQ_FLAG_LB_SHIFT) /* 0x200 */
  64. #define I40E_AQ_FLAG_RD BIT(I40E_AQ_FLAG_RD_SHIFT) /* 0x400 */
  65. #define I40E_AQ_FLAG_VFC BIT(I40E_AQ_FLAG_VFC_SHIFT) /* 0x800 */
  66. #define I40E_AQ_FLAG_BUF BIT(I40E_AQ_FLAG_BUF_SHIFT) /* 0x1000 */
  67. #define I40E_AQ_FLAG_SI BIT(I40E_AQ_FLAG_SI_SHIFT) /* 0x2000 */
  68. #define I40E_AQ_FLAG_EI BIT(I40E_AQ_FLAG_EI_SHIFT) /* 0x4000 */
  69. #define I40E_AQ_FLAG_FE BIT(I40E_AQ_FLAG_FE_SHIFT) /* 0x8000 */
  70. /* error codes */
  71. enum i40e_admin_queue_err {
  72. I40E_AQ_RC_OK = 0, /* success */
  73. I40E_AQ_RC_EPERM = 1, /* Operation not permitted */
  74. I40E_AQ_RC_ENOENT = 2, /* No such element */
  75. I40E_AQ_RC_ESRCH = 3, /* Bad opcode */
  76. I40E_AQ_RC_EINTR = 4, /* operation interrupted */
  77. I40E_AQ_RC_EIO = 5, /* I/O error */
  78. I40E_AQ_RC_ENXIO = 6, /* No such resource */
  79. I40E_AQ_RC_E2BIG = 7, /* Arg too long */
  80. I40E_AQ_RC_EAGAIN = 8, /* Try again */
  81. I40E_AQ_RC_ENOMEM = 9, /* Out of memory */
  82. I40E_AQ_RC_EACCES = 10, /* Permission denied */
  83. I40E_AQ_RC_EFAULT = 11, /* Bad address */
  84. I40E_AQ_RC_EBUSY = 12, /* Device or resource busy */
  85. I40E_AQ_RC_EEXIST = 13, /* object already exists */
  86. I40E_AQ_RC_EINVAL = 14, /* Invalid argument */
  87. I40E_AQ_RC_ENOTTY = 15, /* Not a typewriter */
  88. I40E_AQ_RC_ENOSPC = 16, /* No space left or alloc failure */
  89. I40E_AQ_RC_ENOSYS = 17, /* Function not implemented */
  90. I40E_AQ_RC_ERANGE = 18, /* Parameter out of range */
  91. I40E_AQ_RC_EFLUSHED = 19, /* Cmd flushed due to prev cmd error */
  92. I40E_AQ_RC_BAD_ADDR = 20, /* Descriptor contains a bad pointer */
  93. I40E_AQ_RC_EMODE = 21, /* Op not allowed in current dev mode */
  94. I40E_AQ_RC_EFBIG = 22, /* File too large */
  95. };
  96. /* Admin Queue command opcodes */
  97. enum i40e_admin_queue_opc {
  98. /* aq commands */
  99. i40e_aqc_opc_get_version = 0x0001,
  100. i40e_aqc_opc_driver_version = 0x0002,
  101. i40e_aqc_opc_queue_shutdown = 0x0003,
  102. i40e_aqc_opc_set_pf_context = 0x0004,
  103. /* resource ownership */
  104. i40e_aqc_opc_request_resource = 0x0008,
  105. i40e_aqc_opc_release_resource = 0x0009,
  106. i40e_aqc_opc_list_func_capabilities = 0x000A,
  107. i40e_aqc_opc_list_dev_capabilities = 0x000B,
  108. /* Proxy commands */
  109. i40e_aqc_opc_set_proxy_config = 0x0104,
  110. i40e_aqc_opc_set_ns_proxy_table_entry = 0x0105,
  111. /* LAA */
  112. i40e_aqc_opc_mac_address_read = 0x0107,
  113. i40e_aqc_opc_mac_address_write = 0x0108,
  114. /* PXE */
  115. i40e_aqc_opc_clear_pxe_mode = 0x0110,
  116. /* WoL commands */
  117. i40e_aqc_opc_set_wol_filter = 0x0120,
  118. i40e_aqc_opc_get_wake_reason = 0x0121,
  119. /* internal switch commands */
  120. i40e_aqc_opc_get_switch_config = 0x0200,
  121. i40e_aqc_opc_add_statistics = 0x0201,
  122. i40e_aqc_opc_remove_statistics = 0x0202,
  123. i40e_aqc_opc_set_port_parameters = 0x0203,
  124. i40e_aqc_opc_get_switch_resource_alloc = 0x0204,
  125. i40e_aqc_opc_set_switch_config = 0x0205,
  126. i40e_aqc_opc_rx_ctl_reg_read = 0x0206,
  127. i40e_aqc_opc_rx_ctl_reg_write = 0x0207,
  128. i40e_aqc_opc_add_vsi = 0x0210,
  129. i40e_aqc_opc_update_vsi_parameters = 0x0211,
  130. i40e_aqc_opc_get_vsi_parameters = 0x0212,
  131. i40e_aqc_opc_add_pv = 0x0220,
  132. i40e_aqc_opc_update_pv_parameters = 0x0221,
  133. i40e_aqc_opc_get_pv_parameters = 0x0222,
  134. i40e_aqc_opc_add_veb = 0x0230,
  135. i40e_aqc_opc_update_veb_parameters = 0x0231,
  136. i40e_aqc_opc_get_veb_parameters = 0x0232,
  137. i40e_aqc_opc_delete_element = 0x0243,
  138. i40e_aqc_opc_add_macvlan = 0x0250,
  139. i40e_aqc_opc_remove_macvlan = 0x0251,
  140. i40e_aqc_opc_add_vlan = 0x0252,
  141. i40e_aqc_opc_remove_vlan = 0x0253,
  142. i40e_aqc_opc_set_vsi_promiscuous_modes = 0x0254,
  143. i40e_aqc_opc_add_tag = 0x0255,
  144. i40e_aqc_opc_remove_tag = 0x0256,
  145. i40e_aqc_opc_add_multicast_etag = 0x0257,
  146. i40e_aqc_opc_remove_multicast_etag = 0x0258,
  147. i40e_aqc_opc_update_tag = 0x0259,
  148. i40e_aqc_opc_add_control_packet_filter = 0x025A,
  149. i40e_aqc_opc_remove_control_packet_filter = 0x025B,
  150. i40e_aqc_opc_add_cloud_filters = 0x025C,
  151. i40e_aqc_opc_remove_cloud_filters = 0x025D,
  152. i40e_aqc_opc_clear_wol_switch_filters = 0x025E,
  153. i40e_aqc_opc_add_mirror_rule = 0x0260,
  154. i40e_aqc_opc_delete_mirror_rule = 0x0261,
  155. /* Dynamic Device Personalization */
  156. i40e_aqc_opc_write_personalization_profile = 0x0270,
  157. i40e_aqc_opc_get_personalization_profile_list = 0x0271,
  158. /* DCB commands */
  159. i40e_aqc_opc_dcb_ignore_pfc = 0x0301,
  160. i40e_aqc_opc_dcb_updated = 0x0302,
  161. i40e_aqc_opc_set_dcb_parameters = 0x0303,
  162. /* TX scheduler */
  163. i40e_aqc_opc_configure_vsi_bw_limit = 0x0400,
  164. i40e_aqc_opc_configure_vsi_ets_sla_bw_limit = 0x0406,
  165. i40e_aqc_opc_configure_vsi_tc_bw = 0x0407,
  166. i40e_aqc_opc_query_vsi_bw_config = 0x0408,
  167. i40e_aqc_opc_query_vsi_ets_sla_config = 0x040A,
  168. i40e_aqc_opc_configure_switching_comp_bw_limit = 0x0410,
  169. i40e_aqc_opc_enable_switching_comp_ets = 0x0413,
  170. i40e_aqc_opc_modify_switching_comp_ets = 0x0414,
  171. i40e_aqc_opc_disable_switching_comp_ets = 0x0415,
  172. i40e_aqc_opc_configure_switching_comp_ets_bw_limit = 0x0416,
  173. i40e_aqc_opc_configure_switching_comp_bw_config = 0x0417,
  174. i40e_aqc_opc_query_switching_comp_ets_config = 0x0418,
  175. i40e_aqc_opc_query_port_ets_config = 0x0419,
  176. i40e_aqc_opc_query_switching_comp_bw_config = 0x041A,
  177. i40e_aqc_opc_suspend_port_tx = 0x041B,
  178. i40e_aqc_opc_resume_port_tx = 0x041C,
  179. i40e_aqc_opc_configure_partition_bw = 0x041D,
  180. /* hmc */
  181. i40e_aqc_opc_query_hmc_resource_profile = 0x0500,
  182. i40e_aqc_opc_set_hmc_resource_profile = 0x0501,
  183. /* phy commands*/
  184. i40e_aqc_opc_get_phy_abilities = 0x0600,
  185. i40e_aqc_opc_set_phy_config = 0x0601,
  186. i40e_aqc_opc_set_mac_config = 0x0603,
  187. i40e_aqc_opc_set_link_restart_an = 0x0605,
  188. i40e_aqc_opc_get_link_status = 0x0607,
  189. i40e_aqc_opc_set_phy_int_mask = 0x0613,
  190. i40e_aqc_opc_get_local_advt_reg = 0x0614,
  191. i40e_aqc_opc_set_local_advt_reg = 0x0615,
  192. i40e_aqc_opc_get_partner_advt = 0x0616,
  193. i40e_aqc_opc_set_lb_modes = 0x0618,
  194. i40e_aqc_opc_get_phy_wol_caps = 0x0621,
  195. i40e_aqc_opc_set_phy_debug = 0x0622,
  196. i40e_aqc_opc_upload_ext_phy_fm = 0x0625,
  197. i40e_aqc_opc_run_phy_activity = 0x0626,
  198. i40e_aqc_opc_set_phy_register = 0x0628,
  199. i40e_aqc_opc_get_phy_register = 0x0629,
  200. /* NVM commands */
  201. i40e_aqc_opc_nvm_read = 0x0701,
  202. i40e_aqc_opc_nvm_erase = 0x0702,
  203. i40e_aqc_opc_nvm_update = 0x0703,
  204. i40e_aqc_opc_nvm_config_read = 0x0704,
  205. i40e_aqc_opc_nvm_config_write = 0x0705,
  206. i40e_aqc_opc_oem_post_update = 0x0720,
  207. i40e_aqc_opc_thermal_sensor = 0x0721,
  208. /* virtualization commands */
  209. i40e_aqc_opc_send_msg_to_pf = 0x0801,
  210. i40e_aqc_opc_send_msg_to_vf = 0x0802,
  211. i40e_aqc_opc_send_msg_to_peer = 0x0803,
  212. /* alternate structure */
  213. i40e_aqc_opc_alternate_write = 0x0900,
  214. i40e_aqc_opc_alternate_write_indirect = 0x0901,
  215. i40e_aqc_opc_alternate_read = 0x0902,
  216. i40e_aqc_opc_alternate_read_indirect = 0x0903,
  217. i40e_aqc_opc_alternate_write_done = 0x0904,
  218. i40e_aqc_opc_alternate_set_mode = 0x0905,
  219. i40e_aqc_opc_alternate_clear_port = 0x0906,
  220. /* LLDP commands */
  221. i40e_aqc_opc_lldp_get_mib = 0x0A00,
  222. i40e_aqc_opc_lldp_update_mib = 0x0A01,
  223. i40e_aqc_opc_lldp_add_tlv = 0x0A02,
  224. i40e_aqc_opc_lldp_update_tlv = 0x0A03,
  225. i40e_aqc_opc_lldp_delete_tlv = 0x0A04,
  226. i40e_aqc_opc_lldp_stop = 0x0A05,
  227. i40e_aqc_opc_lldp_start = 0x0A06,
  228. /* Tunnel commands */
  229. i40e_aqc_opc_add_udp_tunnel = 0x0B00,
  230. i40e_aqc_opc_del_udp_tunnel = 0x0B01,
  231. i40e_aqc_opc_set_rss_key = 0x0B02,
  232. i40e_aqc_opc_set_rss_lut = 0x0B03,
  233. i40e_aqc_opc_get_rss_key = 0x0B04,
  234. i40e_aqc_opc_get_rss_lut = 0x0B05,
  235. /* Async Events */
  236. i40e_aqc_opc_event_lan_overflow = 0x1001,
  237. /* OEM commands */
  238. i40e_aqc_opc_oem_parameter_change = 0xFE00,
  239. i40e_aqc_opc_oem_device_status_change = 0xFE01,
  240. i40e_aqc_opc_oem_ocsd_initialize = 0xFE02,
  241. i40e_aqc_opc_oem_ocbb_initialize = 0xFE03,
  242. /* debug commands */
  243. i40e_aqc_opc_debug_read_reg = 0xFF03,
  244. i40e_aqc_opc_debug_write_reg = 0xFF04,
  245. i40e_aqc_opc_debug_modify_reg = 0xFF07,
  246. i40e_aqc_opc_debug_dump_internals = 0xFF08,
  247. };
  248. /* command structures and indirect data structures */
  249. /* Structure naming conventions:
  250. * - no suffix for direct command descriptor structures
  251. * - _data for indirect sent data
  252. * - _resp for indirect return data (data which is both will use _data)
  253. * - _completion for direct return data
  254. * - _element_ for repeated elements (may also be _data or _resp)
  255. *
  256. * Command structures are expected to overlay the params.raw member of the basic
  257. * descriptor, and as such cannot exceed 16 bytes in length.
  258. */
  259. /* This macro is used to generate a compilation error if a structure
  260. * is not exactly the correct length. It gives a divide by zero error if the
  261. * structure is not of the correct size, otherwise it creates an enum that is
  262. * never used.
  263. */
  264. #define I40E_CHECK_STRUCT_LEN(n, X) enum i40e_static_assert_enum_##X \
  265. { i40e_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
  266. /* This macro is used extensively to ensure that command structures are 16
  267. * bytes in length as they have to map to the raw array of that size.
  268. */
  269. #define I40E_CHECK_CMD_LENGTH(X) I40E_CHECK_STRUCT_LEN(16, X)
  270. /* Queue Shutdown (direct 0x0003) */
  271. struct i40e_aqc_queue_shutdown {
  272. __le32 driver_unloading;
  273. #define I40E_AQ_DRIVER_UNLOADING 0x1
  274. u8 reserved[12];
  275. };
  276. I40E_CHECK_CMD_LENGTH(i40e_aqc_queue_shutdown);
  277. struct i40e_aqc_vsi_properties_data {
  278. /* first 96 byte are written by SW */
  279. __le16 valid_sections;
  280. #define I40E_AQ_VSI_PROP_SWITCH_VALID 0x0001
  281. #define I40E_AQ_VSI_PROP_SECURITY_VALID 0x0002
  282. #define I40E_AQ_VSI_PROP_VLAN_VALID 0x0004
  283. #define I40E_AQ_VSI_PROP_CAS_PV_VALID 0x0008
  284. #define I40E_AQ_VSI_PROP_INGRESS_UP_VALID 0x0010
  285. #define I40E_AQ_VSI_PROP_EGRESS_UP_VALID 0x0020
  286. #define I40E_AQ_VSI_PROP_QUEUE_MAP_VALID 0x0040
  287. #define I40E_AQ_VSI_PROP_QUEUE_OPT_VALID 0x0080
  288. #define I40E_AQ_VSI_PROP_OUTER_UP_VALID 0x0100
  289. #define I40E_AQ_VSI_PROP_SCHED_VALID 0x0200
  290. /* switch section */
  291. __le16 switch_id; /* 12bit id combined with flags below */
  292. #define I40E_AQ_VSI_SW_ID_SHIFT 0x0000
  293. #define I40E_AQ_VSI_SW_ID_MASK (0xFFF << I40E_AQ_VSI_SW_ID_SHIFT)
  294. #define I40E_AQ_VSI_SW_ID_FLAG_NOT_STAG 0x1000
  295. #define I40E_AQ_VSI_SW_ID_FLAG_ALLOW_LB 0x2000
  296. #define I40E_AQ_VSI_SW_ID_FLAG_LOCAL_LB 0x4000
  297. u8 sw_reserved[2];
  298. /* security section */
  299. u8 sec_flags;
  300. #define I40E_AQ_VSI_SEC_FLAG_ALLOW_DEST_OVRD 0x01
  301. #define I40E_AQ_VSI_SEC_FLAG_ENABLE_VLAN_CHK 0x02
  302. #define I40E_AQ_VSI_SEC_FLAG_ENABLE_MAC_CHK 0x04
  303. u8 sec_reserved;
  304. /* VLAN section */
  305. __le16 pvid; /* VLANS include priority bits */
  306. __le16 fcoe_pvid;
  307. u8 port_vlan_flags;
  308. #define I40E_AQ_VSI_PVLAN_MODE_SHIFT 0x00
  309. #define I40E_AQ_VSI_PVLAN_MODE_MASK (0x03 << \
  310. I40E_AQ_VSI_PVLAN_MODE_SHIFT)
  311. #define I40E_AQ_VSI_PVLAN_MODE_TAGGED 0x01
  312. #define I40E_AQ_VSI_PVLAN_MODE_UNTAGGED 0x02
  313. #define I40E_AQ_VSI_PVLAN_MODE_ALL 0x03
  314. #define I40E_AQ_VSI_PVLAN_INSERT_PVID 0x04
  315. #define I40E_AQ_VSI_PVLAN_EMOD_SHIFT 0x03
  316. #define I40E_AQ_VSI_PVLAN_EMOD_MASK (0x3 << \
  317. I40E_AQ_VSI_PVLAN_EMOD_SHIFT)
  318. #define I40E_AQ_VSI_PVLAN_EMOD_STR_BOTH 0x0
  319. #define I40E_AQ_VSI_PVLAN_EMOD_STR_UP 0x08
  320. #define I40E_AQ_VSI_PVLAN_EMOD_STR 0x10
  321. #define I40E_AQ_VSI_PVLAN_EMOD_NOTHING 0x18
  322. u8 pvlan_reserved[3];
  323. /* ingress egress up sections */
  324. __le32 ingress_table; /* bitmap, 3 bits per up */
  325. #define I40E_AQ_VSI_UP_TABLE_UP0_SHIFT 0
  326. #define I40E_AQ_VSI_UP_TABLE_UP0_MASK (0x7 << \
  327. I40E_AQ_VSI_UP_TABLE_UP0_SHIFT)
  328. #define I40E_AQ_VSI_UP_TABLE_UP1_SHIFT 3
  329. #define I40E_AQ_VSI_UP_TABLE_UP1_MASK (0x7 << \
  330. I40E_AQ_VSI_UP_TABLE_UP1_SHIFT)
  331. #define I40E_AQ_VSI_UP_TABLE_UP2_SHIFT 6
  332. #define I40E_AQ_VSI_UP_TABLE_UP2_MASK (0x7 << \
  333. I40E_AQ_VSI_UP_TABLE_UP2_SHIFT)
  334. #define I40E_AQ_VSI_UP_TABLE_UP3_SHIFT 9
  335. #define I40E_AQ_VSI_UP_TABLE_UP3_MASK (0x7 << \
  336. I40E_AQ_VSI_UP_TABLE_UP3_SHIFT)
  337. #define I40E_AQ_VSI_UP_TABLE_UP4_SHIFT 12
  338. #define I40E_AQ_VSI_UP_TABLE_UP4_MASK (0x7 << \
  339. I40E_AQ_VSI_UP_TABLE_UP4_SHIFT)
  340. #define I40E_AQ_VSI_UP_TABLE_UP5_SHIFT 15
  341. #define I40E_AQ_VSI_UP_TABLE_UP5_MASK (0x7 << \
  342. I40E_AQ_VSI_UP_TABLE_UP5_SHIFT)
  343. #define I40E_AQ_VSI_UP_TABLE_UP6_SHIFT 18
  344. #define I40E_AQ_VSI_UP_TABLE_UP6_MASK (0x7 << \
  345. I40E_AQ_VSI_UP_TABLE_UP6_SHIFT)
  346. #define I40E_AQ_VSI_UP_TABLE_UP7_SHIFT 21
  347. #define I40E_AQ_VSI_UP_TABLE_UP7_MASK (0x7 << \
  348. I40E_AQ_VSI_UP_TABLE_UP7_SHIFT)
  349. __le32 egress_table; /* same defines as for ingress table */
  350. /* cascaded PV section */
  351. __le16 cas_pv_tag;
  352. u8 cas_pv_flags;
  353. #define I40E_AQ_VSI_CAS_PV_TAGX_SHIFT 0x00
  354. #define I40E_AQ_VSI_CAS_PV_TAGX_MASK (0x03 << \
  355. I40E_AQ_VSI_CAS_PV_TAGX_SHIFT)
  356. #define I40E_AQ_VSI_CAS_PV_TAGX_LEAVE 0x00
  357. #define I40E_AQ_VSI_CAS_PV_TAGX_REMOVE 0x01
  358. #define I40E_AQ_VSI_CAS_PV_TAGX_COPY 0x02
  359. #define I40E_AQ_VSI_CAS_PV_INSERT_TAG 0x10
  360. #define I40E_AQ_VSI_CAS_PV_ETAG_PRUNE 0x20
  361. #define I40E_AQ_VSI_CAS_PV_ACCEPT_HOST_TAG 0x40
  362. u8 cas_pv_reserved;
  363. /* queue mapping section */
  364. __le16 mapping_flags;
  365. #define I40E_AQ_VSI_QUE_MAP_CONTIG 0x0
  366. #define I40E_AQ_VSI_QUE_MAP_NONCONTIG 0x1
  367. __le16 queue_mapping[16];
  368. #define I40E_AQ_VSI_QUEUE_SHIFT 0x0
  369. #define I40E_AQ_VSI_QUEUE_MASK (0x7FF << I40E_AQ_VSI_QUEUE_SHIFT)
  370. __le16 tc_mapping[8];
  371. #define I40E_AQ_VSI_TC_QUE_OFFSET_SHIFT 0
  372. #define I40E_AQ_VSI_TC_QUE_OFFSET_MASK (0x1FF << \
  373. I40E_AQ_VSI_TC_QUE_OFFSET_SHIFT)
  374. #define I40E_AQ_VSI_TC_QUE_NUMBER_SHIFT 9
  375. #define I40E_AQ_VSI_TC_QUE_NUMBER_MASK (0x7 << \
  376. I40E_AQ_VSI_TC_QUE_NUMBER_SHIFT)
  377. /* queueing option section */
  378. u8 queueing_opt_flags;
  379. #define I40E_AQ_VSI_QUE_OPT_MULTICAST_UDP_ENA 0x04
  380. #define I40E_AQ_VSI_QUE_OPT_UNICAST_UDP_ENA 0x08
  381. #define I40E_AQ_VSI_QUE_OPT_TCP_ENA 0x10
  382. #define I40E_AQ_VSI_QUE_OPT_FCOE_ENA 0x20
  383. #define I40E_AQ_VSI_QUE_OPT_RSS_LUT_PF 0x00
  384. #define I40E_AQ_VSI_QUE_OPT_RSS_LUT_VSI 0x40
  385. u8 queueing_opt_reserved[3];
  386. /* scheduler section */
  387. u8 up_enable_bits;
  388. u8 sched_reserved;
  389. /* outer up section */
  390. __le32 outer_up_table; /* same structure and defines as ingress tbl */
  391. u8 cmd_reserved[8];
  392. /* last 32 bytes are written by FW */
  393. __le16 qs_handle[8];
  394. #define I40E_AQ_VSI_QS_HANDLE_INVALID 0xFFFF
  395. __le16 stat_counter_idx;
  396. __le16 sched_id;
  397. u8 resp_reserved[12];
  398. };
  399. I40E_CHECK_STRUCT_LEN(128, i40e_aqc_vsi_properties_data);
  400. /* Get VEB Parameters (direct 0x0232)
  401. * uses i40e_aqc_switch_seid for the descriptor
  402. */
  403. struct i40e_aqc_get_veb_parameters_completion {
  404. __le16 seid;
  405. __le16 switch_id;
  406. __le16 veb_flags; /* only the first/last flags from 0x0230 is valid */
  407. __le16 statistic_index;
  408. __le16 vebs_used;
  409. __le16 vebs_free;
  410. u8 reserved[4];
  411. };
  412. I40E_CHECK_CMD_LENGTH(i40e_aqc_get_veb_parameters_completion);
  413. #define I40E_LINK_SPEED_100MB_SHIFT 0x1
  414. #define I40E_LINK_SPEED_1000MB_SHIFT 0x2
  415. #define I40E_LINK_SPEED_10GB_SHIFT 0x3
  416. #define I40E_LINK_SPEED_40GB_SHIFT 0x4
  417. #define I40E_LINK_SPEED_20GB_SHIFT 0x5
  418. #define I40E_LINK_SPEED_25GB_SHIFT 0x6
  419. enum i40e_aq_link_speed {
  420. I40E_LINK_SPEED_UNKNOWN = 0,
  421. I40E_LINK_SPEED_100MB = BIT(I40E_LINK_SPEED_100MB_SHIFT),
  422. I40E_LINK_SPEED_1GB = BIT(I40E_LINK_SPEED_1000MB_SHIFT),
  423. I40E_LINK_SPEED_10GB = BIT(I40E_LINK_SPEED_10GB_SHIFT),
  424. I40E_LINK_SPEED_40GB = BIT(I40E_LINK_SPEED_40GB_SHIFT),
  425. I40E_LINK_SPEED_20GB = BIT(I40E_LINK_SPEED_20GB_SHIFT),
  426. I40E_LINK_SPEED_25GB = BIT(I40E_LINK_SPEED_25GB_SHIFT),
  427. };
  428. /* Send to PF command (indirect 0x0801) id is only used by PF
  429. * Send to VF command (indirect 0x0802) id is only used by PF
  430. * Send to Peer PF command (indirect 0x0803)
  431. */
  432. struct i40e_aqc_pf_vf_message {
  433. __le32 id;
  434. u8 reserved[4];
  435. __le32 addr_high;
  436. __le32 addr_low;
  437. };
  438. I40E_CHECK_CMD_LENGTH(i40e_aqc_pf_vf_message);
  439. struct i40e_aqc_get_set_rss_key {
  440. #define I40E_AQC_SET_RSS_KEY_VSI_VALID BIT(15)
  441. #define I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT 0
  442. #define I40E_AQC_SET_RSS_KEY_VSI_ID_MASK (0x3FF << \
  443. I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT)
  444. __le16 vsi_id;
  445. u8 reserved[6];
  446. __le32 addr_high;
  447. __le32 addr_low;
  448. };
  449. I40E_CHECK_CMD_LENGTH(i40e_aqc_get_set_rss_key);
  450. struct i40e_aqc_get_set_rss_key_data {
  451. u8 standard_rss_key[0x28];
  452. u8 extended_hash_key[0xc];
  453. };
  454. I40E_CHECK_STRUCT_LEN(0x34, i40e_aqc_get_set_rss_key_data);
  455. struct i40e_aqc_get_set_rss_lut {
  456. #define I40E_AQC_SET_RSS_LUT_VSI_VALID BIT(15)
  457. #define I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT 0
  458. #define I40E_AQC_SET_RSS_LUT_VSI_ID_MASK (0x3FF << \
  459. I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT)
  460. __le16 vsi_id;
  461. #define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT 0
  462. #define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_MASK \
  463. BIT(I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT)
  464. #define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_VSI 0
  465. #define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_PF 1
  466. __le16 flags;
  467. u8 reserved[4];
  468. __le32 addr_high;
  469. __le32 addr_low;
  470. };
  471. I40E_CHECK_CMD_LENGTH(i40e_aqc_get_set_rss_lut);
  472. #endif /* _I40E_ADMINQ_CMD_H_ */