i40e_adminq_cmd.h 85 KB

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