bnxt_hsi.h 107 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821
  1. /* Broadcom NetXtreme-C/E network driver.
  2. *
  3. * Copyright (c) 2014-2015 Broadcom Corporation
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation.
  8. */
  9. #ifndef BNXT_HSI_H
  10. #define BNXT_HSI_H
  11. /* per-context HW statistics -- chip view */
  12. struct ctx_hw_stats {
  13. __le64 rx_ucast_pkts;
  14. __le64 rx_mcast_pkts;
  15. __le64 rx_bcast_pkts;
  16. __le64 rx_discard_pkts;
  17. __le64 rx_drop_pkts;
  18. __le64 rx_ucast_bytes;
  19. __le64 rx_mcast_bytes;
  20. __le64 rx_bcast_bytes;
  21. __le64 tx_ucast_pkts;
  22. __le64 tx_mcast_pkts;
  23. __le64 tx_bcast_pkts;
  24. __le64 tx_discard_pkts;
  25. __le64 tx_drop_pkts;
  26. __le64 tx_ucast_bytes;
  27. __le64 tx_mcast_bytes;
  28. __le64 tx_bcast_bytes;
  29. __le64 tpa_pkts;
  30. __le64 tpa_bytes;
  31. __le64 tpa_events;
  32. __le64 tpa_aborts;
  33. };
  34. /* Statistics Ejection Buffer Completion Record (16 bytes) */
  35. struct eject_cmpl {
  36. __le16 type;
  37. #define EJECT_CMPL_TYPE_MASK 0x3fUL
  38. #define EJECT_CMPL_TYPE_SFT 0
  39. #define EJECT_CMPL_TYPE_STAT_EJECT (0x1aUL << 0)
  40. __le16 len;
  41. __le32 opaque;
  42. __le32 v;
  43. #define EJECT_CMPL_V 0x1UL
  44. __le32 unused_2;
  45. };
  46. /* HWRM Completion Record (16 bytes) */
  47. struct hwrm_cmpl {
  48. __le16 type;
  49. #define HWRM_CMPL_TYPE_MASK 0x3fUL
  50. #define HWRM_CMPL_TYPE_SFT 0
  51. #define HWRM_CMPL_TYPE_HWRM_DONE (0x20UL << 0)
  52. __le16 sequence_id;
  53. __le32 unused_1;
  54. __le32 v;
  55. #define HWRM_CMPL_V 0x1UL
  56. __le32 unused_3;
  57. };
  58. /* HWRM Forwarded Request (16 bytes) */
  59. struct hwrm_fwd_req_cmpl {
  60. __le16 req_len_type;
  61. #define HWRM_FWD_REQ_CMPL_TYPE_MASK 0x3fUL
  62. #define HWRM_FWD_REQ_CMPL_TYPE_SFT 0
  63. #define HWRM_FWD_REQ_CMPL_TYPE_HWRM_FWD_REQ (0x22UL << 0)
  64. #define HWRM_FWD_REQ_CMPL_REQ_LEN_MASK 0xffc0UL
  65. #define HWRM_FWD_REQ_CMPL_REQ_LEN_SFT 6
  66. __le16 source_id;
  67. __le32 unused_0;
  68. __le32 req_buf_addr_v[2];
  69. #define HWRM_FWD_REQ_CMPL_V 0x1UL
  70. #define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_MASK 0xfffffffeUL
  71. #define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_SFT 1
  72. };
  73. /* HWRM Forwarded Response (16 bytes) */
  74. struct hwrm_fwd_resp_cmpl {
  75. __le16 type;
  76. #define HWRM_FWD_RESP_CMPL_TYPE_MASK 0x3fUL
  77. #define HWRM_FWD_RESP_CMPL_TYPE_SFT 0
  78. #define HWRM_FWD_RESP_CMPL_TYPE_HWRM_FWD_RESP (0x24UL << 0)
  79. __le16 source_id;
  80. __le16 resp_len;
  81. __le16 unused_1;
  82. __le32 resp_buf_addr_v[2];
  83. #define HWRM_FWD_RESP_CMPL_V 0x1UL
  84. #define HWRM_FWD_RESP_CMPL_RESP_BUF_ADDR_MASK 0xfffffffeUL
  85. #define HWRM_FWD_RESP_CMPL_RESP_BUF_ADDR_SFT 1
  86. };
  87. /* HWRM Asynchronous Event Completion Record (16 bytes) */
  88. struct hwrm_async_event_cmpl {
  89. __le16 type;
  90. #define HWRM_ASYNC_EVENT_CMPL_TYPE_MASK 0x3fUL
  91. #define HWRM_ASYNC_EVENT_CMPL_TYPE_SFT 0
  92. #define HWRM_ASYNC_EVENT_CMPL_TYPE_HWRM_ASYNC_EVENT (0x2eUL << 0)
  93. __le16 event_id;
  94. #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE (0x0UL << 0)
  95. #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_MTU_CHANGE (0x1UL << 0)
  96. #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CHANGE (0x2UL << 0)
  97. #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DCB_CONFIG_CHANGE (0x3UL << 0)
  98. #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED (0x4UL << 0)
  99. #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED (0x5UL << 0)
  100. #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_UNLOAD (0x10UL << 0)
  101. #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_LOAD (0x11UL << 0)
  102. #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD (0x20UL << 0)
  103. #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_LOAD (0x21UL << 0)
  104. #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_FLR (0x30UL << 0)
  105. #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_MAC_ADDR_CHANGE (0x31UL << 0)
  106. #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_VF_COMM_STATUS_CHANGE (0x32UL << 0)
  107. #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR (0xffUL << 0)
  108. __le32 event_data2;
  109. u8 opaque_v;
  110. #define HWRM_ASYNC_EVENT_CMPL_V 0x1UL
  111. #define HWRM_ASYNC_EVENT_CMPL_OPAQUE_MASK 0xfeUL
  112. #define HWRM_ASYNC_EVENT_CMPL_OPAQUE_SFT 1
  113. u8 timestamp_lo;
  114. __le16 timestamp_hi;
  115. __le32 event_data1;
  116. };
  117. /* HWRM Asynchronous Event Completion Record for link status change (16 bytes) */
  118. struct hwrm_async_event_cmpl_link_status_change {
  119. __le16 type;
  120. #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_MASK 0x3fUL
  121. #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_SFT 0
  122. #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT (0x2eUL << 0)
  123. __le16 event_id;
  124. #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_ID_LINK_STATUS_CHANGE (0x0UL << 0)
  125. __le32 event_data2;
  126. u8 opaque_v;
  127. #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_V 0x1UL
  128. #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_OPAQUE_MASK 0xfeUL
  129. #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_OPAQUE_SFT 1
  130. u8 timestamp_lo;
  131. __le16 timestamp_hi;
  132. __le32 event_data1;
  133. #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE 0x1UL
  134. #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_DOWN (0x0UL << 0)
  135. #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_UP (0x1UL << 0)
  136. #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_MASK 0xeUL
  137. #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_SFT 1
  138. #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_ID_MASK 0xffff0UL
  139. #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_ID_SFT 4
  140. };
  141. /* HWRM Asynchronous Event Completion Record for link MTU change (16 bytes) */
  142. struct hwrm_async_event_cmpl_link_mtu_change {
  143. __le16 type;
  144. #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_MASK 0x3fUL
  145. #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_SFT 0
  146. #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_HWRM_ASYNC_EVENT (0x2eUL << 0)
  147. __le16 event_id;
  148. #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_ID_LINK_MTU_CHANGE (0x1UL << 0)
  149. __le32 event_data2;
  150. u8 opaque_v;
  151. #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_V 0x1UL
  152. #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_OPAQUE_MASK 0xfeUL
  153. #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_OPAQUE_SFT 1
  154. u8 timestamp_lo;
  155. __le16 timestamp_hi;
  156. __le32 event_data1;
  157. #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_DATA1_NEW_MTU_MASK 0xffffUL
  158. #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_DATA1_NEW_MTU_SFT 0
  159. };
  160. /* HWRM Asynchronous Event Completion Record for link speed change (16 bytes) */
  161. struct hwrm_async_event_cmpl_link_speed_change {
  162. __le16 type;
  163. #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_MASK 0x3fUL
  164. #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_SFT 0
  165. #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_HWRM_ASYNC_EVENT (0x2eUL << 0)
  166. __le16 event_id;
  167. #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_ID_LINK_SPEED_CHANGE (0x2UL << 0)
  168. __le32 event_data2;
  169. u8 opaque_v;
  170. #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_V 0x1UL
  171. #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_OPAQUE_MASK 0xfeUL
  172. #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_OPAQUE_SFT 1
  173. u8 timestamp_lo;
  174. __le16 timestamp_hi;
  175. __le32 event_data1;
  176. #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_FORCE 0x1UL
  177. #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_MASK 0xfffeUL
  178. #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_SFT 1
  179. #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_100MB (0x1UL << 1)
  180. #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_1GB (0xaUL << 1)
  181. #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_2GB (0x14UL << 1)
  182. #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_2_5GB (0x19UL << 1)
  183. #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_10GB (0x64UL << 1)
  184. #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_20GB (0xc8UL << 1)
  185. #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_25GB (0xfaUL << 1)
  186. #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_40GB (0x190UL << 1)
  187. #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_50GB (0x1f4UL << 1)
  188. #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_PORT_ID_MASK 0xffff0000UL
  189. #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_PORT_ID_SFT 16
  190. };
  191. /* HWRM Asynchronous Event Completion Record for DCB Config change (16 bytes) */
  192. struct hwrm_async_event_cmpl_dcb_config_change {
  193. __le16 type;
  194. #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_MASK 0x3fUL
  195. #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_SFT 0
  196. #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_HWRM_ASYNC_EVENT (0x2eUL << 0)
  197. __le16 event_id;
  198. #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_ID_DCB_CONFIG_CHANGE (0x3UL << 0)
  199. __le32 event_data2;
  200. u8 opaque_v;
  201. #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_V 0x1UL
  202. #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_OPAQUE_MASK 0xfeUL
  203. #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_OPAQUE_SFT 1
  204. u8 timestamp_lo;
  205. __le16 timestamp_hi;
  206. __le32 event_data1;
  207. #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_PORT_ID_MASK 0xffffUL
  208. #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_PORT_ID_SFT 0
  209. };
  210. /* HWRM Asynchronous Event Completion Record for port connection not allowed (16 bytes) */
  211. struct hwrm_async_event_cmpl_port_conn_not_allowed {
  212. __le16 type;
  213. #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_MASK 0x3fUL
  214. #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_SFT 0
  215. #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT (0x2eUL << 0)
  216. __le16 event_id;
  217. #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_ID_PORT_CONN_NOT_ALLOWED (0x4UL << 0)
  218. __le32 event_data2;
  219. u8 opaque_v;
  220. #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_V 0x1UL
  221. #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_OPAQUE_MASK 0xfeUL
  222. #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_OPAQUE_SFT 1
  223. u8 timestamp_lo;
  224. __le16 timestamp_hi;
  225. __le32 event_data1;
  226. #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_PORT_ID_MASK 0xffffUL
  227. #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_PORT_ID_SFT 0
  228. };
  229. /* HWRM Asynchronous Event Completion Record for Function Driver Unload (16 bytes) */
  230. struct hwrm_async_event_cmpl_func_drvr_unload {
  231. __le16 type;
  232. #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_MASK 0x3fUL
  233. #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_SFT 0
  234. #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT (0x2eUL << 0)
  235. __le16 event_id;
  236. #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_ID_FUNC_DRVR_UNLOAD (0x10UL << 0)
  237. __le32 event_data2;
  238. u8 opaque_v;
  239. #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_V 0x1UL
  240. #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_OPAQUE_MASK 0xfeUL
  241. #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_OPAQUE_SFT 1
  242. u8 timestamp_lo;
  243. __le16 timestamp_hi;
  244. __le32 event_data1;
  245. #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_MASK 0xffffUL
  246. #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_SFT 0
  247. };
  248. /* HWRM Asynchronous Event Completion Record for Function Driver load (16 bytes) */
  249. struct hwrm_async_event_cmpl_func_drvr_load {
  250. __le16 type;
  251. #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_MASK 0x3fUL
  252. #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_SFT 0
  253. #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT (0x2eUL << 0)
  254. __le16 event_id;
  255. #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_ID_FUNC_DRVR_LOAD (0x11UL << 0)
  256. __le32 event_data2;
  257. u8 opaque_v;
  258. #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_V 0x1UL
  259. #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_OPAQUE_MASK 0xfeUL
  260. #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_OPAQUE_SFT 1
  261. u8 timestamp_lo;
  262. __le16 timestamp_hi;
  263. __le32 event_data1;
  264. #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_DATA1_FUNC_ID_MASK 0xffffUL
  265. #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_DATA1_FUNC_ID_SFT 0
  266. };
  267. /* HWRM Asynchronous Event Completion Record for PF Driver Unload (16 bytes) */
  268. struct hwrm_async_event_cmpl_pf_drvr_unload {
  269. __le16 type;
  270. #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_MASK 0x3fUL
  271. #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_SFT 0
  272. #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT (0x2eUL << 0)
  273. __le16 event_id;
  274. #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_ID_PF_DRVR_UNLOAD (0x20UL << 0)
  275. __le32 event_data2;
  276. u8 opaque_v;
  277. #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_V 0x1UL
  278. #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_OPAQUE_MASK 0xfeUL
  279. #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_OPAQUE_SFT 1
  280. u8 timestamp_lo;
  281. __le16 timestamp_hi;
  282. __le32 event_data1;
  283. #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_MASK 0xffffUL
  284. #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_SFT 0
  285. #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_PORT_MASK 0x70000UL
  286. #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_PORT_SFT 16
  287. };
  288. /* HWRM Asynchronous Event Completion Record for PF Driver load (16 bytes) */
  289. struct hwrm_async_event_cmpl_pf_drvr_load {
  290. __le16 type;
  291. #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_MASK 0x3fUL
  292. #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_SFT 0
  293. #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT (0x2eUL << 0)
  294. __le16 event_id;
  295. #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_ID_PF_DRVR_LOAD (0x21UL << 0)
  296. __le32 event_data2;
  297. u8 opaque_v;
  298. #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_V 0x1UL
  299. #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_OPAQUE_MASK 0xfeUL
  300. #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_OPAQUE_SFT 1
  301. u8 timestamp_lo;
  302. __le16 timestamp_hi;
  303. __le32 event_data1;
  304. #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_FUNC_ID_MASK 0xffffUL
  305. #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_FUNC_ID_SFT 0
  306. #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_PORT_MASK 0x70000UL
  307. #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_PORT_SFT 16
  308. };
  309. /* HWRM Asynchronous Event Completion Record for VF FLR (16 bytes) */
  310. struct hwrm_async_event_cmpl_vf_flr {
  311. __le16 type;
  312. #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_MASK 0x3fUL
  313. #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_SFT 0
  314. #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_HWRM_ASYNC_EVENT (0x2eUL << 0)
  315. __le16 event_id;
  316. #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_ID_VF_FLR (0x30UL << 0)
  317. __le32 event_data2;
  318. u8 opaque_v;
  319. #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_V 0x1UL
  320. #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_OPAQUE_MASK 0xfeUL
  321. #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_OPAQUE_SFT 1
  322. u8 timestamp_lo;
  323. __le16 timestamp_hi;
  324. __le32 event_data1;
  325. #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_VF_ID_MASK 0xffffUL
  326. #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_VF_ID_SFT 0
  327. };
  328. /* HWRM Asynchronous Event Completion Record for VF MAC Addr change (16 bytes) */
  329. struct hwrm_async_event_cmpl_vf_mac_addr_change {
  330. __le16 type;
  331. #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_MASK 0x3fUL
  332. #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_SFT 0
  333. #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_HWRM_ASYNC_EVENT (0x2eUL << 0)
  334. __le16 event_id;
  335. #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_ID_VF_MAC_ADDR_CHANGE (0x31UL << 0)
  336. __le32 event_data2;
  337. u8 opaque_v;
  338. #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_V 0x1UL
  339. #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_OPAQUE_MASK 0xfeUL
  340. #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_OPAQUE_SFT 1
  341. u8 timestamp_lo;
  342. __le16 timestamp_hi;
  343. __le32 event_data1;
  344. #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_DATA1_VF_ID_MASK 0xffffUL
  345. #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_DATA1_VF_ID_SFT 0
  346. };
  347. /* HWRM Asynchronous Event Completion Record for HWRM Error (16 bytes) */
  348. struct hwrm_async_event_cmpl_hwrm_error {
  349. __le16 type;
  350. #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_MASK 0x3fUL
  351. #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_SFT 0
  352. #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_HWRM_ASYNC_EVENT (0x2eUL << 0)
  353. __le16 event_id;
  354. #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_ID_HWRM_ERROR (0xffUL << 0)
  355. __le32 event_data2;
  356. #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_MASK 0xffUL
  357. #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_SFT 0
  358. #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_WARNING (0x0UL << 0)
  359. #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_NONFATAL (0x1UL << 0)
  360. #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_FATAL (0x2UL << 0)
  361. u8 opaque_v;
  362. #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_V 0x1UL
  363. #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_OPAQUE_MASK 0xfeUL
  364. #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_OPAQUE_SFT 1
  365. u8 timestamp_lo;
  366. __le16 timestamp_hi;
  367. __le32 event_data1;
  368. #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA1_TIMESTAMP 0x1UL
  369. };
  370. /* HW Resource Manager Specification 1.0.0 */
  371. #define HWRM_VERSION_MAJOR 1
  372. #define HWRM_VERSION_MINOR 0
  373. #define HWRM_VERSION_UPDATE 0
  374. #define HWRM_VERSION_STR "1.0.0"
  375. /*
  376. * Following is the signature for HWRM message field that indicates not
  377. * applicable (All F's). Need to cast it the size of the field if needed.
  378. */
  379. #define HWRM_NA_SIGNATURE ((__le32)(-1))
  380. #define HWRM_MAX_REQ_LEN (128) /* hwrm_func_buf_rgtr */
  381. #define HWRM_MAX_RESP_LEN (176) /* hwrm_func_qstats */
  382. #define HW_HASH_INDEX_SIZE 0x80 /* 7 bit indirection table index. */
  383. #define HW_HASH_KEY_SIZE 40
  384. #define HWRM_RESP_VALID_KEY 1 /* valid key for HWRM response */
  385. /* Input (16 bytes) */
  386. struct input {
  387. __le16 req_type;
  388. __le16 cmpl_ring;
  389. __le16 seq_id;
  390. __le16 target_id;
  391. __le64 resp_addr;
  392. };
  393. /* Output (8 bytes) */
  394. struct output {
  395. __le16 error_code;
  396. __le16 req_type;
  397. __le16 seq_id;
  398. __le16 resp_len;
  399. };
  400. /* Command numbering (8 bytes) */
  401. struct cmd_nums {
  402. __le16 req_type;
  403. #define HWRM_VER_GET (0x0UL)
  404. #define HWRM_FUNC_BUF_UNRGTR (0xeUL)
  405. #define HWRM_FUNC_VF_CFG (0xfUL)
  406. #define RESERVED1 (0x10UL)
  407. #define HWRM_FUNC_RESET (0x11UL)
  408. #define HWRM_FUNC_GETFID (0x12UL)
  409. #define HWRM_FUNC_VF_ALLOC (0x13UL)
  410. #define HWRM_FUNC_VF_FREE (0x14UL)
  411. #define HWRM_FUNC_QCAPS (0x15UL)
  412. #define HWRM_FUNC_QCFG (0x16UL)
  413. #define HWRM_FUNC_CFG (0x17UL)
  414. #define HWRM_FUNC_QSTATS (0x18UL)
  415. #define HWRM_FUNC_CLR_STATS (0x19UL)
  416. #define HWRM_FUNC_DRV_UNRGTR (0x1aUL)
  417. #define HWRM_FUNC_VF_RESC_FREE (0x1bUL)
  418. #define HWRM_FUNC_VF_VNIC_IDS_QUERY (0x1cUL)
  419. #define HWRM_FUNC_DRV_RGTR (0x1dUL)
  420. #define HWRM_FUNC_DRV_QVER (0x1eUL)
  421. #define HWRM_FUNC_BUF_RGTR (0x1fUL)
  422. #define HWRM_PORT_PHY_CFG (0x20UL)
  423. #define HWRM_PORT_MAC_CFG (0x21UL)
  424. #define RESERVED2 (0x22UL)
  425. #define HWRM_PORT_QSTATS (0x23UL)
  426. #define HWRM_PORT_LPBK_QSTATS (0x24UL)
  427. #define HWRM_PORT_CLR_STATS (0x25UL)
  428. #define HWRM_PORT_LPBK_CLR_STATS (0x26UL)
  429. #define HWRM_PORT_PHY_QCFG (0x27UL)
  430. #define HWRM_PORT_MAC_QCFG (0x28UL)
  431. #define HWRM_PORT_BLINK_LED (0x29UL)
  432. #define HWRM_QUEUE_QPORTCFG (0x30UL)
  433. #define HWRM_QUEUE_QCFG (0x31UL)
  434. #define HWRM_QUEUE_CFG (0x32UL)
  435. #define HWRM_QUEUE_BUFFERS_QCFG (0x33UL)
  436. #define HWRM_QUEUE_BUFFERS_CFG (0x34UL)
  437. #define HWRM_QUEUE_PFCENABLE_QCFG (0x35UL)
  438. #define HWRM_QUEUE_PFCENABLE_CFG (0x36UL)
  439. #define HWRM_QUEUE_PRI2COS_QCFG (0x37UL)
  440. #define HWRM_QUEUE_PRI2COS_CFG (0x38UL)
  441. #define HWRM_QUEUE_COS2BW_QCFG (0x39UL)
  442. #define HWRM_QUEUE_COS2BW_CFG (0x3aUL)
  443. #define HWRM_VNIC_ALLOC (0x40UL)
  444. #define HWRM_VNIC_FREE (0x41UL)
  445. #define HWRM_VNIC_CFG (0x42UL)
  446. #define HWRM_VNIC_QCFG (0x43UL)
  447. #define HWRM_VNIC_TPA_CFG (0x44UL)
  448. #define HWRM_VNIC_TPA_QCFG (0x45UL)
  449. #define HWRM_VNIC_RSS_CFG (0x46UL)
  450. #define HWRM_VNIC_RSS_QCFG (0x47UL)
  451. #define HWRM_VNIC_PLCMODES_CFG (0x48UL)
  452. #define HWRM_VNIC_PLCMODES_QCFG (0x49UL)
  453. #define HWRM_RING_ALLOC (0x50UL)
  454. #define HWRM_RING_FREE (0x51UL)
  455. #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS (0x52UL)
  456. #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS (0x53UL)
  457. #define HWRM_RING_RESET (0x5eUL)
  458. #define HWRM_RING_GRP_ALLOC (0x60UL)
  459. #define HWRM_RING_GRP_FREE (0x61UL)
  460. #define HWRM_VNIC_RSS_COS_LB_CTX_ALLOC (0x70UL)
  461. #define HWRM_VNIC_RSS_COS_LB_CTX_FREE (0x71UL)
  462. #define HWRM_CFA_L2_FILTER_ALLOC (0x90UL)
  463. #define HWRM_CFA_L2_FILTER_FREE (0x91UL)
  464. #define HWRM_CFA_L2_FILTER_CFG (0x92UL)
  465. #define HWRM_CFA_L2_SET_RX_MASK (0x93UL)
  466. #define RESERVED3 (0x94UL)
  467. #define HWRM_CFA_TUNNEL_FILTER_ALLOC (0x95UL)
  468. #define HWRM_CFA_TUNNEL_FILTER_FREE (0x96UL)
  469. #define HWRM_CFA_ENCAP_RECORD_ALLOC (0x97UL)
  470. #define HWRM_CFA_ENCAP_RECORD_FREE (0x98UL)
  471. #define HWRM_CFA_NTUPLE_FILTER_ALLOC (0x99UL)
  472. #define HWRM_CFA_NTUPLE_FILTER_FREE (0x9aUL)
  473. #define HWRM_CFA_NTUPLE_FILTER_CFG (0x9bUL)
  474. #define HWRM_CFA_EM_FLOW_ALLOC (0x9cUL)
  475. #define HWRM_CFA_EM_FLOW_FREE (0x9dUL)
  476. #define HWRM_CFA_EM_FLOW_CFG (0x9eUL)
  477. #define HWRM_TUNNEL_DST_PORT_QUERY (0xa0UL)
  478. #define HWRM_TUNNEL_DST_PORT_ALLOC (0xa1UL)
  479. #define HWRM_TUNNEL_DST_PORT_FREE (0xa2UL)
  480. #define HWRM_STAT_CTX_ALLOC (0xb0UL)
  481. #define HWRM_STAT_CTX_FREE (0xb1UL)
  482. #define HWRM_STAT_CTX_QUERY (0xb2UL)
  483. #define HWRM_STAT_CTX_CLR_STATS (0xb3UL)
  484. #define HWRM_FW_RESET (0xc0UL)
  485. #define HWRM_FW_QSTATUS (0xc1UL)
  486. #define HWRM_EXEC_FWD_RESP (0xd0UL)
  487. #define HWRM_REJECT_FWD_RESP (0xd1UL)
  488. #define HWRM_FWD_RESP (0xd2UL)
  489. #define HWRM_FWD_ASYNC_EVENT_CMPL (0xd3UL)
  490. #define HWRM_TEMP_MONITOR_QUERY (0xe0UL)
  491. #define HWRM_DBG_READ_DIRECT (0xff10UL)
  492. #define HWRM_DBG_READ_INDIRECT (0xff11UL)
  493. #define HWRM_DBG_WRITE_DIRECT (0xff12UL)
  494. #define HWRM_DBG_WRITE_INDIRECT (0xff13UL)
  495. #define HWRM_DBG_DUMP (0xff14UL)
  496. #define HWRM_NVM_MODIFY (0xfff4UL)
  497. #define HWRM_NVM_VERIFY_UPDATE (0xfff5UL)
  498. #define HWRM_NVM_GET_DEV_INFO (0xfff6UL)
  499. #define HWRM_NVM_ERASE_DIR_ENTRY (0xfff7UL)
  500. #define HWRM_NVM_MOD_DIR_ENTRY (0xfff8UL)
  501. #define HWRM_NVM_FIND_DIR_ENTRY (0xfff9UL)
  502. #define HWRM_NVM_GET_DIR_ENTRIES (0xfffaUL)
  503. #define HWRM_NVM_GET_DIR_INFO (0xfffbUL)
  504. #define HWRM_NVM_RAW_DUMP (0xfffcUL)
  505. #define HWRM_NVM_READ (0xfffdUL)
  506. #define HWRM_NVM_WRITE (0xfffeUL)
  507. #define HWRM_NVM_RAW_WRITE_BLK (0xffffUL)
  508. __le16 unused_0[3];
  509. };
  510. struct ret_codes {
  511. __le16 error_code;
  512. #define HWRM_ERR_CODE_SUCCESS (0x0UL)
  513. #define HWRM_ERR_CODE_FAIL (0x1UL)
  514. #define HWRM_ERR_CODE_INVALID_PARAMS (0x2UL)
  515. #define HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED (0x3UL)
  516. #define HWRM_ERR_CODE_RESOURCE_ALLOC_ERROR (0x4UL)
  517. #define HWRM_ERR_CODE_INVALID_FLAGS (0x5UL)
  518. #define HWRM_ERR_CODE_INVALID_ENABLES (0x6UL)
  519. #define HWRM_ERR_CODE_HWRM_ERROR (0xfUL)
  520. #define HWRM_ERR_CODE_UNKNOWN_ERR (0xfffeUL)
  521. #define HWRM_ERR_CODE_CMD_NOT_SUPPORTED (0xffffUL)
  522. __le16 unused_0[3];
  523. };
  524. /* Output (16 bytes) */
  525. struct hwrm_err_output {
  526. __le16 error_code;
  527. __le16 req_type;
  528. __le16 seq_id;
  529. __le16 resp_len;
  530. __le32 opaque_0;
  531. __le16 opaque_1;
  532. u8 cmd_err;
  533. u8 valid;
  534. };
  535. /* Port Tx Statistics Formats (408 bytes) */
  536. struct tx_port_stats {
  537. __le64 tx_64b_frames;
  538. __le64 tx_65b_127b_frames;
  539. __le64 tx_128b_255b_frames;
  540. __le64 tx_256b_511b_frames;
  541. __le64 tx_512b_1023b_frames;
  542. __le64 tx_1024b_1518_frames;
  543. __le64 tx_good_vlan_frames;
  544. __le64 tx_1519b_2047_frames;
  545. __le64 tx_2048b_4095b_frames;
  546. __le64 tx_4096b_9216b_frames;
  547. __le64 tx_9217b_16383b_frames;
  548. __le64 tx_good_frames;
  549. __le64 tx_total_frames;
  550. __le64 tx_ucast_frames;
  551. __le64 tx_mcast_frames;
  552. __le64 tx_bcast_frames;
  553. __le64 tx_pause_frames;
  554. __le64 tx_pfc_frames;
  555. __le64 tx_jabber_frames;
  556. __le64 tx_fcs_err_frames;
  557. __le64 tx_control_frames;
  558. __le64 tx_oversz_frames;
  559. __le64 tx_single_dfrl_frames;
  560. __le64 tx_multi_dfrl_frames;
  561. __le64 tx_single_coll_frames;
  562. __le64 tx_multi_coll_frames;
  563. __le64 tx_late_coll_frames;
  564. __le64 tx_excessive_coll_frames;
  565. __le64 tx_frag_frames;
  566. __le64 tx_err;
  567. __le64 tx_tagged_frames;
  568. __le64 tx_dbl_tagged_frames;
  569. __le64 tx_runt_frames;
  570. __le64 tx_fifo_underruns;
  571. __le64 tx_pfc_ena_frames_pri0;
  572. __le64 tx_pfc_ena_frames_pri1;
  573. __le64 tx_pfc_ena_frames_pri2;
  574. __le64 tx_pfc_ena_frames_pri3;
  575. __le64 tx_pfc_ena_frames_pri4;
  576. __le64 tx_pfc_ena_frames_pri5;
  577. __le64 tx_pfc_ena_frames_pri6;
  578. __le64 tx_pfc_ena_frames_pri7;
  579. __le64 tx_eee_lpi_events;
  580. __le64 tx_eee_lpi_duration;
  581. __le64 tx_llfc_logical_msgs;
  582. __le64 tx_hcfc_msgs;
  583. __le64 tx_total_collisions;
  584. __le64 tx_bytes;
  585. __le64 tx_xthol_frames;
  586. __le64 tx_stat_discard;
  587. __le64 tx_stat_error;
  588. };
  589. /* Port Rx Statistics Formats (528 bytes) */
  590. struct rx_port_stats {
  591. __le64 rx_64b_frames;
  592. __le64 rx_65b_127b_frames;
  593. __le64 rx_128b_255b_frames;
  594. __le64 rx_256b_511b_frames;
  595. __le64 rx_512b_1023b_frames;
  596. __le64 rx_1024b_1518_frames;
  597. __le64 rx_good_vlan_frames;
  598. __le64 rx_1519b_2047b_frames;
  599. __le64 rx_2048b_4095b_frames;
  600. __le64 rx_4096b_9216b_frames;
  601. __le64 rx_9217b_16383b_frames;
  602. __le64 rx_total_frames;
  603. __le64 rx_ucast_frames;
  604. __le64 rx_mcast_frames;
  605. __le64 rx_bcast_frames;
  606. __le64 rx_fcs_err_frames;
  607. __le64 rx_ctrl_frames;
  608. __le64 rx_pause_frames;
  609. __le64 rx_pfc_frames;
  610. __le64 rx_unsupported_opcode_frames;
  611. __le64 rx_unsupported_da_pausepfc_frames;
  612. __le64 rx_wrong_sa_frames;
  613. __le64 rx_align_err_frames;
  614. __le64 rx_oor_len_frames;
  615. __le64 rx_code_err_frames;
  616. __le64 rx_false_carrier_frames;
  617. __le64 rx_ovrsz_frames;
  618. __le64 rx_jbr_frames;
  619. __le64 rx_mtu_err_frames;
  620. __le64 rx_match_crc_frames;
  621. __le64 rx_promiscuous_frames;
  622. __le64 rx_tagged_frames;
  623. __le64 rx_double_tagged_frames;
  624. __le64 rx_trunc_frames;
  625. __le64 rx_good_frames;
  626. __le64 rx_pfc_xon2xoff_frames_pri0;
  627. __le64 rx_pfc_xon2xoff_frames_pri1;
  628. __le64 rx_pfc_xon2xoff_frames_pri2;
  629. __le64 rx_pfc_xon2xoff_frames_pri3;
  630. __le64 rx_pfc_xon2xoff_frames_pri4;
  631. __le64 rx_pfc_xon2xoff_frames_pri5;
  632. __le64 rx_pfc_xon2xoff_frames_pri6;
  633. __le64 rx_pfc_xon2xoff_frames_pri7;
  634. __le64 rx_pfc_ena_frames_pri0;
  635. __le64 rx_pfc_ena_frames_pri1;
  636. __le64 rx_pfc_ena_frames_pri2;
  637. __le64 rx_pfc_ena_frames_pri3;
  638. __le64 rx_pfc_ena_frames_pri4;
  639. __le64 rx_pfc_ena_frames_pri5;
  640. __le64 rx_pfc_ena_frames_pri6;
  641. __le64 rx_pfc_ena_frames_pri7;
  642. __le64 rx_sch_crc_err_frames;
  643. __le64 rx_undrsz_frames;
  644. __le64 rx_frag_frames;
  645. __le64 rx_eee_lpi_events;
  646. __le64 rx_eee_lpi_duration;
  647. __le64 rx_llfc_physical_msgs;
  648. __le64 rx_llfc_logical_msgs;
  649. __le64 rx_llfc_msgs_with_crc_err;
  650. __le64 rx_hcfc_msgs;
  651. __le64 rx_hcfc_msgs_with_crc_err;
  652. __le64 rx_bytes;
  653. __le64 rx_runt_bytes;
  654. __le64 rx_runt_frames;
  655. __le64 rx_stat_discard;
  656. __le64 rx_stat_err;
  657. };
  658. /* hwrm_ver_get */
  659. /* Input (24 bytes) */
  660. struct hwrm_ver_get_input {
  661. __le16 req_type;
  662. __le16 cmpl_ring;
  663. __le16 seq_id;
  664. __le16 target_id;
  665. __le64 resp_addr;
  666. u8 hwrm_intf_maj;
  667. u8 hwrm_intf_min;
  668. u8 hwrm_intf_upd;
  669. u8 unused_0[5];
  670. };
  671. /* Output (128 bytes) */
  672. struct hwrm_ver_get_output {
  673. __le16 error_code;
  674. __le16 req_type;
  675. __le16 seq_id;
  676. __le16 resp_len;
  677. u8 hwrm_intf_maj;
  678. u8 hwrm_intf_min;
  679. u8 hwrm_intf_upd;
  680. u8 hwrm_intf_rsvd;
  681. u8 hwrm_fw_maj;
  682. u8 hwrm_fw_min;
  683. u8 hwrm_fw_bld;
  684. u8 hwrm_fw_rsvd;
  685. u8 mgmt_fw_maj;
  686. u8 mgmt_fw_min;
  687. u8 mgmt_fw_bld;
  688. u8 mgmt_fw_rsvd;
  689. u8 netctrl_fw_maj;
  690. u8 netctrl_fw_min;
  691. u8 netctrl_fw_bld;
  692. u8 netctrl_fw_rsvd;
  693. __le32 reserved1;
  694. u8 roce_fw_maj;
  695. u8 roce_fw_min;
  696. u8 roce_fw_bld;
  697. u8 roce_fw_rsvd;
  698. char hwrm_fw_name[16];
  699. char mgmt_fw_name[16];
  700. char netctrl_fw_name[16];
  701. __le32 reserved2[4];
  702. char roce_fw_name[16];
  703. __le16 chip_num;
  704. u8 chip_rev;
  705. u8 chip_metal;
  706. u8 chip_bond_id;
  707. u8 chip_platform_type;
  708. #define VER_GET_RESP_CHIP_PLATFORM_TYPE_ASIC (0x0UL << 0)
  709. #define VER_GET_RESP_CHIP_PLATFORM_TYPE_FPGA (0x1UL << 0)
  710. #define VER_GET_RESP_CHIP_PLATFORM_TYPE_PALLADIUM (0x2UL << 0)
  711. __le16 max_req_win_len;
  712. __le16 max_resp_len;
  713. __le16 def_req_timeout;
  714. u8 unused_0;
  715. u8 unused_1;
  716. u8 unused_2;
  717. u8 valid;
  718. };
  719. /* hwrm_func_reset */
  720. /* Input (24 bytes) */
  721. struct hwrm_func_reset_input {
  722. __le16 req_type;
  723. __le16 cmpl_ring;
  724. __le16 seq_id;
  725. __le16 target_id;
  726. __le64 resp_addr;
  727. __le32 enables;
  728. #define FUNC_RESET_REQ_ENABLES_VF_ID_VALID 0x1UL
  729. __le16 vf_id;
  730. u8 func_reset_level;
  731. #define FUNC_RESET_REQ_FUNC_RESET_LEVEL_RESETALL (0x0UL << 0)
  732. #define FUNC_RESET_REQ_FUNC_RESET_LEVEL_RESETME (0x1UL << 0)
  733. #define FUNC_RESET_REQ_FUNC_RESET_LEVEL_RESETCHILDREN (0x2UL << 0)
  734. #define FUNC_RESET_REQ_FUNC_RESET_LEVEL_RESETVF (0x3UL << 0)
  735. u8 unused_0;
  736. };
  737. /* Output (16 bytes) */
  738. struct hwrm_func_reset_output {
  739. __le16 error_code;
  740. __le16 req_type;
  741. __le16 seq_id;
  742. __le16 resp_len;
  743. __le32 unused_0;
  744. u8 unused_1;
  745. u8 unused_2;
  746. u8 unused_3;
  747. u8 valid;
  748. };
  749. /* hwrm_func_getfid */
  750. /* Input (24 bytes) */
  751. struct hwrm_func_getfid_input {
  752. __le16 req_type;
  753. __le16 cmpl_ring;
  754. __le16 seq_id;
  755. __le16 target_id;
  756. __le64 resp_addr;
  757. __le32 enables;
  758. #define FUNC_GETFID_REQ_ENABLES_PCI_ID 0x1UL
  759. __le16 pci_id;
  760. __le16 unused_0;
  761. };
  762. /* Output (16 bytes) */
  763. struct hwrm_func_getfid_output {
  764. __le16 error_code;
  765. __le16 req_type;
  766. __le16 seq_id;
  767. __le16 resp_len;
  768. __le16 fid;
  769. u8 unused_0;
  770. u8 unused_1;
  771. u8 unused_2;
  772. u8 unused_3;
  773. u8 unused_4;
  774. u8 valid;
  775. };
  776. /* hwrm_func_vf_alloc */
  777. /* Input (24 bytes) */
  778. struct hwrm_func_vf_alloc_input {
  779. __le16 req_type;
  780. __le16 cmpl_ring;
  781. __le16 seq_id;
  782. __le16 target_id;
  783. __le64 resp_addr;
  784. __le32 enables;
  785. #define FUNC_VF_ALLOC_REQ_ENABLES_FIRST_VF_ID 0x1UL
  786. __le16 first_vf_id;
  787. __le16 num_vfs;
  788. };
  789. /* Output (16 bytes) */
  790. struct hwrm_func_vf_alloc_output {
  791. __le16 error_code;
  792. __le16 req_type;
  793. __le16 seq_id;
  794. __le16 resp_len;
  795. __le16 first_vf_id;
  796. u8 unused_0;
  797. u8 unused_1;
  798. u8 unused_2;
  799. u8 unused_3;
  800. u8 unused_4;
  801. u8 valid;
  802. };
  803. /* hwrm_func_vf_free */
  804. /* Input (24 bytes) */
  805. struct hwrm_func_vf_free_input {
  806. __le16 req_type;
  807. __le16 cmpl_ring;
  808. __le16 seq_id;
  809. __le16 target_id;
  810. __le64 resp_addr;
  811. __le32 enables;
  812. #define FUNC_VF_FREE_REQ_ENABLES_FIRST_VF_ID 0x1UL
  813. __le16 first_vf_id;
  814. __le16 num_vfs;
  815. };
  816. /* Output (16 bytes) */
  817. struct hwrm_func_vf_free_output {
  818. __le16 error_code;
  819. __le16 req_type;
  820. __le16 seq_id;
  821. __le16 resp_len;
  822. __le32 unused_0;
  823. u8 unused_1;
  824. u8 unused_2;
  825. u8 unused_3;
  826. u8 valid;
  827. };
  828. /* hwrm_func_vf_cfg */
  829. /* Input (32 bytes) */
  830. struct hwrm_func_vf_cfg_input {
  831. __le16 req_type;
  832. __le16 cmpl_ring;
  833. __le16 seq_id;
  834. __le16 target_id;
  835. __le64 resp_addr;
  836. __le32 enables;
  837. #define FUNC_VF_CFG_REQ_ENABLES_MTU 0x1UL
  838. #define FUNC_VF_CFG_REQ_ENABLES_GUEST_VLAN 0x2UL
  839. #define FUNC_VF_CFG_REQ_ENABLES_ASYNC_EVENT_CR 0x4UL
  840. __le16 mtu;
  841. __le16 guest_vlan;
  842. __le16 async_event_cr;
  843. __le16 unused_0[3];
  844. };
  845. /* Output (16 bytes) */
  846. struct hwrm_func_vf_cfg_output {
  847. __le16 error_code;
  848. __le16 req_type;
  849. __le16 seq_id;
  850. __le16 resp_len;
  851. __le32 unused_0;
  852. u8 unused_1;
  853. u8 unused_2;
  854. u8 unused_3;
  855. u8 valid;
  856. };
  857. /* hwrm_func_qcaps */
  858. /* Input (24 bytes) */
  859. struct hwrm_func_qcaps_input {
  860. __le16 req_type;
  861. __le16 cmpl_ring;
  862. __le16 seq_id;
  863. __le16 target_id;
  864. __le64 resp_addr;
  865. __le16 fid;
  866. __le16 unused_0[3];
  867. };
  868. /* Output (80 bytes) */
  869. struct hwrm_func_qcaps_output {
  870. __le16 error_code;
  871. __le16 req_type;
  872. __le16 seq_id;
  873. __le16 resp_len;
  874. __le16 fid;
  875. __le16 port_id;
  876. __le32 flags;
  877. #define FUNC_QCAPS_RESP_FLAGS_PUSH_MODE_SUPPORTED 0x1UL
  878. #define FUNC_QCAPS_RESP_FLAGS_GLOBAL_MSIX_AUTOMASKING 0x2UL
  879. u8 perm_mac_address[6];
  880. __le16 max_rsscos_ctx;
  881. __le16 max_cmpl_rings;
  882. __le16 max_tx_rings;
  883. __le16 max_rx_rings;
  884. __le16 max_l2_ctxs;
  885. __le16 max_vnics;
  886. __le16 first_vf_id;
  887. __le16 max_vfs;
  888. __le16 max_stat_ctx;
  889. __le32 max_encap_records;
  890. __le32 max_decap_records;
  891. __le32 max_tx_em_flows;
  892. __le32 max_tx_wm_flows;
  893. __le32 max_rx_em_flows;
  894. __le32 max_rx_wm_flows;
  895. __le32 max_mcast_filters;
  896. __le32 max_flow_id;
  897. __le32 max_hw_ring_grps;
  898. u8 unused_0;
  899. u8 unused_1;
  900. u8 unused_2;
  901. u8 valid;
  902. };
  903. /* hwrm_func_cfg */
  904. /* Input (88 bytes) */
  905. struct hwrm_func_cfg_input {
  906. __le16 req_type;
  907. __le16 cmpl_ring;
  908. __le16 seq_id;
  909. __le16 target_id;
  910. __le64 resp_addr;
  911. __le16 fid;
  912. u8 unused_0;
  913. u8 unused_1;
  914. __le32 flags;
  915. #define FUNC_CFG_REQ_FLAGS_PROM_MODE 0x1UL
  916. #define FUNC_CFG_REQ_FLAGS_SRC_MAC_ADDR_CHECK 0x2UL
  917. #define FUNC_CFG_REQ_FLAGS_SRC_IP_ADDR_CHECK 0x4UL
  918. #define FUNC_CFG_REQ_FLAGS_VLAN_PRI_MATCH 0x8UL
  919. #define FUNC_CFG_REQ_FLAGS_DFLT_PRI_NOMATCH 0x10UL
  920. #define FUNC_CFG_REQ_FLAGS_DISABLE_PAUSE 0x20UL
  921. #define FUNC_CFG_REQ_FLAGS_DISABLE_STP 0x40UL
  922. #define FUNC_CFG_REQ_FLAGS_DISABLE_LLDP 0x80UL
  923. #define FUNC_CFG_REQ_FLAGS_DISABLE_PTPV2 0x100UL
  924. __le32 enables;
  925. #define FUNC_CFG_REQ_ENABLES_MTU 0x1UL
  926. #define FUNC_CFG_REQ_ENABLES_MRU 0x2UL
  927. #define FUNC_CFG_REQ_ENABLES_NUM_RSSCOS_CTXS 0x4UL
  928. #define FUNC_CFG_REQ_ENABLES_NUM_CMPL_RINGS 0x8UL
  929. #define FUNC_CFG_REQ_ENABLES_NUM_TX_RINGS 0x10UL
  930. #define FUNC_CFG_REQ_ENABLES_NUM_RX_RINGS 0x20UL
  931. #define FUNC_CFG_REQ_ENABLES_NUM_L2_CTXS 0x40UL
  932. #define FUNC_CFG_REQ_ENABLES_NUM_VNICS 0x80UL
  933. #define FUNC_CFG_REQ_ENABLES_NUM_STAT_CTXS 0x100UL
  934. #define FUNC_CFG_REQ_ENABLES_DFLT_MAC_ADDR 0x200UL
  935. #define FUNC_CFG_REQ_ENABLES_DFLT_VLAN 0x400UL
  936. #define FUNC_CFG_REQ_ENABLES_DFLT_IP_ADDR 0x800UL
  937. #define FUNC_CFG_REQ_ENABLES_MIN_BW 0x1000UL
  938. #define FUNC_CFG_REQ_ENABLES_MAX_BW 0x2000UL
  939. #define FUNC_CFG_REQ_ENABLES_ASYNC_EVENT_CR 0x4000UL
  940. #define FUNC_CFG_REQ_ENABLES_VLAN_ANTISPOOF_MODE 0x8000UL
  941. #define FUNC_CFG_REQ_ENABLES_ALLOWED_VLAN_PRIS 0x10000UL
  942. #define FUNC_CFG_REQ_ENABLES_EVB_MODE 0x20000UL
  943. #define FUNC_CFG_REQ_ENABLES_NUM_MCAST_FILTERS 0x40000UL
  944. #define FUNC_CFG_REQ_ENABLES_NUM_HW_RING_GRPS 0x80000UL
  945. __le16 mtu;
  946. __le16 mru;
  947. __le16 num_rsscos_ctxs;
  948. __le16 num_cmpl_rings;
  949. __le16 num_tx_rings;
  950. __le16 num_rx_rings;
  951. __le16 num_l2_ctxs;
  952. __le16 num_vnics;
  953. __le16 num_stat_ctxs;
  954. __le16 num_hw_ring_grps;
  955. u8 dflt_mac_addr[6];
  956. __le16 dflt_vlan;
  957. __be32 dflt_ip_addr[4];
  958. __le32 min_bw;
  959. __le32 max_bw;
  960. __le16 async_event_cr;
  961. u8 vlan_antispoof_mode;
  962. #define FUNC_CFG_REQ_VLAN_ANTISPOOF_MODE_NOCHECK (0x0UL << 0)
  963. #define FUNC_CFG_REQ_VLAN_ANTISPOOF_MODE_VALIDATE_VLAN (0x1UL << 0)
  964. #define FUNC_CFG_REQ_VLAN_ANTISPOOF_MODE_INSERT_IF_VLANDNE (0x2UL << 0)
  965. #define FUNC_CFG_REQ_VLAN_ANTISPOOF_MODE_INSERT_OR_OVERRIDE_VLAN (0x3UL << 0)
  966. u8 allowed_vlan_pris;
  967. u8 evb_mode;
  968. #define FUNC_CFG_REQ_EVB_MODE_NO_EVB (0x0UL << 0)
  969. #define FUNC_CFG_REQ_EVB_MODE_VEB (0x1UL << 0)
  970. #define FUNC_CFG_REQ_EVB_MODE_VEPA (0x2UL << 0)
  971. u8 unused_2;
  972. __le16 num_mcast_filters;
  973. };
  974. /* Output (16 bytes) */
  975. struct hwrm_func_cfg_output {
  976. __le16 error_code;
  977. __le16 req_type;
  978. __le16 seq_id;
  979. __le16 resp_len;
  980. __le32 unused_0;
  981. u8 unused_1;
  982. u8 unused_2;
  983. u8 unused_3;
  984. u8 valid;
  985. };
  986. /* hwrm_func_qstats */
  987. /* Input (24 bytes) */
  988. struct hwrm_func_qstats_input {
  989. __le16 req_type;
  990. __le16 cmpl_ring;
  991. __le16 seq_id;
  992. __le16 target_id;
  993. __le64 resp_addr;
  994. __le16 fid;
  995. __le16 unused_0[3];
  996. };
  997. /* Output (176 bytes) */
  998. struct hwrm_func_qstats_output {
  999. __le16 error_code;
  1000. __le16 req_type;
  1001. __le16 seq_id;
  1002. __le16 resp_len;
  1003. __le64 tx_ucast_pkts;
  1004. __le64 tx_mcast_pkts;
  1005. __le64 tx_bcast_pkts;
  1006. __le64 tx_err_pkts;
  1007. __le64 tx_drop_pkts;
  1008. __le64 tx_ucast_bytes;
  1009. __le64 tx_mcast_bytes;
  1010. __le64 tx_bcast_bytes;
  1011. __le64 rx_ucast_pkts;
  1012. __le64 rx_mcast_pkts;
  1013. __le64 rx_bcast_pkts;
  1014. __le64 rx_err_pkts;
  1015. __le64 rx_drop_pkts;
  1016. __le64 rx_ucast_bytes;
  1017. __le64 rx_mcast_bytes;
  1018. __le64 rx_bcast_bytes;
  1019. __le64 rx_agg_pkts;
  1020. __le64 rx_agg_bytes;
  1021. __le64 rx_agg_events;
  1022. __le64 rx_agg_aborts;
  1023. __le32 unused_0;
  1024. u8 unused_1;
  1025. u8 unused_2;
  1026. u8 unused_3;
  1027. u8 valid;
  1028. };
  1029. /* hwrm_func_clr_stats */
  1030. /* Input (24 bytes) */
  1031. struct hwrm_func_clr_stats_input {
  1032. __le16 req_type;
  1033. __le16 cmpl_ring;
  1034. __le16 seq_id;
  1035. __le16 target_id;
  1036. __le64 resp_addr;
  1037. __le16 fid;
  1038. __le16 unused_0[3];
  1039. };
  1040. /* Output (16 bytes) */
  1041. struct hwrm_func_clr_stats_output {
  1042. __le16 error_code;
  1043. __le16 req_type;
  1044. __le16 seq_id;
  1045. __le16 resp_len;
  1046. __le32 unused_0;
  1047. u8 unused_1;
  1048. u8 unused_2;
  1049. u8 unused_3;
  1050. u8 valid;
  1051. };
  1052. /* hwrm_func_vf_resc_free */
  1053. /* Input (24 bytes) */
  1054. struct hwrm_func_vf_resc_free_input {
  1055. __le16 req_type;
  1056. __le16 cmpl_ring;
  1057. __le16 seq_id;
  1058. __le16 target_id;
  1059. __le64 resp_addr;
  1060. __le16 vf_id;
  1061. __le16 unused_0[3];
  1062. };
  1063. /* Output (16 bytes) */
  1064. struct hwrm_func_vf_resc_free_output {
  1065. __le16 error_code;
  1066. __le16 req_type;
  1067. __le16 seq_id;
  1068. __le16 resp_len;
  1069. __le32 unused_0;
  1070. u8 unused_1;
  1071. u8 unused_2;
  1072. u8 unused_3;
  1073. u8 valid;
  1074. };
  1075. /* hwrm_func_vf_vnic_ids_query */
  1076. /* Input (32 bytes) */
  1077. struct hwrm_func_vf_vnic_ids_query_input {
  1078. __le16 req_type;
  1079. __le16 cmpl_ring;
  1080. __le16 seq_id;
  1081. __le16 target_id;
  1082. __le64 resp_addr;
  1083. __le16 vf_id;
  1084. u8 unused_0;
  1085. u8 unused_1;
  1086. __le32 max_vnic_id_cnt;
  1087. __le64 vnic_id_tbl_addr;
  1088. };
  1089. /* Output (16 bytes) */
  1090. struct hwrm_func_vf_vnic_ids_query_output {
  1091. __le16 error_code;
  1092. __le16 req_type;
  1093. __le16 seq_id;
  1094. __le16 resp_len;
  1095. __le32 vnic_id_cnt;
  1096. u8 unused_0;
  1097. u8 unused_1;
  1098. u8 unused_2;
  1099. u8 valid;
  1100. };
  1101. /* hwrm_func_drv_rgtr */
  1102. /* Input (80 bytes) */
  1103. struct hwrm_func_drv_rgtr_input {
  1104. __le16 req_type;
  1105. __le16 cmpl_ring;
  1106. __le16 seq_id;
  1107. __le16 target_id;
  1108. __le64 resp_addr;
  1109. __le32 flags;
  1110. #define FUNC_DRV_RGTR_REQ_FLAGS_FWD_ALL_MODE 0x1UL
  1111. #define FUNC_DRV_RGTR_REQ_FLAGS_FWD_NONE_MODE 0x2UL
  1112. __le32 enables;
  1113. #define FUNC_DRV_RGTR_REQ_ENABLES_OS_TYPE 0x1UL
  1114. #define FUNC_DRV_RGTR_REQ_ENABLES_VER 0x2UL
  1115. #define FUNC_DRV_RGTR_REQ_ENABLES_TIMESTAMP 0x4UL
  1116. #define FUNC_DRV_RGTR_REQ_ENABLES_VF_REQ_FWD 0x8UL
  1117. #define FUNC_DRV_RGTR_REQ_ENABLES_ASYNC_EVENT_FWD 0x10UL
  1118. __le16 os_type;
  1119. #define FUNC_DRV_RGTR_REQ_OS_TYPE_UNKNOWN (0x0UL << 0)
  1120. #define FUNC_DRV_RGTR_REQ_OS_TYPE_OTHER (0x1UL << 0)
  1121. #define FUNC_DRV_RGTR_REQ_OS_TYPE_MSDOS (0xeUL << 0)
  1122. #define FUNC_DRV_RGTR_REQ_OS_TYPE_SOLARIS (0x1dUL << 0)
  1123. #define FUNC_DRV_RGTR_REQ_OS_TYPE_LINUX (0x24UL << 0)
  1124. #define FUNC_DRV_RGTR_REQ_OS_TYPE_FREEBSD (0x2aUL << 0)
  1125. #define FUNC_DRV_RGTR_REQ_OS_TYPE_ESXI (0x68UL << 0)
  1126. #define FUNC_DRV_RGTR_REQ_OS_TYPE_WIN864 (0x73UL << 0)
  1127. #define FUNC_DRV_RGTR_REQ_OS_TYPE_WIN2012R2 (0x74UL << 0)
  1128. u8 ver_maj;
  1129. u8 ver_min;
  1130. u8 ver_upd;
  1131. u8 unused_0;
  1132. __le16 unused_1;
  1133. __le32 timestamp;
  1134. __le32 unused_2;
  1135. __le32 vf_req_fwd[8];
  1136. __le32 async_event_fwd[8];
  1137. };
  1138. /* Output (16 bytes) */
  1139. struct hwrm_func_drv_rgtr_output {
  1140. __le16 error_code;
  1141. __le16 req_type;
  1142. __le16 seq_id;
  1143. __le16 resp_len;
  1144. __le32 unused_0;
  1145. u8 unused_1;
  1146. u8 unused_2;
  1147. u8 unused_3;
  1148. u8 valid;
  1149. };
  1150. /* hwrm_func_drv_unrgtr */
  1151. /* Input (24 bytes) */
  1152. struct hwrm_func_drv_unrgtr_input {
  1153. __le16 req_type;
  1154. __le16 cmpl_ring;
  1155. __le16 seq_id;
  1156. __le16 target_id;
  1157. __le64 resp_addr;
  1158. __le32 flags;
  1159. #define FUNC_DRV_UNRGTR_REQ_FLAGS_PREPARE_FOR_SHUTDOWN 0x1UL
  1160. __le32 unused_0;
  1161. };
  1162. /* Output (16 bytes) */
  1163. struct hwrm_func_drv_unrgtr_output {
  1164. __le16 error_code;
  1165. __le16 req_type;
  1166. __le16 seq_id;
  1167. __le16 resp_len;
  1168. __le32 unused_0;
  1169. u8 unused_1;
  1170. u8 unused_2;
  1171. u8 unused_3;
  1172. u8 valid;
  1173. };
  1174. /* hwrm_func_buf_rgtr */
  1175. /* Input (128 bytes) */
  1176. struct hwrm_func_buf_rgtr_input {
  1177. __le16 req_type;
  1178. __le16 cmpl_ring;
  1179. __le16 seq_id;
  1180. __le16 target_id;
  1181. __le64 resp_addr;
  1182. __le32 enables;
  1183. #define FUNC_BUF_RGTR_REQ_ENABLES_VF_ID 0x1UL
  1184. #define FUNC_BUF_RGTR_REQ_ENABLES_ERR_BUF_ADDR 0x2UL
  1185. __le16 vf_id;
  1186. __le16 req_buf_num_pages;
  1187. __le16 req_buf_page_size;
  1188. #define FUNC_BUF_RGTR_REQ_REQ_BUF_PAGE_SIZE_16B (0x4UL << 0)
  1189. #define FUNC_BUF_RGTR_REQ_REQ_BUF_PAGE_SIZE_4K (0xcUL << 0)
  1190. #define FUNC_BUF_RGTR_REQ_REQ_BUF_PAGE_SIZE_8K (0xdUL << 0)
  1191. #define FUNC_BUF_RGTR_REQ_REQ_BUF_PAGE_SIZE_64K (0x10UL << 0)
  1192. #define FUNC_BUF_RGTR_REQ_REQ_BUF_PAGE_SIZE_2M (0x16UL << 0)
  1193. #define FUNC_BUF_RGTR_REQ_REQ_BUF_PAGE_SIZE_4M (0x17UL << 0)
  1194. #define FUNC_BUF_RGTR_REQ_REQ_BUF_PAGE_SIZE_1G (0x1eUL << 0)
  1195. __le16 req_buf_len;
  1196. __le16 resp_buf_len;
  1197. u8 unused_0;
  1198. u8 unused_1;
  1199. __le64 req_buf_page_addr0;
  1200. __le64 req_buf_page_addr1;
  1201. __le64 req_buf_page_addr2;
  1202. __le64 req_buf_page_addr3;
  1203. __le64 req_buf_page_addr4;
  1204. __le64 req_buf_page_addr5;
  1205. __le64 req_buf_page_addr6;
  1206. __le64 req_buf_page_addr7;
  1207. __le64 req_buf_page_addr8;
  1208. __le64 req_buf_page_addr9;
  1209. __le64 error_buf_addr;
  1210. __le64 resp_buf_addr;
  1211. };
  1212. /* Output (16 bytes) */
  1213. struct hwrm_func_buf_rgtr_output {
  1214. __le16 error_code;
  1215. __le16 req_type;
  1216. __le16 seq_id;
  1217. __le16 resp_len;
  1218. __le32 unused_0;
  1219. u8 unused_1;
  1220. u8 unused_2;
  1221. u8 unused_3;
  1222. u8 valid;
  1223. };
  1224. /* hwrm_func_drv_qver */
  1225. /* Input (24 bytes) */
  1226. struct hwrm_func_drv_qver_input {
  1227. __le16 req_type;
  1228. __le16 cmpl_ring;
  1229. __le16 seq_id;
  1230. __le16 target_id;
  1231. __le64 resp_addr;
  1232. __le32 reserved;
  1233. __le16 fid;
  1234. __le16 unused_0;
  1235. };
  1236. /* Output (16 bytes) */
  1237. struct hwrm_func_drv_qver_output {
  1238. __le16 error_code;
  1239. __le16 req_type;
  1240. __le16 seq_id;
  1241. __le16 resp_len;
  1242. __le16 os_type;
  1243. #define FUNC_DRV_QVER_RESP_OS_TYPE_UNKNOWN (0x0UL << 0)
  1244. #define FUNC_DRV_QVER_RESP_OS_TYPE_OTHER (0x1UL << 0)
  1245. #define FUNC_DRV_QVER_RESP_OS_TYPE_MSDOS (0xeUL << 0)
  1246. #define FUNC_DRV_QVER_RESP_OS_TYPE_SOLARIS (0x1dUL << 0)
  1247. #define FUNC_DRV_QVER_RESP_OS_TYPE_LINUX (0x24UL << 0)
  1248. #define FUNC_DRV_QVER_RESP_OS_TYPE_FREEBSD (0x2aUL << 0)
  1249. #define FUNC_DRV_QVER_RESP_OS_TYPE_ESXI (0x68UL << 0)
  1250. #define FUNC_DRV_QVER_RESP_OS_TYPE_WIN864 (0x73UL << 0)
  1251. #define FUNC_DRV_QVER_RESP_OS_TYPE_WIN2012R2 (0x74UL << 0)
  1252. u8 ver_maj;
  1253. u8 ver_min;
  1254. u8 ver_upd;
  1255. u8 unused_0;
  1256. u8 unused_1;
  1257. u8 valid;
  1258. };
  1259. /* hwrm_port_phy_cfg */
  1260. /* Input (48 bytes) */
  1261. struct hwrm_port_phy_cfg_input {
  1262. __le16 req_type;
  1263. __le16 cmpl_ring;
  1264. __le16 seq_id;
  1265. __le16 target_id;
  1266. __le64 resp_addr;
  1267. __le32 flags;
  1268. #define PORT_PHY_CFG_REQ_FLAGS_RESET_PHY 0x1UL
  1269. #define PORT_PHY_CFG_REQ_FLAGS_FORCE_LINK_DOWN 0x2UL
  1270. #define PORT_PHY_CFG_REQ_FLAGS_FORCE 0x4UL
  1271. #define PORT_PHY_CFG_REQ_FLAGS_RESTART_AUTONEG 0x8UL
  1272. __le32 enables;
  1273. #define PORT_PHY_CFG_REQ_ENABLES_AUTO_MODE 0x1UL
  1274. #define PORT_PHY_CFG_REQ_ENABLES_AUTO_DUPLEX 0x2UL
  1275. #define PORT_PHY_CFG_REQ_ENABLES_AUTO_PAUSE 0x4UL
  1276. #define PORT_PHY_CFG_REQ_ENABLES_AUTO_LINK_SPEED 0x8UL
  1277. #define PORT_PHY_CFG_REQ_ENABLES_AUTO_LINK_SPEED_MASK 0x10UL
  1278. #define PORT_PHY_CFG_REQ_ENABLES_WIRESPEED 0x20UL
  1279. #define PORT_PHY_CFG_REQ_ENABLES_LPBK 0x40UL
  1280. #define PORT_PHY_CFG_REQ_ENABLES_PREEMPHASIS 0x80UL
  1281. #define PORT_PHY_CFG_REQ_ENABLES_FORCE_PAUSE 0x100UL
  1282. __le16 port_id;
  1283. __le16 force_link_speed;
  1284. #define PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_100MB (0x1UL << 0)
  1285. #define PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_1GB (0xaUL << 0)
  1286. #define PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_2GB (0x14UL << 0)
  1287. #define PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_2_5GB (0x19UL << 0)
  1288. #define PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_10GB (0x64UL << 0)
  1289. #define PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_20GB (0xc8UL << 0)
  1290. #define PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_25GB (0xfaUL << 0)
  1291. #define PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_40GB (0x190UL << 0)
  1292. #define PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_50GB (0x1f4UL << 0)
  1293. u8 auto_mode;
  1294. #define PORT_PHY_CFG_REQ_AUTO_MODE_NONE (0x0UL << 0)
  1295. #define PORT_PHY_CFG_REQ_AUTO_MODE_ALL_SPEEDS (0x1UL << 0)
  1296. #define PORT_PHY_CFG_REQ_AUTO_MODE_ONE_SPEED (0x2UL << 0)
  1297. #define PORT_PHY_CFG_REQ_AUTO_MODE_ONE_OR_BELOW (0x3UL << 0)
  1298. #define PORT_PHY_CFG_REQ_AUTO_MODE_MASK (0x4UL << 0)
  1299. u8 auto_duplex;
  1300. #define PORT_PHY_CFG_REQ_AUTO_DUPLEX_HALF (0x0UL << 0)
  1301. #define PORT_PHY_CFG_REQ_AUTO_DUPLEX_FULL (0x1UL << 0)
  1302. #define PORT_PHY_CFG_REQ_AUTO_DUPLEX_BOTH (0x2UL << 0)
  1303. u8 auto_pause;
  1304. #define PORT_PHY_CFG_REQ_AUTO_PAUSE_TX 0x1UL
  1305. #define PORT_PHY_CFG_REQ_AUTO_PAUSE_RX 0x2UL
  1306. u8 unused_0;
  1307. __le16 auto_link_speed;
  1308. #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_100MB (0x1UL << 0)
  1309. #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_1GB (0xaUL << 0)
  1310. #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_2GB (0x14UL << 0)
  1311. #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_2_5GB (0x19UL << 0)
  1312. #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_10GB (0x64UL << 0)
  1313. #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_20GB (0xc8UL << 0)
  1314. #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_25GB (0xfaUL << 0)
  1315. #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_40GB (0x190UL << 0)
  1316. #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_50GB (0x1f4UL << 0)
  1317. __le16 auto_link_speed_mask;
  1318. #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_MASK_100MBHD 0x1UL
  1319. #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_MASK_100MB 0x2UL
  1320. #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_MASK_1GBHD 0x4UL
  1321. #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_MASK_1GB 0x8UL
  1322. #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_MASK_2GB 0x10UL
  1323. #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_MASK_2_5GB 0x20UL
  1324. #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_MASK_10GB 0x40UL
  1325. #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_MASK_20GB 0x80UL
  1326. #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_MASK_25GB 0x100UL
  1327. #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_MASK_40GB 0x200UL
  1328. #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_MASK_50GB 0x400UL
  1329. u8 wirespeed;
  1330. #define PORT_PHY_CFG_REQ_WIRESPEED_OFF (0x0UL << 0)
  1331. #define PORT_PHY_CFG_REQ_WIRESPEED_ON (0x1UL << 0)
  1332. u8 lpbk;
  1333. #define PORT_PHY_CFG_REQ_LPBK_NONE (0x0UL << 0)
  1334. #define PORT_PHY_CFG_REQ_LPBK_LOCAL (0x1UL << 0)
  1335. #define PORT_PHY_CFG_REQ_LPBK_REMOTE (0x2UL << 0)
  1336. u8 force_pause;
  1337. #define PORT_PHY_CFG_REQ_FORCE_PAUSE_TX 0x1UL
  1338. #define PORT_PHY_CFG_REQ_FORCE_PAUSE_RX 0x2UL
  1339. u8 unused_1;
  1340. __le32 preemphasis;
  1341. __le32 unused_2;
  1342. };
  1343. /* Output (16 bytes) */
  1344. struct hwrm_port_phy_cfg_output {
  1345. __le16 error_code;
  1346. __le16 req_type;
  1347. __le16 seq_id;
  1348. __le16 resp_len;
  1349. __le32 unused_0;
  1350. u8 unused_1;
  1351. u8 unused_2;
  1352. u8 unused_3;
  1353. u8 valid;
  1354. };
  1355. /* hwrm_port_phy_qcfg */
  1356. /* Input (24 bytes) */
  1357. struct hwrm_port_phy_qcfg_input {
  1358. __le16 req_type;
  1359. __le16 cmpl_ring;
  1360. __le16 seq_id;
  1361. __le16 target_id;
  1362. __le64 resp_addr;
  1363. __le16 port_id;
  1364. __le16 unused_0[3];
  1365. };
  1366. /* Output (48 bytes) */
  1367. struct hwrm_port_phy_qcfg_output {
  1368. __le16 error_code;
  1369. __le16 req_type;
  1370. __le16 seq_id;
  1371. __le16 resp_len;
  1372. u8 link;
  1373. #define PORT_PHY_QCFG_RESP_LINK_NO_LINK (0x0UL << 0)
  1374. #define PORT_PHY_QCFG_RESP_LINK_SIGNAL (0x1UL << 0)
  1375. #define PORT_PHY_QCFG_RESP_LINK_LINK (0x2UL << 0)
  1376. u8 unused_0;
  1377. __le16 link_speed;
  1378. #define PORT_PHY_QCFG_RESP_LINK_SPEED_100MB (0x1UL << 0)
  1379. #define PORT_PHY_QCFG_RESP_LINK_SPEED_1GB (0xaUL << 0)
  1380. #define PORT_PHY_QCFG_RESP_LINK_SPEED_2GB (0x14UL << 0)
  1381. #define PORT_PHY_QCFG_RESP_LINK_SPEED_2_5GB (0x19UL << 0)
  1382. #define PORT_PHY_QCFG_RESP_LINK_SPEED_10GB (0x64UL << 0)
  1383. #define PORT_PHY_QCFG_RESP_LINK_SPEED_20GB (0xc8UL << 0)
  1384. #define PORT_PHY_QCFG_RESP_LINK_SPEED_25GB (0xfaUL << 0)
  1385. #define PORT_PHY_QCFG_RESP_LINK_SPEED_40GB (0x190UL << 0)
  1386. #define PORT_PHY_QCFG_RESP_LINK_SPEED_50GB (0x1f4UL << 0)
  1387. u8 duplex;
  1388. #define PORT_PHY_QCFG_RESP_DUPLEX_HALF (0x0UL << 0)
  1389. #define PORT_PHY_QCFG_RESP_DUPLEX_FULL (0x1UL << 0)
  1390. u8 pause;
  1391. #define PORT_PHY_QCFG_RESP_PAUSE_TX 0x1UL
  1392. #define PORT_PHY_QCFG_RESP_PAUSE_RX 0x2UL
  1393. __le16 support_speeds;
  1394. #define PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_100MBHD 0x1UL
  1395. #define PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_100MB 0x2UL
  1396. #define PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_1GBHD 0x4UL
  1397. #define PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_1GB 0x8UL
  1398. #define PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_2GB 0x10UL
  1399. #define PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_2_5GB 0x20UL
  1400. #define PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_10GB 0x40UL
  1401. #define PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_20GB 0x80UL
  1402. #define PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_25GB 0x100UL
  1403. #define PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_40GB 0x200UL
  1404. #define PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_50GB 0x400UL
  1405. __le16 force_link_speed;
  1406. #define PORT_PHY_QCFG_RESP_FORCE_LINK_SPEED_100MB (0x1UL << 0)
  1407. #define PORT_PHY_QCFG_RESP_FORCE_LINK_SPEED_1GB (0xaUL << 0)
  1408. #define PORT_PHY_QCFG_RESP_FORCE_LINK_SPEED_2GB (0x14UL << 0)
  1409. #define PORT_PHY_QCFG_RESP_FORCE_LINK_SPEED_2_5GB (0x19UL << 0)
  1410. #define PORT_PHY_QCFG_RESP_FORCE_LINK_SPEED_10GB (0x64UL << 0)
  1411. #define PORT_PHY_QCFG_RESP_FORCE_LINK_SPEED_20GB (0xc8UL << 0)
  1412. #define PORT_PHY_QCFG_RESP_FORCE_LINK_SPEED_25GB (0xfaUL << 0)
  1413. #define PORT_PHY_QCFG_RESP_FORCE_LINK_SPEED_40GB (0x190UL << 0)
  1414. #define PORT_PHY_QCFG_RESP_FORCE_LINK_SPEED_50GB (0x1f4UL << 0)
  1415. u8 auto_mode;
  1416. #define PORT_PHY_QCFG_RESP_AUTO_MODE_NONE (0x0UL << 0)
  1417. #define PORT_PHY_QCFG_RESP_AUTO_MODE_ALL_SPEEDS (0x1UL << 0)
  1418. #define PORT_PHY_QCFG_RESP_AUTO_MODE_ONE_SPEED (0x2UL << 0)
  1419. #define PORT_PHY_QCFG_RESP_AUTO_MODE_ONE_OR_BELOW (0x3UL << 0)
  1420. #define PORT_PHY_QCFG_RESP_AUTO_MODE_MASK (0x4UL << 0)
  1421. u8 auto_pause;
  1422. #define PORT_PHY_QCFG_RESP_AUTO_PAUSE_TX 0x1UL
  1423. #define PORT_PHY_QCFG_RESP_AUTO_PAUSE_RX 0x2UL
  1424. __le16 auto_link_speed;
  1425. #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_100MB (0x1UL << 0)
  1426. #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_1GB (0xaUL << 0)
  1427. #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_2GB (0x14UL << 0)
  1428. #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_2_5GB (0x19UL << 0)
  1429. #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_10GB (0x64UL << 0)
  1430. #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_20GB (0xc8UL << 0)
  1431. #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_25GB (0xfaUL << 0)
  1432. #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_40GB (0x190UL << 0)
  1433. #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_50GB (0x1f4UL << 0)
  1434. __le16 auto_link_speed_mask;
  1435. #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_MASK_100MBHD 0x1UL
  1436. #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_MASK_100MB 0x2UL
  1437. #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_MASK_1GBHD 0x4UL
  1438. #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_MASK_1GB 0x8UL
  1439. #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_MASK_2GB 0x10UL
  1440. #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_MASK_2_5GB 0x20UL
  1441. #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_MASK_10GB 0x40UL
  1442. #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_MASK_20GB 0x80UL
  1443. #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_MASK_25GB 0x100UL
  1444. #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_MASK_40GB 0x200UL
  1445. #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_MASK_50GB 0x400UL
  1446. u8 wirespeed;
  1447. #define PORT_PHY_QCFG_RESP_WIRESPEED_OFF (0x0UL << 0)
  1448. #define PORT_PHY_QCFG_RESP_WIRESPEED_ON (0x1UL << 0)
  1449. u8 lpbk;
  1450. #define PORT_PHY_QCFG_RESP_LPBK_NONE (0x0UL << 0)
  1451. #define PORT_PHY_QCFG_RESP_LPBK_LOCAL (0x1UL << 0)
  1452. #define PORT_PHY_QCFG_RESP_LPBK_REMOTE (0x2UL << 0)
  1453. u8 force_pause;
  1454. #define PORT_PHY_QCFG_RESP_FORCE_PAUSE_TX 0x1UL
  1455. #define PORT_PHY_QCFG_RESP_FORCE_PAUSE_RX 0x2UL
  1456. u8 reserved1;
  1457. __le32 preemphasis;
  1458. u8 phy_maj;
  1459. u8 phy_min;
  1460. u8 phy_bld;
  1461. u8 phy_type;
  1462. #define PORT_PHY_QCFG_RESP_PHY_TYPE_BASECR4 (0x1UL << 0)
  1463. #define PORT_PHY_QCFG_RESP_PHY_TYPE_BASEKR4 (0x2UL << 0)
  1464. #define PORT_PHY_QCFG_RESP_PHY_TYPE_BASELR4 (0x3UL << 0)
  1465. #define PORT_PHY_QCFG_RESP_PHY_TYPE_BASESR4 (0x4UL << 0)
  1466. #define PORT_PHY_QCFG_RESP_PHY_TYPE_BASEKR2 (0x5UL << 0)
  1467. #define PORT_PHY_QCFG_RESP_PHY_TYPE_BASEKX4 (0x6UL << 0)
  1468. #define PORT_PHY_QCFG_RESP_PHY_TYPE_BASEKR (0x7UL << 0)
  1469. #define PORT_PHY_QCFG_RESP_PHY_TYPE_BASET (0x8UL << 0)
  1470. u8 media_type;
  1471. #define PORT_PHY_QCFG_RESP_MEDIA_TYPE_TP (0x1UL << 0)
  1472. #define PORT_PHY_QCFG_RESP_MEDIA_TYPE_DAC (0x2UL << 0)
  1473. #define PORT_PHY_QCFG_RESP_MEDIA_TYPE_FIBRE (0x3UL << 0)
  1474. u8 transceiver_type;
  1475. #define PORT_PHY_QCFG_RESP_TRANSCEIVER_TYPE_XCVR_INTERNAL (0x1UL << 0)
  1476. #define PORT_PHY_QCFG_RESP_TRANSCEIVER_TYPE_XCVR_EXTERNAL (0x2UL << 0)
  1477. u8 phy_addr;
  1478. #define PORT_PHY_QCFG_RESP_PHY_ADDR_MASK 0x1fUL
  1479. #define PORT_PHY_QCFG_RESP_PHY_ADDR_SFT 0
  1480. u8 unused_2;
  1481. __le16 link_partner_adv_speeds;
  1482. #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_SPEEDS_100MBHD 0x1UL
  1483. #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_SPEEDS_100MB 0x2UL
  1484. #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_SPEEDS_1GBHD 0x4UL
  1485. #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_SPEEDS_1GB 0x8UL
  1486. #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_SPEEDS_2GB 0x10UL
  1487. #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_SPEEDS_2_5GB 0x20UL
  1488. #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_SPEEDS_10GB 0x40UL
  1489. #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_SPEEDS_20GB 0x80UL
  1490. #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_SPEEDS_25GB 0x100UL
  1491. #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_SPEEDS_40GB 0x200UL
  1492. #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_SPEEDS_50GB 0x400UL
  1493. u8 link_partner_adv_auto_mode;
  1494. #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_AUTO_MODE_NONE (0x0UL << 0)
  1495. #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_AUTO_MODE_ALL_SPEEDS (0x1UL << 0)
  1496. #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_AUTO_MODE_ONE_SPEED (0x2UL << 0)
  1497. #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_AUTO_MODE_ONE_OR_BELOW (0x3UL << 0)
  1498. #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_AUTO_MODE_MASK (0x4UL << 0)
  1499. u8 link_partner_adv_pause;
  1500. #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_PAUSE_TX 0x1UL
  1501. #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_PAUSE_RX 0x2UL
  1502. u8 unused_3;
  1503. u8 unused_4;
  1504. u8 unused_5;
  1505. u8 valid;
  1506. };
  1507. /* hwrm_port_mac_cfg */
  1508. /* Input (32 bytes) */
  1509. struct hwrm_port_mac_cfg_input {
  1510. __le16 req_type;
  1511. __le16 cmpl_ring;
  1512. __le16 seq_id;
  1513. __le16 target_id;
  1514. __le64 resp_addr;
  1515. __le32 flags;
  1516. #define PORT_MAC_CFG_REQ_FLAGS_MATCH_LINK 0x1UL
  1517. #define PORT_MAC_CFG_REQ_FLAGS_COS_ASSIGNMENT_ENABLE 0x2UL
  1518. #define PORT_MAC_CFG_REQ_FLAGS_TUNNEL_PRI2COS_ENABLE 0x4UL
  1519. #define PORT_MAC_CFG_REQ_FLAGS_IP_DSCP2COS_ENABLE 0x8UL
  1520. __le32 enables;
  1521. #define PORT_MAC_CFG_REQ_ENABLES_IPG 0x1UL
  1522. #define PORT_MAC_CFG_REQ_ENABLES_LPBK 0x2UL
  1523. #define PORT_MAC_CFG_REQ_ENABLES_IVLAN_PRI2COS_MAP_PRI 0x4UL
  1524. #define PORT_MAC_CFG_REQ_ENABLES_LCOS_MAP_PRI 0x8UL
  1525. #define PORT_MAC_CFG_REQ_ENABLES_TUNNEL_PRI2COS_MAP_PRI 0x10UL
  1526. #define PORT_MAC_CFG_REQ_ENABLES_DSCP2COS_MAP_PRI 0x20UL
  1527. __le16 port_id;
  1528. u8 ipg;
  1529. u8 lpbk;
  1530. #define PORT_MAC_CFG_REQ_LPBK_NONE (0x0UL << 0)
  1531. #define PORT_MAC_CFG_REQ_LPBK_LOCAL (0x1UL << 0)
  1532. #define PORT_MAC_CFG_REQ_LPBK_REMOTE (0x2UL << 0)
  1533. u8 ivlan_pri2cos_map_pri;
  1534. u8 lcos_map_pri;
  1535. u8 tunnel_pri2cos_map_pri;
  1536. u8 dscp2pri_map_pri;
  1537. };
  1538. /* Output (16 bytes) */
  1539. struct hwrm_port_mac_cfg_output {
  1540. __le16 error_code;
  1541. __le16 req_type;
  1542. __le16 seq_id;
  1543. __le16 resp_len;
  1544. __le16 mru;
  1545. __le16 mtu;
  1546. u8 ipg;
  1547. u8 lpbk;
  1548. #define PORT_MAC_CFG_RESP_LPBK_NONE (0x0UL << 0)
  1549. #define PORT_MAC_CFG_RESP_LPBK_LOCAL (0x1UL << 0)
  1550. #define PORT_MAC_CFG_RESP_LPBK_REMOTE (0x2UL << 0)
  1551. u8 unused_0;
  1552. u8 valid;
  1553. };
  1554. /* hwrm_port_qstats */
  1555. /* Input (40 bytes) */
  1556. struct hwrm_port_qstats_input {
  1557. __le16 req_type;
  1558. __le16 cmpl_ring;
  1559. __le16 seq_id;
  1560. __le16 target_id;
  1561. __le64 resp_addr;
  1562. __le16 port_id;
  1563. u8 unused_0;
  1564. u8 unused_1;
  1565. u8 unused_2[3];
  1566. u8 unused_3;
  1567. __le64 tx_stat_host_addr;
  1568. __le64 rx_stat_host_addr;
  1569. };
  1570. /* Output (16 bytes) */
  1571. struct hwrm_port_qstats_output {
  1572. __le16 error_code;
  1573. __le16 req_type;
  1574. __le16 seq_id;
  1575. __le16 resp_len;
  1576. __le16 tx_stat_size;
  1577. __le16 rx_stat_size;
  1578. u8 unused_0;
  1579. u8 unused_1;
  1580. u8 unused_2;
  1581. u8 valid;
  1582. };
  1583. /* hwrm_port_lpbk_qstats */
  1584. /* Input (16 bytes) */
  1585. struct hwrm_port_lpbk_qstats_input {
  1586. __le16 req_type;
  1587. __le16 cmpl_ring;
  1588. __le16 seq_id;
  1589. __le16 target_id;
  1590. __le64 resp_addr;
  1591. };
  1592. /* Output (96 bytes) */
  1593. struct hwrm_port_lpbk_qstats_output {
  1594. __le16 error_code;
  1595. __le16 req_type;
  1596. __le16 seq_id;
  1597. __le16 resp_len;
  1598. __le64 lpbk_ucast_frames;
  1599. __le64 lpbk_mcast_frames;
  1600. __le64 lpbk_bcast_frames;
  1601. __le64 lpbk_ucast_bytes;
  1602. __le64 lpbk_mcast_bytes;
  1603. __le64 lpbk_bcast_bytes;
  1604. __le64 tx_stat_discard;
  1605. __le64 tx_stat_error;
  1606. __le64 rx_stat_discard;
  1607. __le64 rx_stat_error;
  1608. __le32 unused_0;
  1609. u8 unused_1;
  1610. u8 unused_2;
  1611. u8 unused_3;
  1612. u8 valid;
  1613. };
  1614. /* hwrm_port_clr_stats */
  1615. /* Input (24 bytes) */
  1616. struct hwrm_port_clr_stats_input {
  1617. __le16 req_type;
  1618. __le16 cmpl_ring;
  1619. __le16 seq_id;
  1620. __le16 target_id;
  1621. __le64 resp_addr;
  1622. __le16 port_id;
  1623. __le16 unused_0[3];
  1624. };
  1625. /* Output (16 bytes) */
  1626. struct hwrm_port_clr_stats_output {
  1627. __le16 error_code;
  1628. __le16 req_type;
  1629. __le16 seq_id;
  1630. __le16 resp_len;
  1631. __le32 unused_0;
  1632. u8 unused_1;
  1633. u8 unused_2;
  1634. u8 unused_3;
  1635. u8 valid;
  1636. };
  1637. /* hwrm_port_lpbk_clr_stats */
  1638. /* Input (16 bytes) */
  1639. struct hwrm_port_lpbk_clr_stats_input {
  1640. __le16 req_type;
  1641. __le16 cmpl_ring;
  1642. __le16 seq_id;
  1643. __le16 target_id;
  1644. __le64 resp_addr;
  1645. };
  1646. /* Output (16 bytes) */
  1647. struct hwrm_port_lpbk_clr_stats_output {
  1648. __le16 error_code;
  1649. __le16 req_type;
  1650. __le16 seq_id;
  1651. __le16 resp_len;
  1652. __le32 unused_0;
  1653. u8 unused_1;
  1654. u8 unused_2;
  1655. u8 unused_3;
  1656. u8 valid;
  1657. };
  1658. /* hwrm_port_blink_led */
  1659. /* Input (24 bytes) */
  1660. struct hwrm_port_blink_led_input {
  1661. __le16 req_type;
  1662. __le16 cmpl_ring;
  1663. __le16 seq_id;
  1664. __le16 target_id;
  1665. __le64 resp_addr;
  1666. __le32 num_blinks;
  1667. __le32 unused_0;
  1668. };
  1669. /* Output (16 bytes) */
  1670. struct hwrm_port_blink_led_output {
  1671. __le16 error_code;
  1672. __le16 req_type;
  1673. __le16 seq_id;
  1674. __le16 resp_len;
  1675. __le32 unused_0;
  1676. u8 unused_1;
  1677. u8 unused_2;
  1678. u8 unused_3;
  1679. u8 valid;
  1680. };
  1681. /* hwrm_queue_qportcfg */
  1682. /* Input (24 bytes) */
  1683. struct hwrm_queue_qportcfg_input {
  1684. __le16 req_type;
  1685. __le16 cmpl_ring;
  1686. __le16 seq_id;
  1687. __le16 target_id;
  1688. __le64 resp_addr;
  1689. __le32 flags;
  1690. #define QUEUE_QPORTCFG_REQ_FLAGS_PATH 0x1UL
  1691. #define QUEUE_QPORTCFG_REQ_FLAGS_PATH_TX (0x0UL << 0)
  1692. #define QUEUE_QPORTCFG_REQ_FLAGS_PATH_RX (0x1UL << 0)
  1693. __le16 port_id;
  1694. __le16 unused_0;
  1695. };
  1696. /* Output (32 bytes) */
  1697. struct hwrm_queue_qportcfg_output {
  1698. __le16 error_code;
  1699. __le16 req_type;
  1700. __le16 seq_id;
  1701. __le16 resp_len;
  1702. u8 max_configurable_queues;
  1703. u8 max_configurable_lossless_queues;
  1704. u8 queue_cfg_allowed;
  1705. u8 queue_buffers_cfg_allowed;
  1706. u8 queue_pfcenable_cfg_allowed;
  1707. u8 queue_pri2cos_cfg_allowed;
  1708. u8 queue_cos2bw_cfg_allowed;
  1709. u8 queue_id0;
  1710. u8 queue_id0_service_profile;
  1711. #define QUEUE_QPORTCFG_RESP_QUEUE_ID0_SERVICE_PROFILE_LOSSY (0x0UL << 0)
  1712. #define QUEUE_QPORTCFG_RESP_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS (0x1UL << 0)
  1713. #define QUEUE_QPORTCFG_RESP_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN (0xffUL << 0)
  1714. u8 queue_id1;
  1715. u8 queue_id1_service_profile;
  1716. #define QUEUE_QPORTCFG_RESP_QUEUE_ID1_SERVICE_PROFILE_LOSSY (0x0UL << 0)
  1717. #define QUEUE_QPORTCFG_RESP_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS (0x1UL << 0)
  1718. #define QUEUE_QPORTCFG_RESP_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN (0xffUL << 0)
  1719. u8 queue_id2;
  1720. u8 queue_id2_service_profile;
  1721. #define QUEUE_QPORTCFG_RESP_QUEUE_ID2_SERVICE_PROFILE_LOSSY (0x0UL << 0)
  1722. #define QUEUE_QPORTCFG_RESP_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS (0x1UL << 0)
  1723. #define QUEUE_QPORTCFG_RESP_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN (0xffUL << 0)
  1724. u8 queue_id3;
  1725. u8 queue_id3_service_profile;
  1726. #define QUEUE_QPORTCFG_RESP_QUEUE_ID3_SERVICE_PROFILE_LOSSY (0x0UL << 0)
  1727. #define QUEUE_QPORTCFG_RESP_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS (0x1UL << 0)
  1728. #define QUEUE_QPORTCFG_RESP_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN (0xffUL << 0)
  1729. u8 queue_id4;
  1730. u8 queue_id4_service_profile;
  1731. #define QUEUE_QPORTCFG_RESP_QUEUE_ID4_SERVICE_PROFILE_LOSSY (0x0UL << 0)
  1732. #define QUEUE_QPORTCFG_RESP_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS (0x1UL << 0)
  1733. #define QUEUE_QPORTCFG_RESP_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN (0xffUL << 0)
  1734. u8 queue_id5;
  1735. u8 queue_id5_service_profile;
  1736. #define QUEUE_QPORTCFG_RESP_QUEUE_ID5_SERVICE_PROFILE_LOSSY (0x0UL << 0)
  1737. #define QUEUE_QPORTCFG_RESP_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS (0x1UL << 0)
  1738. #define QUEUE_QPORTCFG_RESP_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN (0xffUL << 0)
  1739. u8 queue_id6;
  1740. u8 queue_id6_service_profile;
  1741. #define QUEUE_QPORTCFG_RESP_QUEUE_ID6_SERVICE_PROFILE_LOSSY (0x0UL << 0)
  1742. #define QUEUE_QPORTCFG_RESP_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS (0x1UL << 0)
  1743. #define QUEUE_QPORTCFG_RESP_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN (0xffUL << 0)
  1744. u8 queue_id7;
  1745. u8 queue_id7_service_profile;
  1746. #define QUEUE_QPORTCFG_RESP_QUEUE_ID7_SERVICE_PROFILE_LOSSY (0x0UL << 0)
  1747. #define QUEUE_QPORTCFG_RESP_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS (0x1UL << 0)
  1748. #define QUEUE_QPORTCFG_RESP_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN (0xffUL << 0)
  1749. u8 valid;
  1750. };
  1751. /* hwrm_queue_cfg */
  1752. /* Input (40 bytes) */
  1753. struct hwrm_queue_cfg_input {
  1754. __le16 req_type;
  1755. __le16 cmpl_ring;
  1756. __le16 seq_id;
  1757. __le16 target_id;
  1758. __le64 resp_addr;
  1759. __le32 flags;
  1760. #define QUEUE_CFG_REQ_FLAGS_PATH 0x1UL
  1761. #define QUEUE_CFG_REQ_FLAGS_PATH_TX (0x0UL << 0)
  1762. #define QUEUE_CFG_REQ_FLAGS_PATH_RX (0x1UL << 0)
  1763. __le32 enables;
  1764. #define QUEUE_CFG_REQ_ENABLES_DFLT_LEN 0x1UL
  1765. #define QUEUE_CFG_REQ_ENABLES_SERVICE_PROFILE 0x2UL
  1766. __le32 queue_id;
  1767. __le32 dflt_len;
  1768. u8 service_profile;
  1769. #define QUEUE_CFG_REQ_SERVICE_PROFILE_LOSSY (0x0UL << 0)
  1770. #define QUEUE_CFG_REQ_SERVICE_PROFILE_LOSSLESS (0x1UL << 0)
  1771. #define QUEUE_CFG_REQ_SERVICE_PROFILE_UNKNOWN (0xffUL << 0)
  1772. u8 unused_0[7];
  1773. };
  1774. /* Output (16 bytes) */
  1775. struct hwrm_queue_cfg_output {
  1776. __le16 error_code;
  1777. __le16 req_type;
  1778. __le16 seq_id;
  1779. __le16 resp_len;
  1780. __le32 unused_0;
  1781. u8 unused_1;
  1782. u8 unused_2;
  1783. u8 unused_3;
  1784. u8 valid;
  1785. };
  1786. /* hwrm_queue_buffers_cfg */
  1787. /* Input (56 bytes) */
  1788. struct hwrm_queue_buffers_cfg_input {
  1789. __le16 req_type;
  1790. __le16 cmpl_ring;
  1791. __le16 seq_id;
  1792. __le16 target_id;
  1793. __le64 resp_addr;
  1794. __le32 flags;
  1795. #define QUEUE_BUFFERS_CFG_REQ_FLAGS_PATH 0x1UL
  1796. #define QUEUE_BUFFERS_CFG_REQ_FLAGS_PATH_TX (0x0UL << 0)
  1797. #define QUEUE_BUFFERS_CFG_REQ_FLAGS_PATH_RX (0x1UL << 0)
  1798. __le32 enables;
  1799. #define QUEUE_BUFFERS_CFG_REQ_ENABLES_RESERVED 0x1UL
  1800. #define QUEUE_BUFFERS_CFG_REQ_ENABLES_SHARED 0x2UL
  1801. #define QUEUE_BUFFERS_CFG_REQ_ENABLES_XOFF 0x4UL
  1802. #define QUEUE_BUFFERS_CFG_REQ_ENABLES_XON 0x8UL
  1803. #define QUEUE_BUFFERS_CFG_REQ_ENABLES_FULL 0x10UL
  1804. #define QUEUE_BUFFERS_CFG_REQ_ENABLES_NOTFULL 0x20UL
  1805. #define QUEUE_BUFFERS_CFG_REQ_ENABLES_MAX 0x40UL
  1806. __le32 queue_id;
  1807. __le32 reserved;
  1808. __le32 shared;
  1809. __le32 xoff;
  1810. __le32 xon;
  1811. __le32 full;
  1812. __le32 notfull;
  1813. __le32 max;
  1814. };
  1815. /* Output (16 bytes) */
  1816. struct hwrm_queue_buffers_cfg_output {
  1817. __le16 error_code;
  1818. __le16 req_type;
  1819. __le16 seq_id;
  1820. __le16 resp_len;
  1821. __le32 unused_0;
  1822. u8 unused_1;
  1823. u8 unused_2;
  1824. u8 unused_3;
  1825. u8 valid;
  1826. };
  1827. /* hwrm_queue_pfcenable_cfg */
  1828. /* Input (24 bytes) */
  1829. struct hwrm_queue_pfcenable_cfg_input {
  1830. __le16 req_type;
  1831. __le16 cmpl_ring;
  1832. __le16 seq_id;
  1833. __le16 target_id;
  1834. __le64 resp_addr;
  1835. __le32 flags;
  1836. #define QUEUE_PFCENABLE_CFG_REQ_FLAGS_PRI0_PFC_ENABLED 0x1UL
  1837. #define QUEUE_PFCENABLE_CFG_REQ_FLAGS_PRI1_PFC_ENABLED 0x2UL
  1838. #define QUEUE_PFCENABLE_CFG_REQ_FLAGS_PRI2_PFC_ENABLED 0x4UL
  1839. #define QUEUE_PFCENABLE_CFG_REQ_FLAGS_PRI3_PFC_ENABLED 0x8UL
  1840. #define QUEUE_PFCENABLE_CFG_REQ_FLAGS_PRI4_PFC_ENABLED 0x10UL
  1841. #define QUEUE_PFCENABLE_CFG_REQ_FLAGS_PRI5_PFC_ENABLED 0x20UL
  1842. #define QUEUE_PFCENABLE_CFG_REQ_FLAGS_PRI6_PFC_ENABLED 0x40UL
  1843. #define QUEUE_PFCENABLE_CFG_REQ_FLAGS_PRI7_PFC_ENABLED 0x80UL
  1844. __le16 port_id;
  1845. __le16 unused_0;
  1846. };
  1847. /* Output (16 bytes) */
  1848. struct hwrm_queue_pfcenable_cfg_output {
  1849. __le16 error_code;
  1850. __le16 req_type;
  1851. __le16 seq_id;
  1852. __le16 resp_len;
  1853. __le32 unused_0;
  1854. u8 unused_1;
  1855. u8 unused_2;
  1856. u8 unused_3;
  1857. u8 valid;
  1858. };
  1859. /* hwrm_queue_pri2cos_cfg */
  1860. /* Input (40 bytes) */
  1861. struct hwrm_queue_pri2cos_cfg_input {
  1862. __le16 req_type;
  1863. __le16 cmpl_ring;
  1864. __le16 seq_id;
  1865. __le16 target_id;
  1866. __le64 resp_addr;
  1867. __le32 flags;
  1868. #define QUEUE_PRI2COS_CFG_REQ_FLAGS_PATH 0x1UL
  1869. #define QUEUE_PRI2COS_CFG_REQ_FLAGS_PATH_TX (0x0UL << 0)
  1870. #define QUEUE_PRI2COS_CFG_REQ_FLAGS_PATH_RX (0x1UL << 0)
  1871. #define QUEUE_PRI2COS_CFG_REQ_FLAGS_IVLAN 0x2UL
  1872. __le32 enables;
  1873. u8 port_id;
  1874. u8 pri0_cos_queue_id;
  1875. u8 pri1_cos_queue_id;
  1876. u8 pri2_cos_queue_id;
  1877. u8 pri3_cos_queue_id;
  1878. u8 pri4_cos_queue_id;
  1879. u8 pri5_cos_queue_id;
  1880. u8 pri6_cos_queue_id;
  1881. u8 pri7_cos_queue_id;
  1882. u8 unused_0[7];
  1883. };
  1884. /* Output (16 bytes) */
  1885. struct hwrm_queue_pri2cos_cfg_output {
  1886. __le16 error_code;
  1887. __le16 req_type;
  1888. __le16 seq_id;
  1889. __le16 resp_len;
  1890. __le32 unused_0;
  1891. u8 unused_1;
  1892. u8 unused_2;
  1893. u8 unused_3;
  1894. u8 valid;
  1895. };
  1896. /* hwrm_queue_cos2bw_cfg */
  1897. /* Input (128 bytes) */
  1898. struct hwrm_queue_cos2bw_cfg_input {
  1899. __le16 req_type;
  1900. __le16 cmpl_ring;
  1901. __le16 seq_id;
  1902. __le16 target_id;
  1903. __le64 resp_addr;
  1904. __le32 flags;
  1905. __le32 enables;
  1906. #define QUEUE_COS2BW_CFG_REQ_ENABLES_COS_QUEUE_ID0_VALID 0x1UL
  1907. #define QUEUE_COS2BW_CFG_REQ_ENABLES_COS_QUEUE_ID1_VALID 0x2UL
  1908. #define QUEUE_COS2BW_CFG_REQ_ENABLES_COS_QUEUE_ID2_VALID 0x4UL
  1909. #define QUEUE_COS2BW_CFG_REQ_ENABLES_COS_QUEUE_ID3_VALID 0x8UL
  1910. #define QUEUE_COS2BW_CFG_REQ_ENABLES_COS_QUEUE_ID4_VALID 0x10UL
  1911. #define QUEUE_COS2BW_CFG_REQ_ENABLES_COS_QUEUE_ID5_VALID 0x20UL
  1912. #define QUEUE_COS2BW_CFG_REQ_ENABLES_COS_QUEUE_ID6_VALID 0x40UL
  1913. #define QUEUE_COS2BW_CFG_REQ_ENABLES_COS_QUEUE_ID7_VALID 0x80UL
  1914. __le16 port_id;
  1915. u8 queue_id0;
  1916. u8 unused_0;
  1917. __le32 queue_id0_min_bw;
  1918. __le32 queue_id0_max_bw;
  1919. u8 queue_id0_tsa_assign;
  1920. #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID0_TSA_ASSIGN_SP (0x0UL << 0)
  1921. #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID0_TSA_ASSIGN_ETS (0x1UL << 0)
  1922. #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID0_TSA_ASSIGN_RESERVED_FIRST (0x2UL << 0)
  1923. #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID0_TSA_ASSIGN_RESERVED_LAST (0xffffUL << 0)
  1924. u8 queue_id0_pri_lvl;
  1925. u8 queue_id0_bw_weight;
  1926. u8 queue_id1;
  1927. __le32 queue_id1_min_bw;
  1928. __le32 queue_id1_max_bw;
  1929. u8 queue_id1_tsa_assign;
  1930. #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID1_TSA_ASSIGN_SP (0x0UL << 0)
  1931. #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID1_TSA_ASSIGN_ETS (0x1UL << 0)
  1932. #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID1_TSA_ASSIGN_RESERVED_FIRST (0x2UL << 0)
  1933. #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID1_TSA_ASSIGN_RESERVED_LAST (0xffffUL << 0)
  1934. u8 queue_id1_pri_lvl;
  1935. u8 queue_id1_bw_weight;
  1936. u8 queue_id2;
  1937. __le32 queue_id2_min_bw;
  1938. __le32 queue_id2_max_bw;
  1939. u8 queue_id2_tsa_assign;
  1940. #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID2_TSA_ASSIGN_SP (0x0UL << 0)
  1941. #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID2_TSA_ASSIGN_ETS (0x1UL << 0)
  1942. #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID2_TSA_ASSIGN_RESERVED_FIRST (0x2UL << 0)
  1943. #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID2_TSA_ASSIGN_RESERVED_LAST (0xffffUL << 0)
  1944. u8 queue_id2_pri_lvl;
  1945. u8 queue_id2_bw_weight;
  1946. u8 queue_id3;
  1947. __le32 queue_id3_min_bw;
  1948. __le32 queue_id3_max_bw;
  1949. u8 queue_id3_tsa_assign;
  1950. #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID3_TSA_ASSIGN_SP (0x0UL << 0)
  1951. #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID3_TSA_ASSIGN_ETS (0x1UL << 0)
  1952. #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID3_TSA_ASSIGN_RESERVED_FIRST (0x2UL << 0)
  1953. #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID3_TSA_ASSIGN_RESERVED_LAST (0xffffUL << 0)
  1954. u8 queue_id3_pri_lvl;
  1955. u8 queue_id3_bw_weight;
  1956. u8 queue_id4;
  1957. __le32 queue_id4_min_bw;
  1958. __le32 queue_id4_max_bw;
  1959. u8 queue_id4_tsa_assign;
  1960. #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID4_TSA_ASSIGN_SP (0x0UL << 0)
  1961. #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID4_TSA_ASSIGN_ETS (0x1UL << 0)
  1962. #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID4_TSA_ASSIGN_RESERVED_FIRST (0x2UL << 0)
  1963. #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID4_TSA_ASSIGN_RESERVED_LAST (0xffffUL << 0)
  1964. u8 queue_id4_pri_lvl;
  1965. u8 queue_id4_bw_weight;
  1966. u8 queue_id5;
  1967. __le32 queue_id5_min_bw;
  1968. __le32 queue_id5_max_bw;
  1969. u8 queue_id5_tsa_assign;
  1970. #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID5_TSA_ASSIGN_SP (0x0UL << 0)
  1971. #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID5_TSA_ASSIGN_ETS (0x1UL << 0)
  1972. #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID5_TSA_ASSIGN_RESERVED_FIRST (0x2UL << 0)
  1973. #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID5_TSA_ASSIGN_RESERVED_LAST (0xffffUL << 0)
  1974. u8 queue_id5_pri_lvl;
  1975. u8 queue_id5_bw_weight;
  1976. u8 queue_id6;
  1977. __le32 queue_id6_min_bw;
  1978. __le32 queue_id6_max_bw;
  1979. u8 queue_id6_tsa_assign;
  1980. #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID6_TSA_ASSIGN_SP (0x0UL << 0)
  1981. #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID6_TSA_ASSIGN_ETS (0x1UL << 0)
  1982. #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID6_TSA_ASSIGN_RESERVED_FIRST (0x2UL << 0)
  1983. #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID6_TSA_ASSIGN_RESERVED_LAST (0xffffUL << 0)
  1984. u8 queue_id6_pri_lvl;
  1985. u8 queue_id6_bw_weight;
  1986. u8 queue_id7;
  1987. __le32 queue_id7_min_bw;
  1988. __le32 queue_id7_max_bw;
  1989. u8 queue_id7_tsa_assign;
  1990. #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID7_TSA_ASSIGN_SP (0x0UL << 0)
  1991. #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID7_TSA_ASSIGN_ETS (0x1UL << 0)
  1992. #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID7_TSA_ASSIGN_RESERVED_FIRST (0x2UL << 0)
  1993. #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID7_TSA_ASSIGN_RESERVED_LAST (0xffffUL << 0)
  1994. u8 queue_id7_pri_lvl;
  1995. u8 queue_id7_bw_weight;
  1996. u8 unused_1[5];
  1997. };
  1998. /* Output (16 bytes) */
  1999. struct hwrm_queue_cos2bw_cfg_output {
  2000. __le16 error_code;
  2001. __le16 req_type;
  2002. __le16 seq_id;
  2003. __le16 resp_len;
  2004. __le32 unused_0;
  2005. u8 unused_1;
  2006. u8 unused_2;
  2007. u8 unused_3;
  2008. u8 valid;
  2009. };
  2010. /* hwrm_vnic_alloc */
  2011. /* Input (24 bytes) */
  2012. struct hwrm_vnic_alloc_input {
  2013. __le16 req_type;
  2014. __le16 cmpl_ring;
  2015. __le16 seq_id;
  2016. __le16 target_id;
  2017. __le64 resp_addr;
  2018. __le32 flags;
  2019. #define VNIC_ALLOC_REQ_FLAGS_DEFAULT 0x1UL
  2020. __le32 unused_0;
  2021. };
  2022. /* Output (16 bytes) */
  2023. struct hwrm_vnic_alloc_output {
  2024. __le16 error_code;
  2025. __le16 req_type;
  2026. __le16 seq_id;
  2027. __le16 resp_len;
  2028. __le32 vnic_id;
  2029. u8 unused_0;
  2030. u8 unused_1;
  2031. u8 unused_2;
  2032. u8 valid;
  2033. };
  2034. /* hwrm_vnic_free */
  2035. /* Input (24 bytes) */
  2036. struct hwrm_vnic_free_input {
  2037. __le16 req_type;
  2038. __le16 cmpl_ring;
  2039. __le16 seq_id;
  2040. __le16 target_id;
  2041. __le64 resp_addr;
  2042. __le32 vnic_id;
  2043. __le32 unused_0;
  2044. };
  2045. /* Output (16 bytes) */
  2046. struct hwrm_vnic_free_output {
  2047. __le16 error_code;
  2048. __le16 req_type;
  2049. __le16 seq_id;
  2050. __le16 resp_len;
  2051. __le32 unused_0;
  2052. u8 unused_1;
  2053. u8 unused_2;
  2054. u8 unused_3;
  2055. u8 valid;
  2056. };
  2057. /* hwrm_vnic_cfg */
  2058. /* Input (40 bytes) */
  2059. struct hwrm_vnic_cfg_input {
  2060. __le16 req_type;
  2061. __le16 cmpl_ring;
  2062. __le16 seq_id;
  2063. __le16 target_id;
  2064. __le64 resp_addr;
  2065. __le32 flags;
  2066. #define VNIC_CFG_REQ_FLAGS_DEFAULT 0x1UL
  2067. #define VNIC_CFG_REQ_FLAGS_VLAN_STRIP_MODE 0x2UL
  2068. #define VNIC_CFG_REQ_FLAGS_BD_STALL_MODE 0x4UL
  2069. __le32 enables;
  2070. #define VNIC_CFG_REQ_ENABLES_DFLT_RING_GRP 0x1UL
  2071. #define VNIC_CFG_REQ_ENABLES_RSS_RULE 0x2UL
  2072. #define VNIC_CFG_REQ_ENABLES_COS_RULE 0x4UL
  2073. #define VNIC_CFG_REQ_ENABLES_LB_RULE 0x8UL
  2074. #define VNIC_CFG_REQ_ENABLES_MRU 0x10UL
  2075. __le16 vnic_id;
  2076. __le16 dflt_ring_grp;
  2077. __le16 rss_rule;
  2078. __le16 cos_rule;
  2079. __le16 lb_rule;
  2080. __le16 mru;
  2081. __le32 unused_0;
  2082. };
  2083. /* Output (16 bytes) */
  2084. struct hwrm_vnic_cfg_output {
  2085. __le16 error_code;
  2086. __le16 req_type;
  2087. __le16 seq_id;
  2088. __le16 resp_len;
  2089. __le32 unused_0;
  2090. u8 unused_1;
  2091. u8 unused_2;
  2092. u8 unused_3;
  2093. u8 valid;
  2094. };
  2095. /* hwrm_vnic_tpa_cfg */
  2096. /* Input (40 bytes) */
  2097. struct hwrm_vnic_tpa_cfg_input {
  2098. __le16 req_type;
  2099. __le16 cmpl_ring;
  2100. __le16 seq_id;
  2101. __le16 target_id;
  2102. __le64 resp_addr;
  2103. __le32 flags;
  2104. #define VNIC_TPA_CFG_REQ_FLAGS_TPA 0x1UL
  2105. #define VNIC_TPA_CFG_REQ_FLAGS_ENCAP_TPA 0x2UL
  2106. #define VNIC_TPA_CFG_REQ_FLAGS_RSC_WND_UPDATE 0x4UL
  2107. #define VNIC_TPA_CFG_REQ_FLAGS_GRO 0x8UL
  2108. #define VNIC_TPA_CFG_REQ_FLAGS_AGG_WITH_ECN 0x10UL
  2109. #define VNIC_TPA_CFG_REQ_FLAGS_AGG_WITH_SAME_GRE_SEQ 0x20UL
  2110. #define VNIC_TPA_CFG_REQ_FLAGS_GRO_IPID_CHECK 0x40UL
  2111. #define VNIC_TPA_CFG_REQ_FLAGS_GRO_TTL_CHECK 0x80UL
  2112. __le32 enables;
  2113. #define VNIC_TPA_CFG_REQ_ENABLES_MAX_AGG_SEGS 0x1UL
  2114. #define VNIC_TPA_CFG_REQ_ENABLES_MAX_AGGS 0x2UL
  2115. #define VNIC_TPA_CFG_REQ_ENABLES_MAX_AGG_TIMER 0x4UL
  2116. #define VNIC_TPA_CFG_REQ_ENABLES_MIN_AGG_LEN 0x8UL
  2117. __le16 vnic_id;
  2118. __le16 max_agg_segs;
  2119. #define VNIC_TPA_CFG_REQ_MAX_AGG_SEGS_1 (0x0UL << 0)
  2120. #define VNIC_TPA_CFG_REQ_MAX_AGG_SEGS_2 (0x1UL << 0)
  2121. #define VNIC_TPA_CFG_REQ_MAX_AGG_SEGS_4 (0x2UL << 0)
  2122. #define VNIC_TPA_CFG_REQ_MAX_AGG_SEGS_8 (0x3UL << 0)
  2123. #define VNIC_TPA_CFG_REQ_MAX_AGG_SEGS_MAX (0x1fUL << 0)
  2124. __le16 max_aggs;
  2125. #define VNIC_TPA_CFG_REQ_MAX_AGGS_1 (0x0UL << 0)
  2126. #define VNIC_TPA_CFG_REQ_MAX_AGGS_2 (0x1UL << 0)
  2127. #define VNIC_TPA_CFG_REQ_MAX_AGGS_4 (0x2UL << 0)
  2128. #define VNIC_TPA_CFG_REQ_MAX_AGGS_8 (0x3UL << 0)
  2129. #define VNIC_TPA_CFG_REQ_MAX_AGGS_16 (0x4UL << 0)
  2130. #define VNIC_TPA_CFG_REQ_MAX_AGGS_MAX (0x7UL << 0)
  2131. u8 unused_0;
  2132. u8 unused_1;
  2133. __le32 max_agg_timer;
  2134. __le32 min_agg_len;
  2135. };
  2136. /* Output (16 bytes) */
  2137. struct hwrm_vnic_tpa_cfg_output {
  2138. __le16 error_code;
  2139. __le16 req_type;
  2140. __le16 seq_id;
  2141. __le16 resp_len;
  2142. __le32 unused_0;
  2143. u8 unused_1;
  2144. u8 unused_2;
  2145. u8 unused_3;
  2146. u8 valid;
  2147. };
  2148. /* hwrm_vnic_rss_cfg */
  2149. /* Input (48 bytes) */
  2150. struct hwrm_vnic_rss_cfg_input {
  2151. __le16 req_type;
  2152. __le16 cmpl_ring;
  2153. __le16 seq_id;
  2154. __le16 target_id;
  2155. __le64 resp_addr;
  2156. __le32 hash_type;
  2157. #define VNIC_RSS_CFG_REQ_HASH_TYPE_IPV4 0x1UL
  2158. #define VNIC_RSS_CFG_REQ_HASH_TYPE_TCP_IPV4 0x2UL
  2159. #define VNIC_RSS_CFG_REQ_HASH_TYPE_UDP_IPV4 0x4UL
  2160. #define VNIC_RSS_CFG_REQ_HASH_TYPE_IPV6 0x8UL
  2161. #define VNIC_RSS_CFG_REQ_HASH_TYPE_TCP_IPV6 0x10UL
  2162. #define VNIC_RSS_CFG_REQ_HASH_TYPE_UDP_IPV6 0x20UL
  2163. __le32 unused_0;
  2164. __le64 ring_grp_tbl_addr;
  2165. __le64 hash_key_tbl_addr;
  2166. __le16 rss_ctx_idx;
  2167. __le16 unused_1[3];
  2168. };
  2169. /* Output (16 bytes) */
  2170. struct hwrm_vnic_rss_cfg_output {
  2171. __le16 error_code;
  2172. __le16 req_type;
  2173. __le16 seq_id;
  2174. __le16 resp_len;
  2175. __le32 unused_0;
  2176. u8 unused_1;
  2177. u8 unused_2;
  2178. u8 unused_3;
  2179. u8 valid;
  2180. };
  2181. /* hwrm_vnic_plcmodes_cfg */
  2182. /* Input (40 bytes) */
  2183. struct hwrm_vnic_plcmodes_cfg_input {
  2184. __le16 req_type;
  2185. __le16 cmpl_ring;
  2186. __le16 seq_id;
  2187. __le16 target_id;
  2188. __le64 resp_addr;
  2189. __le32 flags;
  2190. #define VNIC_PLCMODES_CFG_REQ_FLAGS_REGULAR_PLACEMENT 0x1UL
  2191. #define VNIC_PLCMODES_CFG_REQ_FLAGS_JUMBO_PLACEMENT 0x2UL
  2192. #define VNIC_PLCMODES_CFG_REQ_FLAGS_HDS_IPV4 0x4UL
  2193. #define VNIC_PLCMODES_CFG_REQ_FLAGS_HDS_IPV6 0x8UL
  2194. #define VNIC_PLCMODES_CFG_REQ_FLAGS_HDS_FCOE 0x10UL
  2195. #define VNIC_PLCMODES_CFG_REQ_FLAGS_HDS_ROCE 0x20UL
  2196. __le32 enables;
  2197. #define VNIC_PLCMODES_CFG_REQ_ENABLES_JUMBO_THRESH_VALID 0x1UL
  2198. #define VNIC_PLCMODES_CFG_REQ_ENABLES_HDS_OFFSET_VALID 0x2UL
  2199. #define VNIC_PLCMODES_CFG_REQ_ENABLES_HDS_THRESHOLD_VALID 0x4UL
  2200. __le32 vnic_id;
  2201. __le16 jumbo_thresh;
  2202. __le16 hds_offset;
  2203. __le16 hds_threshold;
  2204. __le16 unused_0[3];
  2205. };
  2206. /* Output (16 bytes) */
  2207. struct hwrm_vnic_plcmodes_cfg_output {
  2208. __le16 error_code;
  2209. __le16 req_type;
  2210. __le16 seq_id;
  2211. __le16 resp_len;
  2212. __le32 unused_0;
  2213. u8 unused_1;
  2214. u8 unused_2;
  2215. u8 unused_3;
  2216. u8 valid;
  2217. };
  2218. /* hwrm_vnic_rss_cos_lb_ctx_alloc */
  2219. /* Input (16 bytes) */
  2220. struct hwrm_vnic_rss_cos_lb_ctx_alloc_input {
  2221. __le16 req_type;
  2222. __le16 cmpl_ring;
  2223. __le16 seq_id;
  2224. __le16 target_id;
  2225. __le64 resp_addr;
  2226. };
  2227. /* Output (16 bytes) */
  2228. struct hwrm_vnic_rss_cos_lb_ctx_alloc_output {
  2229. __le16 error_code;
  2230. __le16 req_type;
  2231. __le16 seq_id;
  2232. __le16 resp_len;
  2233. __le16 rss_cos_lb_ctx_id;
  2234. u8 unused_0;
  2235. u8 unused_1;
  2236. u8 unused_2;
  2237. u8 unused_3;
  2238. u8 unused_4;
  2239. u8 valid;
  2240. };
  2241. /* hwrm_vnic_rss_cos_lb_ctx_free */
  2242. /* Input (24 bytes) */
  2243. struct hwrm_vnic_rss_cos_lb_ctx_free_input {
  2244. __le16 req_type;
  2245. __le16 cmpl_ring;
  2246. __le16 seq_id;
  2247. __le16 target_id;
  2248. __le64 resp_addr;
  2249. __le16 rss_cos_lb_ctx_id;
  2250. __le16 unused_0[3];
  2251. };
  2252. /* Output (16 bytes) */
  2253. struct hwrm_vnic_rss_cos_lb_ctx_free_output {
  2254. __le16 error_code;
  2255. __le16 req_type;
  2256. __le16 seq_id;
  2257. __le16 resp_len;
  2258. __le32 unused_0;
  2259. u8 unused_1;
  2260. u8 unused_2;
  2261. u8 unused_3;
  2262. u8 valid;
  2263. };
  2264. /* hwrm_ring_alloc */
  2265. /* Input (80 bytes) */
  2266. struct hwrm_ring_alloc_input {
  2267. __le16 req_type;
  2268. __le16 cmpl_ring;
  2269. __le16 seq_id;
  2270. __le16 target_id;
  2271. __le64 resp_addr;
  2272. __le32 enables;
  2273. #define RING_ALLOC_REQ_ENABLES_RESERVED1 0x1UL
  2274. #define RING_ALLOC_REQ_ENABLES_RESERVED2 0x2UL
  2275. #define RING_ALLOC_REQ_ENABLES_RESERVED3 0x4UL
  2276. #define RING_ALLOC_REQ_ENABLES_STAT_CTX_ID_VALID 0x8UL
  2277. #define RING_ALLOC_REQ_ENABLES_RESERVED4 0x10UL
  2278. #define RING_ALLOC_REQ_ENABLES_MAX_BW_VALID 0x20UL
  2279. u8 ring_type;
  2280. #define RING_ALLOC_REQ_RING_TYPE_CMPL (0x0UL << 0)
  2281. #define RING_ALLOC_REQ_RING_TYPE_TX (0x1UL << 0)
  2282. #define RING_ALLOC_REQ_RING_TYPE_RX (0x2UL << 0)
  2283. u8 unused_0;
  2284. __le16 unused_1;
  2285. __le64 page_tbl_addr;
  2286. __le32 fbo;
  2287. u8 page_size;
  2288. u8 page_tbl_depth;
  2289. u8 unused_2;
  2290. u8 unused_3;
  2291. __le32 length;
  2292. __le16 logical_id;
  2293. __le16 cmpl_ring_id;
  2294. __le16 queue_id;
  2295. u8 unused_4;
  2296. u8 unused_5;
  2297. __le32 reserved1;
  2298. __le16 reserved2;
  2299. u8 unused_6;
  2300. u8 unused_7;
  2301. __le32 reserved3;
  2302. __le32 stat_ctx_id;
  2303. __le32 reserved4;
  2304. __le32 max_bw;
  2305. u8 int_mode;
  2306. #define RING_ALLOC_REQ_INT_MODE_LEGACY (0x0UL << 0)
  2307. #define RING_ALLOC_REQ_INT_MODE_RSVD (0x1UL << 0)
  2308. #define RING_ALLOC_REQ_INT_MODE_MSIX (0x2UL << 0)
  2309. #define RING_ALLOC_REQ_INT_MODE_POLL (0x3UL << 0)
  2310. u8 unused_8[3];
  2311. };
  2312. /* Output (16 bytes) */
  2313. struct hwrm_ring_alloc_output {
  2314. __le16 error_code;
  2315. __le16 req_type;
  2316. __le16 seq_id;
  2317. __le16 resp_len;
  2318. __le16 ring_id;
  2319. __le16 logical_ring_id;
  2320. u8 unused_0;
  2321. u8 unused_1;
  2322. u8 unused_2;
  2323. u8 valid;
  2324. };
  2325. /* hwrm_ring_free */
  2326. /* Input (24 bytes) */
  2327. struct hwrm_ring_free_input {
  2328. __le16 req_type;
  2329. __le16 cmpl_ring;
  2330. __le16 seq_id;
  2331. __le16 target_id;
  2332. __le64 resp_addr;
  2333. u8 ring_type;
  2334. #define RING_FREE_REQ_RING_TYPE_CMPL (0x0UL << 0)
  2335. #define RING_FREE_REQ_RING_TYPE_TX (0x1UL << 0)
  2336. #define RING_FREE_REQ_RING_TYPE_RX (0x2UL << 0)
  2337. u8 unused_0;
  2338. __le16 ring_id;
  2339. __le32 unused_1;
  2340. };
  2341. /* Output (16 bytes) */
  2342. struct hwrm_ring_free_output {
  2343. __le16 error_code;
  2344. __le16 req_type;
  2345. __le16 seq_id;
  2346. __le16 resp_len;
  2347. __le32 unused_0;
  2348. u8 unused_1;
  2349. u8 unused_2;
  2350. u8 unused_3;
  2351. u8 valid;
  2352. };
  2353. /* hwrm_ring_cmpl_ring_qaggint_params */
  2354. /* Input (24 bytes) */
  2355. struct hwrm_ring_cmpl_ring_qaggint_params_input {
  2356. __le16 req_type;
  2357. __le16 cmpl_ring;
  2358. __le16 seq_id;
  2359. __le16 target_id;
  2360. __le64 resp_addr;
  2361. __le16 ring_id;
  2362. __le16 unused_0[3];
  2363. };
  2364. /* Output (32 bytes) */
  2365. struct hwrm_ring_cmpl_ring_qaggint_params_output {
  2366. __le16 error_code;
  2367. __le16 req_type;
  2368. __le16 seq_id;
  2369. __le16 resp_len;
  2370. __le16 flags;
  2371. #define RING_CMPL_RING_QAGGINT_PARAMS_RESP_FLAGS_TIMER_RESET 0x1UL
  2372. #define RING_CMPL_RING_QAGGINT_PARAMS_RESP_FLAGS_RING_IDLE 0x2UL
  2373. __le16 num_cmpl_dma_aggr;
  2374. __le16 num_cmpl_dma_aggr_during_int;
  2375. __le16 cmpl_aggr_dma_tmr;
  2376. __le16 cmpl_aggr_dma_tmr_during_int;
  2377. __le16 int_lat_tmr_min;
  2378. __le16 int_lat_tmr_max;
  2379. __le16 num_cmpl_aggr_int;
  2380. __le32 unused_0;
  2381. u8 unused_1;
  2382. u8 unused_2;
  2383. u8 unused_3;
  2384. u8 valid;
  2385. };
  2386. /* hwrm_ring_cmpl_ring_cfg_aggint_params */
  2387. /* Input (40 bytes) */
  2388. struct hwrm_ring_cmpl_ring_cfg_aggint_params_input {
  2389. __le16 req_type;
  2390. __le16 cmpl_ring;
  2391. __le16 seq_id;
  2392. __le16 target_id;
  2393. __le64 resp_addr;
  2394. __le16 ring_id;
  2395. __le16 flags;
  2396. #define RING_CMPL_RING_CFG_AGGINT_PARAMS_REQ_FLAGS_TIMER_RESET 0x1UL
  2397. #define RING_CMPL_RING_CFG_AGGINT_PARAMS_REQ_FLAGS_RING_IDLE 0x2UL
  2398. __le16 num_cmpl_dma_aggr;
  2399. __le16 num_cmpl_dma_aggr_during_int;
  2400. __le16 cmpl_aggr_dma_tmr;
  2401. __le16 cmpl_aggr_dma_tmr_during_int;
  2402. __le16 int_lat_tmr_min;
  2403. __le16 int_lat_tmr_max;
  2404. __le16 num_cmpl_aggr_int;
  2405. __le16 unused_0[3];
  2406. };
  2407. /* Output (16 bytes) */
  2408. struct hwrm_ring_cmpl_ring_cfg_aggint_params_output {
  2409. __le16 error_code;
  2410. __le16 req_type;
  2411. __le16 seq_id;
  2412. __le16 resp_len;
  2413. __le32 unused_0;
  2414. u8 unused_1;
  2415. u8 unused_2;
  2416. u8 unused_3;
  2417. u8 valid;
  2418. };
  2419. /* hwrm_ring_reset */
  2420. /* Input (24 bytes) */
  2421. struct hwrm_ring_reset_input {
  2422. __le16 req_type;
  2423. __le16 cmpl_ring;
  2424. __le16 seq_id;
  2425. __le16 target_id;
  2426. __le64 resp_addr;
  2427. u8 ring_type;
  2428. #define RING_RESET_REQ_RING_TYPE_CMPL (0x0UL << 0)
  2429. #define RING_RESET_REQ_RING_TYPE_TX (0x1UL << 0)
  2430. #define RING_RESET_REQ_RING_TYPE_RX (0x2UL << 0)
  2431. u8 unused_0;
  2432. __le16 ring_id;
  2433. __le32 unused_1;
  2434. };
  2435. /* Output (16 bytes) */
  2436. struct hwrm_ring_reset_output {
  2437. __le16 error_code;
  2438. __le16 req_type;
  2439. __le16 seq_id;
  2440. __le16 resp_len;
  2441. __le32 unused_0;
  2442. u8 unused_1;
  2443. u8 unused_2;
  2444. u8 unused_3;
  2445. u8 valid;
  2446. };
  2447. /* hwrm_ring_grp_alloc */
  2448. /* Input (24 bytes) */
  2449. struct hwrm_ring_grp_alloc_input {
  2450. __le16 req_type;
  2451. __le16 cmpl_ring;
  2452. __le16 seq_id;
  2453. __le16 target_id;
  2454. __le64 resp_addr;
  2455. __le16 cr;
  2456. __le16 rr;
  2457. __le16 ar;
  2458. __le16 sc;
  2459. };
  2460. /* Output (16 bytes) */
  2461. struct hwrm_ring_grp_alloc_output {
  2462. __le16 error_code;
  2463. __le16 req_type;
  2464. __le16 seq_id;
  2465. __le16 resp_len;
  2466. __le32 ring_group_id;
  2467. u8 unused_0;
  2468. u8 unused_1;
  2469. u8 unused_2;
  2470. u8 valid;
  2471. };
  2472. /* hwrm_ring_grp_free */
  2473. /* Input (24 bytes) */
  2474. struct hwrm_ring_grp_free_input {
  2475. __le16 req_type;
  2476. __le16 cmpl_ring;
  2477. __le16 seq_id;
  2478. __le16 target_id;
  2479. __le64 resp_addr;
  2480. __le32 ring_group_id;
  2481. __le32 unused_0;
  2482. };
  2483. /* Output (16 bytes) */
  2484. struct hwrm_ring_grp_free_output {
  2485. __le16 error_code;
  2486. __le16 req_type;
  2487. __le16 seq_id;
  2488. __le16 resp_len;
  2489. __le32 unused_0;
  2490. u8 unused_1;
  2491. u8 unused_2;
  2492. u8 unused_3;
  2493. u8 valid;
  2494. };
  2495. /* hwrm_cfa_l2_filter_alloc */
  2496. /* Input (96 bytes) */
  2497. struct hwrm_cfa_l2_filter_alloc_input {
  2498. __le16 req_type;
  2499. __le16 cmpl_ring;
  2500. __le16 seq_id;
  2501. __le16 target_id;
  2502. __le64 resp_addr;
  2503. __le32 flags;
  2504. #define CFA_L2_FILTER_ALLOC_REQ_FLAGS_PATH 0x1UL
  2505. #define CFA_L2_FILTER_ALLOC_REQ_FLAGS_PATH_TX (0x0UL << 0)
  2506. #define CFA_L2_FILTER_ALLOC_REQ_FLAGS_PATH_RX (0x1UL << 0)
  2507. #define CFA_L2_FILTER_ALLOC_REQ_FLAGS_LOOPBACK 0x2UL
  2508. #define CFA_L2_FILTER_ALLOC_REQ_FLAGS_DROP 0x4UL
  2509. #define CFA_L2_FILTER_ALLOC_REQ_FLAGS_OUTERMOST 0x8UL
  2510. __le32 enables;
  2511. #define CFA_L2_FILTER_ALLOC_REQ_ENABLES_L2_ADDR 0x1UL
  2512. #define CFA_L2_FILTER_ALLOC_REQ_ENABLES_L2_ADDR_MASK 0x2UL
  2513. #define CFA_L2_FILTER_ALLOC_REQ_ENABLES_L2_OVLAN 0x4UL
  2514. #define CFA_L2_FILTER_ALLOC_REQ_ENABLES_L2_OVLAN_MASK 0x8UL
  2515. #define CFA_L2_FILTER_ALLOC_REQ_ENABLES_L2_IVLAN 0x10UL
  2516. #define CFA_L2_FILTER_ALLOC_REQ_ENABLES_L2_IVLAN_MASK 0x20UL
  2517. #define CFA_L2_FILTER_ALLOC_REQ_ENABLES_T_L2_ADDR 0x40UL
  2518. #define CFA_L2_FILTER_ALLOC_REQ_ENABLES_T_L2_ADDR_MASK 0x80UL
  2519. #define CFA_L2_FILTER_ALLOC_REQ_ENABLES_T_L2_OVLAN 0x100UL
  2520. #define CFA_L2_FILTER_ALLOC_REQ_ENABLES_T_L2_OVLAN_MASK 0x200UL
  2521. #define CFA_L2_FILTER_ALLOC_REQ_ENABLES_T_L2_IVLAN 0x400UL
  2522. #define CFA_L2_FILTER_ALLOC_REQ_ENABLES_T_L2_IVLAN_MASK 0x800UL
  2523. #define CFA_L2_FILTER_ALLOC_REQ_ENABLES_SRC_TYPE 0x1000UL
  2524. #define CFA_L2_FILTER_ALLOC_REQ_ENABLES_SRC_ID 0x2000UL
  2525. #define CFA_L2_FILTER_ALLOC_REQ_ENABLES_TUNNEL_TYPE 0x4000UL
  2526. #define CFA_L2_FILTER_ALLOC_REQ_ENABLES_DST_ID 0x8000UL
  2527. #define CFA_L2_FILTER_ALLOC_REQ_ENABLES_MIRROR_VNIC_ID 0x10000UL
  2528. u8 l2_addr[6];
  2529. u8 unused_0;
  2530. u8 unused_1;
  2531. u8 l2_addr_mask[6];
  2532. __le16 l2_ovlan;
  2533. __le16 l2_ovlan_mask;
  2534. __le16 l2_ivlan;
  2535. __le16 l2_ivlan_mask;
  2536. u8 unused_2;
  2537. u8 unused_3;
  2538. u8 t_l2_addr[6];
  2539. u8 unused_4;
  2540. u8 unused_5;
  2541. u8 t_l2_addr_mask[6];
  2542. __le16 t_l2_ovlan;
  2543. __le16 t_l2_ovlan_mask;
  2544. __le16 t_l2_ivlan;
  2545. __le16 t_l2_ivlan_mask;
  2546. u8 src_type;
  2547. #define CFA_L2_FILTER_ALLOC_REQ_SRC_TYPE_NPORT (0x0UL << 0)
  2548. #define CFA_L2_FILTER_ALLOC_REQ_SRC_TYPE_PF (0x1UL << 0)
  2549. #define CFA_L2_FILTER_ALLOC_REQ_SRC_TYPE_VF (0x2UL << 0)
  2550. #define CFA_L2_FILTER_ALLOC_REQ_SRC_TYPE_VNIC (0x3UL << 0)
  2551. #define CFA_L2_FILTER_ALLOC_REQ_SRC_TYPE_KONG (0x4UL << 0)
  2552. #define CFA_L2_FILTER_ALLOC_REQ_SRC_TYPE_APE (0x5UL << 0)
  2553. #define CFA_L2_FILTER_ALLOC_REQ_SRC_TYPE_BONO (0x6UL << 0)
  2554. #define CFA_L2_FILTER_ALLOC_REQ_SRC_TYPE_TANG (0x7UL << 0)
  2555. u8 unused_6;
  2556. __le32 src_id;
  2557. u8 tunnel_type;
  2558. #define CFA_L2_FILTER_ALLOC_REQ_TUNNEL_TYPE_NONTUNNEL (0x0UL << 0)
  2559. #define CFA_L2_FILTER_ALLOC_REQ_TUNNEL_TYPE_VXLAN (0x1UL << 0)
  2560. #define CFA_L2_FILTER_ALLOC_REQ_TUNNEL_TYPE_NVGRE (0x2UL << 0)
  2561. #define CFA_L2_FILTER_ALLOC_REQ_TUNNEL_TYPE_L2GRE (0x3UL << 0)
  2562. #define CFA_L2_FILTER_ALLOC_REQ_TUNNEL_TYPE_IPIP (0x4UL << 0)
  2563. #define CFA_L2_FILTER_ALLOC_REQ_TUNNEL_TYPE_GENEVE (0x5UL << 0)
  2564. #define CFA_L2_FILTER_ALLOC_REQ_TUNNEL_TYPE_MPLS (0x6UL << 0)
  2565. #define CFA_L2_FILTER_ALLOC_REQ_TUNNEL_TYPE_STT (0x7UL << 0)
  2566. #define CFA_L2_FILTER_ALLOC_REQ_TUNNEL_TYPE_IPGRE (0x8UL << 0)
  2567. #define CFA_L2_FILTER_ALLOC_REQ_TUNNEL_TYPE_ANYTUNNEL (0xffUL << 0)
  2568. u8 unused_7;
  2569. __le16 dst_id;
  2570. __le16 mirror_vnic_id;
  2571. u8 pri_hint;
  2572. #define CFA_L2_FILTER_ALLOC_REQ_PRI_HINT_NO_PREFER (0x0UL << 0)
  2573. #define CFA_L2_FILTER_ALLOC_REQ_PRI_HINT_ABOVE_FILTER (0x1UL << 0)
  2574. #define CFA_L2_FILTER_ALLOC_REQ_PRI_HINT_BELOW_FILTER (0x2UL << 0)
  2575. #define CFA_L2_FILTER_ALLOC_REQ_PRI_HINT_MAX (0x3UL << 0)
  2576. #define CFA_L2_FILTER_ALLOC_REQ_PRI_HINT_MIN (0x4UL << 0)
  2577. u8 unused_8;
  2578. __le32 unused_9;
  2579. __le64 l2_filter_id_hint;
  2580. };
  2581. /* Output (24 bytes) */
  2582. struct hwrm_cfa_l2_filter_alloc_output {
  2583. __le16 error_code;
  2584. __le16 req_type;
  2585. __le16 seq_id;
  2586. __le16 resp_len;
  2587. __le64 l2_filter_id;
  2588. __le32 flow_id;
  2589. u8 unused_0;
  2590. u8 unused_1;
  2591. u8 unused_2;
  2592. u8 valid;
  2593. };
  2594. /* hwrm_cfa_l2_filter_free */
  2595. /* Input (24 bytes) */
  2596. struct hwrm_cfa_l2_filter_free_input {
  2597. __le16 req_type;
  2598. __le16 cmpl_ring;
  2599. __le16 seq_id;
  2600. __le16 target_id;
  2601. __le64 resp_addr;
  2602. __le64 l2_filter_id;
  2603. };
  2604. /* Output (16 bytes) */
  2605. struct hwrm_cfa_l2_filter_free_output {
  2606. __le16 error_code;
  2607. __le16 req_type;
  2608. __le16 seq_id;
  2609. __le16 resp_len;
  2610. __le32 unused_0;
  2611. u8 unused_1;
  2612. u8 unused_2;
  2613. u8 unused_3;
  2614. u8 valid;
  2615. };
  2616. /* hwrm_cfa_l2_filter_cfg */
  2617. /* Input (40 bytes) */
  2618. struct hwrm_cfa_l2_filter_cfg_input {
  2619. __le16 req_type;
  2620. __le16 cmpl_ring;
  2621. __le16 seq_id;
  2622. __le16 target_id;
  2623. __le64 resp_addr;
  2624. __le32 flags;
  2625. #define CFA_L2_FILTER_CFG_REQ_FLAGS_PATH 0x1UL
  2626. #define CFA_L2_FILTER_CFG_REQ_FLAGS_PATH_TX (0x0UL << 0)
  2627. #define CFA_L2_FILTER_CFG_REQ_FLAGS_PATH_RX (0x1UL << 0)
  2628. #define CFA_L2_FILTER_CFG_REQ_FLAGS_DROP 0x2UL
  2629. __le32 enables;
  2630. #define CFA_L2_FILTER_CFG_REQ_ENABLES_DST_ID 0x1UL
  2631. #define CFA_L2_FILTER_CFG_REQ_ENABLES_NEW_MIRROR_VNIC_ID 0x2UL
  2632. __le64 l2_filter_id;
  2633. __le32 dst_id;
  2634. __le32 new_mirror_vnic_id;
  2635. };
  2636. /* Output (16 bytes) */
  2637. struct hwrm_cfa_l2_filter_cfg_output {
  2638. __le16 error_code;
  2639. __le16 req_type;
  2640. __le16 seq_id;
  2641. __le16 resp_len;
  2642. __le32 unused_0;
  2643. u8 unused_1;
  2644. u8 unused_2;
  2645. u8 unused_3;
  2646. u8 valid;
  2647. };
  2648. /* hwrm_cfa_l2_set_rx_mask */
  2649. /* Input (40 bytes) */
  2650. struct hwrm_cfa_l2_set_rx_mask_input {
  2651. __le16 req_type;
  2652. __le16 cmpl_ring;
  2653. __le16 seq_id;
  2654. __le16 target_id;
  2655. __le64 resp_addr;
  2656. __le32 vnic_id;
  2657. __le32 mask;
  2658. #define CFA_L2_SET_RX_MASK_REQ_MASK_RESERVED 0x1UL
  2659. #define CFA_L2_SET_RX_MASK_REQ_MASK_MCAST 0x2UL
  2660. #define CFA_L2_SET_RX_MASK_REQ_MASK_ALL_MCAST 0x4UL
  2661. #define CFA_L2_SET_RX_MASK_REQ_MASK_BCAST 0x8UL
  2662. #define CFA_L2_SET_RX_MASK_REQ_MASK_PROMISCUOUS 0x10UL
  2663. #define CFA_L2_SET_RX_MASK_REQ_MASK_OUTERMOST 0x20UL
  2664. __le64 mc_tbl_addr;
  2665. __le32 num_mc_entries;
  2666. __le32 unused_0;
  2667. };
  2668. /* Output (16 bytes) */
  2669. struct hwrm_cfa_l2_set_rx_mask_output {
  2670. __le16 error_code;
  2671. __le16 req_type;
  2672. __le16 seq_id;
  2673. __le16 resp_len;
  2674. __le32 unused_0;
  2675. u8 unused_1;
  2676. u8 unused_2;
  2677. u8 unused_3;
  2678. u8 valid;
  2679. };
  2680. /* hwrm_cfa_tunnel_filter_alloc */
  2681. /* Input (88 bytes) */
  2682. struct hwrm_cfa_tunnel_filter_alloc_input {
  2683. __le16 req_type;
  2684. __le16 cmpl_ring;
  2685. __le16 seq_id;
  2686. __le16 target_id;
  2687. __le64 resp_addr;
  2688. __le32 flags;
  2689. #define CFA_TUNNEL_FILTER_ALLOC_REQ_FLAGS_LOOPBACK 0x1UL
  2690. __le32 enables;
  2691. #define CFA_TUNNEL_FILTER_ALLOC_REQ_ENABLES_L2_FILTER_ID 0x1UL
  2692. #define CFA_TUNNEL_FILTER_ALLOC_REQ_ENABLES_L2_ADDR 0x2UL
  2693. #define CFA_TUNNEL_FILTER_ALLOC_REQ_ENABLES_L2_IVLAN 0x4UL
  2694. #define CFA_TUNNEL_FILTER_ALLOC_REQ_ENABLES_L3_ADDR 0x8UL
  2695. #define CFA_TUNNEL_FILTER_ALLOC_REQ_ENABLES_L3_ADDR_TYPE 0x10UL
  2696. #define CFA_TUNNEL_FILTER_ALLOC_REQ_ENABLES_T_L3_ADDR_TYPE 0x20UL
  2697. #define CFA_TUNNEL_FILTER_ALLOC_REQ_ENABLES_T_L3_ADDR 0x40UL
  2698. #define CFA_TUNNEL_FILTER_ALLOC_REQ_ENABLES_TUNNEL_TYPE 0x80UL
  2699. #define CFA_TUNNEL_FILTER_ALLOC_REQ_ENABLES_VNI 0x100UL
  2700. #define CFA_TUNNEL_FILTER_ALLOC_REQ_ENABLES_DST_VNIC_ID 0x200UL
  2701. #define CFA_TUNNEL_FILTER_ALLOC_REQ_ENABLES_MIRROR_VNIC_ID 0x400UL
  2702. __le64 l2_filter_id;
  2703. u8 l2_addr[6];
  2704. __le16 l2_ivlan;
  2705. __le32 l3_addr[4];
  2706. __le32 t_l3_addr[4];
  2707. u8 l3_addr_type;
  2708. u8 t_l3_addr_type;
  2709. u8 tunnel_type;
  2710. #define CFA_TUNNEL_FILTER_ALLOC_REQ_TUNNEL_TYPE_NONTUNNEL (0x0UL << 0)
  2711. #define CFA_TUNNEL_FILTER_ALLOC_REQ_TUNNEL_TYPE_VXLAN (0x1UL << 0)
  2712. #define CFA_TUNNEL_FILTER_ALLOC_REQ_TUNNEL_TYPE_NVGRE (0x2UL << 0)
  2713. #define CFA_TUNNEL_FILTER_ALLOC_REQ_TUNNEL_TYPE_L2GRE (0x3UL << 0)
  2714. #define CFA_TUNNEL_FILTER_ALLOC_REQ_TUNNEL_TYPE_IPIP (0x4UL << 0)
  2715. #define CFA_TUNNEL_FILTER_ALLOC_REQ_TUNNEL_TYPE_GENEVE (0x5UL << 0)
  2716. #define CFA_TUNNEL_FILTER_ALLOC_REQ_TUNNEL_TYPE_MPLS (0x6UL << 0)
  2717. #define CFA_TUNNEL_FILTER_ALLOC_REQ_TUNNEL_TYPE_STT (0x7UL << 0)
  2718. #define CFA_TUNNEL_FILTER_ALLOC_REQ_TUNNEL_TYPE_IPGRE (0x8UL << 0)
  2719. #define CFA_TUNNEL_FILTER_ALLOC_REQ_TUNNEL_TYPE_ANYTUNNEL (0xffUL << 0)
  2720. u8 unused_0;
  2721. __le32 vni;
  2722. __le32 dst_vnic_id;
  2723. __le32 mirror_vnic_id;
  2724. };
  2725. /* Output (24 bytes) */
  2726. struct hwrm_cfa_tunnel_filter_alloc_output {
  2727. __le16 error_code;
  2728. __le16 req_type;
  2729. __le16 seq_id;
  2730. __le16 resp_len;
  2731. __le64 tunnel_filter_id;
  2732. __le32 flow_id;
  2733. u8 unused_0;
  2734. u8 unused_1;
  2735. u8 unused_2;
  2736. u8 valid;
  2737. };
  2738. /* hwrm_cfa_tunnel_filter_free */
  2739. /* Input (24 bytes) */
  2740. struct hwrm_cfa_tunnel_filter_free_input {
  2741. __le16 req_type;
  2742. __le16 cmpl_ring;
  2743. __le16 seq_id;
  2744. __le16 target_id;
  2745. __le64 resp_addr;
  2746. __le64 tunnel_filter_id;
  2747. };
  2748. /* Output (16 bytes) */
  2749. struct hwrm_cfa_tunnel_filter_free_output {
  2750. __le16 error_code;
  2751. __le16 req_type;
  2752. __le16 seq_id;
  2753. __le16 resp_len;
  2754. __le32 unused_0;
  2755. u8 unused_1;
  2756. u8 unused_2;
  2757. u8 unused_3;
  2758. u8 valid;
  2759. };
  2760. /* hwrm_cfa_encap_record_alloc */
  2761. /* Input (32 bytes) */
  2762. struct hwrm_cfa_encap_record_alloc_input {
  2763. __le16 req_type;
  2764. __le16 cmpl_ring;
  2765. __le16 seq_id;
  2766. __le16 target_id;
  2767. __le64 resp_addr;
  2768. __le32 flags;
  2769. #define CFA_ENCAP_RECORD_ALLOC_REQ_FLAGS_LOOPBACK 0x1UL
  2770. u8 encap_type;
  2771. #define CFA_ENCAP_RECORD_ALLOC_REQ_ENCAP_TYPE_VXLAN (0x1UL << 0)
  2772. #define CFA_ENCAP_RECORD_ALLOC_REQ_ENCAP_TYPE_NVGRE (0x2UL << 0)
  2773. #define CFA_ENCAP_RECORD_ALLOC_REQ_ENCAP_TYPE_L2GRE (0x3UL << 0)
  2774. #define CFA_ENCAP_RECORD_ALLOC_REQ_ENCAP_TYPE_IPIP (0x4UL << 0)
  2775. #define CFA_ENCAP_RECORD_ALLOC_REQ_ENCAP_TYPE_GENEVE (0x5UL << 0)
  2776. #define CFA_ENCAP_RECORD_ALLOC_REQ_ENCAP_TYPE_MPLS (0x6UL << 0)
  2777. #define CFA_ENCAP_RECORD_ALLOC_REQ_ENCAP_TYPE_VLAN (0x7UL << 0)
  2778. #define CFA_ENCAP_RECORD_ALLOC_REQ_ENCAP_TYPE_IPGRE (0x8UL << 0)
  2779. u8 unused_0;
  2780. __le16 unused_1;
  2781. __le32 encap_data[16];
  2782. };
  2783. /* Output (16 bytes) */
  2784. struct hwrm_cfa_encap_record_alloc_output {
  2785. __le16 error_code;
  2786. __le16 req_type;
  2787. __le16 seq_id;
  2788. __le16 resp_len;
  2789. __le32 encap_record_id;
  2790. u8 unused_0;
  2791. u8 unused_1;
  2792. u8 unused_2;
  2793. u8 valid;
  2794. };
  2795. /* hwrm_cfa_encap_record_free */
  2796. /* Input (24 bytes) */
  2797. struct hwrm_cfa_encap_record_free_input {
  2798. __le16 req_type;
  2799. __le16 cmpl_ring;
  2800. __le16 seq_id;
  2801. __le16 target_id;
  2802. __le64 resp_addr;
  2803. __le32 encap_record_id;
  2804. __le32 unused_0;
  2805. };
  2806. /* Output (16 bytes) */
  2807. struct hwrm_cfa_encap_record_free_output {
  2808. __le16 error_code;
  2809. __le16 req_type;
  2810. __le16 seq_id;
  2811. __le16 resp_len;
  2812. __le32 unused_0;
  2813. u8 unused_1;
  2814. u8 unused_2;
  2815. u8 unused_3;
  2816. u8 valid;
  2817. };
  2818. /* hwrm_cfa_ntuple_filter_alloc */
  2819. /* Input (128 bytes) */
  2820. struct hwrm_cfa_ntuple_filter_alloc_input {
  2821. __le16 req_type;
  2822. __le16 cmpl_ring;
  2823. __le16 seq_id;
  2824. __le16 target_id;
  2825. __le64 resp_addr;
  2826. __le32 flags;
  2827. #define CFA_NTUPLE_FILTER_ALLOC_REQ_FLAGS_LOOPBACK 0x1UL
  2828. #define CFA_NTUPLE_FILTER_ALLOC_REQ_FLAGS_DROP 0x2UL
  2829. __le32 enables;
  2830. #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_L2_FILTER_ID 0x1UL
  2831. #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_ETHERTYPE 0x2UL
  2832. #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_TUNNEL_TYPE 0x4UL
  2833. #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_SRC_MACADDR 0x8UL
  2834. #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_IPADDR_TYPE 0x10UL
  2835. #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_SRC_IPADDR 0x20UL
  2836. #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_SRC_IPADDR_MASK 0x40UL
  2837. #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_DST_IPADDR 0x80UL
  2838. #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_DST_IPADDR_MASK 0x100UL
  2839. #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_IP_PROTOCOL 0x200UL
  2840. #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_SRC_PORT 0x400UL
  2841. #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_SRC_PORT_MASK 0x800UL
  2842. #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_DST_PORT 0x1000UL
  2843. #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_DST_PORT_MASK 0x2000UL
  2844. #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_PRI_HINT 0x4000UL
  2845. #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_NTUPLE_FILTER_ID 0x8000UL
  2846. #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_DST_ID 0x10000UL
  2847. #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_MIRROR_VNIC_ID 0x20000UL
  2848. #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_DST_MACADDR 0x40000UL
  2849. __le64 l2_filter_id;
  2850. u8 src_macaddr[6];
  2851. __be16 ethertype;
  2852. u8 ip_addr_type;
  2853. #define CFA_NTUPLE_FILTER_ALLOC_REQ_IP_ADDR_TYPE_UNKNOWN (0x0UL << 0)
  2854. #define CFA_NTUPLE_FILTER_ALLOC_REQ_IP_ADDR_TYPE_IPV4 (0x4UL << 0)
  2855. #define CFA_NTUPLE_FILTER_ALLOC_REQ_IP_ADDR_TYPE_IPV6 (0x6UL << 0)
  2856. u8 ip_protocol;
  2857. #define CFA_NTUPLE_FILTER_ALLOC_REQ_IP_PROTOCOL_UNKNOWN (0x0UL << 0)
  2858. #define CFA_NTUPLE_FILTER_ALLOC_REQ_IP_PROTOCOL_UDP (0x6UL << 0)
  2859. #define CFA_NTUPLE_FILTER_ALLOC_REQ_IP_PROTOCOL_TCP (0x11UL << 0)
  2860. __le16 dst_id;
  2861. __le16 mirror_vnic_id;
  2862. u8 tunnel_type;
  2863. #define CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_NONTUNNEL (0x0UL << 0)
  2864. #define CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_VXLAN (0x1UL << 0)
  2865. #define CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_NVGRE (0x2UL << 0)
  2866. #define CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_L2GRE (0x3UL << 0)
  2867. #define CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_IPIP (0x4UL << 0)
  2868. #define CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_GENEVE (0x5UL << 0)
  2869. #define CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_MPLS (0x6UL << 0)
  2870. #define CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_STT (0x7UL << 0)
  2871. #define CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_IPGRE (0x8UL << 0)
  2872. #define CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_ANYTUNNEL (0xffUL << 0)
  2873. u8 pri_hint;
  2874. #define CFA_NTUPLE_FILTER_ALLOC_REQ_PRI_HINT_NO_PREFER (0x0UL << 0)
  2875. #define CFA_NTUPLE_FILTER_ALLOC_REQ_PRI_HINT_ABOVE (0x1UL << 0)
  2876. #define CFA_NTUPLE_FILTER_ALLOC_REQ_PRI_HINT_BELOW (0x2UL << 0)
  2877. #define CFA_NTUPLE_FILTER_ALLOC_REQ_PRI_HINT_HIGHEST (0x3UL << 0)
  2878. #define CFA_NTUPLE_FILTER_ALLOC_REQ_PRI_HINT_LOWEST (0x4UL << 0)
  2879. __be32 src_ipaddr[4];
  2880. __be32 src_ipaddr_mask[4];
  2881. __be32 dst_ipaddr[4];
  2882. __be32 dst_ipaddr_mask[4];
  2883. __be16 src_port;
  2884. __be16 src_port_mask;
  2885. __be16 dst_port;
  2886. __be16 dst_port_mask;
  2887. __le64 ntuple_filter_id_hint;
  2888. };
  2889. /* Output (24 bytes) */
  2890. struct hwrm_cfa_ntuple_filter_alloc_output {
  2891. __le16 error_code;
  2892. __le16 req_type;
  2893. __le16 seq_id;
  2894. __le16 resp_len;
  2895. __le64 ntuple_filter_id;
  2896. __le32 flow_id;
  2897. u8 unused_0;
  2898. u8 unused_1;
  2899. u8 unused_2;
  2900. u8 valid;
  2901. };
  2902. /* hwrm_cfa_ntuple_filter_free */
  2903. /* Input (24 bytes) */
  2904. struct hwrm_cfa_ntuple_filter_free_input {
  2905. __le16 req_type;
  2906. __le16 cmpl_ring;
  2907. __le16 seq_id;
  2908. __le16 target_id;
  2909. __le64 resp_addr;
  2910. __le64 ntuple_filter_id;
  2911. };
  2912. /* Output (16 bytes) */
  2913. struct hwrm_cfa_ntuple_filter_free_output {
  2914. __le16 error_code;
  2915. __le16 req_type;
  2916. __le16 seq_id;
  2917. __le16 resp_len;
  2918. __le32 unused_0;
  2919. u8 unused_1;
  2920. u8 unused_2;
  2921. u8 unused_3;
  2922. u8 valid;
  2923. };
  2924. /* hwrm_cfa_ntuple_filter_cfg */
  2925. /* Input (40 bytes) */
  2926. struct hwrm_cfa_ntuple_filter_cfg_input {
  2927. __le16 req_type;
  2928. __le16 cmpl_ring;
  2929. __le16 seq_id;
  2930. __le16 target_id;
  2931. __le64 resp_addr;
  2932. __le32 enables;
  2933. #define CFA_NTUPLE_FILTER_CFG_REQ_ENABLES_NEW_DST_ID 0x1UL
  2934. #define CFA_NTUPLE_FILTER_CFG_REQ_ENABLES_NEW_MIRROR_VNIC_ID 0x2UL
  2935. __le32 unused_0;
  2936. __le64 ntuple_filter_id;
  2937. __le32 new_dst_id;
  2938. __le32 new_mirror_vnic_id;
  2939. };
  2940. /* Output (16 bytes) */
  2941. struct hwrm_cfa_ntuple_filter_cfg_output {
  2942. __le16 error_code;
  2943. __le16 req_type;
  2944. __le16 seq_id;
  2945. __le16 resp_len;
  2946. __le32 unused_0;
  2947. u8 unused_1;
  2948. u8 unused_2;
  2949. u8 unused_3;
  2950. u8 valid;
  2951. };
  2952. /* hwrm_tunnel_dst_port_query */
  2953. /* Input (24 bytes) */
  2954. struct hwrm_tunnel_dst_port_query_input {
  2955. __le16 req_type;
  2956. __le16 cmpl_ring;
  2957. __le16 seq_id;
  2958. __le16 target_id;
  2959. __le64 resp_addr;
  2960. u8 tunnel_type;
  2961. #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_VXLAN (0x1UL << 0)
  2962. #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_GENEVE (0x5UL << 0)
  2963. u8 unused_0[7];
  2964. };
  2965. /* Output (16 bytes) */
  2966. struct hwrm_tunnel_dst_port_query_output {
  2967. __le16 error_code;
  2968. __le16 req_type;
  2969. __le16 seq_id;
  2970. __le16 resp_len;
  2971. __le16 tunnel_dst_port_id;
  2972. __be16 tunnel_dst_port_val;
  2973. u8 unused_0;
  2974. u8 unused_1;
  2975. u8 unused_2;
  2976. u8 valid;
  2977. };
  2978. /* hwrm_tunnel_dst_port_alloc */
  2979. /* Input (24 bytes) */
  2980. struct hwrm_tunnel_dst_port_alloc_input {
  2981. __le16 req_type;
  2982. __le16 cmpl_ring;
  2983. __le16 seq_id;
  2984. __le16 target_id;
  2985. __le64 resp_addr;
  2986. u8 tunnel_type;
  2987. #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_VXLAN (0x1UL << 0)
  2988. #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_GENEVE (0x5UL << 0)
  2989. u8 unused_0;
  2990. __be16 tunnel_dst_port_val;
  2991. __le32 unused_1;
  2992. };
  2993. /* Output (16 bytes) */
  2994. struct hwrm_tunnel_dst_port_alloc_output {
  2995. __le16 error_code;
  2996. __le16 req_type;
  2997. __le16 seq_id;
  2998. __le16 resp_len;
  2999. __le16 tunnel_dst_port_id;
  3000. u8 unused_0;
  3001. u8 unused_1;
  3002. u8 unused_2;
  3003. u8 unused_3;
  3004. u8 unused_4;
  3005. u8 valid;
  3006. };
  3007. /* hwrm_tunnel_dst_port_free */
  3008. /* Input (24 bytes) */
  3009. struct hwrm_tunnel_dst_port_free_input {
  3010. __le16 req_type;
  3011. __le16 cmpl_ring;
  3012. __le16 seq_id;
  3013. __le16 target_id;
  3014. __le64 resp_addr;
  3015. u8 tunnel_type;
  3016. #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_VXLAN (0x1UL << 0)
  3017. #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_GENEVE (0x5UL << 0)
  3018. u8 unused_0;
  3019. __le16 tunnel_dst_port_id;
  3020. __le32 unused_1;
  3021. };
  3022. /* Output (16 bytes) */
  3023. struct hwrm_tunnel_dst_port_free_output {
  3024. __le16 error_code;
  3025. __le16 req_type;
  3026. __le16 seq_id;
  3027. __le16 resp_len;
  3028. __le32 unused_0;
  3029. u8 unused_1;
  3030. u8 unused_2;
  3031. u8 unused_3;
  3032. u8 valid;
  3033. };
  3034. /* hwrm_stat_ctx_alloc */
  3035. /* Input (32 bytes) */
  3036. struct hwrm_stat_ctx_alloc_input {
  3037. __le16 req_type;
  3038. __le16 cmpl_ring;
  3039. __le16 seq_id;
  3040. __le16 target_id;
  3041. __le64 resp_addr;
  3042. __le64 stats_dma_addr;
  3043. __le32 update_period_ms;
  3044. __le32 unused_0;
  3045. };
  3046. /* Output (16 bytes) */
  3047. struct hwrm_stat_ctx_alloc_output {
  3048. __le16 error_code;
  3049. __le16 req_type;
  3050. __le16 seq_id;
  3051. __le16 resp_len;
  3052. __le32 stat_ctx_id;
  3053. u8 unused_0;
  3054. u8 unused_1;
  3055. u8 unused_2;
  3056. u8 valid;
  3057. };
  3058. /* hwrm_stat_ctx_free */
  3059. /* Input (24 bytes) */
  3060. struct hwrm_stat_ctx_free_input {
  3061. __le16 req_type;
  3062. __le16 cmpl_ring;
  3063. __le16 seq_id;
  3064. __le16 target_id;
  3065. __le64 resp_addr;
  3066. __le32 stat_ctx_id;
  3067. __le32 unused_0;
  3068. };
  3069. /* Output (16 bytes) */
  3070. struct hwrm_stat_ctx_free_output {
  3071. __le16 error_code;
  3072. __le16 req_type;
  3073. __le16 seq_id;
  3074. __le16 resp_len;
  3075. __le32 stat_ctx_id;
  3076. u8 unused_0;
  3077. u8 unused_1;
  3078. u8 unused_2;
  3079. u8 valid;
  3080. };
  3081. /* hwrm_stat_ctx_query */
  3082. /* Input (24 bytes) */
  3083. struct hwrm_stat_ctx_query_input {
  3084. __le16 req_type;
  3085. __le16 cmpl_ring;
  3086. __le16 seq_id;
  3087. __le16 target_id;
  3088. __le64 resp_addr;
  3089. __le32 stat_ctx_id;
  3090. __le32 unused_0;
  3091. };
  3092. /* Output (176 bytes) */
  3093. struct hwrm_stat_ctx_query_output {
  3094. __le16 error_code;
  3095. __le16 req_type;
  3096. __le16 seq_id;
  3097. __le16 resp_len;
  3098. __le64 tx_ucast_pkts;
  3099. __le64 tx_mcast_pkts;
  3100. __le64 tx_bcast_pkts;
  3101. __le64 tx_err_pkts;
  3102. __le64 tx_drop_pkts;
  3103. __le64 tx_ucast_bytes;
  3104. __le64 tx_mcast_bytes;
  3105. __le64 tx_bcast_bytes;
  3106. __le64 rx_ucast_pkts;
  3107. __le64 rx_mcast_pkts;
  3108. __le64 rx_bcast_pkts;
  3109. __le64 rx_err_pkts;
  3110. __le64 rx_drop_pkts;
  3111. __le64 rx_ucast_bytes;
  3112. __le64 rx_mcast_bytes;
  3113. __le64 rx_bcast_bytes;
  3114. __le64 rx_agg_pkts;
  3115. __le64 rx_agg_bytes;
  3116. __le64 rx_agg_events;
  3117. __le64 rx_agg_aborts;
  3118. __le32 unused_0;
  3119. u8 unused_1;
  3120. u8 unused_2;
  3121. u8 unused_3;
  3122. u8 valid;
  3123. };
  3124. /* hwrm_stat_ctx_clr_stats */
  3125. /* Input (24 bytes) */
  3126. struct hwrm_stat_ctx_clr_stats_input {
  3127. __le16 req_type;
  3128. __le16 cmpl_ring;
  3129. __le16 seq_id;
  3130. __le16 target_id;
  3131. __le64 resp_addr;
  3132. __le32 stat_ctx_id;
  3133. __le32 unused_0;
  3134. };
  3135. /* Output (16 bytes) */
  3136. struct hwrm_stat_ctx_clr_stats_output {
  3137. __le16 error_code;
  3138. __le16 req_type;
  3139. __le16 seq_id;
  3140. __le16 resp_len;
  3141. __le32 unused_0;
  3142. u8 unused_1;
  3143. u8 unused_2;
  3144. u8 unused_3;
  3145. u8 valid;
  3146. };
  3147. /* hwrm_fw_reset */
  3148. /* Input (24 bytes) */
  3149. struct hwrm_fw_reset_input {
  3150. __le16 req_type;
  3151. __le16 cmpl_ring;
  3152. __le16 seq_id;
  3153. __le16 target_id;
  3154. __le64 resp_addr;
  3155. u8 embedded_proc_type;
  3156. #define FW_RESET_REQ_EMBEDDED_PROC_TYPE_BOOT (0x0UL << 0)
  3157. #define FW_RESET_REQ_EMBEDDED_PROC_TYPE_MGMT (0x1UL << 0)
  3158. #define FW_RESET_REQ_EMBEDDED_PROC_TYPE_NETCTRL (0x2UL << 0)
  3159. #define FW_RESET_REQ_EMBEDDED_PROC_TYPE_ROCE (0x3UL << 0)
  3160. #define FW_RESET_REQ_EMBEDDED_PROC_TYPE_RSVD (0x4UL << 0)
  3161. u8 selfrst_status;
  3162. #define FW_RESET_REQ_SELFRST_STATUS_SELFRSTNONE (0x0UL << 0)
  3163. #define FW_RESET_REQ_SELFRST_STATUS_SELFRSTASAP (0x1UL << 0)
  3164. #define FW_RESET_REQ_SELFRST_STATUS_SELFRSTPCIERST (0x2UL << 0)
  3165. __le16 unused_0[3];
  3166. };
  3167. /* Output (16 bytes) */
  3168. struct hwrm_fw_reset_output {
  3169. __le16 error_code;
  3170. __le16 req_type;
  3171. __le16 seq_id;
  3172. __le16 resp_len;
  3173. u8 selfrst_status;
  3174. #define FW_RESET_RESP_SELFRST_STATUS_SELFRSTNONE (0x0UL << 0)
  3175. #define FW_RESET_RESP_SELFRST_STATUS_SELFRSTASAP (0x1UL << 0)
  3176. #define FW_RESET_RESP_SELFRST_STATUS_SELFRSTPCIERST (0x2UL << 0)
  3177. u8 unused_0;
  3178. __le16 unused_1;
  3179. u8 unused_2;
  3180. u8 unused_3;
  3181. u8 unused_4;
  3182. u8 valid;
  3183. };
  3184. /* hwrm_exec_fwd_resp */
  3185. /* Input (128 bytes) */
  3186. struct hwrm_exec_fwd_resp_input {
  3187. __le16 req_type;
  3188. __le16 cmpl_ring;
  3189. __le16 seq_id;
  3190. __le16 target_id;
  3191. __le64 resp_addr;
  3192. __le32 encap_request[26];
  3193. __le16 encap_resp_target_id;
  3194. __le16 unused_0[3];
  3195. };
  3196. /* Output (16 bytes) */
  3197. struct hwrm_exec_fwd_resp_output {
  3198. __le16 error_code;
  3199. __le16 req_type;
  3200. __le16 seq_id;
  3201. __le16 resp_len;
  3202. __le32 unused_0;
  3203. u8 unused_1;
  3204. u8 unused_2;
  3205. u8 unused_3;
  3206. u8 valid;
  3207. };
  3208. /* hwrm_reject_fwd_resp */
  3209. /* Input (128 bytes) */
  3210. struct hwrm_reject_fwd_resp_input {
  3211. __le16 req_type;
  3212. __le16 cmpl_ring;
  3213. __le16 seq_id;
  3214. __le16 target_id;
  3215. __le64 resp_addr;
  3216. __le32 encap_request[26];
  3217. __le16 encap_resp_target_id;
  3218. __le16 unused_0[3];
  3219. };
  3220. /* Output (16 bytes) */
  3221. struct hwrm_reject_fwd_resp_output {
  3222. __le16 error_code;
  3223. __le16 req_type;
  3224. __le16 seq_id;
  3225. __le16 resp_len;
  3226. __le32 unused_0;
  3227. u8 unused_1;
  3228. u8 unused_2;
  3229. u8 unused_3;
  3230. u8 valid;
  3231. };
  3232. /* hwrm_fwd_resp */
  3233. /* Input (40 bytes) */
  3234. struct hwrm_fwd_resp_input {
  3235. __le16 req_type;
  3236. __le16 cmpl_ring;
  3237. __le16 seq_id;
  3238. __le16 target_id;
  3239. __le64 resp_addr;
  3240. __le16 encap_resp_target_id;
  3241. __le16 encap_resp_cmpl_ring;
  3242. __le16 encap_resp_len;
  3243. u8 unused_0;
  3244. u8 unused_1;
  3245. __le64 encap_resp_addr;
  3246. __le32 encap_resp[24];
  3247. };
  3248. /* Output (16 bytes) */
  3249. struct hwrm_fwd_resp_output {
  3250. __le16 error_code;
  3251. __le16 req_type;
  3252. __le16 seq_id;
  3253. __le16 resp_len;
  3254. __le32 unused_0;
  3255. u8 unused_1;
  3256. u8 unused_2;
  3257. u8 unused_3;
  3258. u8 valid;
  3259. };
  3260. /* hwrm_fwd_async_event_cmpl */
  3261. /* Input (32 bytes) */
  3262. struct hwrm_fwd_async_event_cmpl_input {
  3263. __le16 req_type;
  3264. __le16 cmpl_ring;
  3265. __le16 seq_id;
  3266. __le16 target_id;
  3267. __le64 resp_addr;
  3268. __le16 encap_async_event_target_id;
  3269. u8 unused_0;
  3270. u8 unused_1;
  3271. u8 unused_2[3];
  3272. u8 unused_3;
  3273. __le32 encap_async_event_cmpl[4];
  3274. };
  3275. /* Output (16 bytes) */
  3276. struct hwrm_fwd_async_event_cmpl_output {
  3277. __le16 error_code;
  3278. __le16 req_type;
  3279. __le16 seq_id;
  3280. __le16 resp_len;
  3281. __le32 unused_0;
  3282. u8 unused_1;
  3283. u8 unused_2;
  3284. u8 unused_3;
  3285. u8 valid;
  3286. };
  3287. /* hwrm_temp_monitor_query */
  3288. /* Input (16 bytes) */
  3289. struct hwrm_temp_monitor_query_input {
  3290. __le16 req_type;
  3291. __le16 cmpl_ring;
  3292. __le16 seq_id;
  3293. __le16 target_id;
  3294. __le64 resp_addr;
  3295. };
  3296. /* Output (16 bytes) */
  3297. struct hwrm_temp_monitor_query_output {
  3298. __le16 error_code;
  3299. __le16 req_type;
  3300. __le16 seq_id;
  3301. __le16 resp_len;
  3302. u8 temp;
  3303. u8 unused_0;
  3304. __le16 unused_1;
  3305. u8 unused_2;
  3306. u8 unused_3;
  3307. u8 unused_4;
  3308. u8 valid;
  3309. };
  3310. /* hwrm_nvm_raw_write_blk */
  3311. /* Input (32 bytes) */
  3312. struct hwrm_nvm_raw_write_blk_input {
  3313. __le16 req_type;
  3314. __le16 cmpl_ring;
  3315. __le16 seq_id;
  3316. __le16 target_id;
  3317. __le64 resp_addr;
  3318. __le64 host_src_addr;
  3319. __le32 dest_addr;
  3320. __le32 len;
  3321. };
  3322. /* Output (16 bytes) */
  3323. struct hwrm_nvm_raw_write_blk_output {
  3324. __le16 error_code;
  3325. __le16 req_type;
  3326. __le16 seq_id;
  3327. __le16 resp_len;
  3328. __le32 unused_0;
  3329. u8 unused_1;
  3330. u8 unused_2;
  3331. u8 unused_3;
  3332. u8 valid;
  3333. };
  3334. /* hwrm_nvm_read */
  3335. /* Input (40 bytes) */
  3336. struct hwrm_nvm_read_input {
  3337. __le16 req_type;
  3338. __le16 cmpl_ring;
  3339. __le16 seq_id;
  3340. __le16 target_id;
  3341. __le64 resp_addr;
  3342. __le64 host_dest_addr;
  3343. __le16 dir_idx;
  3344. u8 unused_0;
  3345. u8 unused_1;
  3346. __le32 offset;
  3347. __le32 len;
  3348. __le32 unused_2;
  3349. };
  3350. /* Output (16 bytes) */
  3351. struct hwrm_nvm_read_output {
  3352. __le16 error_code;
  3353. __le16 req_type;
  3354. __le16 seq_id;
  3355. __le16 resp_len;
  3356. __le32 unused_0;
  3357. u8 unused_1;
  3358. u8 unused_2;
  3359. u8 unused_3;
  3360. u8 valid;
  3361. };
  3362. /* hwrm_nvm_raw_dump */
  3363. /* Input (32 bytes) */
  3364. struct hwrm_nvm_raw_dump_input {
  3365. __le16 req_type;
  3366. __le16 cmpl_ring;
  3367. __le16 seq_id;
  3368. __le16 target_id;
  3369. __le64 resp_addr;
  3370. __le64 host_dest_addr;
  3371. __le32 offset;
  3372. __le32 len;
  3373. };
  3374. /* Output (16 bytes) */
  3375. struct hwrm_nvm_raw_dump_output {
  3376. __le16 error_code;
  3377. __le16 req_type;
  3378. __le16 seq_id;
  3379. __le16 resp_len;
  3380. __le32 unused_0;
  3381. u8 unused_1;
  3382. u8 unused_2;
  3383. u8 unused_3;
  3384. u8 valid;
  3385. };
  3386. /* hwrm_nvm_get_dir_entries */
  3387. /* Input (24 bytes) */
  3388. struct hwrm_nvm_get_dir_entries_input {
  3389. __le16 req_type;
  3390. __le16 cmpl_ring;
  3391. __le16 seq_id;
  3392. __le16 target_id;
  3393. __le64 resp_addr;
  3394. __le64 host_dest_addr;
  3395. };
  3396. /* Output (16 bytes) */
  3397. struct hwrm_nvm_get_dir_entries_output {
  3398. __le16 error_code;
  3399. __le16 req_type;
  3400. __le16 seq_id;
  3401. __le16 resp_len;
  3402. __le32 unused_0;
  3403. u8 unused_1;
  3404. u8 unused_2;
  3405. u8 unused_3;
  3406. u8 valid;
  3407. };
  3408. /* hwrm_nvm_get_dir_info */
  3409. /* Input (16 bytes) */
  3410. struct hwrm_nvm_get_dir_info_input {
  3411. __le16 req_type;
  3412. __le16 cmpl_ring;
  3413. __le16 seq_id;
  3414. __le16 target_id;
  3415. __le64 resp_addr;
  3416. };
  3417. /* Output (24 bytes) */
  3418. struct hwrm_nvm_get_dir_info_output {
  3419. __le16 error_code;
  3420. __le16 req_type;
  3421. __le16 seq_id;
  3422. __le16 resp_len;
  3423. __le32 entries;
  3424. __le32 entry_length;
  3425. __le32 unused_0;
  3426. u8 unused_1;
  3427. u8 unused_2;
  3428. u8 unused_3;
  3429. u8 valid;
  3430. };
  3431. /* hwrm_nvm_write */
  3432. /* Input (48 bytes) */
  3433. struct hwrm_nvm_write_input {
  3434. __le16 req_type;
  3435. __le16 cmpl_ring;
  3436. __le16 seq_id;
  3437. __le16 target_id;
  3438. __le64 resp_addr;
  3439. __le64 host_src_addr;
  3440. __le16 dir_type;
  3441. __le16 dir_ordinal;
  3442. __le16 dir_ext;
  3443. __le16 dir_attr;
  3444. __le32 dir_data_length;
  3445. __le16 option;
  3446. __le16 flags;
  3447. #define NVM_WRITE_REQ_FLAGS_KEEP_ORIG_ACTIVE_IMG 0x1UL
  3448. __le32 dir_item_length;
  3449. __le32 unused_0;
  3450. };
  3451. /* Output (16 bytes) */
  3452. struct hwrm_nvm_write_output {
  3453. __le16 error_code;
  3454. __le16 req_type;
  3455. __le16 seq_id;
  3456. __le16 resp_len;
  3457. __le32 dir_item_length;
  3458. __le16 dir_idx;
  3459. u8 unused_0;
  3460. u8 valid;
  3461. };
  3462. /* hwrm_nvm_modify */
  3463. /* Input (40 bytes) */
  3464. struct hwrm_nvm_modify_input {
  3465. __le16 req_type;
  3466. __le16 cmpl_ring;
  3467. __le16 seq_id;
  3468. __le16 target_id;
  3469. __le64 resp_addr;
  3470. __le64 host_src_addr;
  3471. __le16 dir_idx;
  3472. u8 unused_0;
  3473. u8 unused_1;
  3474. __le32 offset;
  3475. __le32 len;
  3476. __le32 unused_2;
  3477. };
  3478. /* Output (16 bytes) */
  3479. struct hwrm_nvm_modify_output {
  3480. __le16 error_code;
  3481. __le16 req_type;
  3482. __le16 seq_id;
  3483. __le16 resp_len;
  3484. __le32 unused_0;
  3485. u8 unused_1;
  3486. u8 unused_2;
  3487. u8 unused_3;
  3488. u8 valid;
  3489. };
  3490. /* hwrm_nvm_find_dir_entry */
  3491. /* Input (32 bytes) */
  3492. struct hwrm_nvm_find_dir_entry_input {
  3493. __le16 req_type;
  3494. __le16 cmpl_ring;
  3495. __le16 seq_id;
  3496. __le16 target_id;
  3497. __le64 resp_addr;
  3498. __le32 enables;
  3499. #define NVM_FIND_DIR_ENTRY_REQ_ENABLES_DIR_IDX_VALID 0x1UL
  3500. __le16 dir_idx;
  3501. __le16 dir_type;
  3502. __le16 dir_ordinal;
  3503. __le16 dir_ext;
  3504. u8 opt_ordinal;
  3505. #define NVM_FIND_DIR_ENTRY_REQ_OPT_ORDINAL_MASK 0x3UL
  3506. #define NVM_FIND_DIR_ENTRY_REQ_OPT_ORDINAL_SFT 0
  3507. #define NVM_FIND_DIR_ENTRY_REQ_OPT_ORDINAL_EQ (0x0UL << 0)
  3508. #define NVM_FIND_DIR_ENTRY_REQ_OPT_ORDINAL_GE (0x1UL << 0)
  3509. #define NVM_FIND_DIR_ENTRY_REQ_OPT_ORDINAL_GT (0x2UL << 0)
  3510. u8 unused_1[3];
  3511. };
  3512. /* Output (32 bytes) */
  3513. struct hwrm_nvm_find_dir_entry_output {
  3514. __le16 error_code;
  3515. __le16 req_type;
  3516. __le16 seq_id;
  3517. __le16 resp_len;
  3518. __le32 dir_item_length;
  3519. __le32 dir_data_length;
  3520. __le32 fw_ver;
  3521. __le16 dir_ordinal;
  3522. __le16 dir_idx;
  3523. __le32 unused_0;
  3524. u8 unused_1;
  3525. u8 unused_2;
  3526. u8 unused_3;
  3527. u8 valid;
  3528. };
  3529. /* hwrm_nvm_erase_dir_entry */
  3530. /* Input (24 bytes) */
  3531. struct hwrm_nvm_erase_dir_entry_input {
  3532. __le16 req_type;
  3533. __le16 cmpl_ring;
  3534. __le16 seq_id;
  3535. __le16 target_id;
  3536. __le64 resp_addr;
  3537. __le16 dir_idx;
  3538. __le16 unused_0[3];
  3539. };
  3540. /* Output (16 bytes) */
  3541. struct hwrm_nvm_erase_dir_entry_output {
  3542. __le16 error_code;
  3543. __le16 req_type;
  3544. __le16 seq_id;
  3545. __le16 resp_len;
  3546. __le32 unused_0;
  3547. u8 unused_1;
  3548. u8 unused_2;
  3549. u8 unused_3;
  3550. u8 valid;
  3551. };
  3552. /* hwrm_nvm_get_dev_info */
  3553. /* Input (16 bytes) */
  3554. struct hwrm_nvm_get_dev_info_input {
  3555. __le16 req_type;
  3556. __le16 cmpl_ring;
  3557. __le16 seq_id;
  3558. __le16 target_id;
  3559. __le64 resp_addr;
  3560. };
  3561. /* Output (32 bytes) */
  3562. struct hwrm_nvm_get_dev_info_output {
  3563. __le16 error_code;
  3564. __le16 req_type;
  3565. __le16 seq_id;
  3566. __le16 resp_len;
  3567. __le16 manufacturer_id;
  3568. __le16 device_id;
  3569. __le32 sector_size;
  3570. __le32 nvram_size;
  3571. __le32 reserved_size;
  3572. __le32 available_size;
  3573. u8 unused_0;
  3574. u8 unused_1;
  3575. u8 unused_2;
  3576. u8 valid;
  3577. };
  3578. /* hwrm_nvm_mod_dir_entry */
  3579. /* Input (32 bytes) */
  3580. struct hwrm_nvm_mod_dir_entry_input {
  3581. __le16 req_type;
  3582. __le16 cmpl_ring;
  3583. __le16 seq_id;
  3584. __le16 target_id;
  3585. __le64 resp_addr;
  3586. __le32 enables;
  3587. #define NVM_MOD_DIR_ENTRY_REQ_ENABLES_CHECKSUM 0x1UL
  3588. __le16 dir_idx;
  3589. __le16 dir_ordinal;
  3590. __le16 dir_ext;
  3591. __le16 dir_attr;
  3592. __le32 checksum;
  3593. };
  3594. /* Output (16 bytes) */
  3595. struct hwrm_nvm_mod_dir_entry_output {
  3596. __le16 error_code;
  3597. __le16 req_type;
  3598. __le16 seq_id;
  3599. __le16 resp_len;
  3600. __le32 unused_0;
  3601. u8 unused_1;
  3602. u8 unused_2;
  3603. u8 unused_3;
  3604. u8 valid;
  3605. };
  3606. /* hwrm_nvm_verify_update */
  3607. /* Input (24 bytes) */
  3608. struct hwrm_nvm_verify_update_input {
  3609. __le16 req_type;
  3610. __le16 cmpl_ring;
  3611. __le16 seq_id;
  3612. __le16 target_id;
  3613. __le64 resp_addr;
  3614. __le16 dir_type;
  3615. __le16 dir_ordinal;
  3616. __le16 dir_ext;
  3617. __le16 unused_0;
  3618. };
  3619. /* Output (16 bytes) */
  3620. struct hwrm_nvm_verify_update_output {
  3621. __le16 error_code;
  3622. __le16 req_type;
  3623. __le16 seq_id;
  3624. __le16 resp_len;
  3625. __le32 unused_0;
  3626. u8 unused_1;
  3627. u8 unused_2;
  3628. u8 unused_3;
  3629. u8 valid;
  3630. };
  3631. #endif