ice_adminq_cmd.h 46 KB

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