i40e_adminq_cmd.h 79 KB

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