ice_adminq_cmd.h 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* Copyright (c) 2018, Intel Corporation. */
  3. #ifndef _ICE_ADMINQ_CMD_H_
  4. #define _ICE_ADMINQ_CMD_H_
  5. /* This header file defines the Admin Queue commands, error codes and
  6. * descriptor format. It is shared between Firmware and Software.
  7. */
  8. #define ICE_MAX_VSI 768
  9. #define ICE_AQC_TOPO_MAX_LEVEL_NUM 0x9
  10. #define ICE_AQ_SET_MAC_FRAME_SIZE_MAX 9728
  11. struct ice_aqc_generic {
  12. __le32 param0;
  13. __le32 param1;
  14. __le32 addr_high;
  15. __le32 addr_low;
  16. };
  17. /* Get version (direct 0x0001) */
  18. struct ice_aqc_get_ver {
  19. __le32 rom_ver;
  20. __le32 fw_build;
  21. u8 fw_branch;
  22. u8 fw_major;
  23. u8 fw_minor;
  24. u8 fw_patch;
  25. u8 api_branch;
  26. u8 api_major;
  27. u8 api_minor;
  28. u8 api_patch;
  29. };
  30. /* Queue Shutdown (direct 0x0003) */
  31. struct ice_aqc_q_shutdown {
  32. #define ICE_AQC_DRIVER_UNLOADING BIT(0)
  33. __le32 driver_unloading;
  34. u8 reserved[12];
  35. };
  36. /* Request resource ownership (direct 0x0008)
  37. * Release resource ownership (direct 0x0009)
  38. */
  39. struct ice_aqc_req_res {
  40. __le16 res_id;
  41. #define ICE_AQC_RES_ID_NVM 1
  42. #define ICE_AQC_RES_ID_SDP 2
  43. #define ICE_AQC_RES_ID_CHNG_LOCK 3
  44. #define ICE_AQC_RES_ID_GLBL_LOCK 4
  45. __le16 access_type;
  46. #define ICE_AQC_RES_ACCESS_READ 1
  47. #define ICE_AQC_RES_ACCESS_WRITE 2
  48. /* Upon successful completion, FW writes this value and driver is
  49. * expected to release resource before timeout. This value is provided
  50. * in milliseconds.
  51. */
  52. __le32 timeout;
  53. #define ICE_AQ_RES_NVM_READ_DFLT_TIMEOUT_MS 3000
  54. #define ICE_AQ_RES_NVM_WRITE_DFLT_TIMEOUT_MS 180000
  55. #define ICE_AQ_RES_CHNG_LOCK_DFLT_TIMEOUT_MS 1000
  56. #define ICE_AQ_RES_GLBL_LOCK_DFLT_TIMEOUT_MS 3000
  57. /* For SDP: pin id of the SDP */
  58. __le32 res_number;
  59. /* Status is only used for ICE_AQC_RES_ID_GLBL_LOCK */
  60. __le16 status;
  61. #define ICE_AQ_RES_GLBL_SUCCESS 0
  62. #define ICE_AQ_RES_GLBL_IN_PROG 1
  63. #define ICE_AQ_RES_GLBL_DONE 2
  64. u8 reserved[2];
  65. };
  66. /* Get function capabilities (indirect 0x000A)
  67. * Get device capabilities (indirect 0x000B)
  68. */
  69. struct ice_aqc_list_caps {
  70. u8 cmd_flags;
  71. u8 pf_index;
  72. u8 reserved[2];
  73. __le32 count;
  74. __le32 addr_high;
  75. __le32 addr_low;
  76. };
  77. /* Device/Function buffer entry, repeated per reported capability */
  78. struct ice_aqc_list_caps_elem {
  79. __le16 cap;
  80. #define ICE_AQC_CAPS_VSI 0x0017
  81. #define ICE_AQC_CAPS_RSS 0x0040
  82. #define ICE_AQC_CAPS_RXQS 0x0041
  83. #define ICE_AQC_CAPS_TXQS 0x0042
  84. #define ICE_AQC_CAPS_MSIX 0x0043
  85. #define ICE_AQC_CAPS_MAX_MTU 0x0047
  86. u8 major_ver;
  87. u8 minor_ver;
  88. /* Number of resources described by this capability */
  89. __le32 number;
  90. /* Only meaningful for some types of resources */
  91. __le32 logical_id;
  92. /* Only meaningful for some types of resources */
  93. __le32 phys_id;
  94. __le64 rsvd1;
  95. __le64 rsvd2;
  96. };
  97. /* Manage MAC address, read command - indirect (0x0107)
  98. * This struct is also used for the response
  99. */
  100. struct ice_aqc_manage_mac_read {
  101. __le16 flags; /* Zeroed by device driver */
  102. #define ICE_AQC_MAN_MAC_LAN_ADDR_VALID BIT(4)
  103. #define ICE_AQC_MAN_MAC_SAN_ADDR_VALID BIT(5)
  104. #define ICE_AQC_MAN_MAC_PORT_ADDR_VALID BIT(6)
  105. #define ICE_AQC_MAN_MAC_WOL_ADDR_VALID BIT(7)
  106. #define ICE_AQC_MAN_MAC_READ_S 4
  107. #define ICE_AQC_MAN_MAC_READ_M (0xF << ICE_AQC_MAN_MAC_READ_S)
  108. u8 lport_num;
  109. u8 lport_num_valid;
  110. #define ICE_AQC_MAN_MAC_PORT_NUM_IS_VALID BIT(0)
  111. u8 num_addr; /* Used in response */
  112. u8 reserved[3];
  113. __le32 addr_high;
  114. __le32 addr_low;
  115. };
  116. /* Response buffer format for manage MAC read command */
  117. struct ice_aqc_manage_mac_read_resp {
  118. u8 lport_num;
  119. u8 addr_type;
  120. #define ICE_AQC_MAN_MAC_ADDR_TYPE_LAN 0
  121. #define ICE_AQC_MAN_MAC_ADDR_TYPE_WOL 1
  122. u8 mac_addr[ETH_ALEN];
  123. };
  124. /* Clear PXE Command and response (direct 0x0110) */
  125. struct ice_aqc_clear_pxe {
  126. u8 rx_cnt;
  127. #define ICE_AQC_CLEAR_PXE_RX_CNT 0x2
  128. u8 reserved[15];
  129. };
  130. /* Get switch configuration (0x0200) */
  131. struct ice_aqc_get_sw_cfg {
  132. /* Reserved for command and copy of request flags for response */
  133. __le16 flags;
  134. /* First desc in case of command and next_elem in case of response
  135. * In case of response, if it is not zero, means all the configuration
  136. * was not returned and new command shall be sent with this value in
  137. * the 'first desc' field
  138. */
  139. __le16 element;
  140. /* Reserved for command, only used for response */
  141. __le16 num_elems;
  142. __le16 rsvd;
  143. __le32 addr_high;
  144. __le32 addr_low;
  145. };
  146. /* Each entry in the response buffer is of the following type: */
  147. struct ice_aqc_get_sw_cfg_resp_elem {
  148. /* VSI/Port Number */
  149. __le16 vsi_port_num;
  150. #define ICE_AQC_GET_SW_CONF_RESP_VSI_PORT_NUM_S 0
  151. #define ICE_AQC_GET_SW_CONF_RESP_VSI_PORT_NUM_M \
  152. (0x3FF << ICE_AQC_GET_SW_CONF_RESP_VSI_PORT_NUM_S)
  153. #define ICE_AQC_GET_SW_CONF_RESP_TYPE_S 14
  154. #define ICE_AQC_GET_SW_CONF_RESP_TYPE_M (0x3 << ICE_AQC_GET_SW_CONF_RESP_TYPE_S)
  155. #define ICE_AQC_GET_SW_CONF_RESP_PHYS_PORT 0
  156. #define ICE_AQC_GET_SW_CONF_RESP_VIRT_PORT 1
  157. #define ICE_AQC_GET_SW_CONF_RESP_VSI 2
  158. /* SWID VSI/Port belongs to */
  159. __le16 swid;
  160. /* Bit 14..0 : PF/VF number VSI belongs to
  161. * Bit 15 : VF indication bit
  162. */
  163. __le16 pf_vf_num;
  164. #define ICE_AQC_GET_SW_CONF_RESP_FUNC_NUM_S 0
  165. #define ICE_AQC_GET_SW_CONF_RESP_FUNC_NUM_M \
  166. (0x7FFF << ICE_AQC_GET_SW_CONF_RESP_FUNC_NUM_S)
  167. #define ICE_AQC_GET_SW_CONF_RESP_IS_VF BIT(15)
  168. };
  169. /* The response buffer is as follows. Note that the length of the
  170. * elements array varies with the length of the command response.
  171. */
  172. struct ice_aqc_get_sw_cfg_resp {
  173. struct ice_aqc_get_sw_cfg_resp_elem elements[1];
  174. };
  175. /* These resource type defines are used for all switch resource
  176. * commands where a resource type is required, such as:
  177. * Get Resource Allocation command (indirect 0x0204)
  178. * Allocate Resources command (indirect 0x0208)
  179. * Free Resources command (indirect 0x0209)
  180. * Get Allocated Resource Descriptors Command (indirect 0x020A)
  181. */
  182. #define ICE_AQC_RES_TYPE_VSI_LIST_REP 0x03
  183. #define ICE_AQC_RES_TYPE_VSI_LIST_PRUNE 0x04
  184. /* Allocate Resources command (indirect 0x0208)
  185. * Free Resources command (indirect 0x0209)
  186. */
  187. struct ice_aqc_alloc_free_res_cmd {
  188. __le16 num_entries; /* Number of Resource entries */
  189. u8 reserved[6];
  190. __le32 addr_high;
  191. __le32 addr_low;
  192. };
  193. /* Resource descriptor */
  194. struct ice_aqc_res_elem {
  195. union {
  196. __le16 sw_resp;
  197. __le16 flu_resp;
  198. } e;
  199. };
  200. /* Buffer for Allocate/Free Resources commands */
  201. struct ice_aqc_alloc_free_res_elem {
  202. __le16 res_type; /* Types defined above cmd 0x0204 */
  203. #define ICE_AQC_RES_TYPE_SHARED_S 7
  204. #define ICE_AQC_RES_TYPE_SHARED_M (0x1 << ICE_AQC_RES_TYPE_SHARED_S)
  205. #define ICE_AQC_RES_TYPE_VSI_PRUNE_LIST_S 8
  206. #define ICE_AQC_RES_TYPE_VSI_PRUNE_LIST_M \
  207. (0xF << ICE_AQC_RES_TYPE_VSI_PRUNE_LIST_S)
  208. __le16 num_elems;
  209. struct ice_aqc_res_elem elem[1];
  210. };
  211. /* Add VSI (indirect 0x0210)
  212. * Update VSI (indirect 0x0211)
  213. * Get VSI (indirect 0x0212)
  214. * Free VSI (indirect 0x0213)
  215. */
  216. struct ice_aqc_add_get_update_free_vsi {
  217. __le16 vsi_num;
  218. #define ICE_AQ_VSI_NUM_S 0
  219. #define ICE_AQ_VSI_NUM_M (0x03FF << ICE_AQ_VSI_NUM_S)
  220. #define ICE_AQ_VSI_IS_VALID BIT(15)
  221. __le16 cmd_flags;
  222. #define ICE_AQ_VSI_KEEP_ALLOC 0x1
  223. u8 vf_id;
  224. u8 reserved;
  225. __le16 vsi_flags;
  226. #define ICE_AQ_VSI_TYPE_S 0
  227. #define ICE_AQ_VSI_TYPE_M (0x3 << ICE_AQ_VSI_TYPE_S)
  228. #define ICE_AQ_VSI_TYPE_VF 0x0
  229. #define ICE_AQ_VSI_TYPE_VMDQ2 0x1
  230. #define ICE_AQ_VSI_TYPE_PF 0x2
  231. #define ICE_AQ_VSI_TYPE_EMP_MNG 0x3
  232. __le32 addr_high;
  233. __le32 addr_low;
  234. };
  235. /* Response descriptor for:
  236. * Add VSI (indirect 0x0210)
  237. * Update VSI (indirect 0x0211)
  238. * Free VSI (indirect 0x0213)
  239. */
  240. struct ice_aqc_add_update_free_vsi_resp {
  241. __le16 vsi_num;
  242. __le16 ext_status;
  243. __le16 vsi_used;
  244. __le16 vsi_free;
  245. __le32 addr_high;
  246. __le32 addr_low;
  247. };
  248. struct ice_aqc_vsi_props {
  249. __le16 valid_sections;
  250. #define ICE_AQ_VSI_PROP_SW_VALID BIT(0)
  251. #define ICE_AQ_VSI_PROP_SECURITY_VALID BIT(1)
  252. #define ICE_AQ_VSI_PROP_VLAN_VALID BIT(2)
  253. #define ICE_AQ_VSI_PROP_OUTER_TAG_VALID BIT(3)
  254. #define ICE_AQ_VSI_PROP_INGRESS_UP_VALID BIT(4)
  255. #define ICE_AQ_VSI_PROP_EGRESS_UP_VALID BIT(5)
  256. #define ICE_AQ_VSI_PROP_RXQ_MAP_VALID BIT(6)
  257. #define ICE_AQ_VSI_PROP_Q_OPT_VALID BIT(7)
  258. #define ICE_AQ_VSI_PROP_OUTER_UP_VALID BIT(8)
  259. #define ICE_AQ_VSI_PROP_FLOW_DIR_VALID BIT(11)
  260. #define ICE_AQ_VSI_PROP_PASID_VALID BIT(12)
  261. /* switch section */
  262. u8 sw_id;
  263. u8 sw_flags;
  264. #define ICE_AQ_VSI_SW_FLAG_ALLOW_LB BIT(5)
  265. #define ICE_AQ_VSI_SW_FLAG_LOCAL_LB BIT(6)
  266. #define ICE_AQ_VSI_SW_FLAG_SRC_PRUNE BIT(7)
  267. u8 sw_flags2;
  268. #define ICE_AQ_VSI_SW_FLAG_RX_PRUNE_EN_S 0
  269. #define ICE_AQ_VSI_SW_FLAG_RX_PRUNE_EN_M \
  270. (0xF << ICE_AQ_VSI_SW_FLAG_RX_PRUNE_EN_S)
  271. #define ICE_AQ_VSI_SW_FLAG_RX_VLAN_PRUNE_ENA BIT(0)
  272. #define ICE_AQ_VSI_SW_FLAG_LAN_ENA BIT(4)
  273. u8 veb_stat_id;
  274. #define ICE_AQ_VSI_SW_VEB_STAT_ID_S 0
  275. #define ICE_AQ_VSI_SW_VEB_STAT_ID_M (0x1F << ICE_AQ_VSI_SW_VEB_STAT_ID_S)
  276. #define ICE_AQ_VSI_SW_VEB_STAT_ID_VALID BIT(5)
  277. /* security section */
  278. u8 sec_flags;
  279. #define ICE_AQ_VSI_SEC_FLAG_ALLOW_DEST_OVRD BIT(0)
  280. #define ICE_AQ_VSI_SEC_FLAG_ENA_MAC_ANTI_SPOOF BIT(2)
  281. #define ICE_AQ_VSI_SEC_TX_PRUNE_ENA_S 4
  282. #define ICE_AQ_VSI_SEC_TX_PRUNE_ENA_M (0xF << ICE_AQ_VSI_SEC_TX_PRUNE_ENA_S)
  283. #define ICE_AQ_VSI_SEC_TX_VLAN_PRUNE_ENA BIT(0)
  284. u8 sec_reserved;
  285. /* VLAN section */
  286. __le16 pvid; /* VLANS include priority bits */
  287. u8 pvlan_reserved[2];
  288. u8 port_vlan_flags;
  289. #define ICE_AQ_VSI_PVLAN_MODE_S 0
  290. #define ICE_AQ_VSI_PVLAN_MODE_M (0x3 << ICE_AQ_VSI_PVLAN_MODE_S)
  291. #define ICE_AQ_VSI_PVLAN_MODE_UNTAGGED 0x1
  292. #define ICE_AQ_VSI_PVLAN_MODE_TAGGED 0x2
  293. #define ICE_AQ_VSI_PVLAN_MODE_ALL 0x3
  294. #define ICE_AQ_VSI_PVLAN_INSERT_PVID BIT(2)
  295. #define ICE_AQ_VSI_PVLAN_EMOD_S 3
  296. #define ICE_AQ_VSI_PVLAN_EMOD_M (0x3 << ICE_AQ_VSI_PVLAN_EMOD_S)
  297. #define ICE_AQ_VSI_PVLAN_EMOD_STR_BOTH (0x0 << ICE_AQ_VSI_PVLAN_EMOD_S)
  298. #define ICE_AQ_VSI_PVLAN_EMOD_STR_UP (0x1 << ICE_AQ_VSI_PVLAN_EMOD_S)
  299. #define ICE_AQ_VSI_PVLAN_EMOD_STR (0x2 << ICE_AQ_VSI_PVLAN_EMOD_S)
  300. #define ICE_AQ_VSI_PVLAN_EMOD_NOTHING (0x3 << ICE_AQ_VSI_PVLAN_EMOD_S)
  301. u8 pvlan_reserved2[3];
  302. /* ingress egress up sections */
  303. __le32 ingress_table; /* bitmap, 3 bits per up */
  304. #define ICE_AQ_VSI_UP_TABLE_UP0_S 0
  305. #define ICE_AQ_VSI_UP_TABLE_UP0_M (0x7 << ICE_AQ_VSI_UP_TABLE_UP0_S)
  306. #define ICE_AQ_VSI_UP_TABLE_UP1_S 3
  307. #define ICE_AQ_VSI_UP_TABLE_UP1_M (0x7 << ICE_AQ_VSI_UP_TABLE_UP1_S)
  308. #define ICE_AQ_VSI_UP_TABLE_UP2_S 6
  309. #define ICE_AQ_VSI_UP_TABLE_UP2_M (0x7 << ICE_AQ_VSI_UP_TABLE_UP2_S)
  310. #define ICE_AQ_VSI_UP_TABLE_UP3_S 9
  311. #define ICE_AQ_VSI_UP_TABLE_UP3_M (0x7 << ICE_AQ_VSI_UP_TABLE_UP3_S)
  312. #define ICE_AQ_VSI_UP_TABLE_UP4_S 12
  313. #define ICE_AQ_VSI_UP_TABLE_UP4_M (0x7 << ICE_AQ_VSI_UP_TABLE_UP4_S)
  314. #define ICE_AQ_VSI_UP_TABLE_UP5_S 15
  315. #define ICE_AQ_VSI_UP_TABLE_UP5_M (0x7 << ICE_AQ_VSI_UP_TABLE_UP5_S)
  316. #define ICE_AQ_VSI_UP_TABLE_UP6_S 18
  317. #define ICE_AQ_VSI_UP_TABLE_UP6_M (0x7 << ICE_AQ_VSI_UP_TABLE_UP6_S)
  318. #define ICE_AQ_VSI_UP_TABLE_UP7_S 21
  319. #define ICE_AQ_VSI_UP_TABLE_UP7_M (0x7 << ICE_AQ_VSI_UP_TABLE_UP7_S)
  320. __le32 egress_table; /* same defines as for ingress table */
  321. /* outer tags section */
  322. __le16 outer_tag;
  323. u8 outer_tag_flags;
  324. #define ICE_AQ_VSI_OUTER_TAG_MODE_S 0
  325. #define ICE_AQ_VSI_OUTER_TAG_MODE_M (0x3 << ICE_AQ_VSI_OUTER_TAG_MODE_S)
  326. #define ICE_AQ_VSI_OUTER_TAG_NOTHING 0x0
  327. #define ICE_AQ_VSI_OUTER_TAG_REMOVE 0x1
  328. #define ICE_AQ_VSI_OUTER_TAG_COPY 0x2
  329. #define ICE_AQ_VSI_OUTER_TAG_TYPE_S 2
  330. #define ICE_AQ_VSI_OUTER_TAG_TYPE_M (0x3 << ICE_AQ_VSI_OUTER_TAG_TYPE_S)
  331. #define ICE_AQ_VSI_OUTER_TAG_NONE 0x0
  332. #define ICE_AQ_VSI_OUTER_TAG_STAG 0x1
  333. #define ICE_AQ_VSI_OUTER_TAG_VLAN_8100 0x2
  334. #define ICE_AQ_VSI_OUTER_TAG_VLAN_9100 0x3
  335. #define ICE_AQ_VSI_OUTER_TAG_INSERT BIT(4)
  336. #define ICE_AQ_VSI_OUTER_TAG_ACCEPT_HOST BIT(6)
  337. u8 outer_tag_reserved;
  338. /* queue mapping section */
  339. __le16 mapping_flags;
  340. #define ICE_AQ_VSI_Q_MAP_CONTIG 0x0
  341. #define ICE_AQ_VSI_Q_MAP_NONCONTIG BIT(0)
  342. __le16 q_mapping[16];
  343. #define ICE_AQ_VSI_Q_S 0
  344. #define ICE_AQ_VSI_Q_M (0x7FF << ICE_AQ_VSI_Q_S)
  345. __le16 tc_mapping[8];
  346. #define ICE_AQ_VSI_TC_Q_OFFSET_S 0
  347. #define ICE_AQ_VSI_TC_Q_OFFSET_M (0x7FF << ICE_AQ_VSI_TC_Q_OFFSET_S)
  348. #define ICE_AQ_VSI_TC_Q_NUM_S 11
  349. #define ICE_AQ_VSI_TC_Q_NUM_M (0xF << ICE_AQ_VSI_TC_Q_NUM_S)
  350. /* queueing option section */
  351. u8 q_opt_rss;
  352. #define ICE_AQ_VSI_Q_OPT_RSS_LUT_S 0
  353. #define ICE_AQ_VSI_Q_OPT_RSS_LUT_M (0x3 << ICE_AQ_VSI_Q_OPT_RSS_LUT_S)
  354. #define ICE_AQ_VSI_Q_OPT_RSS_LUT_VSI 0x0
  355. #define ICE_AQ_VSI_Q_OPT_RSS_LUT_PF 0x2
  356. #define ICE_AQ_VSI_Q_OPT_RSS_LUT_GBL 0x3
  357. #define ICE_AQ_VSI_Q_OPT_RSS_GBL_LUT_S 2
  358. #define ICE_AQ_VSI_Q_OPT_RSS_GBL_LUT_M (0xF << ICE_AQ_VSI_Q_OPT_RSS_GBL_LUT_S)
  359. #define ICE_AQ_VSI_Q_OPT_RSS_HASH_S 6
  360. #define ICE_AQ_VSI_Q_OPT_RSS_HASH_M (0x3 << ICE_AQ_VSI_Q_OPT_RSS_HASH_S)
  361. #define ICE_AQ_VSI_Q_OPT_RSS_TPLZ (0x0 << ICE_AQ_VSI_Q_OPT_RSS_HASH_S)
  362. #define ICE_AQ_VSI_Q_OPT_RSS_SYM_TPLZ (0x1 << ICE_AQ_VSI_Q_OPT_RSS_HASH_S)
  363. #define ICE_AQ_VSI_Q_OPT_RSS_XOR (0x2 << ICE_AQ_VSI_Q_OPT_RSS_HASH_S)
  364. #define ICE_AQ_VSI_Q_OPT_RSS_JHASH (0x3 << ICE_AQ_VSI_Q_OPT_RSS_HASH_S)
  365. u8 q_opt_tc;
  366. #define ICE_AQ_VSI_Q_OPT_TC_OVR_S 0
  367. #define ICE_AQ_VSI_Q_OPT_TC_OVR_M (0x1F << ICE_AQ_VSI_Q_OPT_TC_OVR_S)
  368. #define ICE_AQ_VSI_Q_OPT_PROF_TC_OVR BIT(7)
  369. u8 q_opt_flags;
  370. #define ICE_AQ_VSI_Q_OPT_PE_FLTR_EN BIT(0)
  371. u8 q_opt_reserved[3];
  372. /* outer up section */
  373. __le32 outer_up_table; /* same structure and defines as ingress tbl */
  374. /* section 10 */
  375. __le16 sect_10_reserved;
  376. /* flow director section */
  377. __le16 fd_options;
  378. #define ICE_AQ_VSI_FD_ENABLE BIT(0)
  379. #define ICE_AQ_VSI_FD_TX_AUTO_ENABLE BIT(1)
  380. #define ICE_AQ_VSI_FD_PROG_ENABLE BIT(3)
  381. __le16 max_fd_fltr_dedicated;
  382. __le16 max_fd_fltr_shared;
  383. __le16 fd_def_q;
  384. #define ICE_AQ_VSI_FD_DEF_Q_S 0
  385. #define ICE_AQ_VSI_FD_DEF_Q_M (0x7FF << ICE_AQ_VSI_FD_DEF_Q_S)
  386. #define ICE_AQ_VSI_FD_DEF_GRP_S 12
  387. #define ICE_AQ_VSI_FD_DEF_GRP_M (0x7 << ICE_AQ_VSI_FD_DEF_GRP_S)
  388. __le16 fd_report_opt;
  389. #define ICE_AQ_VSI_FD_REPORT_Q_S 0
  390. #define ICE_AQ_VSI_FD_REPORT_Q_M (0x7FF << ICE_AQ_VSI_FD_REPORT_Q_S)
  391. #define ICE_AQ_VSI_FD_DEF_PRIORITY_S 12
  392. #define ICE_AQ_VSI_FD_DEF_PRIORITY_M (0x7 << ICE_AQ_VSI_FD_DEF_PRIORITY_S)
  393. #define ICE_AQ_VSI_FD_DEF_DROP BIT(15)
  394. /* PASID section */
  395. __le32 pasid_id;
  396. #define ICE_AQ_VSI_PASID_ID_S 0
  397. #define ICE_AQ_VSI_PASID_ID_M (0xFFFFF << ICE_AQ_VSI_PASID_ID_S)
  398. #define ICE_AQ_VSI_PASID_ID_VALID BIT(31)
  399. u8 reserved[24];
  400. };
  401. /* Add/Update/Remove/Get switch rules (indirect 0x02A0, 0x02A1, 0x02A2, 0x02A3)
  402. */
  403. struct ice_aqc_sw_rules {
  404. /* ops: add switch rules, referring the number of rules.
  405. * ops: update switch rules, referring the number of filters
  406. * ops: remove switch rules, referring the entry index.
  407. * ops: get switch rules, referring to the number of filters.
  408. */
  409. __le16 num_rules_fltr_entry_index;
  410. u8 reserved[6];
  411. __le32 addr_high;
  412. __le32 addr_low;
  413. };
  414. /* Add/Update/Get/Remove lookup Rx/Tx command/response entry
  415. * This structures describes the lookup rules and associated actions. "index"
  416. * is returned as part of a response to a successful Add command, and can be
  417. * used to identify the rule for Update/Get/Remove commands.
  418. */
  419. struct ice_sw_rule_lkup_rx_tx {
  420. __le16 recipe_id;
  421. #define ICE_SW_RECIPE_LOGICAL_PORT_FWD 10
  422. /* Source port for LOOKUP_RX and source VSI in case of LOOKUP_TX */
  423. __le16 src;
  424. __le32 act;
  425. /* Bit 0:1 - Action type */
  426. #define ICE_SINGLE_ACT_TYPE_S 0x00
  427. #define ICE_SINGLE_ACT_TYPE_M (0x3 << ICE_SINGLE_ACT_TYPE_S)
  428. /* Bit 2 - Loop back enable
  429. * Bit 3 - LAN enable
  430. */
  431. #define ICE_SINGLE_ACT_LB_ENABLE BIT(2)
  432. #define ICE_SINGLE_ACT_LAN_ENABLE BIT(3)
  433. /* Action type = 0 - Forward to VSI or VSI list */
  434. #define ICE_SINGLE_ACT_VSI_FORWARDING 0x0
  435. #define ICE_SINGLE_ACT_VSI_ID_S 4
  436. #define ICE_SINGLE_ACT_VSI_ID_M (0x3FF << ICE_SINGLE_ACT_VSI_ID_S)
  437. #define ICE_SINGLE_ACT_VSI_LIST_ID_S 4
  438. #define ICE_SINGLE_ACT_VSI_LIST_ID_M (0x3FF << ICE_SINGLE_ACT_VSI_LIST_ID_S)
  439. /* This bit needs to be set if action is forward to VSI list */
  440. #define ICE_SINGLE_ACT_VSI_LIST BIT(14)
  441. #define ICE_SINGLE_ACT_VALID_BIT BIT(17)
  442. #define ICE_SINGLE_ACT_DROP BIT(18)
  443. /* Action type = 1 - Forward to Queue of Queue group */
  444. #define ICE_SINGLE_ACT_TO_Q 0x1
  445. #define ICE_SINGLE_ACT_Q_INDEX_S 4
  446. #define ICE_SINGLE_ACT_Q_INDEX_M (0x7FF << ICE_SINGLE_ACT_Q_INDEX_S)
  447. #define ICE_SINGLE_ACT_Q_REGION_S 15
  448. #define ICE_SINGLE_ACT_Q_REGION_M (0x7 << ICE_SINGLE_ACT_Q_REGION_S)
  449. #define ICE_SINGLE_ACT_Q_PRIORITY BIT(18)
  450. /* Action type = 2 - Prune */
  451. #define ICE_SINGLE_ACT_PRUNE 0x2
  452. #define ICE_SINGLE_ACT_EGRESS BIT(15)
  453. #define ICE_SINGLE_ACT_INGRESS BIT(16)
  454. #define ICE_SINGLE_ACT_PRUNET BIT(17)
  455. /* Bit 18 should be set to 0 for this action */
  456. /* Action type = 2 - Pointer */
  457. #define ICE_SINGLE_ACT_PTR 0x2
  458. #define ICE_SINGLE_ACT_PTR_VAL_S 4
  459. #define ICE_SINGLE_ACT_PTR_VAL_M (0x1FFF << ICE_SINGLE_ACT_PTR_VAL_S)
  460. /* Bit 18 should be set to 1 */
  461. #define ICE_SINGLE_ACT_PTR_BIT BIT(18)
  462. /* Action type = 3 - Other actions. Last two bits
  463. * are other action identifier
  464. */
  465. #define ICE_SINGLE_ACT_OTHER_ACTS 0x3
  466. #define ICE_SINGLE_OTHER_ACT_IDENTIFIER_S 17
  467. #define ICE_SINGLE_OTHER_ACT_IDENTIFIER_M \
  468. (0x3 << \ ICE_SINGLE_OTHER_ACT_IDENTIFIER_S)
  469. /* Bit 17:18 - Defines other actions */
  470. /* Other action = 0 - Mirror VSI */
  471. #define ICE_SINGLE_OTHER_ACT_MIRROR 0
  472. #define ICE_SINGLE_ACT_MIRROR_VSI_ID_S 4
  473. #define ICE_SINGLE_ACT_MIRROR_VSI_ID_M \
  474. (0x3FF << ICE_SINGLE_ACT_MIRROR_VSI_ID_S)
  475. /* Other action = 3 - Set Stat count */
  476. #define ICE_SINGLE_OTHER_ACT_STAT_COUNT 3
  477. #define ICE_SINGLE_ACT_STAT_COUNT_INDEX_S 4
  478. #define ICE_SINGLE_ACT_STAT_COUNT_INDEX_M \
  479. (0x7F << ICE_SINGLE_ACT_STAT_COUNT_INDEX_S)
  480. __le16 index; /* The index of the rule in the lookup table */
  481. /* Length and values of the header to be matched per recipe or
  482. * lookup-type
  483. */
  484. __le16 hdr_len;
  485. u8 hdr[1];
  486. } __packed;
  487. /* Add/Update/Remove large action command/response entry
  488. * "index" is returned as part of a response to a successful Add command, and
  489. * can be used to identify the action for Update/Get/Remove commands.
  490. */
  491. struct ice_sw_rule_lg_act {
  492. __le16 index; /* Index in large action table */
  493. __le16 size;
  494. __le32 act[1]; /* array of size for actions */
  495. /* Max number of large actions */
  496. #define ICE_MAX_LG_ACT 4
  497. /* Bit 0:1 - Action type */
  498. #define ICE_LG_ACT_TYPE_S 0
  499. #define ICE_LG_ACT_TYPE_M (0x7 << ICE_LG_ACT_TYPE_S)
  500. /* Action type = 0 - Forward to VSI or VSI list */
  501. #define ICE_LG_ACT_VSI_FORWARDING 0
  502. #define ICE_LG_ACT_VSI_ID_S 3
  503. #define ICE_LG_ACT_VSI_ID_M (0x3FF << ICE_LG_ACT_VSI_ID_S)
  504. #define ICE_LG_ACT_VSI_LIST_ID_S 3
  505. #define ICE_LG_ACT_VSI_LIST_ID_M (0x3FF << ICE_LG_ACT_VSI_LIST_ID_S)
  506. /* This bit needs to be set if action is forward to VSI list */
  507. #define ICE_LG_ACT_VSI_LIST BIT(13)
  508. #define ICE_LG_ACT_VALID_BIT BIT(16)
  509. /* Action type = 1 - Forward to Queue of Queue group */
  510. #define ICE_LG_ACT_TO_Q 0x1
  511. #define ICE_LG_ACT_Q_INDEX_S 3
  512. #define ICE_LG_ACT_Q_INDEX_M (0x7FF << ICE_LG_ACT_Q_INDEX_S)
  513. #define ICE_LG_ACT_Q_REGION_S 14
  514. #define ICE_LG_ACT_Q_REGION_M (0x7 << ICE_LG_ACT_Q_REGION_S)
  515. #define ICE_LG_ACT_Q_PRIORITY_SET BIT(17)
  516. /* Action type = 2 - Prune */
  517. #define ICE_LG_ACT_PRUNE 0x2
  518. #define ICE_LG_ACT_EGRESS BIT(14)
  519. #define ICE_LG_ACT_INGRESS BIT(15)
  520. #define ICE_LG_ACT_PRUNET BIT(16)
  521. /* Action type = 3 - Mirror VSI */
  522. #define ICE_LG_OTHER_ACT_MIRROR 0x3
  523. #define ICE_LG_ACT_MIRROR_VSI_ID_S 3
  524. #define ICE_LG_ACT_MIRROR_VSI_ID_M (0x3FF << ICE_LG_ACT_MIRROR_VSI_ID_S)
  525. /* Action type = 5 - Large Action */
  526. #define ICE_LG_ACT_GENERIC 0x5
  527. #define ICE_LG_ACT_GENERIC_VALUE_S 3
  528. #define ICE_LG_ACT_GENERIC_VALUE_M (0xFFFF << ICE_LG_ACT_GENERIC_VALUE_S)
  529. #define ICE_LG_ACT_GENERIC_OFFSET_S 19
  530. #define ICE_LG_ACT_GENERIC_OFFSET_M (0x7 << ICE_LG_ACT_GENERIC_OFFSET_S)
  531. #define ICE_LG_ACT_GENERIC_PRIORITY_S 22
  532. #define ICE_LG_ACT_GENERIC_PRIORITY_M (0x7 << ICE_LG_ACT_GENERIC_PRIORITY_S)
  533. /* Action = 7 - Set Stat count */
  534. #define ICE_LG_ACT_STAT_COUNT 0x7
  535. #define ICE_LG_ACT_STAT_COUNT_S 3
  536. #define ICE_LG_ACT_STAT_COUNT_M (0x7F << ICE_LG_ACT_STAT_COUNT_S)
  537. };
  538. /* Add/Update/Remove VSI list command/response entry
  539. * "index" is returned as part of a response to a successful Add command, and
  540. * can be used to identify the VSI list for Update/Get/Remove commands.
  541. */
  542. struct ice_sw_rule_vsi_list {
  543. __le16 index; /* Index of VSI/Prune list */
  544. __le16 number_vsi;
  545. __le16 vsi[1]; /* Array of number_vsi VSI numbers */
  546. };
  547. /* Query VSI list command/response entry */
  548. struct ice_sw_rule_vsi_list_query {
  549. __le16 index;
  550. DECLARE_BITMAP(vsi_list, ICE_MAX_VSI);
  551. } __packed;
  552. /* Add switch rule response:
  553. * Content of return buffer is same as the input buffer. The status field and
  554. * LUT index are updated as part of the response
  555. */
  556. struct ice_aqc_sw_rules_elem {
  557. __le16 type; /* Switch rule type, one of T_... */
  558. #define ICE_AQC_SW_RULES_T_LKUP_RX 0x0
  559. #define ICE_AQC_SW_RULES_T_LKUP_TX 0x1
  560. #define ICE_AQC_SW_RULES_T_LG_ACT 0x2
  561. #define ICE_AQC_SW_RULES_T_VSI_LIST_SET 0x3
  562. #define ICE_AQC_SW_RULES_T_VSI_LIST_CLEAR 0x4
  563. #define ICE_AQC_SW_RULES_T_PRUNE_LIST_SET 0x5
  564. #define ICE_AQC_SW_RULES_T_PRUNE_LIST_CLEAR 0x6
  565. __le16 status;
  566. union {
  567. struct ice_sw_rule_lkup_rx_tx lkup_tx_rx;
  568. struct ice_sw_rule_lg_act lg_act;
  569. struct ice_sw_rule_vsi_list vsi_list;
  570. struct ice_sw_rule_vsi_list_query vsi_list_query;
  571. } __packed pdata;
  572. };
  573. /* Get Default Topology (indirect 0x0400) */
  574. struct ice_aqc_get_topo {
  575. u8 port_num;
  576. u8 num_branches;
  577. __le16 reserved1;
  578. __le32 reserved2;
  579. __le32 addr_high;
  580. __le32 addr_low;
  581. };
  582. /* Update TSE (indirect 0x0403)
  583. * Get TSE (indirect 0x0404)
  584. */
  585. struct ice_aqc_get_cfg_elem {
  586. __le16 num_elem_req; /* Used by commands */
  587. __le16 num_elem_resp; /* Used by responses */
  588. __le32 reserved;
  589. __le32 addr_high;
  590. __le32 addr_low;
  591. };
  592. /* This is the buffer for:
  593. * Suspend Nodes (indirect 0x0409)
  594. * Resume Nodes (indirect 0x040A)
  595. */
  596. struct ice_aqc_suspend_resume_elem {
  597. __le32 teid[1];
  598. };
  599. /* Add TSE (indirect 0x0401)
  600. * Delete TSE (indirect 0x040F)
  601. * Move TSE (indirect 0x0408)
  602. */
  603. struct ice_aqc_add_move_delete_elem {
  604. __le16 num_grps_req;
  605. __le16 num_grps_updated;
  606. __le32 reserved;
  607. __le32 addr_high;
  608. __le32 addr_low;
  609. };
  610. struct ice_aqc_elem_info_bw {
  611. __le16 bw_profile_idx;
  612. __le16 bw_alloc;
  613. };
  614. struct ice_aqc_txsched_elem {
  615. u8 elem_type; /* Special field, reserved for some aq calls */
  616. #define ICE_AQC_ELEM_TYPE_UNDEFINED 0x0
  617. #define ICE_AQC_ELEM_TYPE_ROOT_PORT 0x1
  618. #define ICE_AQC_ELEM_TYPE_TC 0x2
  619. #define ICE_AQC_ELEM_TYPE_SE_GENERIC 0x3
  620. #define ICE_AQC_ELEM_TYPE_ENTRY_POINT 0x4
  621. #define ICE_AQC_ELEM_TYPE_LEAF 0x5
  622. #define ICE_AQC_ELEM_TYPE_SE_PADDED 0x6
  623. u8 valid_sections;
  624. #define ICE_AQC_ELEM_VALID_GENERIC BIT(0)
  625. #define ICE_AQC_ELEM_VALID_CIR BIT(1)
  626. #define ICE_AQC_ELEM_VALID_EIR BIT(2)
  627. #define ICE_AQC_ELEM_VALID_SHARED BIT(3)
  628. u8 generic;
  629. #define ICE_AQC_ELEM_GENERIC_MODE_M 0x1
  630. #define ICE_AQC_ELEM_GENERIC_PRIO_S 0x1
  631. #define ICE_AQC_ELEM_GENERIC_PRIO_M (0x7 << ICE_AQC_ELEM_GENERIC_PRIO_S)
  632. #define ICE_AQC_ELEM_GENERIC_SP_S 0x4
  633. #define ICE_AQC_ELEM_GENERIC_SP_M (0x1 << ICE_AQC_ELEM_GENERIC_SP_S)
  634. #define ICE_AQC_ELEM_GENERIC_ADJUST_VAL_S 0x5
  635. #define ICE_AQC_ELEM_GENERIC_ADJUST_VAL_M \
  636. (0x3 << ICE_AQC_ELEM_GENERIC_ADJUST_VAL_S)
  637. u8 flags; /* Special field, reserved for some aq calls */
  638. #define ICE_AQC_ELEM_FLAG_SUSPEND_M 0x1
  639. struct ice_aqc_elem_info_bw cir_bw;
  640. struct ice_aqc_elem_info_bw eir_bw;
  641. __le16 srl_id;
  642. __le16 reserved2;
  643. };
  644. struct ice_aqc_txsched_elem_data {
  645. __le32 parent_teid;
  646. __le32 node_teid;
  647. struct ice_aqc_txsched_elem data;
  648. };
  649. struct ice_aqc_txsched_topo_grp_info_hdr {
  650. __le32 parent_teid;
  651. __le16 num_elems;
  652. __le16 reserved2;
  653. };
  654. struct ice_aqc_add_elem {
  655. struct ice_aqc_txsched_topo_grp_info_hdr hdr;
  656. struct ice_aqc_txsched_elem_data generic[1];
  657. };
  658. struct ice_aqc_get_topo_elem {
  659. struct ice_aqc_txsched_topo_grp_info_hdr hdr;
  660. struct ice_aqc_txsched_elem_data
  661. generic[ICE_AQC_TOPO_MAX_LEVEL_NUM];
  662. };
  663. struct ice_aqc_delete_elem {
  664. struct ice_aqc_txsched_topo_grp_info_hdr hdr;
  665. __le32 teid[1];
  666. };
  667. /* Query Scheduler Resource Allocation (indirect 0x0412)
  668. * This indirect command retrieves the scheduler resources allocated by
  669. * EMP Firmware to the given PF.
  670. */
  671. struct ice_aqc_query_txsched_res {
  672. u8 reserved[8];
  673. __le32 addr_high;
  674. __le32 addr_low;
  675. };
  676. struct ice_aqc_generic_sched_props {
  677. __le16 phys_levels;
  678. __le16 logical_levels;
  679. u8 flattening_bitmap;
  680. u8 max_device_cgds;
  681. u8 max_pf_cgds;
  682. u8 rsvd0;
  683. __le16 rdma_qsets;
  684. u8 rsvd1[22];
  685. };
  686. struct ice_aqc_layer_props {
  687. u8 logical_layer;
  688. u8 chunk_size;
  689. __le16 max_device_nodes;
  690. __le16 max_pf_nodes;
  691. u8 rsvd0[2];
  692. __le16 max_shared_rate_lmtr;
  693. __le16 max_children;
  694. __le16 max_cir_rl_profiles;
  695. __le16 max_eir_rl_profiles;
  696. __le16 max_srl_profiles;
  697. u8 rsvd1[14];
  698. };
  699. struct ice_aqc_query_txsched_res_resp {
  700. struct ice_aqc_generic_sched_props sched_props;
  701. struct ice_aqc_layer_props layer_props[ICE_AQC_TOPO_MAX_LEVEL_NUM];
  702. };
  703. /* Get PHY capabilities (indirect 0x0600) */
  704. struct ice_aqc_get_phy_caps {
  705. u8 lport_num;
  706. u8 reserved;
  707. __le16 param0;
  708. /* 18.0 - Report qualified modules */
  709. #define ICE_AQC_GET_PHY_RQM BIT(0)
  710. /* 18.1 - 18.2 : Report mode
  711. * 00b - Report NVM capabilities
  712. * 01b - Report topology capabilities
  713. * 10b - Report SW configured
  714. */
  715. #define ICE_AQC_REPORT_MODE_S 1
  716. #define ICE_AQC_REPORT_MODE_M (3 << ICE_AQC_REPORT_MODE_S)
  717. #define ICE_AQC_REPORT_NVM_CAP 0
  718. #define ICE_AQC_REPORT_TOPO_CAP BIT(1)
  719. #define ICE_AQC_REPORT_SW_CFG BIT(2)
  720. __le32 reserved1;
  721. __le32 addr_high;
  722. __le32 addr_low;
  723. };
  724. /* This is #define of PHY type (Extended):
  725. * The first set of defines is for phy_type_low.
  726. */
  727. #define ICE_PHY_TYPE_LOW_100BASE_TX BIT_ULL(0)
  728. #define ICE_PHY_TYPE_LOW_100M_SGMII BIT_ULL(1)
  729. #define ICE_PHY_TYPE_LOW_1000BASE_T BIT_ULL(2)
  730. #define ICE_PHY_TYPE_LOW_1000BASE_SX BIT_ULL(3)
  731. #define ICE_PHY_TYPE_LOW_1000BASE_LX BIT_ULL(4)
  732. #define ICE_PHY_TYPE_LOW_1000BASE_KX BIT_ULL(5)
  733. #define ICE_PHY_TYPE_LOW_1G_SGMII BIT_ULL(6)
  734. #define ICE_PHY_TYPE_LOW_2500BASE_T BIT_ULL(7)
  735. #define ICE_PHY_TYPE_LOW_2500BASE_X BIT_ULL(8)
  736. #define ICE_PHY_TYPE_LOW_2500BASE_KX BIT_ULL(9)
  737. #define ICE_PHY_TYPE_LOW_5GBASE_T BIT_ULL(10)
  738. #define ICE_PHY_TYPE_LOW_5GBASE_KR BIT_ULL(11)
  739. #define ICE_PHY_TYPE_LOW_10GBASE_T BIT_ULL(12)
  740. #define ICE_PHY_TYPE_LOW_10G_SFI_DA BIT_ULL(13)
  741. #define ICE_PHY_TYPE_LOW_10GBASE_SR BIT_ULL(14)
  742. #define ICE_PHY_TYPE_LOW_10GBASE_LR BIT_ULL(15)
  743. #define ICE_PHY_TYPE_LOW_10GBASE_KR_CR1 BIT_ULL(16)
  744. #define ICE_PHY_TYPE_LOW_10G_SFI_AOC_ACC BIT_ULL(17)
  745. #define ICE_PHY_TYPE_LOW_10G_SFI_C2C BIT_ULL(18)
  746. #define ICE_PHY_TYPE_LOW_25GBASE_T BIT_ULL(19)
  747. #define ICE_PHY_TYPE_LOW_25GBASE_CR BIT_ULL(20)
  748. #define ICE_PHY_TYPE_LOW_25GBASE_CR_S BIT_ULL(21)
  749. #define ICE_PHY_TYPE_LOW_25GBASE_CR1 BIT_ULL(22)
  750. #define ICE_PHY_TYPE_LOW_25GBASE_SR BIT_ULL(23)
  751. #define ICE_PHY_TYPE_LOW_25GBASE_LR BIT_ULL(24)
  752. #define ICE_PHY_TYPE_LOW_25GBASE_KR BIT_ULL(25)
  753. #define ICE_PHY_TYPE_LOW_25GBASE_KR_S BIT_ULL(26)
  754. #define ICE_PHY_TYPE_LOW_25GBASE_KR1 BIT_ULL(27)
  755. #define ICE_PHY_TYPE_LOW_25G_AUI_AOC_ACC BIT_ULL(28)
  756. #define ICE_PHY_TYPE_LOW_25G_AUI_C2C BIT_ULL(29)
  757. #define ICE_PHY_TYPE_LOW_40GBASE_CR4 BIT_ULL(30)
  758. #define ICE_PHY_TYPE_LOW_40GBASE_SR4 BIT_ULL(31)
  759. #define ICE_PHY_TYPE_LOW_40GBASE_LR4 BIT_ULL(32)
  760. #define ICE_PHY_TYPE_LOW_40GBASE_KR4 BIT_ULL(33)
  761. #define ICE_PHY_TYPE_LOW_40G_XLAUI_AOC_ACC BIT_ULL(34)
  762. #define ICE_PHY_TYPE_LOW_40G_XLAUI BIT_ULL(35)
  763. #define ICE_PHY_TYPE_LOW_MAX_INDEX 63
  764. struct ice_aqc_get_phy_caps_data {
  765. __le64 phy_type_low; /* Use values from ICE_PHY_TYPE_LOW_* */
  766. __le64 reserved;
  767. u8 caps;
  768. #define ICE_AQC_PHY_EN_TX_LINK_PAUSE BIT(0)
  769. #define ICE_AQC_PHY_EN_RX_LINK_PAUSE BIT(1)
  770. #define ICE_AQC_PHY_LOW_POWER_MODE BIT(2)
  771. #define ICE_AQC_PHY_EN_LINK BIT(3)
  772. #define ICE_AQC_PHY_AN_MODE BIT(4)
  773. #define ICE_AQC_GET_PHY_EN_MOD_QUAL BIT(5)
  774. u8 low_power_ctrl;
  775. #define ICE_AQC_PHY_EN_D3COLD_LOW_POWER_AUTONEG BIT(0)
  776. __le16 eee_cap;
  777. #define ICE_AQC_PHY_EEE_EN_100BASE_TX BIT(0)
  778. #define ICE_AQC_PHY_EEE_EN_1000BASE_T BIT(1)
  779. #define ICE_AQC_PHY_EEE_EN_10GBASE_T BIT(2)
  780. #define ICE_AQC_PHY_EEE_EN_1000BASE_KX BIT(3)
  781. #define ICE_AQC_PHY_EEE_EN_10GBASE_KR BIT(4)
  782. #define ICE_AQC_PHY_EEE_EN_25GBASE_KR BIT(5)
  783. #define ICE_AQC_PHY_EEE_EN_40GBASE_KR4 BIT(6)
  784. __le16 eeer_value;
  785. u8 phy_id_oui[4]; /* PHY/Module ID connected on the port */
  786. u8 link_fec_options;
  787. #define ICE_AQC_PHY_FEC_10G_KR_40G_KR4_EN BIT(0)
  788. #define ICE_AQC_PHY_FEC_10G_KR_40G_KR4_REQ BIT(1)
  789. #define ICE_AQC_PHY_FEC_25G_RS_528_REQ BIT(2)
  790. #define ICE_AQC_PHY_FEC_25G_KR_REQ BIT(3)
  791. #define ICE_AQC_PHY_FEC_25G_RS_544_REQ BIT(4)
  792. #define ICE_AQC_PHY_FEC_25G_RS_CLAUSE91_EN BIT(6)
  793. #define ICE_AQC_PHY_FEC_25G_KR_CLAUSE74_EN BIT(7)
  794. u8 extended_compliance_code;
  795. #define ICE_MODULE_TYPE_TOTAL_BYTE 3
  796. u8 module_type[ICE_MODULE_TYPE_TOTAL_BYTE];
  797. #define ICE_AQC_MOD_TYPE_BYTE0_SFP_PLUS 0xA0
  798. #define ICE_AQC_MOD_TYPE_BYTE0_QSFP_PLUS 0x80
  799. #define ICE_AQC_MOD_TYPE_BYTE1_SFP_PLUS_CU_PASSIVE BIT(0)
  800. #define ICE_AQC_MOD_TYPE_BYTE1_SFP_PLUS_CU_ACTIVE BIT(1)
  801. #define ICE_AQC_MOD_TYPE_BYTE1_10G_BASE_SR BIT(4)
  802. #define ICE_AQC_MOD_TYPE_BYTE1_10G_BASE_LR BIT(5)
  803. #define ICE_AQC_MOD_TYPE_BYTE1_10G_BASE_LRM BIT(6)
  804. #define ICE_AQC_MOD_TYPE_BYTE1_10G_BASE_ER BIT(7)
  805. #define ICE_AQC_MOD_TYPE_BYTE2_SFP_PLUS 0xA0
  806. #define ICE_AQC_MOD_TYPE_BYTE2_QSFP_PLUS 0x86
  807. u8 qualified_module_count;
  808. #define ICE_AQC_QUAL_MOD_COUNT_MAX 16
  809. struct {
  810. u8 v_oui[3];
  811. u8 rsvd1;
  812. u8 v_part[16];
  813. __le32 v_rev;
  814. __le64 rsvd8;
  815. } qual_modules[ICE_AQC_QUAL_MOD_COUNT_MAX];
  816. };
  817. /* Set PHY capabilities (direct 0x0601)
  818. * NOTE: This command must be followed by setup link and restart auto-neg
  819. */
  820. struct ice_aqc_set_phy_cfg {
  821. u8 lport_num;
  822. u8 reserved[7];
  823. __le32 addr_high;
  824. __le32 addr_low;
  825. };
  826. /* Set PHY config command data structure */
  827. struct ice_aqc_set_phy_cfg_data {
  828. __le64 phy_type_low; /* Use values from ICE_PHY_TYPE_LOW_* */
  829. __le64 rsvd0;
  830. u8 caps;
  831. #define ICE_AQ_PHY_ENA_TX_PAUSE_ABILITY BIT(0)
  832. #define ICE_AQ_PHY_ENA_RX_PAUSE_ABILITY BIT(1)
  833. #define ICE_AQ_PHY_ENA_LOW_POWER BIT(2)
  834. #define ICE_AQ_PHY_ENA_LINK BIT(3)
  835. #define ICE_AQ_PHY_ENA_ATOMIC_LINK BIT(5)
  836. u8 low_power_ctrl;
  837. __le16 eee_cap; /* Value from ice_aqc_get_phy_caps */
  838. __le16 eeer_value;
  839. u8 link_fec_opt; /* Use defines from ice_aqc_get_phy_caps */
  840. u8 rsvd1;
  841. };
  842. /* Restart AN command data structure (direct 0x0605)
  843. * Also used for response, with only the lport_num field present.
  844. */
  845. struct ice_aqc_restart_an {
  846. u8 lport_num;
  847. u8 reserved;
  848. u8 cmd_flags;
  849. #define ICE_AQC_RESTART_AN_LINK_RESTART BIT(1)
  850. #define ICE_AQC_RESTART_AN_LINK_ENABLE BIT(2)
  851. u8 reserved2[13];
  852. };
  853. /* Get link status (indirect 0x0607), also used for Link Status Event */
  854. struct ice_aqc_get_link_status {
  855. u8 lport_num;
  856. u8 reserved;
  857. __le16 cmd_flags;
  858. #define ICE_AQ_LSE_M 0x3
  859. #define ICE_AQ_LSE_NOP 0x0
  860. #define ICE_AQ_LSE_DIS 0x2
  861. #define ICE_AQ_LSE_ENA 0x3
  862. /* only response uses this flag */
  863. #define ICE_AQ_LSE_IS_ENABLED 0x1
  864. __le32 reserved2;
  865. __le32 addr_high;
  866. __le32 addr_low;
  867. };
  868. /* Get link status response data structure, also used for Link Status Event */
  869. struct ice_aqc_get_link_status_data {
  870. u8 topo_media_conflict;
  871. #define ICE_AQ_LINK_TOPO_CONFLICT BIT(0)
  872. #define ICE_AQ_LINK_MEDIA_CONFLICT BIT(1)
  873. #define ICE_AQ_LINK_TOPO_CORRUPT BIT(2)
  874. u8 reserved1;
  875. u8 link_info;
  876. #define ICE_AQ_LINK_UP BIT(0) /* Link Status */
  877. #define ICE_AQ_LINK_FAULT BIT(1)
  878. #define ICE_AQ_LINK_FAULT_TX BIT(2)
  879. #define ICE_AQ_LINK_FAULT_RX BIT(3)
  880. #define ICE_AQ_LINK_FAULT_REMOTE BIT(4)
  881. #define ICE_AQ_LINK_UP_PORT BIT(5) /* External Port Link Status */
  882. #define ICE_AQ_MEDIA_AVAILABLE BIT(6)
  883. #define ICE_AQ_SIGNAL_DETECT BIT(7)
  884. u8 an_info;
  885. #define ICE_AQ_AN_COMPLETED BIT(0)
  886. #define ICE_AQ_LP_AN_ABILITY BIT(1)
  887. #define ICE_AQ_PD_FAULT BIT(2) /* Parallel Detection Fault */
  888. #define ICE_AQ_FEC_EN BIT(3)
  889. #define ICE_AQ_PHY_LOW_POWER BIT(4) /* Low Power State */
  890. #define ICE_AQ_LINK_PAUSE_TX BIT(5)
  891. #define ICE_AQ_LINK_PAUSE_RX BIT(6)
  892. #define ICE_AQ_QUALIFIED_MODULE BIT(7)
  893. u8 ext_info;
  894. #define ICE_AQ_LINK_PHY_TEMP_ALARM BIT(0)
  895. #define ICE_AQ_LINK_EXCESSIVE_ERRORS BIT(1) /* Excessive Link Errors */
  896. /* Port TX Suspended */
  897. #define ICE_AQ_LINK_TX_S 2
  898. #define ICE_AQ_LINK_TX_M (0x03 << ICE_AQ_LINK_TX_S)
  899. #define ICE_AQ_LINK_TX_ACTIVE 0
  900. #define ICE_AQ_LINK_TX_DRAINED 1
  901. #define ICE_AQ_LINK_TX_FLUSHED 3
  902. u8 reserved2;
  903. __le16 max_frame_size;
  904. u8 cfg;
  905. #define ICE_AQ_LINK_25G_KR_FEC_EN BIT(0)
  906. #define ICE_AQ_LINK_25G_RS_528_FEC_EN BIT(1)
  907. #define ICE_AQ_LINK_25G_RS_544_FEC_EN BIT(2)
  908. /* Pacing Config */
  909. #define ICE_AQ_CFG_PACING_S 3
  910. #define ICE_AQ_CFG_PACING_M (0xF << ICE_AQ_CFG_PACING_S)
  911. #define ICE_AQ_CFG_PACING_TYPE_M BIT(7)
  912. #define ICE_AQ_CFG_PACING_TYPE_AVG 0
  913. #define ICE_AQ_CFG_PACING_TYPE_FIXED ICE_AQ_CFG_PACING_TYPE_M
  914. /* External Device Power Ability */
  915. u8 power_desc;
  916. #define ICE_AQ_PWR_CLASS_M 0x3
  917. #define ICE_AQ_LINK_PWR_BASET_LOW_HIGH 0
  918. #define ICE_AQ_LINK_PWR_BASET_HIGH 1
  919. #define ICE_AQ_LINK_PWR_QSFP_CLASS_1 0
  920. #define ICE_AQ_LINK_PWR_QSFP_CLASS_2 1
  921. #define ICE_AQ_LINK_PWR_QSFP_CLASS_3 2
  922. #define ICE_AQ_LINK_PWR_QSFP_CLASS_4 3
  923. __le16 link_speed;
  924. #define ICE_AQ_LINK_SPEED_10MB BIT(0)
  925. #define ICE_AQ_LINK_SPEED_100MB BIT(1)
  926. #define ICE_AQ_LINK_SPEED_1000MB BIT(2)
  927. #define ICE_AQ_LINK_SPEED_2500MB BIT(3)
  928. #define ICE_AQ_LINK_SPEED_5GB BIT(4)
  929. #define ICE_AQ_LINK_SPEED_10GB BIT(5)
  930. #define ICE_AQ_LINK_SPEED_20GB BIT(6)
  931. #define ICE_AQ_LINK_SPEED_25GB BIT(7)
  932. #define ICE_AQ_LINK_SPEED_40GB BIT(8)
  933. #define ICE_AQ_LINK_SPEED_UNKNOWN BIT(15)
  934. __le32 reserved3; /* Aligns next field to 8-byte boundary */
  935. __le64 phy_type_low; /* Use values from ICE_PHY_TYPE_LOW_* */
  936. __le64 reserved4;
  937. };
  938. /* NVM Read command (indirect 0x0701)
  939. * NVM Erase commands (direct 0x0702)
  940. * NVM Update commands (indirect 0x0703)
  941. */
  942. struct ice_aqc_nvm {
  943. u8 cmd_flags;
  944. #define ICE_AQC_NVM_LAST_CMD BIT(0)
  945. #define ICE_AQC_NVM_PCIR_REQ BIT(0) /* Used by NVM Update reply */
  946. #define ICE_AQC_NVM_PRESERVATION_S 1
  947. #define ICE_AQC_NVM_PRESERVATION_M (3 << CSR_AQ_NVM_PRESERVATION_S)
  948. #define ICE_AQC_NVM_NO_PRESERVATION (0 << CSR_AQ_NVM_PRESERVATION_S)
  949. #define ICE_AQC_NVM_PRESERVE_ALL BIT(1)
  950. #define ICE_AQC_NVM_PRESERVE_SELECTED (3 << CSR_AQ_NVM_PRESERVATION_S)
  951. #define ICE_AQC_NVM_FLASH_ONLY BIT(7)
  952. u8 module_typeid;
  953. __le16 length;
  954. #define ICE_AQC_NVM_ERASE_LEN 0xFFFF
  955. __le32 offset;
  956. __le32 addr_high;
  957. __le32 addr_low;
  958. };
  959. /* Get/Set RSS key (indirect 0x0B04/0x0B02) */
  960. struct ice_aqc_get_set_rss_key {
  961. #define ICE_AQC_GSET_RSS_KEY_VSI_VALID BIT(15)
  962. #define ICE_AQC_GSET_RSS_KEY_VSI_ID_S 0
  963. #define ICE_AQC_GSET_RSS_KEY_VSI_ID_M (0x3FF << ICE_AQC_GSET_RSS_KEY_VSI_ID_S)
  964. __le16 vsi_id;
  965. u8 reserved[6];
  966. __le32 addr_high;
  967. __le32 addr_low;
  968. };
  969. #define ICE_AQC_GET_SET_RSS_KEY_DATA_RSS_KEY_SIZE 0x28
  970. #define ICE_AQC_GET_SET_RSS_KEY_DATA_HASH_KEY_SIZE 0xC
  971. struct ice_aqc_get_set_rss_keys {
  972. u8 standard_rss_key[ICE_AQC_GET_SET_RSS_KEY_DATA_RSS_KEY_SIZE];
  973. u8 extended_hash_key[ICE_AQC_GET_SET_RSS_KEY_DATA_HASH_KEY_SIZE];
  974. };
  975. /* Get/Set RSS LUT (indirect 0x0B05/0x0B03) */
  976. struct ice_aqc_get_set_rss_lut {
  977. #define ICE_AQC_GSET_RSS_LUT_VSI_VALID BIT(15)
  978. #define ICE_AQC_GSET_RSS_LUT_VSI_ID_S 0
  979. #define ICE_AQC_GSET_RSS_LUT_VSI_ID_M (0x1FF << ICE_AQC_GSET_RSS_LUT_VSI_ID_S)
  980. __le16 vsi_id;
  981. #define ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_S 0
  982. #define ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_M \
  983. (0x3 << ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_S)
  984. #define ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_VSI 0
  985. #define ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_PF 1
  986. #define ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_GLOBAL 2
  987. #define ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_S 2
  988. #define ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_M \
  989. (0x3 << ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_S)
  990. #define ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_128 128
  991. #define ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_128_FLAG 0
  992. #define ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_512 512
  993. #define ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_512_FLAG 1
  994. #define ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_2K 2048
  995. #define ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_2K_FLAG 2
  996. #define ICE_AQC_GSET_RSS_LUT_GLOBAL_IDX_S 4
  997. #define ICE_AQC_GSET_RSS_LUT_GLOBAL_IDX_M \
  998. (0xF << ICE_AQC_GSET_RSS_LUT_GLOBAL_IDX_S)
  999. __le16 flags;
  1000. __le32 reserved;
  1001. __le32 addr_high;
  1002. __le32 addr_low;
  1003. };
  1004. /* Add TX LAN Queues (indirect 0x0C30) */
  1005. struct ice_aqc_add_txqs {
  1006. u8 num_qgrps;
  1007. u8 reserved[3];
  1008. __le32 reserved1;
  1009. __le32 addr_high;
  1010. __le32 addr_low;
  1011. };
  1012. /* This is the descriptor of each queue entry for the Add TX LAN Queues
  1013. * command (0x0C30). Only used within struct ice_aqc_add_tx_qgrp.
  1014. */
  1015. struct ice_aqc_add_txqs_perq {
  1016. __le16 txq_id;
  1017. u8 rsvd[2];
  1018. __le32 q_teid;
  1019. u8 txq_ctx[22];
  1020. u8 rsvd2[2];
  1021. struct ice_aqc_txsched_elem info;
  1022. };
  1023. /* The format of the command buffer for Add TX LAN Queues (0x0C30)
  1024. * is an array of the following structs. Please note that the length of
  1025. * each struct ice_aqc_add_tx_qgrp is variable due
  1026. * to the variable number of queues in each group!
  1027. */
  1028. struct ice_aqc_add_tx_qgrp {
  1029. __le32 parent_teid;
  1030. u8 num_txqs;
  1031. u8 rsvd[3];
  1032. struct ice_aqc_add_txqs_perq txqs[1];
  1033. };
  1034. /* Disable TX LAN Queues (indirect 0x0C31) */
  1035. struct ice_aqc_dis_txqs {
  1036. u8 cmd_type;
  1037. #define ICE_AQC_Q_DIS_CMD_S 0
  1038. #define ICE_AQC_Q_DIS_CMD_M (0x3 << ICE_AQC_Q_DIS_CMD_S)
  1039. #define ICE_AQC_Q_DIS_CMD_NO_FUNC_RESET (0 << ICE_AQC_Q_DIS_CMD_S)
  1040. #define ICE_AQC_Q_DIS_CMD_VM_RESET BIT(ICE_AQC_Q_DIS_CMD_S)
  1041. #define ICE_AQC_Q_DIS_CMD_VF_RESET (2 << ICE_AQC_Q_DIS_CMD_S)
  1042. #define ICE_AQC_Q_DIS_CMD_PF_RESET (3 << ICE_AQC_Q_DIS_CMD_S)
  1043. #define ICE_AQC_Q_DIS_CMD_SUBSEQ_CALL BIT(2)
  1044. #define ICE_AQC_Q_DIS_CMD_FLUSH_PIPE BIT(3)
  1045. u8 num_entries;
  1046. __le16 vmvf_and_timeout;
  1047. #define ICE_AQC_Q_DIS_VMVF_NUM_S 0
  1048. #define ICE_AQC_Q_DIS_VMVF_NUM_M (0x3FF << ICE_AQC_Q_DIS_VMVF_NUM_S)
  1049. #define ICE_AQC_Q_DIS_TIMEOUT_S 10
  1050. #define ICE_AQC_Q_DIS_TIMEOUT_M (0x3F << ICE_AQC_Q_DIS_TIMEOUT_S)
  1051. __le32 blocked_cgds;
  1052. __le32 addr_high;
  1053. __le32 addr_low;
  1054. };
  1055. /* The buffer for Disable TX LAN Queues (indirect 0x0C31)
  1056. * contains the following structures, arrayed one after the
  1057. * other.
  1058. * Note: Since the q_id is 16 bits wide, if the
  1059. * number of queues is even, then 2 bytes of alignment MUST be
  1060. * added before the start of the next group, to allow correct
  1061. * alignment of the parent_teid field.
  1062. */
  1063. struct ice_aqc_dis_txq_item {
  1064. __le32 parent_teid;
  1065. u8 num_qs;
  1066. u8 rsvd;
  1067. /* The length of the q_id array varies according to num_qs */
  1068. __le16 q_id[1];
  1069. /* This only applies from F8 onward */
  1070. #define ICE_AQC_Q_DIS_BUF_ELEM_TYPE_S 15
  1071. #define ICE_AQC_Q_DIS_BUF_ELEM_TYPE_LAN_Q \
  1072. (0 << ICE_AQC_Q_DIS_BUF_ELEM_TYPE_S)
  1073. #define ICE_AQC_Q_DIS_BUF_ELEM_TYPE_RDMA_QSET \
  1074. (1 << ICE_AQC_Q_DIS_BUF_ELEM_TYPE_S)
  1075. };
  1076. struct ice_aqc_dis_txq {
  1077. struct ice_aqc_dis_txq_item qgrps[1];
  1078. };
  1079. /**
  1080. * struct ice_aq_desc - Admin Queue (AQ) descriptor
  1081. * @flags: ICE_AQ_FLAG_* flags
  1082. * @opcode: AQ command opcode
  1083. * @datalen: length in bytes of indirect/external data buffer
  1084. * @retval: return value from firmware
  1085. * @cookie_h: opaque data high-half
  1086. * @cookie_l: opaque data low-half
  1087. * @params: command-specific parameters
  1088. *
  1089. * Descriptor format for commands the driver posts on the Admin Transmit Queue
  1090. * (ATQ). The firmware writes back onto the command descriptor and returns
  1091. * the result of the command. Asynchronous events that are not an immediate
  1092. * result of the command are written to the Admin Receive Queue (ARQ) using
  1093. * the same descriptor format. Descriptors are in little-endian notation with
  1094. * 32-bit words.
  1095. */
  1096. struct ice_aq_desc {
  1097. __le16 flags;
  1098. __le16 opcode;
  1099. __le16 datalen;
  1100. __le16 retval;
  1101. __le32 cookie_high;
  1102. __le32 cookie_low;
  1103. union {
  1104. u8 raw[16];
  1105. struct ice_aqc_generic generic;
  1106. struct ice_aqc_get_ver get_ver;
  1107. struct ice_aqc_q_shutdown q_shutdown;
  1108. struct ice_aqc_req_res res_owner;
  1109. struct ice_aqc_manage_mac_read mac_read;
  1110. struct ice_aqc_clear_pxe clear_pxe;
  1111. struct ice_aqc_list_caps get_cap;
  1112. struct ice_aqc_get_phy_caps get_phy;
  1113. struct ice_aqc_set_phy_cfg set_phy;
  1114. struct ice_aqc_restart_an restart_an;
  1115. struct ice_aqc_get_sw_cfg get_sw_conf;
  1116. struct ice_aqc_sw_rules sw_rules;
  1117. struct ice_aqc_get_topo get_topo;
  1118. struct ice_aqc_get_cfg_elem get_update_elem;
  1119. struct ice_aqc_query_txsched_res query_sched_res;
  1120. struct ice_aqc_add_move_delete_elem add_move_delete_elem;
  1121. struct ice_aqc_nvm nvm;
  1122. struct ice_aqc_get_set_rss_lut get_set_rss_lut;
  1123. struct ice_aqc_get_set_rss_key get_set_rss_key;
  1124. struct ice_aqc_add_txqs add_txqs;
  1125. struct ice_aqc_dis_txqs dis_txqs;
  1126. struct ice_aqc_add_get_update_free_vsi vsi_cmd;
  1127. struct ice_aqc_alloc_free_res_cmd sw_res_ctrl;
  1128. struct ice_aqc_get_link_status get_link_status;
  1129. } params;
  1130. };
  1131. /* FW defined boundary for a large buffer, 4k >= Large buffer > 512 bytes */
  1132. #define ICE_AQ_LG_BUF 512
  1133. #define ICE_AQ_FLAG_ERR_S 2
  1134. #define ICE_AQ_FLAG_LB_S 9
  1135. #define ICE_AQ_FLAG_RD_S 10
  1136. #define ICE_AQ_FLAG_BUF_S 12
  1137. #define ICE_AQ_FLAG_SI_S 13
  1138. #define ICE_AQ_FLAG_ERR BIT(ICE_AQ_FLAG_ERR_S) /* 0x4 */
  1139. #define ICE_AQ_FLAG_LB BIT(ICE_AQ_FLAG_LB_S) /* 0x200 */
  1140. #define ICE_AQ_FLAG_RD BIT(ICE_AQ_FLAG_RD_S) /* 0x400 */
  1141. #define ICE_AQ_FLAG_BUF BIT(ICE_AQ_FLAG_BUF_S) /* 0x1000 */
  1142. #define ICE_AQ_FLAG_SI BIT(ICE_AQ_FLAG_SI_S) /* 0x2000 */
  1143. /* error codes */
  1144. enum ice_aq_err {
  1145. ICE_AQ_RC_OK = 0, /* success */
  1146. ICE_AQ_RC_ENOMEM = 9, /* Out of memory */
  1147. ICE_AQ_RC_EBUSY = 12, /* Device or resource busy */
  1148. ICE_AQ_RC_EEXIST = 13, /* object already exists */
  1149. };
  1150. /* Admin Queue command opcodes */
  1151. enum ice_adminq_opc {
  1152. /* AQ commands */
  1153. ice_aqc_opc_get_ver = 0x0001,
  1154. ice_aqc_opc_q_shutdown = 0x0003,
  1155. /* resource ownership */
  1156. ice_aqc_opc_req_res = 0x0008,
  1157. ice_aqc_opc_release_res = 0x0009,
  1158. /* device/function capabilities */
  1159. ice_aqc_opc_list_func_caps = 0x000A,
  1160. ice_aqc_opc_list_dev_caps = 0x000B,
  1161. /* manage MAC address */
  1162. ice_aqc_opc_manage_mac_read = 0x0107,
  1163. /* PXE */
  1164. ice_aqc_opc_clear_pxe_mode = 0x0110,
  1165. /* internal switch commands */
  1166. ice_aqc_opc_get_sw_cfg = 0x0200,
  1167. /* Alloc/Free/Get Resources */
  1168. ice_aqc_opc_alloc_res = 0x0208,
  1169. ice_aqc_opc_free_res = 0x0209,
  1170. /* VSI commands */
  1171. ice_aqc_opc_add_vsi = 0x0210,
  1172. ice_aqc_opc_update_vsi = 0x0211,
  1173. ice_aqc_opc_free_vsi = 0x0213,
  1174. /* switch rules population commands */
  1175. ice_aqc_opc_add_sw_rules = 0x02A0,
  1176. ice_aqc_opc_update_sw_rules = 0x02A1,
  1177. ice_aqc_opc_remove_sw_rules = 0x02A2,
  1178. ice_aqc_opc_clear_pf_cfg = 0x02A4,
  1179. /* transmit scheduler commands */
  1180. ice_aqc_opc_get_dflt_topo = 0x0400,
  1181. ice_aqc_opc_add_sched_elems = 0x0401,
  1182. ice_aqc_opc_suspend_sched_elems = 0x0409,
  1183. ice_aqc_opc_resume_sched_elems = 0x040A,
  1184. ice_aqc_opc_delete_sched_elems = 0x040F,
  1185. ice_aqc_opc_query_sched_res = 0x0412,
  1186. /* PHY commands */
  1187. ice_aqc_opc_get_phy_caps = 0x0600,
  1188. ice_aqc_opc_set_phy_cfg = 0x0601,
  1189. ice_aqc_opc_restart_an = 0x0605,
  1190. ice_aqc_opc_get_link_status = 0x0607,
  1191. /* NVM commands */
  1192. ice_aqc_opc_nvm_read = 0x0701,
  1193. /* RSS commands */
  1194. ice_aqc_opc_set_rss_key = 0x0B02,
  1195. ice_aqc_opc_set_rss_lut = 0x0B03,
  1196. ice_aqc_opc_get_rss_key = 0x0B04,
  1197. ice_aqc_opc_get_rss_lut = 0x0B05,
  1198. /* TX queue handling commands/events */
  1199. ice_aqc_opc_add_txqs = 0x0C30,
  1200. ice_aqc_opc_dis_txqs = 0x0C31,
  1201. };
  1202. #endif /* _ICE_ADMINQ_CMD_H_ */