i40e_adminq_cmd.h 64 KB

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