i40e_adminq_cmd.h 68 KB

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