i40e_adminq_cmd.h 74 KB

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