i40e_adminq_cmd.h 65 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312
  1. /*******************************************************************************
  2. *
  3. * Intel Ethernet Controller XL710 Family Linux Virtual Function Driver
  4. * Copyright(c) 2013 - 2014 Intel Corporation.
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms and conditions of the GNU General Public License,
  8. * version 2, as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope it will be useful, but WITHOUT
  11. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  13. * more details.
  14. *
  15. * You should have received a copy of the GNU General Public License along
  16. * with this program. If not, see <http://www.gnu.org/licenses/>.
  17. *
  18. * The full GNU General Public License is included in this distribution in
  19. * the file called "COPYING".
  20. *
  21. * Contact Information:
  22. * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
  23. * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  24. *
  25. ******************************************************************************/
  26. #ifndef _I40E_ADMINQ_CMD_H_
  27. #define _I40E_ADMINQ_CMD_H_
  28. /* This header file defines the i40e Admin Queue commands and is shared between
  29. * i40e Firmware and Software.
  30. *
  31. * This file needs to comply with the Linux Kernel coding style.
  32. */
  33. #define I40E_FW_API_VERSION_MAJOR 0x0001
  34. #define I40E_FW_API_VERSION_MINOR 0x0004
  35. struct i40e_aq_desc {
  36. __le16 flags;
  37. __le16 opcode;
  38. __le16 datalen;
  39. __le16 retval;
  40. __le32 cookie_high;
  41. __le32 cookie_low;
  42. union {
  43. struct {
  44. __le32 param0;
  45. __le32 param1;
  46. __le32 param2;
  47. __le32 param3;
  48. } internal;
  49. struct {
  50. __le32 param0;
  51. __le32 param1;
  52. __le32 addr_high;
  53. __le32 addr_low;
  54. } external;
  55. u8 raw[16];
  56. } params;
  57. };
  58. /* Flags sub-structure
  59. * |0 |1 |2 |3 |4 |5 |6 |7 |8 |9 |10 |11 |12 |13 |14 |15 |
  60. * |DD |CMP|ERR|VFE| * * RESERVED * * |LB |RD |VFC|BUF|SI |EI |FE |
  61. */
  62. /* command flags and offsets*/
  63. #define I40E_AQ_FLAG_DD_SHIFT 0
  64. #define I40E_AQ_FLAG_CMP_SHIFT 1
  65. #define I40E_AQ_FLAG_ERR_SHIFT 2
  66. #define I40E_AQ_FLAG_VFE_SHIFT 3
  67. #define I40E_AQ_FLAG_LB_SHIFT 9
  68. #define I40E_AQ_FLAG_RD_SHIFT 10
  69. #define I40E_AQ_FLAG_VFC_SHIFT 11
  70. #define I40E_AQ_FLAG_BUF_SHIFT 12
  71. #define I40E_AQ_FLAG_SI_SHIFT 13
  72. #define I40E_AQ_FLAG_EI_SHIFT 14
  73. #define I40E_AQ_FLAG_FE_SHIFT 15
  74. #define I40E_AQ_FLAG_DD (1 << I40E_AQ_FLAG_DD_SHIFT) /* 0x1 */
  75. #define I40E_AQ_FLAG_CMP (1 << I40E_AQ_FLAG_CMP_SHIFT) /* 0x2 */
  76. #define I40E_AQ_FLAG_ERR (1 << I40E_AQ_FLAG_ERR_SHIFT) /* 0x4 */
  77. #define I40E_AQ_FLAG_VFE (1 << I40E_AQ_FLAG_VFE_SHIFT) /* 0x8 */
  78. #define I40E_AQ_FLAG_LB (1 << I40E_AQ_FLAG_LB_SHIFT) /* 0x200 */
  79. #define I40E_AQ_FLAG_RD (1 << I40E_AQ_FLAG_RD_SHIFT) /* 0x400 */
  80. #define I40E_AQ_FLAG_VFC (1 << I40E_AQ_FLAG_VFC_SHIFT) /* 0x800 */
  81. #define I40E_AQ_FLAG_BUF (1 << I40E_AQ_FLAG_BUF_SHIFT) /* 0x1000 */
  82. #define I40E_AQ_FLAG_SI (1 << I40E_AQ_FLAG_SI_SHIFT) /* 0x2000 */
  83. #define I40E_AQ_FLAG_EI (1 << I40E_AQ_FLAG_EI_SHIFT) /* 0x4000 */
  84. #define I40E_AQ_FLAG_FE (1 << I40E_AQ_FLAG_FE_SHIFT) /* 0x8000 */
  85. /* error codes */
  86. enum i40e_admin_queue_err {
  87. I40E_AQ_RC_OK = 0, /* success */
  88. I40E_AQ_RC_EPERM = 1, /* Operation not permitted */
  89. I40E_AQ_RC_ENOENT = 2, /* No such element */
  90. I40E_AQ_RC_ESRCH = 3, /* Bad opcode */
  91. I40E_AQ_RC_EINTR = 4, /* operation interrupted */
  92. I40E_AQ_RC_EIO = 5, /* I/O error */
  93. I40E_AQ_RC_ENXIO = 6, /* No such resource */
  94. I40E_AQ_RC_E2BIG = 7, /* Arg too long */
  95. I40E_AQ_RC_EAGAIN = 8, /* Try again */
  96. I40E_AQ_RC_ENOMEM = 9, /* Out of memory */
  97. I40E_AQ_RC_EACCES = 10, /* Permission denied */
  98. I40E_AQ_RC_EFAULT = 11, /* Bad address */
  99. I40E_AQ_RC_EBUSY = 12, /* Device or resource busy */
  100. I40E_AQ_RC_EEXIST = 13, /* object already exists */
  101. I40E_AQ_RC_EINVAL = 14, /* Invalid argument */
  102. I40E_AQ_RC_ENOTTY = 15, /* Not a typewriter */
  103. I40E_AQ_RC_ENOSPC = 16, /* No space left or alloc failure */
  104. I40E_AQ_RC_ENOSYS = 17, /* Function not implemented */
  105. I40E_AQ_RC_ERANGE = 18, /* Parameter out of range */
  106. I40E_AQ_RC_EFLUSHED = 19, /* Cmd flushed due to prev cmd error */
  107. I40E_AQ_RC_BAD_ADDR = 20, /* Descriptor contains a bad pointer */
  108. I40E_AQ_RC_EMODE = 21, /* Op not allowed in current dev mode */
  109. I40E_AQ_RC_EFBIG = 22, /* File too large */
  110. };
  111. /* Admin Queue command opcodes */
  112. enum i40e_admin_queue_opc {
  113. /* aq commands */
  114. i40e_aqc_opc_get_version = 0x0001,
  115. i40e_aqc_opc_driver_version = 0x0002,
  116. i40e_aqc_opc_queue_shutdown = 0x0003,
  117. i40e_aqc_opc_set_pf_context = 0x0004,
  118. /* resource ownership */
  119. i40e_aqc_opc_request_resource = 0x0008,
  120. i40e_aqc_opc_release_resource = 0x0009,
  121. i40e_aqc_opc_list_func_capabilities = 0x000A,
  122. i40e_aqc_opc_list_dev_capabilities = 0x000B,
  123. /* LAA */
  124. i40e_aqc_opc_mac_address_read = 0x0107,
  125. i40e_aqc_opc_mac_address_write = 0x0108,
  126. /* PXE */
  127. i40e_aqc_opc_clear_pxe_mode = 0x0110,
  128. /* internal switch commands */
  129. i40e_aqc_opc_get_switch_config = 0x0200,
  130. i40e_aqc_opc_add_statistics = 0x0201,
  131. i40e_aqc_opc_remove_statistics = 0x0202,
  132. i40e_aqc_opc_set_port_parameters = 0x0203,
  133. i40e_aqc_opc_get_switch_resource_alloc = 0x0204,
  134. i40e_aqc_opc_add_vsi = 0x0210,
  135. i40e_aqc_opc_update_vsi_parameters = 0x0211,
  136. i40e_aqc_opc_get_vsi_parameters = 0x0212,
  137. i40e_aqc_opc_add_pv = 0x0220,
  138. i40e_aqc_opc_update_pv_parameters = 0x0221,
  139. i40e_aqc_opc_get_pv_parameters = 0x0222,
  140. i40e_aqc_opc_add_veb = 0x0230,
  141. i40e_aqc_opc_update_veb_parameters = 0x0231,
  142. i40e_aqc_opc_get_veb_parameters = 0x0232,
  143. i40e_aqc_opc_delete_element = 0x0243,
  144. i40e_aqc_opc_add_macvlan = 0x0250,
  145. i40e_aqc_opc_remove_macvlan = 0x0251,
  146. i40e_aqc_opc_add_vlan = 0x0252,
  147. i40e_aqc_opc_remove_vlan = 0x0253,
  148. i40e_aqc_opc_set_vsi_promiscuous_modes = 0x0254,
  149. i40e_aqc_opc_add_tag = 0x0255,
  150. i40e_aqc_opc_remove_tag = 0x0256,
  151. i40e_aqc_opc_add_multicast_etag = 0x0257,
  152. i40e_aqc_opc_remove_multicast_etag = 0x0258,
  153. i40e_aqc_opc_update_tag = 0x0259,
  154. i40e_aqc_opc_add_control_packet_filter = 0x025A,
  155. i40e_aqc_opc_remove_control_packet_filter = 0x025B,
  156. i40e_aqc_opc_add_cloud_filters = 0x025C,
  157. i40e_aqc_opc_remove_cloud_filters = 0x025D,
  158. i40e_aqc_opc_add_mirror_rule = 0x0260,
  159. i40e_aqc_opc_delete_mirror_rule = 0x0261,
  160. /* DCB commands */
  161. i40e_aqc_opc_dcb_ignore_pfc = 0x0301,
  162. i40e_aqc_opc_dcb_updated = 0x0302,
  163. /* TX scheduler */
  164. i40e_aqc_opc_configure_vsi_bw_limit = 0x0400,
  165. i40e_aqc_opc_configure_vsi_ets_sla_bw_limit = 0x0406,
  166. i40e_aqc_opc_configure_vsi_tc_bw = 0x0407,
  167. i40e_aqc_opc_query_vsi_bw_config = 0x0408,
  168. i40e_aqc_opc_query_vsi_ets_sla_config = 0x040A,
  169. i40e_aqc_opc_configure_switching_comp_bw_limit = 0x0410,
  170. i40e_aqc_opc_enable_switching_comp_ets = 0x0413,
  171. i40e_aqc_opc_modify_switching_comp_ets = 0x0414,
  172. i40e_aqc_opc_disable_switching_comp_ets = 0x0415,
  173. i40e_aqc_opc_configure_switching_comp_ets_bw_limit = 0x0416,
  174. i40e_aqc_opc_configure_switching_comp_bw_config = 0x0417,
  175. i40e_aqc_opc_query_switching_comp_ets_config = 0x0418,
  176. i40e_aqc_opc_query_port_ets_config = 0x0419,
  177. i40e_aqc_opc_query_switching_comp_bw_config = 0x041A,
  178. i40e_aqc_opc_suspend_port_tx = 0x041B,
  179. i40e_aqc_opc_resume_port_tx = 0x041C,
  180. i40e_aqc_opc_configure_partition_bw = 0x041D,
  181. /* hmc */
  182. i40e_aqc_opc_query_hmc_resource_profile = 0x0500,
  183. i40e_aqc_opc_set_hmc_resource_profile = 0x0501,
  184. /* phy commands*/
  185. i40e_aqc_opc_get_phy_abilities = 0x0600,
  186. i40e_aqc_opc_set_phy_config = 0x0601,
  187. i40e_aqc_opc_set_mac_config = 0x0603,
  188. i40e_aqc_opc_set_link_restart_an = 0x0605,
  189. i40e_aqc_opc_get_link_status = 0x0607,
  190. i40e_aqc_opc_set_phy_int_mask = 0x0613,
  191. i40e_aqc_opc_get_local_advt_reg = 0x0614,
  192. i40e_aqc_opc_set_local_advt_reg = 0x0615,
  193. i40e_aqc_opc_get_partner_advt = 0x0616,
  194. i40e_aqc_opc_set_lb_modes = 0x0618,
  195. i40e_aqc_opc_get_phy_wol_caps = 0x0621,
  196. i40e_aqc_opc_set_phy_debug = 0x0622,
  197. i40e_aqc_opc_upload_ext_phy_fm = 0x0625,
  198. /* NVM commands */
  199. i40e_aqc_opc_nvm_read = 0x0701,
  200. i40e_aqc_opc_nvm_erase = 0x0702,
  201. i40e_aqc_opc_nvm_update = 0x0703,
  202. i40e_aqc_opc_nvm_config_read = 0x0704,
  203. i40e_aqc_opc_nvm_config_write = 0x0705,
  204. /* virtualization commands */
  205. i40e_aqc_opc_send_msg_to_pf = 0x0801,
  206. i40e_aqc_opc_send_msg_to_vf = 0x0802,
  207. i40e_aqc_opc_send_msg_to_peer = 0x0803,
  208. /* alternate structure */
  209. i40e_aqc_opc_alternate_write = 0x0900,
  210. i40e_aqc_opc_alternate_write_indirect = 0x0901,
  211. i40e_aqc_opc_alternate_read = 0x0902,
  212. i40e_aqc_opc_alternate_read_indirect = 0x0903,
  213. i40e_aqc_opc_alternate_write_done = 0x0904,
  214. i40e_aqc_opc_alternate_set_mode = 0x0905,
  215. i40e_aqc_opc_alternate_clear_port = 0x0906,
  216. /* LLDP commands */
  217. i40e_aqc_opc_lldp_get_mib = 0x0A00,
  218. i40e_aqc_opc_lldp_update_mib = 0x0A01,
  219. i40e_aqc_opc_lldp_add_tlv = 0x0A02,
  220. i40e_aqc_opc_lldp_update_tlv = 0x0A03,
  221. i40e_aqc_opc_lldp_delete_tlv = 0x0A04,
  222. i40e_aqc_opc_lldp_stop = 0x0A05,
  223. i40e_aqc_opc_lldp_start = 0x0A06,
  224. /* Tunnel commands */
  225. i40e_aqc_opc_add_udp_tunnel = 0x0B00,
  226. i40e_aqc_opc_del_udp_tunnel = 0x0B01,
  227. i40e_aqc_opc_set_rss_key = 0x0B02,
  228. i40e_aqc_opc_set_rss_lut = 0x0B03,
  229. i40e_aqc_opc_get_rss_key = 0x0B04,
  230. i40e_aqc_opc_get_rss_lut = 0x0B05,
  231. /* Async Events */
  232. i40e_aqc_opc_event_lan_overflow = 0x1001,
  233. /* OEM commands */
  234. i40e_aqc_opc_oem_parameter_change = 0xFE00,
  235. i40e_aqc_opc_oem_device_status_change = 0xFE01,
  236. i40e_aqc_opc_oem_ocsd_initialize = 0xFE02,
  237. i40e_aqc_opc_oem_ocbb_initialize = 0xFE03,
  238. /* debug commands */
  239. i40e_aqc_opc_debug_read_reg = 0xFF03,
  240. i40e_aqc_opc_debug_write_reg = 0xFF04,
  241. i40e_aqc_opc_debug_modify_reg = 0xFF07,
  242. i40e_aqc_opc_debug_dump_internals = 0xFF08,
  243. };
  244. /* command structures and indirect data structures */
  245. /* Structure naming conventions:
  246. * - no suffix for direct command descriptor structures
  247. * - _data for indirect sent data
  248. * - _resp for indirect return data (data which is both will use _data)
  249. * - _completion for direct return data
  250. * - _element_ for repeated elements (may also be _data or _resp)
  251. *
  252. * Command structures are expected to overlay the params.raw member of the basic
  253. * descriptor, and as such cannot exceed 16 bytes in length.
  254. */
  255. /* This macro is used to generate a compilation error if a structure
  256. * is not exactly the correct length. It gives a divide by zero error if the
  257. * structure is not of the correct size, otherwise it creates an enum that is
  258. * never used.
  259. */
  260. #define I40E_CHECK_STRUCT_LEN(n, X) enum i40e_static_assert_enum_##X \
  261. { i40e_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
  262. /* This macro is used extensively to ensure that command structures are 16
  263. * bytes in length as they have to map to the raw array of that size.
  264. */
  265. #define I40E_CHECK_CMD_LENGTH(X) I40E_CHECK_STRUCT_LEN(16, X)
  266. /* internal (0x00XX) commands */
  267. /* Get version (direct 0x0001) */
  268. struct i40e_aqc_get_version {
  269. __le32 rom_ver;
  270. __le32 fw_build;
  271. __le16 fw_major;
  272. __le16 fw_minor;
  273. __le16 api_major;
  274. __le16 api_minor;
  275. };
  276. I40E_CHECK_CMD_LENGTH(i40e_aqc_get_version);
  277. /* Send driver version (indirect 0x0002) */
  278. struct i40e_aqc_driver_version {
  279. u8 driver_major_ver;
  280. u8 driver_minor_ver;
  281. u8 driver_build_ver;
  282. u8 driver_subbuild_ver;
  283. u8 reserved[4];
  284. __le32 address_high;
  285. __le32 address_low;
  286. };
  287. I40E_CHECK_CMD_LENGTH(i40e_aqc_driver_version);
  288. /* Queue Shutdown (direct 0x0003) */
  289. struct i40e_aqc_queue_shutdown {
  290. __le32 driver_unloading;
  291. #define I40E_AQ_DRIVER_UNLOADING 0x1
  292. u8 reserved[12];
  293. };
  294. I40E_CHECK_CMD_LENGTH(i40e_aqc_queue_shutdown);
  295. /* Set PF context (0x0004, direct) */
  296. struct i40e_aqc_set_pf_context {
  297. u8 pf_id;
  298. u8 reserved[15];
  299. };
  300. I40E_CHECK_CMD_LENGTH(i40e_aqc_set_pf_context);
  301. /* Request resource ownership (direct 0x0008)
  302. * Release resource ownership (direct 0x0009)
  303. */
  304. #define I40E_AQ_RESOURCE_NVM 1
  305. #define I40E_AQ_RESOURCE_SDP 2
  306. #define I40E_AQ_RESOURCE_ACCESS_READ 1
  307. #define I40E_AQ_RESOURCE_ACCESS_WRITE 2
  308. #define I40E_AQ_RESOURCE_NVM_READ_TIMEOUT 3000
  309. #define I40E_AQ_RESOURCE_NVM_WRITE_TIMEOUT 180000
  310. struct i40e_aqc_request_resource {
  311. __le16 resource_id;
  312. __le16 access_type;
  313. __le32 timeout;
  314. __le32 resource_number;
  315. u8 reserved[4];
  316. };
  317. I40E_CHECK_CMD_LENGTH(i40e_aqc_request_resource);
  318. /* Get function capabilities (indirect 0x000A)
  319. * Get device capabilities (indirect 0x000B)
  320. */
  321. struct i40e_aqc_list_capabilites {
  322. u8 command_flags;
  323. #define I40E_AQ_LIST_CAP_PF_INDEX_EN 1
  324. u8 pf_index;
  325. u8 reserved[2];
  326. __le32 count;
  327. __le32 addr_high;
  328. __le32 addr_low;
  329. };
  330. I40E_CHECK_CMD_LENGTH(i40e_aqc_list_capabilites);
  331. struct i40e_aqc_list_capabilities_element_resp {
  332. __le16 id;
  333. u8 major_rev;
  334. u8 minor_rev;
  335. __le32 number;
  336. __le32 logical_id;
  337. __le32 phys_id;
  338. u8 reserved[16];
  339. };
  340. /* list of caps */
  341. #define I40E_AQ_CAP_ID_SWITCH_MODE 0x0001
  342. #define I40E_AQ_CAP_ID_MNG_MODE 0x0002
  343. #define I40E_AQ_CAP_ID_NPAR_ACTIVE 0x0003
  344. #define I40E_AQ_CAP_ID_OS2BMC_CAP 0x0004
  345. #define I40E_AQ_CAP_ID_FUNCTIONS_VALID 0x0005
  346. #define I40E_AQ_CAP_ID_ALTERNATE_RAM 0x0006
  347. #define I40E_AQ_CAP_ID_SRIOV 0x0012
  348. #define I40E_AQ_CAP_ID_VF 0x0013
  349. #define I40E_AQ_CAP_ID_VMDQ 0x0014
  350. #define I40E_AQ_CAP_ID_8021QBG 0x0015
  351. #define I40E_AQ_CAP_ID_8021QBR 0x0016
  352. #define I40E_AQ_CAP_ID_VSI 0x0017
  353. #define I40E_AQ_CAP_ID_DCB 0x0018
  354. #define I40E_AQ_CAP_ID_FCOE 0x0021
  355. #define I40E_AQ_CAP_ID_ISCSI 0x0022
  356. #define I40E_AQ_CAP_ID_RSS 0x0040
  357. #define I40E_AQ_CAP_ID_RXQ 0x0041
  358. #define I40E_AQ_CAP_ID_TXQ 0x0042
  359. #define I40E_AQ_CAP_ID_MSIX 0x0043
  360. #define I40E_AQ_CAP_ID_VF_MSIX 0x0044
  361. #define I40E_AQ_CAP_ID_FLOW_DIRECTOR 0x0045
  362. #define I40E_AQ_CAP_ID_1588 0x0046
  363. #define I40E_AQ_CAP_ID_IWARP 0x0051
  364. #define I40E_AQ_CAP_ID_LED 0x0061
  365. #define I40E_AQ_CAP_ID_SDP 0x0062
  366. #define I40E_AQ_CAP_ID_MDIO 0x0063
  367. #define I40E_AQ_CAP_ID_FLEX10 0x00F1
  368. #define I40E_AQ_CAP_ID_CEM 0x00F2
  369. /* Set CPPM Configuration (direct 0x0103) */
  370. struct i40e_aqc_cppm_configuration {
  371. __le16 command_flags;
  372. #define I40E_AQ_CPPM_EN_LTRC 0x0800
  373. #define I40E_AQ_CPPM_EN_DMCTH 0x1000
  374. #define I40E_AQ_CPPM_EN_DMCTLX 0x2000
  375. #define I40E_AQ_CPPM_EN_HPTC 0x4000
  376. #define I40E_AQ_CPPM_EN_DMARC 0x8000
  377. __le16 ttlx;
  378. __le32 dmacr;
  379. __le16 dmcth;
  380. u8 hptc;
  381. u8 reserved;
  382. __le32 pfltrc;
  383. };
  384. I40E_CHECK_CMD_LENGTH(i40e_aqc_cppm_configuration);
  385. /* Set ARP Proxy command / response (indirect 0x0104) */
  386. struct i40e_aqc_arp_proxy_data {
  387. __le16 command_flags;
  388. #define I40E_AQ_ARP_INIT_IPV4 0x0008
  389. #define I40E_AQ_ARP_UNSUP_CTL 0x0010
  390. #define I40E_AQ_ARP_ENA 0x0020
  391. #define I40E_AQ_ARP_ADD_IPV4 0x0040
  392. #define I40E_AQ_ARP_DEL_IPV4 0x0080
  393. __le16 table_id;
  394. __le32 pfpm_proxyfc;
  395. __le32 ip_addr;
  396. u8 mac_addr[6];
  397. u8 reserved[2];
  398. };
  399. I40E_CHECK_STRUCT_LEN(0x14, i40e_aqc_arp_proxy_data);
  400. /* Set NS Proxy Table Entry Command (indirect 0x0105) */
  401. struct i40e_aqc_ns_proxy_data {
  402. __le16 table_idx_mac_addr_0;
  403. __le16 table_idx_mac_addr_1;
  404. __le16 table_idx_ipv6_0;
  405. __le16 table_idx_ipv6_1;
  406. __le16 control;
  407. #define I40E_AQ_NS_PROXY_ADD_0 0x0100
  408. #define I40E_AQ_NS_PROXY_DEL_0 0x0200
  409. #define I40E_AQ_NS_PROXY_ADD_1 0x0400
  410. #define I40E_AQ_NS_PROXY_DEL_1 0x0800
  411. #define I40E_AQ_NS_PROXY_ADD_IPV6_0 0x1000
  412. #define I40E_AQ_NS_PROXY_DEL_IPV6_0 0x2000
  413. #define I40E_AQ_NS_PROXY_ADD_IPV6_1 0x4000
  414. #define I40E_AQ_NS_PROXY_DEL_IPV6_1 0x8000
  415. #define I40E_AQ_NS_PROXY_COMMAND_SEQ 0x0001
  416. #define I40E_AQ_NS_PROXY_INIT_IPV6_TBL 0x0002
  417. #define I40E_AQ_NS_PROXY_INIT_MAC_TBL 0x0004
  418. u8 mac_addr_0[6];
  419. u8 mac_addr_1[6];
  420. u8 local_mac_addr[6];
  421. u8 ipv6_addr_0[16]; /* Warning! spec specifies BE byte order */
  422. u8 ipv6_addr_1[16];
  423. };
  424. I40E_CHECK_STRUCT_LEN(0x3c, i40e_aqc_ns_proxy_data);
  425. /* Manage LAA Command (0x0106) - obsolete */
  426. struct i40e_aqc_mng_laa {
  427. __le16 command_flags;
  428. #define I40E_AQ_LAA_FLAG_WR 0x8000
  429. u8 reserved[2];
  430. __le32 sal;
  431. __le16 sah;
  432. u8 reserved2[6];
  433. };
  434. I40E_CHECK_CMD_LENGTH(i40e_aqc_mng_laa);
  435. /* Manage MAC Address Read Command (indirect 0x0107) */
  436. struct i40e_aqc_mac_address_read {
  437. __le16 command_flags;
  438. #define I40E_AQC_LAN_ADDR_VALID 0x10
  439. #define I40E_AQC_SAN_ADDR_VALID 0x20
  440. #define I40E_AQC_PORT_ADDR_VALID 0x40
  441. #define I40E_AQC_WOL_ADDR_VALID 0x80
  442. #define I40E_AQC_MC_MAG_EN_VALID 0x100
  443. #define I40E_AQC_ADDR_VALID_MASK 0x1F0
  444. u8 reserved[6];
  445. __le32 addr_high;
  446. __le32 addr_low;
  447. };
  448. I40E_CHECK_CMD_LENGTH(i40e_aqc_mac_address_read);
  449. struct i40e_aqc_mac_address_read_data {
  450. u8 pf_lan_mac[6];
  451. u8 pf_san_mac[6];
  452. u8 port_mac[6];
  453. u8 pf_wol_mac[6];
  454. };
  455. I40E_CHECK_STRUCT_LEN(24, i40e_aqc_mac_address_read_data);
  456. /* Manage MAC Address Write Command (0x0108) */
  457. struct i40e_aqc_mac_address_write {
  458. __le16 command_flags;
  459. #define I40E_AQC_WRITE_TYPE_LAA_ONLY 0x0000
  460. #define I40E_AQC_WRITE_TYPE_LAA_WOL 0x4000
  461. #define I40E_AQC_WRITE_TYPE_PORT 0x8000
  462. #define I40E_AQC_WRITE_TYPE_UPDATE_MC_MAG 0xC000
  463. #define I40E_AQC_WRITE_TYPE_MASK 0xC000
  464. __le16 mac_sah;
  465. __le32 mac_sal;
  466. u8 reserved[8];
  467. };
  468. I40E_CHECK_CMD_LENGTH(i40e_aqc_mac_address_write);
  469. /* PXE commands (0x011x) */
  470. /* Clear PXE Command and response (direct 0x0110) */
  471. struct i40e_aqc_clear_pxe {
  472. u8 rx_cnt;
  473. u8 reserved[15];
  474. };
  475. I40E_CHECK_CMD_LENGTH(i40e_aqc_clear_pxe);
  476. /* Switch configuration commands (0x02xx) */
  477. /* Used by many indirect commands that only pass an seid and a buffer in the
  478. * command
  479. */
  480. struct i40e_aqc_switch_seid {
  481. __le16 seid;
  482. u8 reserved[6];
  483. __le32 addr_high;
  484. __le32 addr_low;
  485. };
  486. I40E_CHECK_CMD_LENGTH(i40e_aqc_switch_seid);
  487. /* Get Switch Configuration command (indirect 0x0200)
  488. * uses i40e_aqc_switch_seid for the descriptor
  489. */
  490. struct i40e_aqc_get_switch_config_header_resp {
  491. __le16 num_reported;
  492. __le16 num_total;
  493. u8 reserved[12];
  494. };
  495. I40E_CHECK_CMD_LENGTH(i40e_aqc_get_switch_config_header_resp);
  496. struct i40e_aqc_switch_config_element_resp {
  497. u8 element_type;
  498. #define I40E_AQ_SW_ELEM_TYPE_MAC 1
  499. #define I40E_AQ_SW_ELEM_TYPE_PF 2
  500. #define I40E_AQ_SW_ELEM_TYPE_VF 3
  501. #define I40E_AQ_SW_ELEM_TYPE_EMP 4
  502. #define I40E_AQ_SW_ELEM_TYPE_BMC 5
  503. #define I40E_AQ_SW_ELEM_TYPE_PV 16
  504. #define I40E_AQ_SW_ELEM_TYPE_VEB 17
  505. #define I40E_AQ_SW_ELEM_TYPE_PA 18
  506. #define I40E_AQ_SW_ELEM_TYPE_VSI 19
  507. u8 revision;
  508. #define I40E_AQ_SW_ELEM_REV_1 1
  509. __le16 seid;
  510. __le16 uplink_seid;
  511. __le16 downlink_seid;
  512. u8 reserved[3];
  513. u8 connection_type;
  514. #define I40E_AQ_CONN_TYPE_REGULAR 0x1
  515. #define I40E_AQ_CONN_TYPE_DEFAULT 0x2
  516. #define I40E_AQ_CONN_TYPE_CASCADED 0x3
  517. __le16 scheduler_id;
  518. __le16 element_info;
  519. };
  520. I40E_CHECK_STRUCT_LEN(0x10, i40e_aqc_switch_config_element_resp);
  521. /* Get Switch Configuration (indirect 0x0200)
  522. * an array of elements are returned in the response buffer
  523. * the first in the array is the header, remainder are elements
  524. */
  525. struct i40e_aqc_get_switch_config_resp {
  526. struct i40e_aqc_get_switch_config_header_resp header;
  527. struct i40e_aqc_switch_config_element_resp element[1];
  528. };
  529. I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_get_switch_config_resp);
  530. /* Add Statistics (direct 0x0201)
  531. * Remove Statistics (direct 0x0202)
  532. */
  533. struct i40e_aqc_add_remove_statistics {
  534. __le16 seid;
  535. __le16 vlan;
  536. __le16 stat_index;
  537. u8 reserved[10];
  538. };
  539. I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_statistics);
  540. /* Set Port Parameters command (direct 0x0203) */
  541. struct i40e_aqc_set_port_parameters {
  542. __le16 command_flags;
  543. #define I40E_AQ_SET_P_PARAMS_SAVE_BAD_PACKETS 1
  544. #define I40E_AQ_SET_P_PARAMS_PAD_SHORT_PACKETS 2 /* must set! */
  545. #define I40E_AQ_SET_P_PARAMS_DOUBLE_VLAN_ENA 4
  546. __le16 bad_frame_vsi;
  547. __le16 default_seid; /* reserved for command */
  548. u8 reserved[10];
  549. };
  550. I40E_CHECK_CMD_LENGTH(i40e_aqc_set_port_parameters);
  551. /* Get Switch Resource Allocation (indirect 0x0204) */
  552. struct i40e_aqc_get_switch_resource_alloc {
  553. u8 num_entries; /* reserved for command */
  554. u8 reserved[7];
  555. __le32 addr_high;
  556. __le32 addr_low;
  557. };
  558. I40E_CHECK_CMD_LENGTH(i40e_aqc_get_switch_resource_alloc);
  559. /* expect an array of these structs in the response buffer */
  560. struct i40e_aqc_switch_resource_alloc_element_resp {
  561. u8 resource_type;
  562. #define I40E_AQ_RESOURCE_TYPE_VEB 0x0
  563. #define I40E_AQ_RESOURCE_TYPE_VSI 0x1
  564. #define I40E_AQ_RESOURCE_TYPE_MACADDR 0x2
  565. #define I40E_AQ_RESOURCE_TYPE_STAG 0x3
  566. #define I40E_AQ_RESOURCE_TYPE_ETAG 0x4
  567. #define I40E_AQ_RESOURCE_TYPE_MULTICAST_HASH 0x5
  568. #define I40E_AQ_RESOURCE_TYPE_UNICAST_HASH 0x6
  569. #define I40E_AQ_RESOURCE_TYPE_VLAN 0x7
  570. #define I40E_AQ_RESOURCE_TYPE_VSI_LIST_ENTRY 0x8
  571. #define I40E_AQ_RESOURCE_TYPE_ETAG_LIST_ENTRY 0x9
  572. #define I40E_AQ_RESOURCE_TYPE_VLAN_STAT_POOL 0xA
  573. #define I40E_AQ_RESOURCE_TYPE_MIRROR_RULE 0xB
  574. #define I40E_AQ_RESOURCE_TYPE_QUEUE_SETS 0xC
  575. #define I40E_AQ_RESOURCE_TYPE_VLAN_FILTERS 0xD
  576. #define I40E_AQ_RESOURCE_TYPE_INNER_MAC_FILTERS 0xF
  577. #define I40E_AQ_RESOURCE_TYPE_IP_FILTERS 0x10
  578. #define I40E_AQ_RESOURCE_TYPE_GRE_VN_KEYS 0x11
  579. #define I40E_AQ_RESOURCE_TYPE_VN2_KEYS 0x12
  580. #define I40E_AQ_RESOURCE_TYPE_TUNNEL_PORTS 0x13
  581. u8 reserved1;
  582. __le16 guaranteed;
  583. __le16 total;
  584. __le16 used;
  585. __le16 total_unalloced;
  586. u8 reserved2[6];
  587. };
  588. I40E_CHECK_STRUCT_LEN(0x10, i40e_aqc_switch_resource_alloc_element_resp);
  589. /* Add VSI (indirect 0x0210)
  590. * this indirect command uses struct i40e_aqc_vsi_properties_data
  591. * as the indirect buffer (128 bytes)
  592. *
  593. * Update VSI (indirect 0x211)
  594. * uses the same data structure as Add VSI
  595. *
  596. * Get VSI (indirect 0x0212)
  597. * uses the same completion and data structure as Add VSI
  598. */
  599. struct i40e_aqc_add_get_update_vsi {
  600. __le16 uplink_seid;
  601. u8 connection_type;
  602. #define I40E_AQ_VSI_CONN_TYPE_NORMAL 0x1
  603. #define I40E_AQ_VSI_CONN_TYPE_DEFAULT 0x2
  604. #define I40E_AQ_VSI_CONN_TYPE_CASCADED 0x3
  605. u8 reserved1;
  606. u8 vf_id;
  607. u8 reserved2;
  608. __le16 vsi_flags;
  609. #define I40E_AQ_VSI_TYPE_SHIFT 0x0
  610. #define I40E_AQ_VSI_TYPE_MASK (0x3 << I40E_AQ_VSI_TYPE_SHIFT)
  611. #define I40E_AQ_VSI_TYPE_VF 0x0
  612. #define I40E_AQ_VSI_TYPE_VMDQ2 0x1
  613. #define I40E_AQ_VSI_TYPE_PF 0x2
  614. #define I40E_AQ_VSI_TYPE_EMP_MNG 0x3
  615. #define I40E_AQ_VSI_FLAG_CASCADED_PV 0x4
  616. __le32 addr_high;
  617. __le32 addr_low;
  618. };
  619. I40E_CHECK_CMD_LENGTH(i40e_aqc_add_get_update_vsi);
  620. struct i40e_aqc_add_get_update_vsi_completion {
  621. __le16 seid;
  622. __le16 vsi_number;
  623. __le16 vsi_used;
  624. __le16 vsi_free;
  625. __le32 addr_high;
  626. __le32 addr_low;
  627. };
  628. I40E_CHECK_CMD_LENGTH(i40e_aqc_add_get_update_vsi_completion);
  629. struct i40e_aqc_vsi_properties_data {
  630. /* first 96 byte are written by SW */
  631. __le16 valid_sections;
  632. #define I40E_AQ_VSI_PROP_SWITCH_VALID 0x0001
  633. #define I40E_AQ_VSI_PROP_SECURITY_VALID 0x0002
  634. #define I40E_AQ_VSI_PROP_VLAN_VALID 0x0004
  635. #define I40E_AQ_VSI_PROP_CAS_PV_VALID 0x0008
  636. #define I40E_AQ_VSI_PROP_INGRESS_UP_VALID 0x0010
  637. #define I40E_AQ_VSI_PROP_EGRESS_UP_VALID 0x0020
  638. #define I40E_AQ_VSI_PROP_QUEUE_MAP_VALID 0x0040
  639. #define I40E_AQ_VSI_PROP_QUEUE_OPT_VALID 0x0080
  640. #define I40E_AQ_VSI_PROP_OUTER_UP_VALID 0x0100
  641. #define I40E_AQ_VSI_PROP_SCHED_VALID 0x0200
  642. /* switch section */
  643. __le16 switch_id; /* 12bit id combined with flags below */
  644. #define I40E_AQ_VSI_SW_ID_SHIFT 0x0000
  645. #define I40E_AQ_VSI_SW_ID_MASK (0xFFF << I40E_AQ_VSI_SW_ID_SHIFT)
  646. #define I40E_AQ_VSI_SW_ID_FLAG_NOT_STAG 0x1000
  647. #define I40E_AQ_VSI_SW_ID_FLAG_ALLOW_LB 0x2000
  648. #define I40E_AQ_VSI_SW_ID_FLAG_LOCAL_LB 0x4000
  649. u8 sw_reserved[2];
  650. /* security section */
  651. u8 sec_flags;
  652. #define I40E_AQ_VSI_SEC_FLAG_ALLOW_DEST_OVRD 0x01
  653. #define I40E_AQ_VSI_SEC_FLAG_ENABLE_VLAN_CHK 0x02
  654. #define I40E_AQ_VSI_SEC_FLAG_ENABLE_MAC_CHK 0x04
  655. u8 sec_reserved;
  656. /* VLAN section */
  657. __le16 pvid; /* VLANS include priority bits */
  658. __le16 fcoe_pvid;
  659. u8 port_vlan_flags;
  660. #define I40E_AQ_VSI_PVLAN_MODE_SHIFT 0x00
  661. #define I40E_AQ_VSI_PVLAN_MODE_MASK (0x03 << \
  662. I40E_AQ_VSI_PVLAN_MODE_SHIFT)
  663. #define I40E_AQ_VSI_PVLAN_MODE_TAGGED 0x01
  664. #define I40E_AQ_VSI_PVLAN_MODE_UNTAGGED 0x02
  665. #define I40E_AQ_VSI_PVLAN_MODE_ALL 0x03
  666. #define I40E_AQ_VSI_PVLAN_INSERT_PVID 0x04
  667. #define I40E_AQ_VSI_PVLAN_EMOD_SHIFT 0x03
  668. #define I40E_AQ_VSI_PVLAN_EMOD_MASK (0x3 << \
  669. I40E_AQ_VSI_PVLAN_EMOD_SHIFT)
  670. #define I40E_AQ_VSI_PVLAN_EMOD_STR_BOTH 0x0
  671. #define I40E_AQ_VSI_PVLAN_EMOD_STR_UP 0x08
  672. #define I40E_AQ_VSI_PVLAN_EMOD_STR 0x10
  673. #define I40E_AQ_VSI_PVLAN_EMOD_NOTHING 0x18
  674. u8 pvlan_reserved[3];
  675. /* ingress egress up sections */
  676. __le32 ingress_table; /* bitmap, 3 bits per up */
  677. #define I40E_AQ_VSI_UP_TABLE_UP0_SHIFT 0
  678. #define I40E_AQ_VSI_UP_TABLE_UP0_MASK (0x7 << \
  679. I40E_AQ_VSI_UP_TABLE_UP0_SHIFT)
  680. #define I40E_AQ_VSI_UP_TABLE_UP1_SHIFT 3
  681. #define I40E_AQ_VSI_UP_TABLE_UP1_MASK (0x7 << \
  682. I40E_AQ_VSI_UP_TABLE_UP1_SHIFT)
  683. #define I40E_AQ_VSI_UP_TABLE_UP2_SHIFT 6
  684. #define I40E_AQ_VSI_UP_TABLE_UP2_MASK (0x7 << \
  685. I40E_AQ_VSI_UP_TABLE_UP2_SHIFT)
  686. #define I40E_AQ_VSI_UP_TABLE_UP3_SHIFT 9
  687. #define I40E_AQ_VSI_UP_TABLE_UP3_MASK (0x7 << \
  688. I40E_AQ_VSI_UP_TABLE_UP3_SHIFT)
  689. #define I40E_AQ_VSI_UP_TABLE_UP4_SHIFT 12
  690. #define I40E_AQ_VSI_UP_TABLE_UP4_MASK (0x7 << \
  691. I40E_AQ_VSI_UP_TABLE_UP4_SHIFT)
  692. #define I40E_AQ_VSI_UP_TABLE_UP5_SHIFT 15
  693. #define I40E_AQ_VSI_UP_TABLE_UP5_MASK (0x7 << \
  694. I40E_AQ_VSI_UP_TABLE_UP5_SHIFT)
  695. #define I40E_AQ_VSI_UP_TABLE_UP6_SHIFT 18
  696. #define I40E_AQ_VSI_UP_TABLE_UP6_MASK (0x7 << \
  697. I40E_AQ_VSI_UP_TABLE_UP6_SHIFT)
  698. #define I40E_AQ_VSI_UP_TABLE_UP7_SHIFT 21
  699. #define I40E_AQ_VSI_UP_TABLE_UP7_MASK (0x7 << \
  700. I40E_AQ_VSI_UP_TABLE_UP7_SHIFT)
  701. __le32 egress_table; /* same defines as for ingress table */
  702. /* cascaded PV section */
  703. __le16 cas_pv_tag;
  704. u8 cas_pv_flags;
  705. #define I40E_AQ_VSI_CAS_PV_TAGX_SHIFT 0x00
  706. #define I40E_AQ_VSI_CAS_PV_TAGX_MASK (0x03 << \
  707. I40E_AQ_VSI_CAS_PV_TAGX_SHIFT)
  708. #define I40E_AQ_VSI_CAS_PV_TAGX_LEAVE 0x00
  709. #define I40E_AQ_VSI_CAS_PV_TAGX_REMOVE 0x01
  710. #define I40E_AQ_VSI_CAS_PV_TAGX_COPY 0x02
  711. #define I40E_AQ_VSI_CAS_PV_INSERT_TAG 0x10
  712. #define I40E_AQ_VSI_CAS_PV_ETAG_PRUNE 0x20
  713. #define I40E_AQ_VSI_CAS_PV_ACCEPT_HOST_TAG 0x40
  714. u8 cas_pv_reserved;
  715. /* queue mapping section */
  716. __le16 mapping_flags;
  717. #define I40E_AQ_VSI_QUE_MAP_CONTIG 0x0
  718. #define I40E_AQ_VSI_QUE_MAP_NONCONTIG 0x1
  719. __le16 queue_mapping[16];
  720. #define I40E_AQ_VSI_QUEUE_SHIFT 0x0
  721. #define I40E_AQ_VSI_QUEUE_MASK (0x7FF << I40E_AQ_VSI_QUEUE_SHIFT)
  722. __le16 tc_mapping[8];
  723. #define I40E_AQ_VSI_TC_QUE_OFFSET_SHIFT 0
  724. #define I40E_AQ_VSI_TC_QUE_OFFSET_MASK (0x1FF << \
  725. I40E_AQ_VSI_TC_QUE_OFFSET_SHIFT)
  726. #define I40E_AQ_VSI_TC_QUE_NUMBER_SHIFT 9
  727. #define I40E_AQ_VSI_TC_QUE_NUMBER_MASK (0x7 << \
  728. I40E_AQ_VSI_TC_QUE_NUMBER_SHIFT)
  729. /* queueing option section */
  730. u8 queueing_opt_flags;
  731. #define I40E_AQ_VSI_QUE_OPT_MULTICAST_UDP_ENA 0x04
  732. #define I40E_AQ_VSI_QUE_OPT_UNICAST_UDP_ENA 0x08
  733. #define I40E_AQ_VSI_QUE_OPT_TCP_ENA 0x10
  734. #define I40E_AQ_VSI_QUE_OPT_FCOE_ENA 0x20
  735. #define I40E_AQ_VSI_QUE_OPT_RSS_LUT_PF 0x00
  736. #define I40E_AQ_VSI_QUE_OPT_RSS_LUT_VSI 0x40
  737. u8 queueing_opt_reserved[3];
  738. /* scheduler section */
  739. u8 up_enable_bits;
  740. u8 sched_reserved;
  741. /* outer up section */
  742. __le32 outer_up_table; /* same structure and defines as ingress tbl */
  743. u8 cmd_reserved[8];
  744. /* last 32 bytes are written by FW */
  745. __le16 qs_handle[8];
  746. #define I40E_AQ_VSI_QS_HANDLE_INVALID 0xFFFF
  747. __le16 stat_counter_idx;
  748. __le16 sched_id;
  749. u8 resp_reserved[12];
  750. };
  751. I40E_CHECK_STRUCT_LEN(128, i40e_aqc_vsi_properties_data);
  752. /* Add Port Virtualizer (direct 0x0220)
  753. * also used for update PV (direct 0x0221) but only flags are used
  754. * (IS_CTRL_PORT only works on add PV)
  755. */
  756. struct i40e_aqc_add_update_pv {
  757. __le16 command_flags;
  758. #define I40E_AQC_PV_FLAG_PV_TYPE 0x1
  759. #define I40E_AQC_PV_FLAG_FWD_UNKNOWN_STAG_EN 0x2
  760. #define I40E_AQC_PV_FLAG_FWD_UNKNOWN_ETAG_EN 0x4
  761. #define I40E_AQC_PV_FLAG_IS_CTRL_PORT 0x8
  762. __le16 uplink_seid;
  763. __le16 connected_seid;
  764. u8 reserved[10];
  765. };
  766. I40E_CHECK_CMD_LENGTH(i40e_aqc_add_update_pv);
  767. struct i40e_aqc_add_update_pv_completion {
  768. /* reserved for update; for add also encodes error if rc == ENOSPC */
  769. __le16 pv_seid;
  770. #define I40E_AQC_PV_ERR_FLAG_NO_PV 0x1
  771. #define I40E_AQC_PV_ERR_FLAG_NO_SCHED 0x2
  772. #define I40E_AQC_PV_ERR_FLAG_NO_COUNTER 0x4
  773. #define I40E_AQC_PV_ERR_FLAG_NO_ENTRY 0x8
  774. u8 reserved[14];
  775. };
  776. I40E_CHECK_CMD_LENGTH(i40e_aqc_add_update_pv_completion);
  777. /* Get PV Params (direct 0x0222)
  778. * uses i40e_aqc_switch_seid for the descriptor
  779. */
  780. struct i40e_aqc_get_pv_params_completion {
  781. __le16 seid;
  782. __le16 default_stag;
  783. __le16 pv_flags; /* same flags as add_pv */
  784. #define I40E_AQC_GET_PV_PV_TYPE 0x1
  785. #define I40E_AQC_GET_PV_FRWD_UNKNOWN_STAG 0x2
  786. #define I40E_AQC_GET_PV_FRWD_UNKNOWN_ETAG 0x4
  787. u8 reserved[8];
  788. __le16 default_port_seid;
  789. };
  790. I40E_CHECK_CMD_LENGTH(i40e_aqc_get_pv_params_completion);
  791. /* Add VEB (direct 0x0230) */
  792. struct i40e_aqc_add_veb {
  793. __le16 uplink_seid;
  794. __le16 downlink_seid;
  795. __le16 veb_flags;
  796. #define I40E_AQC_ADD_VEB_FLOATING 0x1
  797. #define I40E_AQC_ADD_VEB_PORT_TYPE_SHIFT 1
  798. #define I40E_AQC_ADD_VEB_PORT_TYPE_MASK (0x3 << \
  799. I40E_AQC_ADD_VEB_PORT_TYPE_SHIFT)
  800. #define I40E_AQC_ADD_VEB_PORT_TYPE_DEFAULT 0x2
  801. #define I40E_AQC_ADD_VEB_PORT_TYPE_DATA 0x4
  802. #define I40E_AQC_ADD_VEB_ENABLE_L2_FILTER 0x8
  803. u8 enable_tcs;
  804. u8 reserved[9];
  805. };
  806. I40E_CHECK_CMD_LENGTH(i40e_aqc_add_veb);
  807. struct i40e_aqc_add_veb_completion {
  808. u8 reserved[6];
  809. __le16 switch_seid;
  810. /* also encodes error if rc == ENOSPC; codes are the same as add_pv */
  811. __le16 veb_seid;
  812. #define I40E_AQC_VEB_ERR_FLAG_NO_VEB 0x1
  813. #define I40E_AQC_VEB_ERR_FLAG_NO_SCHED 0x2
  814. #define I40E_AQC_VEB_ERR_FLAG_NO_COUNTER 0x4
  815. #define I40E_AQC_VEB_ERR_FLAG_NO_ENTRY 0x8
  816. __le16 statistic_index;
  817. __le16 vebs_used;
  818. __le16 vebs_free;
  819. };
  820. I40E_CHECK_CMD_LENGTH(i40e_aqc_add_veb_completion);
  821. /* Get VEB Parameters (direct 0x0232)
  822. * uses i40e_aqc_switch_seid for the descriptor
  823. */
  824. struct i40e_aqc_get_veb_parameters_completion {
  825. __le16 seid;
  826. __le16 switch_id;
  827. __le16 veb_flags; /* only the first/last flags from 0x0230 is valid */
  828. __le16 statistic_index;
  829. __le16 vebs_used;
  830. __le16 vebs_free;
  831. u8 reserved[4];
  832. };
  833. I40E_CHECK_CMD_LENGTH(i40e_aqc_get_veb_parameters_completion);
  834. /* Delete Element (direct 0x0243)
  835. * uses the generic i40e_aqc_switch_seid
  836. */
  837. /* Add MAC-VLAN (indirect 0x0250) */
  838. /* used for the command for most vlan commands */
  839. struct i40e_aqc_macvlan {
  840. __le16 num_addresses;
  841. __le16 seid[3];
  842. #define I40E_AQC_MACVLAN_CMD_SEID_NUM_SHIFT 0
  843. #define I40E_AQC_MACVLAN_CMD_SEID_NUM_MASK (0x3FF << \
  844. I40E_AQC_MACVLAN_CMD_SEID_NUM_SHIFT)
  845. #define I40E_AQC_MACVLAN_CMD_SEID_VALID 0x8000
  846. __le32 addr_high;
  847. __le32 addr_low;
  848. };
  849. I40E_CHECK_CMD_LENGTH(i40e_aqc_macvlan);
  850. /* indirect data for command and response */
  851. struct i40e_aqc_add_macvlan_element_data {
  852. u8 mac_addr[6];
  853. __le16 vlan_tag;
  854. __le16 flags;
  855. #define I40E_AQC_MACVLAN_ADD_PERFECT_MATCH 0x0001
  856. #define I40E_AQC_MACVLAN_ADD_HASH_MATCH 0x0002
  857. #define I40E_AQC_MACVLAN_ADD_IGNORE_VLAN 0x0004
  858. #define I40E_AQC_MACVLAN_ADD_TO_QUEUE 0x0008
  859. __le16 queue_number;
  860. #define I40E_AQC_MACVLAN_CMD_QUEUE_SHIFT 0
  861. #define I40E_AQC_MACVLAN_CMD_QUEUE_MASK (0x7FF << \
  862. I40E_AQC_MACVLAN_CMD_SEID_NUM_SHIFT)
  863. /* response section */
  864. u8 match_method;
  865. #define I40E_AQC_MM_PERFECT_MATCH 0x01
  866. #define I40E_AQC_MM_HASH_MATCH 0x02
  867. #define I40E_AQC_MM_ERR_NO_RES 0xFF
  868. u8 reserved1[3];
  869. };
  870. struct i40e_aqc_add_remove_macvlan_completion {
  871. __le16 perfect_mac_used;
  872. __le16 perfect_mac_free;
  873. __le16 unicast_hash_free;
  874. __le16 multicast_hash_free;
  875. __le32 addr_high;
  876. __le32 addr_low;
  877. };
  878. I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_macvlan_completion);
  879. /* Remove MAC-VLAN (indirect 0x0251)
  880. * uses i40e_aqc_macvlan for the descriptor
  881. * data points to an array of num_addresses of elements
  882. */
  883. struct i40e_aqc_remove_macvlan_element_data {
  884. u8 mac_addr[6];
  885. __le16 vlan_tag;
  886. u8 flags;
  887. #define I40E_AQC_MACVLAN_DEL_PERFECT_MATCH 0x01
  888. #define I40E_AQC_MACVLAN_DEL_HASH_MATCH 0x02
  889. #define I40E_AQC_MACVLAN_DEL_IGNORE_VLAN 0x08
  890. #define I40E_AQC_MACVLAN_DEL_ALL_VSIS 0x10
  891. u8 reserved[3];
  892. /* reply section */
  893. u8 error_code;
  894. #define I40E_AQC_REMOVE_MACVLAN_SUCCESS 0x0
  895. #define I40E_AQC_REMOVE_MACVLAN_FAIL 0xFF
  896. u8 reply_reserved[3];
  897. };
  898. /* Add VLAN (indirect 0x0252)
  899. * Remove VLAN (indirect 0x0253)
  900. * use the generic i40e_aqc_macvlan for the command
  901. */
  902. struct i40e_aqc_add_remove_vlan_element_data {
  903. __le16 vlan_tag;
  904. u8 vlan_flags;
  905. /* flags for add VLAN */
  906. #define I40E_AQC_ADD_VLAN_LOCAL 0x1
  907. #define I40E_AQC_ADD_PVLAN_TYPE_SHIFT 1
  908. #define I40E_AQC_ADD_PVLAN_TYPE_MASK (0x3 << I40E_AQC_ADD_PVLAN_TYPE_SHIFT)
  909. #define I40E_AQC_ADD_PVLAN_TYPE_REGULAR 0x0
  910. #define I40E_AQC_ADD_PVLAN_TYPE_PRIMARY 0x2
  911. #define I40E_AQC_ADD_PVLAN_TYPE_SECONDARY 0x4
  912. #define I40E_AQC_VLAN_PTYPE_SHIFT 3
  913. #define I40E_AQC_VLAN_PTYPE_MASK (0x3 << I40E_AQC_VLAN_PTYPE_SHIFT)
  914. #define I40E_AQC_VLAN_PTYPE_REGULAR_VSI 0x0
  915. #define I40E_AQC_VLAN_PTYPE_PROMISC_VSI 0x8
  916. #define I40E_AQC_VLAN_PTYPE_COMMUNITY_VSI 0x10
  917. #define I40E_AQC_VLAN_PTYPE_ISOLATED_VSI 0x18
  918. /* flags for remove VLAN */
  919. #define I40E_AQC_REMOVE_VLAN_ALL 0x1
  920. u8 reserved;
  921. u8 result;
  922. /* flags for add VLAN */
  923. #define I40E_AQC_ADD_VLAN_SUCCESS 0x0
  924. #define I40E_AQC_ADD_VLAN_FAIL_REQUEST 0xFE
  925. #define I40E_AQC_ADD_VLAN_FAIL_RESOURCE 0xFF
  926. /* flags for remove VLAN */
  927. #define I40E_AQC_REMOVE_VLAN_SUCCESS 0x0
  928. #define I40E_AQC_REMOVE_VLAN_FAIL 0xFF
  929. u8 reserved1[3];
  930. };
  931. struct i40e_aqc_add_remove_vlan_completion {
  932. u8 reserved[4];
  933. __le16 vlans_used;
  934. __le16 vlans_free;
  935. __le32 addr_high;
  936. __le32 addr_low;
  937. };
  938. /* Set VSI Promiscuous Modes (direct 0x0254) */
  939. struct i40e_aqc_set_vsi_promiscuous_modes {
  940. __le16 promiscuous_flags;
  941. __le16 valid_flags;
  942. /* flags used for both fields above */
  943. #define I40E_AQC_SET_VSI_PROMISC_UNICAST 0x01
  944. #define I40E_AQC_SET_VSI_PROMISC_MULTICAST 0x02
  945. #define I40E_AQC_SET_VSI_PROMISC_BROADCAST 0x04
  946. #define I40E_AQC_SET_VSI_DEFAULT 0x08
  947. #define I40E_AQC_SET_VSI_PROMISC_VLAN 0x10
  948. __le16 seid;
  949. #define I40E_AQC_VSI_PROM_CMD_SEID_MASK 0x3FF
  950. __le16 vlan_tag;
  951. #define I40E_AQC_SET_VSI_VLAN_MASK 0x0FFF
  952. #define I40E_AQC_SET_VSI_VLAN_VALID 0x8000
  953. u8 reserved[8];
  954. };
  955. I40E_CHECK_CMD_LENGTH(i40e_aqc_set_vsi_promiscuous_modes);
  956. /* Add S/E-tag command (direct 0x0255)
  957. * Uses generic i40e_aqc_add_remove_tag_completion for completion
  958. */
  959. struct i40e_aqc_add_tag {
  960. __le16 flags;
  961. #define I40E_AQC_ADD_TAG_FLAG_TO_QUEUE 0x0001
  962. __le16 seid;
  963. #define I40E_AQC_ADD_TAG_CMD_SEID_NUM_SHIFT 0
  964. #define I40E_AQC_ADD_TAG_CMD_SEID_NUM_MASK (0x3FF << \
  965. I40E_AQC_ADD_TAG_CMD_SEID_NUM_SHIFT)
  966. __le16 tag;
  967. __le16 queue_number;
  968. u8 reserved[8];
  969. };
  970. I40E_CHECK_CMD_LENGTH(i40e_aqc_add_tag);
  971. struct i40e_aqc_add_remove_tag_completion {
  972. u8 reserved[12];
  973. __le16 tags_used;
  974. __le16 tags_free;
  975. };
  976. I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_tag_completion);
  977. /* Remove S/E-tag command (direct 0x0256)
  978. * Uses generic i40e_aqc_add_remove_tag_completion for completion
  979. */
  980. struct i40e_aqc_remove_tag {
  981. __le16 seid;
  982. #define I40E_AQC_REMOVE_TAG_CMD_SEID_NUM_SHIFT 0
  983. #define I40E_AQC_REMOVE_TAG_CMD_SEID_NUM_MASK (0x3FF << \
  984. I40E_AQC_REMOVE_TAG_CMD_SEID_NUM_SHIFT)
  985. __le16 tag;
  986. u8 reserved[12];
  987. };
  988. I40E_CHECK_CMD_LENGTH(i40e_aqc_remove_tag);
  989. /* Add multicast E-Tag (direct 0x0257)
  990. * del multicast E-Tag (direct 0x0258) only uses pv_seid and etag fields
  991. * and no external data
  992. */
  993. struct i40e_aqc_add_remove_mcast_etag {
  994. __le16 pv_seid;
  995. __le16 etag;
  996. u8 num_unicast_etags;
  997. u8 reserved[3];
  998. __le32 addr_high; /* address of array of 2-byte s-tags */
  999. __le32 addr_low;
  1000. };
  1001. I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_mcast_etag);
  1002. struct i40e_aqc_add_remove_mcast_etag_completion {
  1003. u8 reserved[4];
  1004. __le16 mcast_etags_used;
  1005. __le16 mcast_etags_free;
  1006. __le32 addr_high;
  1007. __le32 addr_low;
  1008. };
  1009. I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_mcast_etag_completion);
  1010. /* Update S/E-Tag (direct 0x0259) */
  1011. struct i40e_aqc_update_tag {
  1012. __le16 seid;
  1013. #define I40E_AQC_UPDATE_TAG_CMD_SEID_NUM_SHIFT 0
  1014. #define I40E_AQC_UPDATE_TAG_CMD_SEID_NUM_MASK (0x3FF << \
  1015. I40E_AQC_UPDATE_TAG_CMD_SEID_NUM_SHIFT)
  1016. __le16 old_tag;
  1017. __le16 new_tag;
  1018. u8 reserved[10];
  1019. };
  1020. I40E_CHECK_CMD_LENGTH(i40e_aqc_update_tag);
  1021. struct i40e_aqc_update_tag_completion {
  1022. u8 reserved[12];
  1023. __le16 tags_used;
  1024. __le16 tags_free;
  1025. };
  1026. I40E_CHECK_CMD_LENGTH(i40e_aqc_update_tag_completion);
  1027. /* Add Control Packet filter (direct 0x025A)
  1028. * Remove Control Packet filter (direct 0x025B)
  1029. * uses the i40e_aqc_add_oveb_cloud,
  1030. * and the generic direct completion structure
  1031. */
  1032. struct i40e_aqc_add_remove_control_packet_filter {
  1033. u8 mac[6];
  1034. __le16 etype;
  1035. __le16 flags;
  1036. #define I40E_AQC_ADD_CONTROL_PACKET_FLAGS_IGNORE_MAC 0x0001
  1037. #define I40E_AQC_ADD_CONTROL_PACKET_FLAGS_DROP 0x0002
  1038. #define I40E_AQC_ADD_CONTROL_PACKET_FLAGS_TO_QUEUE 0x0004
  1039. #define I40E_AQC_ADD_CONTROL_PACKET_FLAGS_TX 0x0008
  1040. #define I40E_AQC_ADD_CONTROL_PACKET_FLAGS_RX 0x0000
  1041. __le16 seid;
  1042. #define I40E_AQC_ADD_CONTROL_PACKET_CMD_SEID_NUM_SHIFT 0
  1043. #define I40E_AQC_ADD_CONTROL_PACKET_CMD_SEID_NUM_MASK (0x3FF << \
  1044. I40E_AQC_ADD_CONTROL_PACKET_CMD_SEID_NUM_SHIFT)
  1045. __le16 queue;
  1046. u8 reserved[2];
  1047. };
  1048. I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_control_packet_filter);
  1049. struct i40e_aqc_add_remove_control_packet_filter_completion {
  1050. __le16 mac_etype_used;
  1051. __le16 etype_used;
  1052. __le16 mac_etype_free;
  1053. __le16 etype_free;
  1054. u8 reserved[8];
  1055. };
  1056. I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_control_packet_filter_completion);
  1057. /* Add Cloud filters (indirect 0x025C)
  1058. * Remove Cloud filters (indirect 0x025D)
  1059. * uses the i40e_aqc_add_remove_cloud_filters,
  1060. * and the generic indirect completion structure
  1061. */
  1062. struct i40e_aqc_add_remove_cloud_filters {
  1063. u8 num_filters;
  1064. u8 reserved;
  1065. __le16 seid;
  1066. #define I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_SHIFT 0
  1067. #define I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_MASK (0x3FF << \
  1068. I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_SHIFT)
  1069. u8 reserved2[4];
  1070. __le32 addr_high;
  1071. __le32 addr_low;
  1072. };
  1073. I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_cloud_filters);
  1074. struct i40e_aqc_add_remove_cloud_filters_element_data {
  1075. u8 outer_mac[6];
  1076. u8 inner_mac[6];
  1077. __le16 inner_vlan;
  1078. union {
  1079. struct {
  1080. u8 reserved[12];
  1081. u8 data[4];
  1082. } v4;
  1083. struct {
  1084. u8 data[16];
  1085. } v6;
  1086. } ipaddr;
  1087. __le16 flags;
  1088. #define I40E_AQC_ADD_CLOUD_FILTER_SHIFT 0
  1089. #define I40E_AQC_ADD_CLOUD_FILTER_MASK (0x3F << \
  1090. I40E_AQC_ADD_CLOUD_FILTER_SHIFT)
  1091. /* 0x0000 reserved */
  1092. #define I40E_AQC_ADD_CLOUD_FILTER_OIP 0x0001
  1093. /* 0x0002 reserved */
  1094. #define I40E_AQC_ADD_CLOUD_FILTER_IMAC_IVLAN 0x0003
  1095. #define I40E_AQC_ADD_CLOUD_FILTER_IMAC_IVLAN_TEN_ID 0x0004
  1096. /* 0x0005 reserved */
  1097. #define I40E_AQC_ADD_CLOUD_FILTER_IMAC_TEN_ID 0x0006
  1098. /* 0x0007 reserved */
  1099. /* 0x0008 reserved */
  1100. #define I40E_AQC_ADD_CLOUD_FILTER_OMAC 0x0009
  1101. #define I40E_AQC_ADD_CLOUD_FILTER_IMAC 0x000A
  1102. #define I40E_AQC_ADD_CLOUD_FILTER_OMAC_TEN_ID_IMAC 0x000B
  1103. #define I40E_AQC_ADD_CLOUD_FILTER_IIP 0x000C
  1104. #define I40E_AQC_ADD_CLOUD_FLAGS_TO_QUEUE 0x0080
  1105. #define I40E_AQC_ADD_CLOUD_VNK_SHIFT 6
  1106. #define I40E_AQC_ADD_CLOUD_VNK_MASK 0x00C0
  1107. #define I40E_AQC_ADD_CLOUD_FLAGS_IPV4 0
  1108. #define I40E_AQC_ADD_CLOUD_FLAGS_IPV6 0x0100
  1109. #define I40E_AQC_ADD_CLOUD_TNL_TYPE_SHIFT 9
  1110. #define I40E_AQC_ADD_CLOUD_TNL_TYPE_MASK 0x1E00
  1111. #define I40E_AQC_ADD_CLOUD_TNL_TYPE_XVLAN 0
  1112. #define I40E_AQC_ADD_CLOUD_TNL_TYPE_NVGRE_OMAC 1
  1113. #define I40E_AQC_ADD_CLOUD_TNL_TYPE_NGE 2
  1114. #define I40E_AQC_ADD_CLOUD_TNL_TYPE_IP 3
  1115. __le32 tenant_id;
  1116. u8 reserved[4];
  1117. __le16 queue_number;
  1118. #define I40E_AQC_ADD_CLOUD_QUEUE_SHIFT 0
  1119. #define I40E_AQC_ADD_CLOUD_QUEUE_MASK (0x7FF << \
  1120. I40E_AQC_ADD_CLOUD_QUEUE_SHIFT)
  1121. u8 reserved2[14];
  1122. /* response section */
  1123. u8 allocation_result;
  1124. #define I40E_AQC_ADD_CLOUD_FILTER_SUCCESS 0x0
  1125. #define I40E_AQC_ADD_CLOUD_FILTER_FAIL 0xFF
  1126. u8 response_reserved[7];
  1127. };
  1128. struct i40e_aqc_remove_cloud_filters_completion {
  1129. __le16 perfect_ovlan_used;
  1130. __le16 perfect_ovlan_free;
  1131. __le16 vlan_used;
  1132. __le16 vlan_free;
  1133. __le32 addr_high;
  1134. __le32 addr_low;
  1135. };
  1136. I40E_CHECK_CMD_LENGTH(i40e_aqc_remove_cloud_filters_completion);
  1137. /* Add Mirror Rule (indirect or direct 0x0260)
  1138. * Delete Mirror Rule (indirect or direct 0x0261)
  1139. * note: some rule types (4,5) do not use an external buffer.
  1140. * take care to set the flags correctly.
  1141. */
  1142. struct i40e_aqc_add_delete_mirror_rule {
  1143. __le16 seid;
  1144. __le16 rule_type;
  1145. #define I40E_AQC_MIRROR_RULE_TYPE_SHIFT 0
  1146. #define I40E_AQC_MIRROR_RULE_TYPE_MASK (0x7 << \
  1147. I40E_AQC_MIRROR_RULE_TYPE_SHIFT)
  1148. #define I40E_AQC_MIRROR_RULE_TYPE_VPORT_INGRESS 1
  1149. #define I40E_AQC_MIRROR_RULE_TYPE_VPORT_EGRESS 2
  1150. #define I40E_AQC_MIRROR_RULE_TYPE_VLAN 3
  1151. #define I40E_AQC_MIRROR_RULE_TYPE_ALL_INGRESS 4
  1152. #define I40E_AQC_MIRROR_RULE_TYPE_ALL_EGRESS 5
  1153. __le16 num_entries;
  1154. __le16 destination; /* VSI for add, rule id for delete */
  1155. __le32 addr_high; /* address of array of 2-byte VSI or VLAN ids */
  1156. __le32 addr_low;
  1157. };
  1158. I40E_CHECK_CMD_LENGTH(i40e_aqc_add_delete_mirror_rule);
  1159. struct i40e_aqc_add_delete_mirror_rule_completion {
  1160. u8 reserved[2];
  1161. __le16 rule_id; /* only used on add */
  1162. __le16 mirror_rules_used;
  1163. __le16 mirror_rules_free;
  1164. __le32 addr_high;
  1165. __le32 addr_low;
  1166. };
  1167. I40E_CHECK_CMD_LENGTH(i40e_aqc_add_delete_mirror_rule_completion);
  1168. /* DCB 0x03xx*/
  1169. /* PFC Ignore (direct 0x0301)
  1170. * the command and response use the same descriptor structure
  1171. */
  1172. struct i40e_aqc_pfc_ignore {
  1173. u8 tc_bitmap;
  1174. u8 command_flags; /* unused on response */
  1175. #define I40E_AQC_PFC_IGNORE_SET 0x80
  1176. #define I40E_AQC_PFC_IGNORE_CLEAR 0x0
  1177. u8 reserved[14];
  1178. };
  1179. I40E_CHECK_CMD_LENGTH(i40e_aqc_pfc_ignore);
  1180. /* DCB Update (direct 0x0302) uses the i40e_aq_desc structure
  1181. * with no parameters
  1182. */
  1183. /* TX scheduler 0x04xx */
  1184. /* Almost all the indirect commands use
  1185. * this generic struct to pass the SEID in param0
  1186. */
  1187. struct i40e_aqc_tx_sched_ind {
  1188. __le16 vsi_seid;
  1189. u8 reserved[6];
  1190. __le32 addr_high;
  1191. __le32 addr_low;
  1192. };
  1193. I40E_CHECK_CMD_LENGTH(i40e_aqc_tx_sched_ind);
  1194. /* Several commands respond with a set of queue set handles */
  1195. struct i40e_aqc_qs_handles_resp {
  1196. __le16 qs_handles[8];
  1197. };
  1198. /* Configure VSI BW limits (direct 0x0400) */
  1199. struct i40e_aqc_configure_vsi_bw_limit {
  1200. __le16 vsi_seid;
  1201. u8 reserved[2];
  1202. __le16 credit;
  1203. u8 reserved1[2];
  1204. u8 max_credit; /* 0-3, limit = 2^max */
  1205. u8 reserved2[7];
  1206. };
  1207. I40E_CHECK_CMD_LENGTH(i40e_aqc_configure_vsi_bw_limit);
  1208. /* Configure VSI Bandwidth Limit per Traffic Type (indirect 0x0406)
  1209. * responds with i40e_aqc_qs_handles_resp
  1210. */
  1211. struct i40e_aqc_configure_vsi_ets_sla_bw_data {
  1212. u8 tc_valid_bits;
  1213. u8 reserved[15];
  1214. __le16 tc_bw_credits[8]; /* FW writesback QS handles here */
  1215. /* 4 bits per tc 0-7, 4th bit is reserved, limit = 2^max */
  1216. __le16 tc_bw_max[2];
  1217. u8 reserved1[28];
  1218. };
  1219. I40E_CHECK_STRUCT_LEN(0x40, i40e_aqc_configure_vsi_ets_sla_bw_data);
  1220. /* Configure VSI Bandwidth Allocation per Traffic Type (indirect 0x0407)
  1221. * responds with i40e_aqc_qs_handles_resp
  1222. */
  1223. struct i40e_aqc_configure_vsi_tc_bw_data {
  1224. u8 tc_valid_bits;
  1225. u8 reserved[3];
  1226. u8 tc_bw_credits[8];
  1227. u8 reserved1[4];
  1228. __le16 qs_handles[8];
  1229. };
  1230. I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_configure_vsi_tc_bw_data);
  1231. /* Query vsi bw configuration (indirect 0x0408) */
  1232. struct i40e_aqc_query_vsi_bw_config_resp {
  1233. u8 tc_valid_bits;
  1234. u8 tc_suspended_bits;
  1235. u8 reserved[14];
  1236. __le16 qs_handles[8];
  1237. u8 reserved1[4];
  1238. __le16 port_bw_limit;
  1239. u8 reserved2[2];
  1240. u8 max_bw; /* 0-3, limit = 2^max */
  1241. u8 reserved3[23];
  1242. };
  1243. I40E_CHECK_STRUCT_LEN(0x40, i40e_aqc_query_vsi_bw_config_resp);
  1244. /* Query VSI Bandwidth Allocation per Traffic Type (indirect 0x040A) */
  1245. struct i40e_aqc_query_vsi_ets_sla_config_resp {
  1246. u8 tc_valid_bits;
  1247. u8 reserved[3];
  1248. u8 share_credits[8];
  1249. __le16 credits[8];
  1250. /* 4 bits per tc 0-7, 4th bit is reserved, limit = 2^max */
  1251. __le16 tc_bw_max[2];
  1252. };
  1253. I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_query_vsi_ets_sla_config_resp);
  1254. /* Configure Switching Component Bandwidth Limit (direct 0x0410) */
  1255. struct i40e_aqc_configure_switching_comp_bw_limit {
  1256. __le16 seid;
  1257. u8 reserved[2];
  1258. __le16 credit;
  1259. u8 reserved1[2];
  1260. u8 max_bw; /* 0-3, limit = 2^max */
  1261. u8 reserved2[7];
  1262. };
  1263. I40E_CHECK_CMD_LENGTH(i40e_aqc_configure_switching_comp_bw_limit);
  1264. /* Enable Physical Port ETS (indirect 0x0413)
  1265. * Modify Physical Port ETS (indirect 0x0414)
  1266. * Disable Physical Port ETS (indirect 0x0415)
  1267. */
  1268. struct i40e_aqc_configure_switching_comp_ets_data {
  1269. u8 reserved[4];
  1270. u8 tc_valid_bits;
  1271. u8 seepage;
  1272. #define I40E_AQ_ETS_SEEPAGE_EN_MASK 0x1
  1273. u8 tc_strict_priority_flags;
  1274. u8 reserved1[17];
  1275. u8 tc_bw_share_credits[8];
  1276. u8 reserved2[96];
  1277. };
  1278. I40E_CHECK_STRUCT_LEN(0x80, i40e_aqc_configure_switching_comp_ets_data);
  1279. /* Configure Switching Component Bandwidth Limits per Tc (indirect 0x0416) */
  1280. struct i40e_aqc_configure_switching_comp_ets_bw_limit_data {
  1281. u8 tc_valid_bits;
  1282. u8 reserved[15];
  1283. __le16 tc_bw_credit[8];
  1284. /* 4 bits per tc 0-7, 4th bit is reserved, limit = 2^max */
  1285. __le16 tc_bw_max[2];
  1286. u8 reserved1[28];
  1287. };
  1288. I40E_CHECK_STRUCT_LEN(0x40,
  1289. i40e_aqc_configure_switching_comp_ets_bw_limit_data);
  1290. /* Configure Switching Component Bandwidth Allocation per Tc
  1291. * (indirect 0x0417)
  1292. */
  1293. struct i40e_aqc_configure_switching_comp_bw_config_data {
  1294. u8 tc_valid_bits;
  1295. u8 reserved[2];
  1296. u8 absolute_credits; /* bool */
  1297. u8 tc_bw_share_credits[8];
  1298. u8 reserved1[20];
  1299. };
  1300. I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_configure_switching_comp_bw_config_data);
  1301. /* Query Switching Component Configuration (indirect 0x0418) */
  1302. struct i40e_aqc_query_switching_comp_ets_config_resp {
  1303. u8 tc_valid_bits;
  1304. u8 reserved[35];
  1305. __le16 port_bw_limit;
  1306. u8 reserved1[2];
  1307. u8 tc_bw_max; /* 0-3, limit = 2^max */
  1308. u8 reserved2[23];
  1309. };
  1310. I40E_CHECK_STRUCT_LEN(0x40, i40e_aqc_query_switching_comp_ets_config_resp);
  1311. /* Query PhysicalPort ETS Configuration (indirect 0x0419) */
  1312. struct i40e_aqc_query_port_ets_config_resp {
  1313. u8 reserved[4];
  1314. u8 tc_valid_bits;
  1315. u8 reserved1;
  1316. u8 tc_strict_priority_bits;
  1317. u8 reserved2;
  1318. u8 tc_bw_share_credits[8];
  1319. __le16 tc_bw_limits[8];
  1320. /* 4 bits per tc 0-7, 4th bit reserved, limit = 2^max */
  1321. __le16 tc_bw_max[2];
  1322. u8 reserved3[32];
  1323. };
  1324. I40E_CHECK_STRUCT_LEN(0x44, i40e_aqc_query_port_ets_config_resp);
  1325. /* Query Switching Component Bandwidth Allocation per Traffic Type
  1326. * (indirect 0x041A)
  1327. */
  1328. struct i40e_aqc_query_switching_comp_bw_config_resp {
  1329. u8 tc_valid_bits;
  1330. u8 reserved[2];
  1331. u8 absolute_credits_enable; /* bool */
  1332. u8 tc_bw_share_credits[8];
  1333. __le16 tc_bw_limits[8];
  1334. /* 4 bits per tc 0-7, 4th bit is reserved, limit = 2^max */
  1335. __le16 tc_bw_max[2];
  1336. };
  1337. I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_query_switching_comp_bw_config_resp);
  1338. /* Suspend/resume port TX traffic
  1339. * (direct 0x041B and 0x041C) uses the generic SEID struct
  1340. */
  1341. /* Configure partition BW
  1342. * (indirect 0x041D)
  1343. */
  1344. struct i40e_aqc_configure_partition_bw_data {
  1345. __le16 pf_valid_bits;
  1346. u8 min_bw[16]; /* guaranteed bandwidth */
  1347. u8 max_bw[16]; /* bandwidth limit */
  1348. };
  1349. I40E_CHECK_STRUCT_LEN(0x22, i40e_aqc_configure_partition_bw_data);
  1350. /* Get and set the active HMC resource profile and status.
  1351. * (direct 0x0500) and (direct 0x0501)
  1352. */
  1353. struct i40e_aq_get_set_hmc_resource_profile {
  1354. u8 pm_profile;
  1355. u8 pe_vf_enabled;
  1356. u8 reserved[14];
  1357. };
  1358. I40E_CHECK_CMD_LENGTH(i40e_aq_get_set_hmc_resource_profile);
  1359. enum i40e_aq_hmc_profile {
  1360. /* I40E_HMC_PROFILE_NO_CHANGE = 0, reserved */
  1361. I40E_HMC_PROFILE_DEFAULT = 1,
  1362. I40E_HMC_PROFILE_FAVOR_VF = 2,
  1363. I40E_HMC_PROFILE_EQUAL = 3,
  1364. };
  1365. #define I40E_AQ_GET_HMC_RESOURCE_PROFILE_PM_MASK 0xF
  1366. #define I40E_AQ_GET_HMC_RESOURCE_PROFILE_COUNT_MASK 0x3F
  1367. /* Get PHY Abilities (indirect 0x0600) uses the generic indirect struct */
  1368. /* set in param0 for get phy abilities to report qualified modules */
  1369. #define I40E_AQ_PHY_REPORT_QUALIFIED_MODULES 0x0001
  1370. #define I40E_AQ_PHY_REPORT_INITIAL_VALUES 0x0002
  1371. enum i40e_aq_phy_type {
  1372. I40E_PHY_TYPE_SGMII = 0x0,
  1373. I40E_PHY_TYPE_1000BASE_KX = 0x1,
  1374. I40E_PHY_TYPE_10GBASE_KX4 = 0x2,
  1375. I40E_PHY_TYPE_10GBASE_KR = 0x3,
  1376. I40E_PHY_TYPE_40GBASE_KR4 = 0x4,
  1377. I40E_PHY_TYPE_XAUI = 0x5,
  1378. I40E_PHY_TYPE_XFI = 0x6,
  1379. I40E_PHY_TYPE_SFI = 0x7,
  1380. I40E_PHY_TYPE_XLAUI = 0x8,
  1381. I40E_PHY_TYPE_XLPPI = 0x9,
  1382. I40E_PHY_TYPE_40GBASE_CR4_CU = 0xA,
  1383. I40E_PHY_TYPE_10GBASE_CR1_CU = 0xB,
  1384. I40E_PHY_TYPE_10GBASE_AOC = 0xC,
  1385. I40E_PHY_TYPE_40GBASE_AOC = 0xD,
  1386. I40E_PHY_TYPE_100BASE_TX = 0x11,
  1387. I40E_PHY_TYPE_1000BASE_T = 0x12,
  1388. I40E_PHY_TYPE_10GBASE_T = 0x13,
  1389. I40E_PHY_TYPE_10GBASE_SR = 0x14,
  1390. I40E_PHY_TYPE_10GBASE_LR = 0x15,
  1391. I40E_PHY_TYPE_10GBASE_SFPP_CU = 0x16,
  1392. I40E_PHY_TYPE_10GBASE_CR1 = 0x17,
  1393. I40E_PHY_TYPE_40GBASE_CR4 = 0x18,
  1394. I40E_PHY_TYPE_40GBASE_SR4 = 0x19,
  1395. I40E_PHY_TYPE_40GBASE_LR4 = 0x1A,
  1396. I40E_PHY_TYPE_1000BASE_SX = 0x1B,
  1397. I40E_PHY_TYPE_1000BASE_LX = 0x1C,
  1398. I40E_PHY_TYPE_1000BASE_T_OPTICAL = 0x1D,
  1399. I40E_PHY_TYPE_20GBASE_KR2 = 0x1E,
  1400. I40E_PHY_TYPE_MAX
  1401. };
  1402. #define I40E_LINK_SPEED_100MB_SHIFT 0x1
  1403. #define I40E_LINK_SPEED_1000MB_SHIFT 0x2
  1404. #define I40E_LINK_SPEED_10GB_SHIFT 0x3
  1405. #define I40E_LINK_SPEED_40GB_SHIFT 0x4
  1406. #define I40E_LINK_SPEED_20GB_SHIFT 0x5
  1407. enum i40e_aq_link_speed {
  1408. I40E_LINK_SPEED_UNKNOWN = 0,
  1409. I40E_LINK_SPEED_100MB = (1 << I40E_LINK_SPEED_100MB_SHIFT),
  1410. I40E_LINK_SPEED_1GB = (1 << I40E_LINK_SPEED_1000MB_SHIFT),
  1411. I40E_LINK_SPEED_10GB = (1 << I40E_LINK_SPEED_10GB_SHIFT),
  1412. I40E_LINK_SPEED_40GB = (1 << I40E_LINK_SPEED_40GB_SHIFT),
  1413. I40E_LINK_SPEED_20GB = (1 << I40E_LINK_SPEED_20GB_SHIFT)
  1414. };
  1415. struct i40e_aqc_module_desc {
  1416. u8 oui[3];
  1417. u8 reserved1;
  1418. u8 part_number[16];
  1419. u8 revision[4];
  1420. u8 reserved2[8];
  1421. };
  1422. I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_module_desc);
  1423. struct i40e_aq_get_phy_abilities_resp {
  1424. __le32 phy_type; /* bitmap using the above enum for offsets */
  1425. u8 link_speed; /* bitmap using the above enum bit patterns */
  1426. u8 abilities;
  1427. #define I40E_AQ_PHY_FLAG_PAUSE_TX 0x01
  1428. #define I40E_AQ_PHY_FLAG_PAUSE_RX 0x02
  1429. #define I40E_AQ_PHY_FLAG_LOW_POWER 0x04
  1430. #define I40E_AQ_PHY_LINK_ENABLED 0x08
  1431. #define I40E_AQ_PHY_AN_ENABLED 0x10
  1432. #define I40E_AQ_PHY_FLAG_MODULE_QUAL 0x20
  1433. __le16 eee_capability;
  1434. #define I40E_AQ_EEE_100BASE_TX 0x0002
  1435. #define I40E_AQ_EEE_1000BASE_T 0x0004
  1436. #define I40E_AQ_EEE_10GBASE_T 0x0008
  1437. #define I40E_AQ_EEE_1000BASE_KX 0x0010
  1438. #define I40E_AQ_EEE_10GBASE_KX4 0x0020
  1439. #define I40E_AQ_EEE_10GBASE_KR 0x0040
  1440. __le32 eeer_val;
  1441. u8 d3_lpan;
  1442. #define I40E_AQ_SET_PHY_D3_LPAN_ENA 0x01
  1443. u8 reserved[3];
  1444. u8 phy_id[4];
  1445. u8 module_type[3];
  1446. u8 qualified_module_count;
  1447. #define I40E_AQ_PHY_MAX_QMS 16
  1448. struct i40e_aqc_module_desc qualified_module[I40E_AQ_PHY_MAX_QMS];
  1449. };
  1450. I40E_CHECK_STRUCT_LEN(0x218, i40e_aq_get_phy_abilities_resp);
  1451. /* Set PHY Config (direct 0x0601) */
  1452. struct i40e_aq_set_phy_config { /* same bits as above in all */
  1453. __le32 phy_type;
  1454. u8 link_speed;
  1455. u8 abilities;
  1456. /* bits 0-2 use the values from get_phy_abilities_resp */
  1457. #define I40E_AQ_PHY_ENABLE_LINK 0x08
  1458. #define I40E_AQ_PHY_ENABLE_AN 0x10
  1459. #define I40E_AQ_PHY_ENABLE_ATOMIC_LINK 0x20
  1460. __le16 eee_capability;
  1461. __le32 eeer;
  1462. u8 low_power_ctrl;
  1463. u8 reserved[3];
  1464. };
  1465. I40E_CHECK_CMD_LENGTH(i40e_aq_set_phy_config);
  1466. /* Set MAC Config command data structure (direct 0x0603) */
  1467. struct i40e_aq_set_mac_config {
  1468. __le16 max_frame_size;
  1469. u8 params;
  1470. #define I40E_AQ_SET_MAC_CONFIG_CRC_EN 0x04
  1471. #define I40E_AQ_SET_MAC_CONFIG_PACING_MASK 0x78
  1472. #define I40E_AQ_SET_MAC_CONFIG_PACING_SHIFT 3
  1473. #define I40E_AQ_SET_MAC_CONFIG_PACING_NONE 0x0
  1474. #define I40E_AQ_SET_MAC_CONFIG_PACING_1B_13TX 0xF
  1475. #define I40E_AQ_SET_MAC_CONFIG_PACING_1DW_9TX 0x9
  1476. #define I40E_AQ_SET_MAC_CONFIG_PACING_1DW_4TX 0x8
  1477. #define I40E_AQ_SET_MAC_CONFIG_PACING_3DW_7TX 0x7
  1478. #define I40E_AQ_SET_MAC_CONFIG_PACING_2DW_3TX 0x6
  1479. #define I40E_AQ_SET_MAC_CONFIG_PACING_1DW_1TX 0x5
  1480. #define I40E_AQ_SET_MAC_CONFIG_PACING_3DW_2TX 0x4
  1481. #define I40E_AQ_SET_MAC_CONFIG_PACING_7DW_3TX 0x3
  1482. #define I40E_AQ_SET_MAC_CONFIG_PACING_4DW_1TX 0x2
  1483. #define I40E_AQ_SET_MAC_CONFIG_PACING_9DW_1TX 0x1
  1484. u8 tx_timer_priority; /* bitmap */
  1485. __le16 tx_timer_value;
  1486. __le16 fc_refresh_threshold;
  1487. u8 reserved[8];
  1488. };
  1489. I40E_CHECK_CMD_LENGTH(i40e_aq_set_mac_config);
  1490. /* Restart Auto-Negotiation (direct 0x605) */
  1491. struct i40e_aqc_set_link_restart_an {
  1492. u8 command;
  1493. #define I40E_AQ_PHY_RESTART_AN 0x02
  1494. #define I40E_AQ_PHY_LINK_ENABLE 0x04
  1495. u8 reserved[15];
  1496. };
  1497. I40E_CHECK_CMD_LENGTH(i40e_aqc_set_link_restart_an);
  1498. /* Get Link Status cmd & response data structure (direct 0x0607) */
  1499. struct i40e_aqc_get_link_status {
  1500. __le16 command_flags; /* only field set on command */
  1501. #define I40E_AQ_LSE_MASK 0x3
  1502. #define I40E_AQ_LSE_NOP 0x0
  1503. #define I40E_AQ_LSE_DISABLE 0x2
  1504. #define I40E_AQ_LSE_ENABLE 0x3
  1505. /* only response uses this flag */
  1506. #define I40E_AQ_LSE_IS_ENABLED 0x1
  1507. u8 phy_type; /* i40e_aq_phy_type */
  1508. u8 link_speed; /* i40e_aq_link_speed */
  1509. u8 link_info;
  1510. #define I40E_AQ_LINK_UP 0x01
  1511. #define I40E_AQ_LINK_FAULT 0x02
  1512. #define I40E_AQ_LINK_FAULT_TX 0x04
  1513. #define I40E_AQ_LINK_FAULT_RX 0x08
  1514. #define I40E_AQ_LINK_FAULT_REMOTE 0x10
  1515. #define I40E_AQ_MEDIA_AVAILABLE 0x40
  1516. #define I40E_AQ_SIGNAL_DETECT 0x80
  1517. u8 an_info;
  1518. #define I40E_AQ_AN_COMPLETED 0x01
  1519. #define I40E_AQ_LP_AN_ABILITY 0x02
  1520. #define I40E_AQ_PD_FAULT 0x04
  1521. #define I40E_AQ_FEC_EN 0x08
  1522. #define I40E_AQ_PHY_LOW_POWER 0x10
  1523. #define I40E_AQ_LINK_PAUSE_TX 0x20
  1524. #define I40E_AQ_LINK_PAUSE_RX 0x40
  1525. #define I40E_AQ_QUALIFIED_MODULE 0x80
  1526. u8 ext_info;
  1527. #define I40E_AQ_LINK_PHY_TEMP_ALARM 0x01
  1528. #define I40E_AQ_LINK_XCESSIVE_ERRORS 0x02
  1529. #define I40E_AQ_LINK_TX_SHIFT 0x02
  1530. #define I40E_AQ_LINK_TX_MASK (0x03 << I40E_AQ_LINK_TX_SHIFT)
  1531. #define I40E_AQ_LINK_TX_ACTIVE 0x00
  1532. #define I40E_AQ_LINK_TX_DRAINED 0x01
  1533. #define I40E_AQ_LINK_TX_FLUSHED 0x03
  1534. #define I40E_AQ_LINK_FORCED_40G 0x10
  1535. u8 loopback; /* use defines from i40e_aqc_set_lb_mode */
  1536. __le16 max_frame_size;
  1537. u8 config;
  1538. #define I40E_AQ_CONFIG_CRC_ENA 0x04
  1539. #define I40E_AQ_CONFIG_PACING_MASK 0x78
  1540. u8 reserved[5];
  1541. };
  1542. I40E_CHECK_CMD_LENGTH(i40e_aqc_get_link_status);
  1543. /* Set event mask command (direct 0x613) */
  1544. struct i40e_aqc_set_phy_int_mask {
  1545. u8 reserved[8];
  1546. __le16 event_mask;
  1547. #define I40E_AQ_EVENT_LINK_UPDOWN 0x0002
  1548. #define I40E_AQ_EVENT_MEDIA_NA 0x0004
  1549. #define I40E_AQ_EVENT_LINK_FAULT 0x0008
  1550. #define I40E_AQ_EVENT_PHY_TEMP_ALARM 0x0010
  1551. #define I40E_AQ_EVENT_EXCESSIVE_ERRORS 0x0020
  1552. #define I40E_AQ_EVENT_SIGNAL_DETECT 0x0040
  1553. #define I40E_AQ_EVENT_AN_COMPLETED 0x0080
  1554. #define I40E_AQ_EVENT_MODULE_QUAL_FAIL 0x0100
  1555. #define I40E_AQ_EVENT_PORT_TX_SUSPENDED 0x0200
  1556. u8 reserved1[6];
  1557. };
  1558. I40E_CHECK_CMD_LENGTH(i40e_aqc_set_phy_int_mask);
  1559. /* Get Local AN advt register (direct 0x0614)
  1560. * Set Local AN advt register (direct 0x0615)
  1561. * Get Link Partner AN advt register (direct 0x0616)
  1562. */
  1563. struct i40e_aqc_an_advt_reg {
  1564. __le32 local_an_reg0;
  1565. __le16 local_an_reg1;
  1566. u8 reserved[10];
  1567. };
  1568. I40E_CHECK_CMD_LENGTH(i40e_aqc_an_advt_reg);
  1569. /* Set Loopback mode (0x0618) */
  1570. struct i40e_aqc_set_lb_mode {
  1571. __le16 lb_mode;
  1572. #define I40E_AQ_LB_PHY_LOCAL 0x01
  1573. #define I40E_AQ_LB_PHY_REMOTE 0x02
  1574. #define I40E_AQ_LB_MAC_LOCAL 0x04
  1575. u8 reserved[14];
  1576. };
  1577. I40E_CHECK_CMD_LENGTH(i40e_aqc_set_lb_mode);
  1578. /* Set PHY Debug command (0x0622) */
  1579. struct i40e_aqc_set_phy_debug {
  1580. u8 command_flags;
  1581. #define I40E_AQ_PHY_DEBUG_RESET_INTERNAL 0x02
  1582. #define I40E_AQ_PHY_DEBUG_RESET_EXTERNAL_SHIFT 2
  1583. #define I40E_AQ_PHY_DEBUG_RESET_EXTERNAL_MASK (0x03 << \
  1584. I40E_AQ_PHY_DEBUG_RESET_EXTERNAL_SHIFT)
  1585. #define I40E_AQ_PHY_DEBUG_RESET_EXTERNAL_NONE 0x00
  1586. #define I40E_AQ_PHY_DEBUG_RESET_EXTERNAL_HARD 0x01
  1587. #define I40E_AQ_PHY_DEBUG_RESET_EXTERNAL_SOFT 0x02
  1588. #define I40E_AQ_PHY_DEBUG_DISABLE_LINK_FW 0x10
  1589. u8 reserved[15];
  1590. };
  1591. I40E_CHECK_CMD_LENGTH(i40e_aqc_set_phy_debug);
  1592. enum i40e_aq_phy_reg_type {
  1593. I40E_AQC_PHY_REG_INTERNAL = 0x1,
  1594. I40E_AQC_PHY_REG_EXERNAL_BASET = 0x2,
  1595. I40E_AQC_PHY_REG_EXERNAL_MODULE = 0x3
  1596. };
  1597. /* NVM Read command (indirect 0x0701)
  1598. * NVM Erase commands (direct 0x0702)
  1599. * NVM Update commands (indirect 0x0703)
  1600. */
  1601. struct i40e_aqc_nvm_update {
  1602. u8 command_flags;
  1603. #define I40E_AQ_NVM_LAST_CMD 0x01
  1604. #define I40E_AQ_NVM_FLASH_ONLY 0x80
  1605. u8 module_pointer;
  1606. __le16 length;
  1607. __le32 offset;
  1608. __le32 addr_high;
  1609. __le32 addr_low;
  1610. };
  1611. I40E_CHECK_CMD_LENGTH(i40e_aqc_nvm_update);
  1612. /* NVM Config Read (indirect 0x0704) */
  1613. struct i40e_aqc_nvm_config_read {
  1614. __le16 cmd_flags;
  1615. #define I40E_AQ_ANVM_SINGLE_OR_MULTIPLE_FEATURES_MASK 1
  1616. #define I40E_AQ_ANVM_READ_SINGLE_FEATURE 0
  1617. #define I40E_AQ_ANVM_READ_MULTIPLE_FEATURES 1
  1618. __le16 element_count;
  1619. __le16 element_id; /* Feature/field ID */
  1620. __le16 element_id_msw; /* MSWord of field ID */
  1621. __le32 address_high;
  1622. __le32 address_low;
  1623. };
  1624. I40E_CHECK_CMD_LENGTH(i40e_aqc_nvm_config_read);
  1625. /* NVM Config Write (indirect 0x0705) */
  1626. struct i40e_aqc_nvm_config_write {
  1627. __le16 cmd_flags;
  1628. __le16 element_count;
  1629. u8 reserved[4];
  1630. __le32 address_high;
  1631. __le32 address_low;
  1632. };
  1633. I40E_CHECK_CMD_LENGTH(i40e_aqc_nvm_config_write);
  1634. /* Used for 0x0704 as well as for 0x0705 commands */
  1635. #define I40E_AQ_ANVM_FEATURE_OR_IMMEDIATE_SHIFT 1
  1636. #define I40E_AQ_ANVM_FEATURE_OR_IMMEDIATE_MASK \
  1637. (1 << I40E_AQ_ANVM_FEATURE_OR_IMMEDIATE_SHIFT)
  1638. #define I40E_AQ_ANVM_FEATURE 0
  1639. #define I40E_AQ_ANVM_IMMEDIATE_FIELD (1 << FEATURE_OR_IMMEDIATE_SHIFT)
  1640. struct i40e_aqc_nvm_config_data_feature {
  1641. __le16 feature_id;
  1642. #define I40E_AQ_ANVM_FEATURE_OPTION_OEM_ONLY 0x01
  1643. #define I40E_AQ_ANVM_FEATURE_OPTION_DWORD_MAP 0x08
  1644. #define I40E_AQ_ANVM_FEATURE_OPTION_POR_CSR 0x10
  1645. __le16 feature_options;
  1646. __le16 feature_selection;
  1647. };
  1648. I40E_CHECK_STRUCT_LEN(0x6, i40e_aqc_nvm_config_data_feature);
  1649. struct i40e_aqc_nvm_config_data_immediate_field {
  1650. __le32 field_id;
  1651. __le32 field_value;
  1652. __le16 field_options;
  1653. __le16 reserved;
  1654. };
  1655. I40E_CHECK_STRUCT_LEN(0xc, i40e_aqc_nvm_config_data_immediate_field);
  1656. /* Send to PF command (indirect 0x0801) id is only used by PF
  1657. * Send to VF command (indirect 0x0802) id is only used by PF
  1658. * Send to Peer PF command (indirect 0x0803)
  1659. */
  1660. struct i40e_aqc_pf_vf_message {
  1661. __le32 id;
  1662. u8 reserved[4];
  1663. __le32 addr_high;
  1664. __le32 addr_low;
  1665. };
  1666. I40E_CHECK_CMD_LENGTH(i40e_aqc_pf_vf_message);
  1667. /* Alternate structure */
  1668. /* Direct write (direct 0x0900)
  1669. * Direct read (direct 0x0902)
  1670. */
  1671. struct i40e_aqc_alternate_write {
  1672. __le32 address0;
  1673. __le32 data0;
  1674. __le32 address1;
  1675. __le32 data1;
  1676. };
  1677. I40E_CHECK_CMD_LENGTH(i40e_aqc_alternate_write);
  1678. /* Indirect write (indirect 0x0901)
  1679. * Indirect read (indirect 0x0903)
  1680. */
  1681. struct i40e_aqc_alternate_ind_write {
  1682. __le32 address;
  1683. __le32 length;
  1684. __le32 addr_high;
  1685. __le32 addr_low;
  1686. };
  1687. I40E_CHECK_CMD_LENGTH(i40e_aqc_alternate_ind_write);
  1688. /* Done alternate write (direct 0x0904)
  1689. * uses i40e_aq_desc
  1690. */
  1691. struct i40e_aqc_alternate_write_done {
  1692. __le16 cmd_flags;
  1693. #define I40E_AQ_ALTERNATE_MODE_BIOS_MASK 1
  1694. #define I40E_AQ_ALTERNATE_MODE_BIOS_LEGACY 0
  1695. #define I40E_AQ_ALTERNATE_MODE_BIOS_UEFI 1
  1696. #define I40E_AQ_ALTERNATE_RESET_NEEDED 2
  1697. u8 reserved[14];
  1698. };
  1699. I40E_CHECK_CMD_LENGTH(i40e_aqc_alternate_write_done);
  1700. /* Set OEM mode (direct 0x0905) */
  1701. struct i40e_aqc_alternate_set_mode {
  1702. __le32 mode;
  1703. #define I40E_AQ_ALTERNATE_MODE_NONE 0
  1704. #define I40E_AQ_ALTERNATE_MODE_OEM 1
  1705. u8 reserved[12];
  1706. };
  1707. I40E_CHECK_CMD_LENGTH(i40e_aqc_alternate_set_mode);
  1708. /* Clear port Alternate RAM (direct 0x0906) uses i40e_aq_desc */
  1709. /* async events 0x10xx */
  1710. /* Lan Queue Overflow Event (direct, 0x1001) */
  1711. struct i40e_aqc_lan_overflow {
  1712. __le32 prtdcb_rupto;
  1713. __le32 otx_ctl;
  1714. u8 reserved[8];
  1715. };
  1716. I40E_CHECK_CMD_LENGTH(i40e_aqc_lan_overflow);
  1717. /* Get LLDP MIB (indirect 0x0A00) */
  1718. struct i40e_aqc_lldp_get_mib {
  1719. u8 type;
  1720. u8 reserved1;
  1721. #define I40E_AQ_LLDP_MIB_TYPE_MASK 0x3
  1722. #define I40E_AQ_LLDP_MIB_LOCAL 0x0
  1723. #define I40E_AQ_LLDP_MIB_REMOTE 0x1
  1724. #define I40E_AQ_LLDP_MIB_LOCAL_AND_REMOTE 0x2
  1725. #define I40E_AQ_LLDP_BRIDGE_TYPE_MASK 0xC
  1726. #define I40E_AQ_LLDP_BRIDGE_TYPE_SHIFT 0x2
  1727. #define I40E_AQ_LLDP_BRIDGE_TYPE_NEAREST_BRIDGE 0x0
  1728. #define I40E_AQ_LLDP_BRIDGE_TYPE_NON_TPMR 0x1
  1729. #define I40E_AQ_LLDP_TX_SHIFT 0x4
  1730. #define I40E_AQ_LLDP_TX_MASK (0x03 << I40E_AQ_LLDP_TX_SHIFT)
  1731. /* TX pause flags use I40E_AQ_LINK_TX_* above */
  1732. __le16 local_len;
  1733. __le16 remote_len;
  1734. u8 reserved2[2];
  1735. __le32 addr_high;
  1736. __le32 addr_low;
  1737. };
  1738. I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_get_mib);
  1739. /* Configure LLDP MIB Change Event (direct 0x0A01)
  1740. * also used for the event (with type in the command field)
  1741. */
  1742. struct i40e_aqc_lldp_update_mib {
  1743. u8 command;
  1744. #define I40E_AQ_LLDP_MIB_UPDATE_ENABLE 0x0
  1745. #define I40E_AQ_LLDP_MIB_UPDATE_DISABLE 0x1
  1746. u8 reserved[7];
  1747. __le32 addr_high;
  1748. __le32 addr_low;
  1749. };
  1750. I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_update_mib);
  1751. /* Add LLDP TLV (indirect 0x0A02)
  1752. * Delete LLDP TLV (indirect 0x0A04)
  1753. */
  1754. struct i40e_aqc_lldp_add_tlv {
  1755. u8 type; /* only nearest bridge and non-TPMR from 0x0A00 */
  1756. u8 reserved1[1];
  1757. __le16 len;
  1758. u8 reserved2[4];
  1759. __le32 addr_high;
  1760. __le32 addr_low;
  1761. };
  1762. I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_add_tlv);
  1763. /* Update LLDP TLV (indirect 0x0A03) */
  1764. struct i40e_aqc_lldp_update_tlv {
  1765. u8 type; /* only nearest bridge and non-TPMR from 0x0A00 */
  1766. u8 reserved;
  1767. __le16 old_len;
  1768. __le16 new_offset;
  1769. __le16 new_len;
  1770. __le32 addr_high;
  1771. __le32 addr_low;
  1772. };
  1773. I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_update_tlv);
  1774. /* Stop LLDP (direct 0x0A05) */
  1775. struct i40e_aqc_lldp_stop {
  1776. u8 command;
  1777. #define I40E_AQ_LLDP_AGENT_STOP 0x0
  1778. #define I40E_AQ_LLDP_AGENT_SHUTDOWN 0x1
  1779. u8 reserved[15];
  1780. };
  1781. I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_stop);
  1782. /* Start LLDP (direct 0x0A06) */
  1783. struct i40e_aqc_lldp_start {
  1784. u8 command;
  1785. #define I40E_AQ_LLDP_AGENT_START 0x1
  1786. u8 reserved[15];
  1787. };
  1788. I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_start);
  1789. /* Apply MIB changes (0x0A07)
  1790. * uses the generic struc as it contains no data
  1791. */
  1792. /* Add Udp Tunnel command and completion (direct 0x0B00) */
  1793. struct i40e_aqc_add_udp_tunnel {
  1794. __le16 udp_port;
  1795. u8 reserved0[3];
  1796. u8 protocol_type;
  1797. #define I40E_AQC_TUNNEL_TYPE_VXLAN 0x00
  1798. #define I40E_AQC_TUNNEL_TYPE_NGE 0x01
  1799. #define I40E_AQC_TUNNEL_TYPE_TEREDO 0x10
  1800. u8 reserved1[10];
  1801. };
  1802. I40E_CHECK_CMD_LENGTH(i40e_aqc_add_udp_tunnel);
  1803. struct i40e_aqc_add_udp_tunnel_completion {
  1804. __le16 udp_port;
  1805. u8 filter_entry_index;
  1806. u8 multiple_pfs;
  1807. #define I40E_AQC_SINGLE_PF 0x0
  1808. #define I40E_AQC_MULTIPLE_PFS 0x1
  1809. u8 total_filters;
  1810. u8 reserved[11];
  1811. };
  1812. I40E_CHECK_CMD_LENGTH(i40e_aqc_add_udp_tunnel_completion);
  1813. /* remove UDP Tunnel command (0x0B01) */
  1814. struct i40e_aqc_remove_udp_tunnel {
  1815. u8 reserved[2];
  1816. u8 index; /* 0 to 15 */
  1817. u8 reserved2[13];
  1818. };
  1819. I40E_CHECK_CMD_LENGTH(i40e_aqc_remove_udp_tunnel);
  1820. struct i40e_aqc_del_udp_tunnel_completion {
  1821. __le16 udp_port;
  1822. u8 index; /* 0 to 15 */
  1823. u8 multiple_pfs;
  1824. u8 total_filters_used;
  1825. u8 reserved1[11];
  1826. };
  1827. I40E_CHECK_CMD_LENGTH(i40e_aqc_del_udp_tunnel_completion);
  1828. struct i40e_aqc_get_set_rss_key {
  1829. #define I40E_AQC_SET_RSS_KEY_VSI_VALID (0x1 << 15)
  1830. #define I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT 0
  1831. #define I40E_AQC_SET_RSS_KEY_VSI_ID_MASK (0x3FF << \
  1832. I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT)
  1833. __le16 vsi_id;
  1834. u8 reserved[6];
  1835. __le32 addr_high;
  1836. __le32 addr_low;
  1837. };
  1838. I40E_CHECK_CMD_LENGTH(i40e_aqc_get_set_rss_key);
  1839. struct i40e_aqc_get_set_rss_key_data {
  1840. u8 standard_rss_key[0x28];
  1841. u8 extended_hash_key[0xc];
  1842. };
  1843. I40E_CHECK_STRUCT_LEN(0x34, i40e_aqc_get_set_rss_key_data);
  1844. struct i40e_aqc_get_set_rss_lut {
  1845. #define I40E_AQC_SET_RSS_LUT_VSI_VALID (0x1 << 15)
  1846. #define I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT 0
  1847. #define I40E_AQC_SET_RSS_LUT_VSI_ID_MASK (0x3FF << \
  1848. I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT)
  1849. __le16 vsi_id;
  1850. #define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT 0
  1851. #define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_MASK (0x1 << \
  1852. I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT)
  1853. #define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_VSI 0
  1854. #define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_PF 1
  1855. __le16 flags;
  1856. u8 reserved[4];
  1857. __le32 addr_high;
  1858. __le32 addr_low;
  1859. };
  1860. I40E_CHECK_CMD_LENGTH(i40e_aqc_get_set_rss_lut);
  1861. /* tunnel key structure 0x0B10 */
  1862. struct i40e_aqc_tunnel_key_structure_A0 {
  1863. __le16 key1_off;
  1864. __le16 key1_len;
  1865. __le16 key2_off;
  1866. __le16 key2_len;
  1867. __le16 flags;
  1868. #define I40E_AQC_TUNNEL_KEY_STRUCT_OVERRIDE 0x01
  1869. /* response flags */
  1870. #define I40E_AQC_TUNNEL_KEY_STRUCT_SUCCESS 0x01
  1871. #define I40E_AQC_TUNNEL_KEY_STRUCT_MODIFIED 0x02
  1872. #define I40E_AQC_TUNNEL_KEY_STRUCT_OVERRIDDEN 0x03
  1873. u8 resreved[6];
  1874. };
  1875. I40E_CHECK_CMD_LENGTH(i40e_aqc_tunnel_key_structure_A0);
  1876. struct i40e_aqc_tunnel_key_structure {
  1877. u8 key1_off;
  1878. u8 key2_off;
  1879. u8 key1_len; /* 0 to 15 */
  1880. u8 key2_len; /* 0 to 15 */
  1881. u8 flags;
  1882. #define I40E_AQC_TUNNEL_KEY_STRUCT_OVERRIDE 0x01
  1883. /* response flags */
  1884. #define I40E_AQC_TUNNEL_KEY_STRUCT_SUCCESS 0x01
  1885. #define I40E_AQC_TUNNEL_KEY_STRUCT_MODIFIED 0x02
  1886. #define I40E_AQC_TUNNEL_KEY_STRUCT_OVERRIDDEN 0x03
  1887. u8 network_key_index;
  1888. #define I40E_AQC_NETWORK_KEY_INDEX_VXLAN 0x0
  1889. #define I40E_AQC_NETWORK_KEY_INDEX_NGE 0x1
  1890. #define I40E_AQC_NETWORK_KEY_INDEX_FLEX_MAC_IN_UDP 0x2
  1891. #define I40E_AQC_NETWORK_KEY_INDEX_GRE 0x3
  1892. u8 reserved[10];
  1893. };
  1894. I40E_CHECK_CMD_LENGTH(i40e_aqc_tunnel_key_structure);
  1895. /* OEM mode commands (direct 0xFE0x) */
  1896. struct i40e_aqc_oem_param_change {
  1897. __le32 param_type;
  1898. #define I40E_AQ_OEM_PARAM_TYPE_PF_CTL 0
  1899. #define I40E_AQ_OEM_PARAM_TYPE_BW_CTL 1
  1900. #define I40E_AQ_OEM_PARAM_MAC 2
  1901. __le32 param_value1;
  1902. __le16 param_value2;
  1903. u8 reserved[6];
  1904. };
  1905. I40E_CHECK_CMD_LENGTH(i40e_aqc_oem_param_change);
  1906. struct i40e_aqc_oem_state_change {
  1907. __le32 state;
  1908. #define I40E_AQ_OEM_STATE_LINK_DOWN 0x0
  1909. #define I40E_AQ_OEM_STATE_LINK_UP 0x1
  1910. u8 reserved[12];
  1911. };
  1912. I40E_CHECK_CMD_LENGTH(i40e_aqc_oem_state_change);
  1913. /* Initialize OCSD (0xFE02, direct) */
  1914. struct i40e_aqc_opc_oem_ocsd_initialize {
  1915. u8 type_status;
  1916. u8 reserved1[3];
  1917. __le32 ocsd_memory_block_addr_high;
  1918. __le32 ocsd_memory_block_addr_low;
  1919. __le32 requested_update_interval;
  1920. };
  1921. I40E_CHECK_CMD_LENGTH(i40e_aqc_opc_oem_ocsd_initialize);
  1922. /* Initialize OCBB (0xFE03, direct) */
  1923. struct i40e_aqc_opc_oem_ocbb_initialize {
  1924. u8 type_status;
  1925. u8 reserved1[3];
  1926. __le32 ocbb_memory_block_addr_high;
  1927. __le32 ocbb_memory_block_addr_low;
  1928. u8 reserved2[4];
  1929. };
  1930. I40E_CHECK_CMD_LENGTH(i40e_aqc_opc_oem_ocbb_initialize);
  1931. /* debug commands */
  1932. /* get device id (0xFF00) uses the generic structure */
  1933. /* set test more (0xFF01, internal) */
  1934. struct i40e_acq_set_test_mode {
  1935. u8 mode;
  1936. #define I40E_AQ_TEST_PARTIAL 0
  1937. #define I40E_AQ_TEST_FULL 1
  1938. #define I40E_AQ_TEST_NVM 2
  1939. u8 reserved[3];
  1940. u8 command;
  1941. #define I40E_AQ_TEST_OPEN 0
  1942. #define I40E_AQ_TEST_CLOSE 1
  1943. #define I40E_AQ_TEST_INC 2
  1944. u8 reserved2[3];
  1945. __le32 address_high;
  1946. __le32 address_low;
  1947. };
  1948. I40E_CHECK_CMD_LENGTH(i40e_acq_set_test_mode);
  1949. /* Debug Read Register command (0xFF03)
  1950. * Debug Write Register command (0xFF04)
  1951. */
  1952. struct i40e_aqc_debug_reg_read_write {
  1953. __le32 reserved;
  1954. __le32 address;
  1955. __le32 value_high;
  1956. __le32 value_low;
  1957. };
  1958. I40E_CHECK_CMD_LENGTH(i40e_aqc_debug_reg_read_write);
  1959. /* Scatter/gather Reg Read (indirect 0xFF05)
  1960. * Scatter/gather Reg Write (indirect 0xFF06)
  1961. */
  1962. /* i40e_aq_desc is used for the command */
  1963. struct i40e_aqc_debug_reg_sg_element_data {
  1964. __le32 address;
  1965. __le32 value;
  1966. };
  1967. /* Debug Modify register (direct 0xFF07) */
  1968. struct i40e_aqc_debug_modify_reg {
  1969. __le32 address;
  1970. __le32 value;
  1971. __le32 clear_mask;
  1972. __le32 set_mask;
  1973. };
  1974. I40E_CHECK_CMD_LENGTH(i40e_aqc_debug_modify_reg);
  1975. /* dump internal data (0xFF08, indirect) */
  1976. #define I40E_AQ_CLUSTER_ID_AUX 0
  1977. #define I40E_AQ_CLUSTER_ID_SWITCH_FLU 1
  1978. #define I40E_AQ_CLUSTER_ID_TXSCHED 2
  1979. #define I40E_AQ_CLUSTER_ID_HMC 3
  1980. #define I40E_AQ_CLUSTER_ID_MAC0 4
  1981. #define I40E_AQ_CLUSTER_ID_MAC1 5
  1982. #define I40E_AQ_CLUSTER_ID_MAC2 6
  1983. #define I40E_AQ_CLUSTER_ID_MAC3 7
  1984. #define I40E_AQ_CLUSTER_ID_DCB 8
  1985. #define I40E_AQ_CLUSTER_ID_EMP_MEM 9
  1986. #define I40E_AQ_CLUSTER_ID_PKT_BUF 10
  1987. #define I40E_AQ_CLUSTER_ID_ALTRAM 11
  1988. struct i40e_aqc_debug_dump_internals {
  1989. u8 cluster_id;
  1990. u8 table_id;
  1991. __le16 data_size;
  1992. __le32 idx;
  1993. __le32 address_high;
  1994. __le32 address_low;
  1995. };
  1996. I40E_CHECK_CMD_LENGTH(i40e_aqc_debug_dump_internals);
  1997. struct i40e_aqc_debug_modify_internals {
  1998. u8 cluster_id;
  1999. u8 cluster_specific_params[7];
  2000. __le32 address_high;
  2001. __le32 address_low;
  2002. };
  2003. I40E_CHECK_CMD_LENGTH(i40e_aqc_debug_modify_internals);
  2004. #endif