i40e_adminq_cmd.h 84 KB

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