i40e_adminq_cmd.h 79 KB

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