i40e_adminq_cmd.h 65 KB

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