i40e_adminq_cmd.h 72 KB

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