i40e_adminq_cmd.h 64 KB

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