i40e_adminq_cmd.h 63 KB

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