ice_adminq_cmd.h 43 KB

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