t4fw_api.h 124 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049
  1. /*
  2. * This file is part of the Chelsio T4 Ethernet driver for Linux.
  3. *
  4. * Copyright (c) 2009-2016 Chelsio Communications, Inc. All rights reserved.
  5. *
  6. * This software is available to you under a choice of one of two
  7. * licenses. You may choose to be licensed under the terms of the GNU
  8. * General Public License (GPL) Version 2, available from the file
  9. * COPYING in the main directory of this source tree, or the
  10. * OpenIB.org BSD license below:
  11. *
  12. * Redistribution and use in source and binary forms, with or
  13. * without modification, are permitted provided that the following
  14. * conditions are met:
  15. *
  16. * - Redistributions of source code must retain the above
  17. * copyright notice, this list of conditions and the following
  18. * disclaimer.
  19. *
  20. * - Redistributions in binary form must reproduce the above
  21. * copyright notice, this list of conditions and the following
  22. * disclaimer in the documentation and/or other materials
  23. * provided with the distribution.
  24. *
  25. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  26. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  27. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  28. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  29. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  30. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  31. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  32. * SOFTWARE.
  33. */
  34. #ifndef _T4FW_INTERFACE_H_
  35. #define _T4FW_INTERFACE_H_
  36. enum fw_retval {
  37. FW_SUCCESS = 0, /* completed successfully */
  38. FW_EPERM = 1, /* operation not permitted */
  39. FW_ENOENT = 2, /* no such file or directory */
  40. FW_EIO = 5, /* input/output error; hw bad */
  41. FW_ENOEXEC = 8, /* exec format error; inv microcode */
  42. FW_EAGAIN = 11, /* try again */
  43. FW_ENOMEM = 12, /* out of memory */
  44. FW_EFAULT = 14, /* bad address; fw bad */
  45. FW_EBUSY = 16, /* resource busy */
  46. FW_EEXIST = 17, /* file exists */
  47. FW_ENODEV = 19, /* no such device */
  48. FW_EINVAL = 22, /* invalid argument */
  49. FW_ENOSPC = 28, /* no space left on device */
  50. FW_ENOSYS = 38, /* functionality not implemented */
  51. FW_ENODATA = 61, /* no data available */
  52. FW_EPROTO = 71, /* protocol error */
  53. FW_EADDRINUSE = 98, /* address already in use */
  54. FW_EADDRNOTAVAIL = 99, /* cannot assigned requested address */
  55. FW_ENETDOWN = 100, /* network is down */
  56. FW_ENETUNREACH = 101, /* network is unreachable */
  57. FW_ENOBUFS = 105, /* no buffer space available */
  58. FW_ETIMEDOUT = 110, /* timeout */
  59. FW_EINPROGRESS = 115, /* fw internal */
  60. FW_SCSI_ABORT_REQUESTED = 128, /* */
  61. FW_SCSI_ABORT_TIMEDOUT = 129, /* */
  62. FW_SCSI_ABORTED = 130, /* */
  63. FW_SCSI_CLOSE_REQUESTED = 131, /* */
  64. FW_ERR_LINK_DOWN = 132, /* */
  65. FW_RDEV_NOT_READY = 133, /* */
  66. FW_ERR_RDEV_LOST = 134, /* */
  67. FW_ERR_RDEV_LOGO = 135, /* */
  68. FW_FCOE_NO_XCHG = 136, /* */
  69. FW_SCSI_RSP_ERR = 137, /* */
  70. FW_ERR_RDEV_IMPL_LOGO = 138, /* */
  71. FW_SCSI_UNDER_FLOW_ERR = 139, /* */
  72. FW_SCSI_OVER_FLOW_ERR = 140, /* */
  73. FW_SCSI_DDP_ERR = 141, /* DDP error*/
  74. FW_SCSI_TASK_ERR = 142, /* No SCSI tasks available */
  75. };
  76. #define FW_T4VF_SGE_BASE_ADDR 0x0000
  77. #define FW_T4VF_MPS_BASE_ADDR 0x0100
  78. #define FW_T4VF_PL_BASE_ADDR 0x0200
  79. #define FW_T4VF_MBDATA_BASE_ADDR 0x0240
  80. #define FW_T4VF_CIM_BASE_ADDR 0x0300
  81. enum fw_wr_opcodes {
  82. FW_FILTER_WR = 0x02,
  83. FW_ULPTX_WR = 0x04,
  84. FW_TP_WR = 0x05,
  85. FW_ETH_TX_PKT_WR = 0x08,
  86. FW_OFLD_CONNECTION_WR = 0x2f,
  87. FW_FLOWC_WR = 0x0a,
  88. FW_OFLD_TX_DATA_WR = 0x0b,
  89. FW_CMD_WR = 0x10,
  90. FW_ETH_TX_PKT_VM_WR = 0x11,
  91. FW_RI_RES_WR = 0x0c,
  92. FW_RI_INIT_WR = 0x0d,
  93. FW_RI_RDMA_WRITE_WR = 0x14,
  94. FW_RI_SEND_WR = 0x15,
  95. FW_RI_RDMA_READ_WR = 0x16,
  96. FW_RI_RECV_WR = 0x17,
  97. FW_RI_BIND_MW_WR = 0x18,
  98. FW_RI_FR_NSMR_WR = 0x19,
  99. FW_RI_FR_NSMR_TPTE_WR = 0x20,
  100. FW_RI_RDMA_WRITE_CMPL_WR = 0x21,
  101. FW_RI_INV_LSTAG_WR = 0x1a,
  102. FW_ISCSI_TX_DATA_WR = 0x45,
  103. FW_PTP_TX_PKT_WR = 0x46,
  104. FW_TLSTX_DATA_WR = 0x68,
  105. FW_CRYPTO_LOOKASIDE_WR = 0X6d,
  106. FW_LASTC2E_WR = 0x70,
  107. FW_FILTER2_WR = 0x77
  108. };
  109. struct fw_wr_hdr {
  110. __be32 hi;
  111. __be32 lo;
  112. };
  113. /* work request opcode (hi) */
  114. #define FW_WR_OP_S 24
  115. #define FW_WR_OP_M 0xff
  116. #define FW_WR_OP_V(x) ((x) << FW_WR_OP_S)
  117. #define FW_WR_OP_G(x) (((x) >> FW_WR_OP_S) & FW_WR_OP_M)
  118. /* atomic flag (hi) - firmware encapsulates CPLs in CPL_BARRIER */
  119. #define FW_WR_ATOMIC_S 23
  120. #define FW_WR_ATOMIC_V(x) ((x) << FW_WR_ATOMIC_S)
  121. /* flush flag (hi) - firmware flushes flushable work request buffered
  122. * in the flow context.
  123. */
  124. #define FW_WR_FLUSH_S 22
  125. #define FW_WR_FLUSH_V(x) ((x) << FW_WR_FLUSH_S)
  126. /* completion flag (hi) - firmware generates a cpl_fw6_ack */
  127. #define FW_WR_COMPL_S 21
  128. #define FW_WR_COMPL_V(x) ((x) << FW_WR_COMPL_S)
  129. #define FW_WR_COMPL_F FW_WR_COMPL_V(1U)
  130. /* work request immediate data length (hi) */
  131. #define FW_WR_IMMDLEN_S 0
  132. #define FW_WR_IMMDLEN_M 0xff
  133. #define FW_WR_IMMDLEN_V(x) ((x) << FW_WR_IMMDLEN_S)
  134. /* egress queue status update to associated ingress queue entry (lo) */
  135. #define FW_WR_EQUIQ_S 31
  136. #define FW_WR_EQUIQ_V(x) ((x) << FW_WR_EQUIQ_S)
  137. #define FW_WR_EQUIQ_F FW_WR_EQUIQ_V(1U)
  138. /* egress queue status update to egress queue status entry (lo) */
  139. #define FW_WR_EQUEQ_S 30
  140. #define FW_WR_EQUEQ_V(x) ((x) << FW_WR_EQUEQ_S)
  141. #define FW_WR_EQUEQ_F FW_WR_EQUEQ_V(1U)
  142. /* flow context identifier (lo) */
  143. #define FW_WR_FLOWID_S 8
  144. #define FW_WR_FLOWID_V(x) ((x) << FW_WR_FLOWID_S)
  145. /* length in units of 16-bytes (lo) */
  146. #define FW_WR_LEN16_S 0
  147. #define FW_WR_LEN16_V(x) ((x) << FW_WR_LEN16_S)
  148. #define HW_TPL_FR_MT_PR_IV_P_FC 0X32B
  149. #define HW_TPL_FR_MT_PR_OV_P_FC 0X327
  150. /* filter wr reply code in cookie in CPL_SET_TCB_RPL */
  151. enum fw_filter_wr_cookie {
  152. FW_FILTER_WR_SUCCESS,
  153. FW_FILTER_WR_FLT_ADDED,
  154. FW_FILTER_WR_FLT_DELETED,
  155. FW_FILTER_WR_SMT_TBL_FULL,
  156. FW_FILTER_WR_EINVAL,
  157. };
  158. struct fw_filter_wr {
  159. __be32 op_pkd;
  160. __be32 len16_pkd;
  161. __be64 r3;
  162. __be32 tid_to_iq;
  163. __be32 del_filter_to_l2tix;
  164. __be16 ethtype;
  165. __be16 ethtypem;
  166. __u8 frag_to_ovlan_vldm;
  167. __u8 smac_sel;
  168. __be16 rx_chan_rx_rpl_iq;
  169. __be32 maci_to_matchtypem;
  170. __u8 ptcl;
  171. __u8 ptclm;
  172. __u8 ttyp;
  173. __u8 ttypm;
  174. __be16 ivlan;
  175. __be16 ivlanm;
  176. __be16 ovlan;
  177. __be16 ovlanm;
  178. __u8 lip[16];
  179. __u8 lipm[16];
  180. __u8 fip[16];
  181. __u8 fipm[16];
  182. __be16 lp;
  183. __be16 lpm;
  184. __be16 fp;
  185. __be16 fpm;
  186. __be16 r7;
  187. __u8 sma[6];
  188. };
  189. struct fw_filter2_wr {
  190. __be32 op_pkd;
  191. __be32 len16_pkd;
  192. __be64 r3;
  193. __be32 tid_to_iq;
  194. __be32 del_filter_to_l2tix;
  195. __be16 ethtype;
  196. __be16 ethtypem;
  197. __u8 frag_to_ovlan_vldm;
  198. __u8 smac_sel;
  199. __be16 rx_chan_rx_rpl_iq;
  200. __be32 maci_to_matchtypem;
  201. __u8 ptcl;
  202. __u8 ptclm;
  203. __u8 ttyp;
  204. __u8 ttypm;
  205. __be16 ivlan;
  206. __be16 ivlanm;
  207. __be16 ovlan;
  208. __be16 ovlanm;
  209. __u8 lip[16];
  210. __u8 lipm[16];
  211. __u8 fip[16];
  212. __u8 fipm[16];
  213. __be16 lp;
  214. __be16 lpm;
  215. __be16 fp;
  216. __be16 fpm;
  217. __be16 r7;
  218. __u8 sma[6];
  219. __be16 r8;
  220. __u8 filter_type_swapmac;
  221. __u8 natmode_to_ulp_type;
  222. __be16 newlport;
  223. __be16 newfport;
  224. __u8 newlip[16];
  225. __u8 newfip[16];
  226. __be32 natseqcheck;
  227. __be32 r9;
  228. __be64 r10;
  229. __be64 r11;
  230. __be64 r12;
  231. __be64 r13;
  232. };
  233. #define FW_FILTER_WR_TID_S 12
  234. #define FW_FILTER_WR_TID_M 0xfffff
  235. #define FW_FILTER_WR_TID_V(x) ((x) << FW_FILTER_WR_TID_S)
  236. #define FW_FILTER_WR_TID_G(x) \
  237. (((x) >> FW_FILTER_WR_TID_S) & FW_FILTER_WR_TID_M)
  238. #define FW_FILTER_WR_RQTYPE_S 11
  239. #define FW_FILTER_WR_RQTYPE_M 0x1
  240. #define FW_FILTER_WR_RQTYPE_V(x) ((x) << FW_FILTER_WR_RQTYPE_S)
  241. #define FW_FILTER_WR_RQTYPE_G(x) \
  242. (((x) >> FW_FILTER_WR_RQTYPE_S) & FW_FILTER_WR_RQTYPE_M)
  243. #define FW_FILTER_WR_RQTYPE_F FW_FILTER_WR_RQTYPE_V(1U)
  244. #define FW_FILTER_WR_NOREPLY_S 10
  245. #define FW_FILTER_WR_NOREPLY_M 0x1
  246. #define FW_FILTER_WR_NOREPLY_V(x) ((x) << FW_FILTER_WR_NOREPLY_S)
  247. #define FW_FILTER_WR_NOREPLY_G(x) \
  248. (((x) >> FW_FILTER_WR_NOREPLY_S) & FW_FILTER_WR_NOREPLY_M)
  249. #define FW_FILTER_WR_NOREPLY_F FW_FILTER_WR_NOREPLY_V(1U)
  250. #define FW_FILTER_WR_IQ_S 0
  251. #define FW_FILTER_WR_IQ_M 0x3ff
  252. #define FW_FILTER_WR_IQ_V(x) ((x) << FW_FILTER_WR_IQ_S)
  253. #define FW_FILTER_WR_IQ_G(x) \
  254. (((x) >> FW_FILTER_WR_IQ_S) & FW_FILTER_WR_IQ_M)
  255. #define FW_FILTER_WR_DEL_FILTER_S 31
  256. #define FW_FILTER_WR_DEL_FILTER_M 0x1
  257. #define FW_FILTER_WR_DEL_FILTER_V(x) ((x) << FW_FILTER_WR_DEL_FILTER_S)
  258. #define FW_FILTER_WR_DEL_FILTER_G(x) \
  259. (((x) >> FW_FILTER_WR_DEL_FILTER_S) & FW_FILTER_WR_DEL_FILTER_M)
  260. #define FW_FILTER_WR_DEL_FILTER_F FW_FILTER_WR_DEL_FILTER_V(1U)
  261. #define FW_FILTER_WR_RPTTID_S 25
  262. #define FW_FILTER_WR_RPTTID_M 0x1
  263. #define FW_FILTER_WR_RPTTID_V(x) ((x) << FW_FILTER_WR_RPTTID_S)
  264. #define FW_FILTER_WR_RPTTID_G(x) \
  265. (((x) >> FW_FILTER_WR_RPTTID_S) & FW_FILTER_WR_RPTTID_M)
  266. #define FW_FILTER_WR_RPTTID_F FW_FILTER_WR_RPTTID_V(1U)
  267. #define FW_FILTER_WR_DROP_S 24
  268. #define FW_FILTER_WR_DROP_M 0x1
  269. #define FW_FILTER_WR_DROP_V(x) ((x) << FW_FILTER_WR_DROP_S)
  270. #define FW_FILTER_WR_DROP_G(x) \
  271. (((x) >> FW_FILTER_WR_DROP_S) & FW_FILTER_WR_DROP_M)
  272. #define FW_FILTER_WR_DROP_F FW_FILTER_WR_DROP_V(1U)
  273. #define FW_FILTER_WR_DIRSTEER_S 23
  274. #define FW_FILTER_WR_DIRSTEER_M 0x1
  275. #define FW_FILTER_WR_DIRSTEER_V(x) ((x) << FW_FILTER_WR_DIRSTEER_S)
  276. #define FW_FILTER_WR_DIRSTEER_G(x) \
  277. (((x) >> FW_FILTER_WR_DIRSTEER_S) & FW_FILTER_WR_DIRSTEER_M)
  278. #define FW_FILTER_WR_DIRSTEER_F FW_FILTER_WR_DIRSTEER_V(1U)
  279. #define FW_FILTER_WR_MASKHASH_S 22
  280. #define FW_FILTER_WR_MASKHASH_M 0x1
  281. #define FW_FILTER_WR_MASKHASH_V(x) ((x) << FW_FILTER_WR_MASKHASH_S)
  282. #define FW_FILTER_WR_MASKHASH_G(x) \
  283. (((x) >> FW_FILTER_WR_MASKHASH_S) & FW_FILTER_WR_MASKHASH_M)
  284. #define FW_FILTER_WR_MASKHASH_F FW_FILTER_WR_MASKHASH_V(1U)
  285. #define FW_FILTER_WR_DIRSTEERHASH_S 21
  286. #define FW_FILTER_WR_DIRSTEERHASH_M 0x1
  287. #define FW_FILTER_WR_DIRSTEERHASH_V(x) ((x) << FW_FILTER_WR_DIRSTEERHASH_S)
  288. #define FW_FILTER_WR_DIRSTEERHASH_G(x) \
  289. (((x) >> FW_FILTER_WR_DIRSTEERHASH_S) & FW_FILTER_WR_DIRSTEERHASH_M)
  290. #define FW_FILTER_WR_DIRSTEERHASH_F FW_FILTER_WR_DIRSTEERHASH_V(1U)
  291. #define FW_FILTER_WR_LPBK_S 20
  292. #define FW_FILTER_WR_LPBK_M 0x1
  293. #define FW_FILTER_WR_LPBK_V(x) ((x) << FW_FILTER_WR_LPBK_S)
  294. #define FW_FILTER_WR_LPBK_G(x) \
  295. (((x) >> FW_FILTER_WR_LPBK_S) & FW_FILTER_WR_LPBK_M)
  296. #define FW_FILTER_WR_LPBK_F FW_FILTER_WR_LPBK_V(1U)
  297. #define FW_FILTER_WR_DMAC_S 19
  298. #define FW_FILTER_WR_DMAC_M 0x1
  299. #define FW_FILTER_WR_DMAC_V(x) ((x) << FW_FILTER_WR_DMAC_S)
  300. #define FW_FILTER_WR_DMAC_G(x) \
  301. (((x) >> FW_FILTER_WR_DMAC_S) & FW_FILTER_WR_DMAC_M)
  302. #define FW_FILTER_WR_DMAC_F FW_FILTER_WR_DMAC_V(1U)
  303. #define FW_FILTER_WR_SMAC_S 18
  304. #define FW_FILTER_WR_SMAC_M 0x1
  305. #define FW_FILTER_WR_SMAC_V(x) ((x) << FW_FILTER_WR_SMAC_S)
  306. #define FW_FILTER_WR_SMAC_G(x) \
  307. (((x) >> FW_FILTER_WR_SMAC_S) & FW_FILTER_WR_SMAC_M)
  308. #define FW_FILTER_WR_SMAC_F FW_FILTER_WR_SMAC_V(1U)
  309. #define FW_FILTER_WR_INSVLAN_S 17
  310. #define FW_FILTER_WR_INSVLAN_M 0x1
  311. #define FW_FILTER_WR_INSVLAN_V(x) ((x) << FW_FILTER_WR_INSVLAN_S)
  312. #define FW_FILTER_WR_INSVLAN_G(x) \
  313. (((x) >> FW_FILTER_WR_INSVLAN_S) & FW_FILTER_WR_INSVLAN_M)
  314. #define FW_FILTER_WR_INSVLAN_F FW_FILTER_WR_INSVLAN_V(1U)
  315. #define FW_FILTER_WR_RMVLAN_S 16
  316. #define FW_FILTER_WR_RMVLAN_M 0x1
  317. #define FW_FILTER_WR_RMVLAN_V(x) ((x) << FW_FILTER_WR_RMVLAN_S)
  318. #define FW_FILTER_WR_RMVLAN_G(x) \
  319. (((x) >> FW_FILTER_WR_RMVLAN_S) & FW_FILTER_WR_RMVLAN_M)
  320. #define FW_FILTER_WR_RMVLAN_F FW_FILTER_WR_RMVLAN_V(1U)
  321. #define FW_FILTER_WR_HITCNTS_S 15
  322. #define FW_FILTER_WR_HITCNTS_M 0x1
  323. #define FW_FILTER_WR_HITCNTS_V(x) ((x) << FW_FILTER_WR_HITCNTS_S)
  324. #define FW_FILTER_WR_HITCNTS_G(x) \
  325. (((x) >> FW_FILTER_WR_HITCNTS_S) & FW_FILTER_WR_HITCNTS_M)
  326. #define FW_FILTER_WR_HITCNTS_F FW_FILTER_WR_HITCNTS_V(1U)
  327. #define FW_FILTER_WR_TXCHAN_S 13
  328. #define FW_FILTER_WR_TXCHAN_M 0x3
  329. #define FW_FILTER_WR_TXCHAN_V(x) ((x) << FW_FILTER_WR_TXCHAN_S)
  330. #define FW_FILTER_WR_TXCHAN_G(x) \
  331. (((x) >> FW_FILTER_WR_TXCHAN_S) & FW_FILTER_WR_TXCHAN_M)
  332. #define FW_FILTER_WR_PRIO_S 12
  333. #define FW_FILTER_WR_PRIO_M 0x1
  334. #define FW_FILTER_WR_PRIO_V(x) ((x) << FW_FILTER_WR_PRIO_S)
  335. #define FW_FILTER_WR_PRIO_G(x) \
  336. (((x) >> FW_FILTER_WR_PRIO_S) & FW_FILTER_WR_PRIO_M)
  337. #define FW_FILTER_WR_PRIO_F FW_FILTER_WR_PRIO_V(1U)
  338. #define FW_FILTER_WR_L2TIX_S 0
  339. #define FW_FILTER_WR_L2TIX_M 0xfff
  340. #define FW_FILTER_WR_L2TIX_V(x) ((x) << FW_FILTER_WR_L2TIX_S)
  341. #define FW_FILTER_WR_L2TIX_G(x) \
  342. (((x) >> FW_FILTER_WR_L2TIX_S) & FW_FILTER_WR_L2TIX_M)
  343. #define FW_FILTER_WR_FRAG_S 7
  344. #define FW_FILTER_WR_FRAG_M 0x1
  345. #define FW_FILTER_WR_FRAG_V(x) ((x) << FW_FILTER_WR_FRAG_S)
  346. #define FW_FILTER_WR_FRAG_G(x) \
  347. (((x) >> FW_FILTER_WR_FRAG_S) & FW_FILTER_WR_FRAG_M)
  348. #define FW_FILTER_WR_FRAG_F FW_FILTER_WR_FRAG_V(1U)
  349. #define FW_FILTER_WR_FRAGM_S 6
  350. #define FW_FILTER_WR_FRAGM_M 0x1
  351. #define FW_FILTER_WR_FRAGM_V(x) ((x) << FW_FILTER_WR_FRAGM_S)
  352. #define FW_FILTER_WR_FRAGM_G(x) \
  353. (((x) >> FW_FILTER_WR_FRAGM_S) & FW_FILTER_WR_FRAGM_M)
  354. #define FW_FILTER_WR_FRAGM_F FW_FILTER_WR_FRAGM_V(1U)
  355. #define FW_FILTER_WR_IVLAN_VLD_S 5
  356. #define FW_FILTER_WR_IVLAN_VLD_M 0x1
  357. #define FW_FILTER_WR_IVLAN_VLD_V(x) ((x) << FW_FILTER_WR_IVLAN_VLD_S)
  358. #define FW_FILTER_WR_IVLAN_VLD_G(x) \
  359. (((x) >> FW_FILTER_WR_IVLAN_VLD_S) & FW_FILTER_WR_IVLAN_VLD_M)
  360. #define FW_FILTER_WR_IVLAN_VLD_F FW_FILTER_WR_IVLAN_VLD_V(1U)
  361. #define FW_FILTER_WR_OVLAN_VLD_S 4
  362. #define FW_FILTER_WR_OVLAN_VLD_M 0x1
  363. #define FW_FILTER_WR_OVLAN_VLD_V(x) ((x) << FW_FILTER_WR_OVLAN_VLD_S)
  364. #define FW_FILTER_WR_OVLAN_VLD_G(x) \
  365. (((x) >> FW_FILTER_WR_OVLAN_VLD_S) & FW_FILTER_WR_OVLAN_VLD_M)
  366. #define FW_FILTER_WR_OVLAN_VLD_F FW_FILTER_WR_OVLAN_VLD_V(1U)
  367. #define FW_FILTER_WR_IVLAN_VLDM_S 3
  368. #define FW_FILTER_WR_IVLAN_VLDM_M 0x1
  369. #define FW_FILTER_WR_IVLAN_VLDM_V(x) ((x) << FW_FILTER_WR_IVLAN_VLDM_S)
  370. #define FW_FILTER_WR_IVLAN_VLDM_G(x) \
  371. (((x) >> FW_FILTER_WR_IVLAN_VLDM_S) & FW_FILTER_WR_IVLAN_VLDM_M)
  372. #define FW_FILTER_WR_IVLAN_VLDM_F FW_FILTER_WR_IVLAN_VLDM_V(1U)
  373. #define FW_FILTER_WR_OVLAN_VLDM_S 2
  374. #define FW_FILTER_WR_OVLAN_VLDM_M 0x1
  375. #define FW_FILTER_WR_OVLAN_VLDM_V(x) ((x) << FW_FILTER_WR_OVLAN_VLDM_S)
  376. #define FW_FILTER_WR_OVLAN_VLDM_G(x) \
  377. (((x) >> FW_FILTER_WR_OVLAN_VLDM_S) & FW_FILTER_WR_OVLAN_VLDM_M)
  378. #define FW_FILTER_WR_OVLAN_VLDM_F FW_FILTER_WR_OVLAN_VLDM_V(1U)
  379. #define FW_FILTER_WR_RX_CHAN_S 15
  380. #define FW_FILTER_WR_RX_CHAN_M 0x1
  381. #define FW_FILTER_WR_RX_CHAN_V(x) ((x) << FW_FILTER_WR_RX_CHAN_S)
  382. #define FW_FILTER_WR_RX_CHAN_G(x) \
  383. (((x) >> FW_FILTER_WR_RX_CHAN_S) & FW_FILTER_WR_RX_CHAN_M)
  384. #define FW_FILTER_WR_RX_CHAN_F FW_FILTER_WR_RX_CHAN_V(1U)
  385. #define FW_FILTER_WR_RX_RPL_IQ_S 0
  386. #define FW_FILTER_WR_RX_RPL_IQ_M 0x3ff
  387. #define FW_FILTER_WR_RX_RPL_IQ_V(x) ((x) << FW_FILTER_WR_RX_RPL_IQ_S)
  388. #define FW_FILTER_WR_RX_RPL_IQ_G(x) \
  389. (((x) >> FW_FILTER_WR_RX_RPL_IQ_S) & FW_FILTER_WR_RX_RPL_IQ_M)
  390. #define FW_FILTER2_WR_FILTER_TYPE_S 1
  391. #define FW_FILTER2_WR_FILTER_TYPE_M 0x1
  392. #define FW_FILTER2_WR_FILTER_TYPE_V(x) ((x) << FW_FILTER2_WR_FILTER_TYPE_S)
  393. #define FW_FILTER2_WR_FILTER_TYPE_G(x) \
  394. (((x) >> FW_FILTER2_WR_FILTER_TYPE_S) & FW_FILTER2_WR_FILTER_TYPE_M)
  395. #define FW_FILTER2_WR_FILTER_TYPE_F FW_FILTER2_WR_FILTER_TYPE_V(1U)
  396. #define FW_FILTER2_WR_NATMODE_S 5
  397. #define FW_FILTER2_WR_NATMODE_M 0x7
  398. #define FW_FILTER2_WR_NATMODE_V(x) ((x) << FW_FILTER2_WR_NATMODE_S)
  399. #define FW_FILTER2_WR_NATMODE_G(x) \
  400. (((x) >> FW_FILTER2_WR_NATMODE_S) & FW_FILTER2_WR_NATMODE_M)
  401. #define FW_FILTER2_WR_NATFLAGCHECK_S 4
  402. #define FW_FILTER2_WR_NATFLAGCHECK_M 0x1
  403. #define FW_FILTER2_WR_NATFLAGCHECK_V(x) ((x) << FW_FILTER2_WR_NATFLAGCHECK_S)
  404. #define FW_FILTER2_WR_NATFLAGCHECK_G(x) \
  405. (((x) >> FW_FILTER2_WR_NATFLAGCHECK_S) & FW_FILTER2_WR_NATFLAGCHECK_M)
  406. #define FW_FILTER2_WR_NATFLAGCHECK_F FW_FILTER2_WR_NATFLAGCHECK_V(1U)
  407. #define FW_FILTER2_WR_ULP_TYPE_S 0
  408. #define FW_FILTER2_WR_ULP_TYPE_M 0xf
  409. #define FW_FILTER2_WR_ULP_TYPE_V(x) ((x) << FW_FILTER2_WR_ULP_TYPE_S)
  410. #define FW_FILTER2_WR_ULP_TYPE_G(x) \
  411. (((x) >> FW_FILTER2_WR_ULP_TYPE_S) & FW_FILTER2_WR_ULP_TYPE_M)
  412. #define FW_FILTER_WR_MACI_S 23
  413. #define FW_FILTER_WR_MACI_M 0x1ff
  414. #define FW_FILTER_WR_MACI_V(x) ((x) << FW_FILTER_WR_MACI_S)
  415. #define FW_FILTER_WR_MACI_G(x) \
  416. (((x) >> FW_FILTER_WR_MACI_S) & FW_FILTER_WR_MACI_M)
  417. #define FW_FILTER_WR_MACIM_S 14
  418. #define FW_FILTER_WR_MACIM_M 0x1ff
  419. #define FW_FILTER_WR_MACIM_V(x) ((x) << FW_FILTER_WR_MACIM_S)
  420. #define FW_FILTER_WR_MACIM_G(x) \
  421. (((x) >> FW_FILTER_WR_MACIM_S) & FW_FILTER_WR_MACIM_M)
  422. #define FW_FILTER_WR_FCOE_S 13
  423. #define FW_FILTER_WR_FCOE_M 0x1
  424. #define FW_FILTER_WR_FCOE_V(x) ((x) << FW_FILTER_WR_FCOE_S)
  425. #define FW_FILTER_WR_FCOE_G(x) \
  426. (((x) >> FW_FILTER_WR_FCOE_S) & FW_FILTER_WR_FCOE_M)
  427. #define FW_FILTER_WR_FCOE_F FW_FILTER_WR_FCOE_V(1U)
  428. #define FW_FILTER_WR_FCOEM_S 12
  429. #define FW_FILTER_WR_FCOEM_M 0x1
  430. #define FW_FILTER_WR_FCOEM_V(x) ((x) << FW_FILTER_WR_FCOEM_S)
  431. #define FW_FILTER_WR_FCOEM_G(x) \
  432. (((x) >> FW_FILTER_WR_FCOEM_S) & FW_FILTER_WR_FCOEM_M)
  433. #define FW_FILTER_WR_FCOEM_F FW_FILTER_WR_FCOEM_V(1U)
  434. #define FW_FILTER_WR_PORT_S 9
  435. #define FW_FILTER_WR_PORT_M 0x7
  436. #define FW_FILTER_WR_PORT_V(x) ((x) << FW_FILTER_WR_PORT_S)
  437. #define FW_FILTER_WR_PORT_G(x) \
  438. (((x) >> FW_FILTER_WR_PORT_S) & FW_FILTER_WR_PORT_M)
  439. #define FW_FILTER_WR_PORTM_S 6
  440. #define FW_FILTER_WR_PORTM_M 0x7
  441. #define FW_FILTER_WR_PORTM_V(x) ((x) << FW_FILTER_WR_PORTM_S)
  442. #define FW_FILTER_WR_PORTM_G(x) \
  443. (((x) >> FW_FILTER_WR_PORTM_S) & FW_FILTER_WR_PORTM_M)
  444. #define FW_FILTER_WR_MATCHTYPE_S 3
  445. #define FW_FILTER_WR_MATCHTYPE_M 0x7
  446. #define FW_FILTER_WR_MATCHTYPE_V(x) ((x) << FW_FILTER_WR_MATCHTYPE_S)
  447. #define FW_FILTER_WR_MATCHTYPE_G(x) \
  448. (((x) >> FW_FILTER_WR_MATCHTYPE_S) & FW_FILTER_WR_MATCHTYPE_M)
  449. #define FW_FILTER_WR_MATCHTYPEM_S 0
  450. #define FW_FILTER_WR_MATCHTYPEM_M 0x7
  451. #define FW_FILTER_WR_MATCHTYPEM_V(x) ((x) << FW_FILTER_WR_MATCHTYPEM_S)
  452. #define FW_FILTER_WR_MATCHTYPEM_G(x) \
  453. (((x) >> FW_FILTER_WR_MATCHTYPEM_S) & FW_FILTER_WR_MATCHTYPEM_M)
  454. struct fw_ulptx_wr {
  455. __be32 op_to_compl;
  456. __be32 flowid_len16;
  457. u64 cookie;
  458. };
  459. #define FW_ULPTX_WR_DATA_S 28
  460. #define FW_ULPTX_WR_DATA_M 0x1
  461. #define FW_ULPTX_WR_DATA_V(x) ((x) << FW_ULPTX_WR_DATA_S)
  462. #define FW_ULPTX_WR_DATA_G(x) \
  463. (((x) >> FW_ULPTX_WR_DATA_S) & FW_ULPTX_WR_DATA_M)
  464. #define FW_ULPTX_WR_DATA_F FW_ULPTX_WR_DATA_V(1U)
  465. struct fw_tp_wr {
  466. __be32 op_to_immdlen;
  467. __be32 flowid_len16;
  468. u64 cookie;
  469. };
  470. struct fw_eth_tx_pkt_wr {
  471. __be32 op_immdlen;
  472. __be32 equiq_to_len16;
  473. __be64 r3;
  474. };
  475. struct fw_ofld_connection_wr {
  476. __be32 op_compl;
  477. __be32 len16_pkd;
  478. __u64 cookie;
  479. __be64 r2;
  480. __be64 r3;
  481. struct fw_ofld_connection_le {
  482. __be32 version_cpl;
  483. __be32 filter;
  484. __be32 r1;
  485. __be16 lport;
  486. __be16 pport;
  487. union fw_ofld_connection_leip {
  488. struct fw_ofld_connection_le_ipv4 {
  489. __be32 pip;
  490. __be32 lip;
  491. __be64 r0;
  492. __be64 r1;
  493. __be64 r2;
  494. } ipv4;
  495. struct fw_ofld_connection_le_ipv6 {
  496. __be64 pip_hi;
  497. __be64 pip_lo;
  498. __be64 lip_hi;
  499. __be64 lip_lo;
  500. } ipv6;
  501. } u;
  502. } le;
  503. struct fw_ofld_connection_tcb {
  504. __be32 t_state_to_astid;
  505. __be16 cplrxdataack_cplpassacceptrpl;
  506. __be16 rcv_adv;
  507. __be32 rcv_nxt;
  508. __be32 tx_max;
  509. __be64 opt0;
  510. __be32 opt2;
  511. __be32 r1;
  512. __be64 r2;
  513. __be64 r3;
  514. } tcb;
  515. };
  516. #define FW_OFLD_CONNECTION_WR_VERSION_S 31
  517. #define FW_OFLD_CONNECTION_WR_VERSION_M 0x1
  518. #define FW_OFLD_CONNECTION_WR_VERSION_V(x) \
  519. ((x) << FW_OFLD_CONNECTION_WR_VERSION_S)
  520. #define FW_OFLD_CONNECTION_WR_VERSION_G(x) \
  521. (((x) >> FW_OFLD_CONNECTION_WR_VERSION_S) & \
  522. FW_OFLD_CONNECTION_WR_VERSION_M)
  523. #define FW_OFLD_CONNECTION_WR_VERSION_F \
  524. FW_OFLD_CONNECTION_WR_VERSION_V(1U)
  525. #define FW_OFLD_CONNECTION_WR_CPL_S 30
  526. #define FW_OFLD_CONNECTION_WR_CPL_M 0x1
  527. #define FW_OFLD_CONNECTION_WR_CPL_V(x) ((x) << FW_OFLD_CONNECTION_WR_CPL_S)
  528. #define FW_OFLD_CONNECTION_WR_CPL_G(x) \
  529. (((x) >> FW_OFLD_CONNECTION_WR_CPL_S) & FW_OFLD_CONNECTION_WR_CPL_M)
  530. #define FW_OFLD_CONNECTION_WR_CPL_F FW_OFLD_CONNECTION_WR_CPL_V(1U)
  531. #define FW_OFLD_CONNECTION_WR_T_STATE_S 28
  532. #define FW_OFLD_CONNECTION_WR_T_STATE_M 0xf
  533. #define FW_OFLD_CONNECTION_WR_T_STATE_V(x) \
  534. ((x) << FW_OFLD_CONNECTION_WR_T_STATE_S)
  535. #define FW_OFLD_CONNECTION_WR_T_STATE_G(x) \
  536. (((x) >> FW_OFLD_CONNECTION_WR_T_STATE_S) & \
  537. FW_OFLD_CONNECTION_WR_T_STATE_M)
  538. #define FW_OFLD_CONNECTION_WR_RCV_SCALE_S 24
  539. #define FW_OFLD_CONNECTION_WR_RCV_SCALE_M 0xf
  540. #define FW_OFLD_CONNECTION_WR_RCV_SCALE_V(x) \
  541. ((x) << FW_OFLD_CONNECTION_WR_RCV_SCALE_S)
  542. #define FW_OFLD_CONNECTION_WR_RCV_SCALE_G(x) \
  543. (((x) >> FW_OFLD_CONNECTION_WR_RCV_SCALE_S) & \
  544. FW_OFLD_CONNECTION_WR_RCV_SCALE_M)
  545. #define FW_OFLD_CONNECTION_WR_ASTID_S 0
  546. #define FW_OFLD_CONNECTION_WR_ASTID_M 0xffffff
  547. #define FW_OFLD_CONNECTION_WR_ASTID_V(x) \
  548. ((x) << FW_OFLD_CONNECTION_WR_ASTID_S)
  549. #define FW_OFLD_CONNECTION_WR_ASTID_G(x) \
  550. (((x) >> FW_OFLD_CONNECTION_WR_ASTID_S) & FW_OFLD_CONNECTION_WR_ASTID_M)
  551. #define FW_OFLD_CONNECTION_WR_CPLRXDATAACK_S 15
  552. #define FW_OFLD_CONNECTION_WR_CPLRXDATAACK_M 0x1
  553. #define FW_OFLD_CONNECTION_WR_CPLRXDATAACK_V(x) \
  554. ((x) << FW_OFLD_CONNECTION_WR_CPLRXDATAACK_S)
  555. #define FW_OFLD_CONNECTION_WR_CPLRXDATAACK_G(x) \
  556. (((x) >> FW_OFLD_CONNECTION_WR_CPLRXDATAACK_S) & \
  557. FW_OFLD_CONNECTION_WR_CPLRXDATAACK_M)
  558. #define FW_OFLD_CONNECTION_WR_CPLRXDATAACK_F \
  559. FW_OFLD_CONNECTION_WR_CPLRXDATAACK_V(1U)
  560. #define FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_S 14
  561. #define FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_M 0x1
  562. #define FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_V(x) \
  563. ((x) << FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_S)
  564. #define FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_G(x) \
  565. (((x) >> FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_S) & \
  566. FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_M)
  567. #define FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_F \
  568. FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_V(1U)
  569. enum fw_flowc_mnem_tcpstate {
  570. FW_FLOWC_MNEM_TCPSTATE_CLOSED = 0, /* illegal */
  571. FW_FLOWC_MNEM_TCPSTATE_LISTEN = 1, /* illegal */
  572. FW_FLOWC_MNEM_TCPSTATE_SYNSENT = 2, /* illegal */
  573. FW_FLOWC_MNEM_TCPSTATE_SYNRECEIVED = 3, /* illegal */
  574. FW_FLOWC_MNEM_TCPSTATE_ESTABLISHED = 4, /* default */
  575. FW_FLOWC_MNEM_TCPSTATE_CLOSEWAIT = 5, /* got peer close already */
  576. FW_FLOWC_MNEM_TCPSTATE_FINWAIT1 = 6, /* haven't gotten ACK for FIN and
  577. * will resend FIN - equiv ESTAB
  578. */
  579. FW_FLOWC_MNEM_TCPSTATE_CLOSING = 7, /* haven't gotten ACK for FIN and
  580. * will resend FIN but have
  581. * received FIN
  582. */
  583. FW_FLOWC_MNEM_TCPSTATE_LASTACK = 8, /* haven't gotten ACK for FIN and
  584. * will resend FIN but have
  585. * received FIN
  586. */
  587. FW_FLOWC_MNEM_TCPSTATE_FINWAIT2 = 9, /* sent FIN and got FIN + ACK,
  588. * waiting for FIN
  589. */
  590. FW_FLOWC_MNEM_TCPSTATE_TIMEWAIT = 10, /* not expected */
  591. };
  592. enum fw_flowc_mnem {
  593. FW_FLOWC_MNEM_PFNVFN, /* PFN [15:8] VFN [7:0] */
  594. FW_FLOWC_MNEM_CH,
  595. FW_FLOWC_MNEM_PORT,
  596. FW_FLOWC_MNEM_IQID,
  597. FW_FLOWC_MNEM_SNDNXT,
  598. FW_FLOWC_MNEM_RCVNXT,
  599. FW_FLOWC_MNEM_SNDBUF,
  600. FW_FLOWC_MNEM_MSS,
  601. FW_FLOWC_MNEM_TXDATAPLEN_MAX,
  602. FW_FLOWC_MNEM_TCPSTATE,
  603. FW_FLOWC_MNEM_EOSTATE,
  604. FW_FLOWC_MNEM_SCHEDCLASS,
  605. FW_FLOWC_MNEM_DCBPRIO,
  606. FW_FLOWC_MNEM_SND_SCALE,
  607. FW_FLOWC_MNEM_RCV_SCALE,
  608. FW_FLOWC_MNEM_ULD_MODE,
  609. FW_FLOWC_MNEM_MAX,
  610. };
  611. struct fw_flowc_mnemval {
  612. u8 mnemonic;
  613. u8 r4[3];
  614. __be32 val;
  615. };
  616. struct fw_flowc_wr {
  617. __be32 op_to_nparams;
  618. __be32 flowid_len16;
  619. struct fw_flowc_mnemval mnemval[0];
  620. };
  621. #define FW_FLOWC_WR_NPARAMS_S 0
  622. #define FW_FLOWC_WR_NPARAMS_V(x) ((x) << FW_FLOWC_WR_NPARAMS_S)
  623. struct fw_ofld_tx_data_wr {
  624. __be32 op_to_immdlen;
  625. __be32 flowid_len16;
  626. __be32 plen;
  627. __be32 tunnel_to_proxy;
  628. };
  629. #define FW_OFLD_TX_DATA_WR_ALIGNPLD_S 30
  630. #define FW_OFLD_TX_DATA_WR_ALIGNPLD_V(x) ((x) << FW_OFLD_TX_DATA_WR_ALIGNPLD_S)
  631. #define FW_OFLD_TX_DATA_WR_ALIGNPLD_F FW_OFLD_TX_DATA_WR_ALIGNPLD_V(1U)
  632. #define FW_OFLD_TX_DATA_WR_SHOVE_S 29
  633. #define FW_OFLD_TX_DATA_WR_SHOVE_V(x) ((x) << FW_OFLD_TX_DATA_WR_SHOVE_S)
  634. #define FW_OFLD_TX_DATA_WR_SHOVE_F FW_OFLD_TX_DATA_WR_SHOVE_V(1U)
  635. #define FW_OFLD_TX_DATA_WR_TUNNEL_S 19
  636. #define FW_OFLD_TX_DATA_WR_TUNNEL_V(x) ((x) << FW_OFLD_TX_DATA_WR_TUNNEL_S)
  637. #define FW_OFLD_TX_DATA_WR_SAVE_S 18
  638. #define FW_OFLD_TX_DATA_WR_SAVE_V(x) ((x) << FW_OFLD_TX_DATA_WR_SAVE_S)
  639. #define FW_OFLD_TX_DATA_WR_FLUSH_S 17
  640. #define FW_OFLD_TX_DATA_WR_FLUSH_V(x) ((x) << FW_OFLD_TX_DATA_WR_FLUSH_S)
  641. #define FW_OFLD_TX_DATA_WR_FLUSH_F FW_OFLD_TX_DATA_WR_FLUSH_V(1U)
  642. #define FW_OFLD_TX_DATA_WR_URGENT_S 16
  643. #define FW_OFLD_TX_DATA_WR_URGENT_V(x) ((x) << FW_OFLD_TX_DATA_WR_URGENT_S)
  644. #define FW_OFLD_TX_DATA_WR_MORE_S 15
  645. #define FW_OFLD_TX_DATA_WR_MORE_V(x) ((x) << FW_OFLD_TX_DATA_WR_MORE_S)
  646. #define FW_OFLD_TX_DATA_WR_ULPMODE_S 10
  647. #define FW_OFLD_TX_DATA_WR_ULPMODE_V(x) ((x) << FW_OFLD_TX_DATA_WR_ULPMODE_S)
  648. #define FW_OFLD_TX_DATA_WR_ULPSUBMODE_S 6
  649. #define FW_OFLD_TX_DATA_WR_ULPSUBMODE_V(x) \
  650. ((x) << FW_OFLD_TX_DATA_WR_ULPSUBMODE_S)
  651. struct fw_cmd_wr {
  652. __be32 op_dma;
  653. __be32 len16_pkd;
  654. __be64 cookie_daddr;
  655. };
  656. #define FW_CMD_WR_DMA_S 17
  657. #define FW_CMD_WR_DMA_V(x) ((x) << FW_CMD_WR_DMA_S)
  658. struct fw_eth_tx_pkt_vm_wr {
  659. __be32 op_immdlen;
  660. __be32 equiq_to_len16;
  661. __be32 r3[2];
  662. u8 ethmacdst[6];
  663. u8 ethmacsrc[6];
  664. __be16 ethtype;
  665. __be16 vlantci;
  666. };
  667. #define FW_CMD_MAX_TIMEOUT 10000
  668. /*
  669. * If a host driver does a HELLO and discovers that there's already a MASTER
  670. * selected, we may have to wait for that MASTER to finish issuing RESET,
  671. * configuration and INITIALIZE commands. Also, there's a possibility that
  672. * our own HELLO may get lost if it happens right as the MASTER is issuign a
  673. * RESET command, so we need to be willing to make a few retries of our HELLO.
  674. */
  675. #define FW_CMD_HELLO_TIMEOUT (3 * FW_CMD_MAX_TIMEOUT)
  676. #define FW_CMD_HELLO_RETRIES 3
  677. enum fw_cmd_opcodes {
  678. FW_LDST_CMD = 0x01,
  679. FW_RESET_CMD = 0x03,
  680. FW_HELLO_CMD = 0x04,
  681. FW_BYE_CMD = 0x05,
  682. FW_INITIALIZE_CMD = 0x06,
  683. FW_CAPS_CONFIG_CMD = 0x07,
  684. FW_PARAMS_CMD = 0x08,
  685. FW_PFVF_CMD = 0x09,
  686. FW_IQ_CMD = 0x10,
  687. FW_EQ_MNGT_CMD = 0x11,
  688. FW_EQ_ETH_CMD = 0x12,
  689. FW_EQ_CTRL_CMD = 0x13,
  690. FW_EQ_OFLD_CMD = 0x21,
  691. FW_VI_CMD = 0x14,
  692. FW_VI_MAC_CMD = 0x15,
  693. FW_VI_RXMODE_CMD = 0x16,
  694. FW_VI_ENABLE_CMD = 0x17,
  695. FW_ACL_MAC_CMD = 0x18,
  696. FW_ACL_VLAN_CMD = 0x19,
  697. FW_VI_STATS_CMD = 0x1a,
  698. FW_PORT_CMD = 0x1b,
  699. FW_PORT_STATS_CMD = 0x1c,
  700. FW_PORT_LB_STATS_CMD = 0x1d,
  701. FW_PORT_TRACE_CMD = 0x1e,
  702. FW_PORT_TRACE_MMAP_CMD = 0x1f,
  703. FW_RSS_IND_TBL_CMD = 0x20,
  704. FW_RSS_GLB_CONFIG_CMD = 0x22,
  705. FW_RSS_VI_CONFIG_CMD = 0x23,
  706. FW_SCHED_CMD = 0x24,
  707. FW_DEVLOG_CMD = 0x25,
  708. FW_CLIP_CMD = 0x28,
  709. FW_PTP_CMD = 0x3e,
  710. FW_HMA_CMD = 0x3f,
  711. FW_LASTC2E_CMD = 0x40,
  712. FW_ERROR_CMD = 0x80,
  713. FW_DEBUG_CMD = 0x81,
  714. };
  715. enum fw_cmd_cap {
  716. FW_CMD_CAP_PF = 0x01,
  717. FW_CMD_CAP_DMAQ = 0x02,
  718. FW_CMD_CAP_PORT = 0x04,
  719. FW_CMD_CAP_PORTPROMISC = 0x08,
  720. FW_CMD_CAP_PORTSTATS = 0x10,
  721. FW_CMD_CAP_VF = 0x80,
  722. };
  723. /*
  724. * Generic command header flit0
  725. */
  726. struct fw_cmd_hdr {
  727. __be32 hi;
  728. __be32 lo;
  729. };
  730. #define FW_CMD_OP_S 24
  731. #define FW_CMD_OP_M 0xff
  732. #define FW_CMD_OP_V(x) ((x) << FW_CMD_OP_S)
  733. #define FW_CMD_OP_G(x) (((x) >> FW_CMD_OP_S) & FW_CMD_OP_M)
  734. #define FW_CMD_REQUEST_S 23
  735. #define FW_CMD_REQUEST_V(x) ((x) << FW_CMD_REQUEST_S)
  736. #define FW_CMD_REQUEST_F FW_CMD_REQUEST_V(1U)
  737. #define FW_CMD_READ_S 22
  738. #define FW_CMD_READ_V(x) ((x) << FW_CMD_READ_S)
  739. #define FW_CMD_READ_F FW_CMD_READ_V(1U)
  740. #define FW_CMD_WRITE_S 21
  741. #define FW_CMD_WRITE_V(x) ((x) << FW_CMD_WRITE_S)
  742. #define FW_CMD_WRITE_F FW_CMD_WRITE_V(1U)
  743. #define FW_CMD_EXEC_S 20
  744. #define FW_CMD_EXEC_V(x) ((x) << FW_CMD_EXEC_S)
  745. #define FW_CMD_EXEC_F FW_CMD_EXEC_V(1U)
  746. #define FW_CMD_RAMASK_S 20
  747. #define FW_CMD_RAMASK_V(x) ((x) << FW_CMD_RAMASK_S)
  748. #define FW_CMD_RETVAL_S 8
  749. #define FW_CMD_RETVAL_M 0xff
  750. #define FW_CMD_RETVAL_V(x) ((x) << FW_CMD_RETVAL_S)
  751. #define FW_CMD_RETVAL_G(x) (((x) >> FW_CMD_RETVAL_S) & FW_CMD_RETVAL_M)
  752. #define FW_CMD_LEN16_S 0
  753. #define FW_CMD_LEN16_V(x) ((x) << FW_CMD_LEN16_S)
  754. #define FW_LEN16(fw_struct) FW_CMD_LEN16_V(sizeof(fw_struct) / 16)
  755. enum fw_ldst_addrspc {
  756. FW_LDST_ADDRSPC_FIRMWARE = 0x0001,
  757. FW_LDST_ADDRSPC_SGE_EGRC = 0x0008,
  758. FW_LDST_ADDRSPC_SGE_INGC = 0x0009,
  759. FW_LDST_ADDRSPC_SGE_FLMC = 0x000a,
  760. FW_LDST_ADDRSPC_SGE_CONMC = 0x000b,
  761. FW_LDST_ADDRSPC_TP_PIO = 0x0010,
  762. FW_LDST_ADDRSPC_TP_TM_PIO = 0x0011,
  763. FW_LDST_ADDRSPC_TP_MIB = 0x0012,
  764. FW_LDST_ADDRSPC_MDIO = 0x0018,
  765. FW_LDST_ADDRSPC_MPS = 0x0020,
  766. FW_LDST_ADDRSPC_FUNC = 0x0028,
  767. FW_LDST_ADDRSPC_FUNC_PCIE = 0x0029,
  768. FW_LDST_ADDRSPC_I2C = 0x0038,
  769. };
  770. enum fw_ldst_mps_fid {
  771. FW_LDST_MPS_ATRB,
  772. FW_LDST_MPS_RPLC
  773. };
  774. enum fw_ldst_func_access_ctl {
  775. FW_LDST_FUNC_ACC_CTL_VIID,
  776. FW_LDST_FUNC_ACC_CTL_FID
  777. };
  778. enum fw_ldst_func_mod_index {
  779. FW_LDST_FUNC_MPS
  780. };
  781. struct fw_ldst_cmd {
  782. __be32 op_to_addrspace;
  783. __be32 cycles_to_len16;
  784. union fw_ldst {
  785. struct fw_ldst_addrval {
  786. __be32 addr;
  787. __be32 val;
  788. } addrval;
  789. struct fw_ldst_idctxt {
  790. __be32 physid;
  791. __be32 msg_ctxtflush;
  792. __be32 ctxt_data7;
  793. __be32 ctxt_data6;
  794. __be32 ctxt_data5;
  795. __be32 ctxt_data4;
  796. __be32 ctxt_data3;
  797. __be32 ctxt_data2;
  798. __be32 ctxt_data1;
  799. __be32 ctxt_data0;
  800. } idctxt;
  801. struct fw_ldst_mdio {
  802. __be16 paddr_mmd;
  803. __be16 raddr;
  804. __be16 vctl;
  805. __be16 rval;
  806. } mdio;
  807. struct fw_ldst_cim_rq {
  808. u8 req_first64[8];
  809. u8 req_second64[8];
  810. u8 resp_first64[8];
  811. u8 resp_second64[8];
  812. __be32 r3[2];
  813. } cim_rq;
  814. union fw_ldst_mps {
  815. struct fw_ldst_mps_rplc {
  816. __be16 fid_idx;
  817. __be16 rplcpf_pkd;
  818. __be32 rplc255_224;
  819. __be32 rplc223_192;
  820. __be32 rplc191_160;
  821. __be32 rplc159_128;
  822. __be32 rplc127_96;
  823. __be32 rplc95_64;
  824. __be32 rplc63_32;
  825. __be32 rplc31_0;
  826. } rplc;
  827. struct fw_ldst_mps_atrb {
  828. __be16 fid_mpsid;
  829. __be16 r2[3];
  830. __be32 r3[2];
  831. __be32 r4;
  832. __be32 atrb;
  833. __be16 vlan[16];
  834. } atrb;
  835. } mps;
  836. struct fw_ldst_func {
  837. u8 access_ctl;
  838. u8 mod_index;
  839. __be16 ctl_id;
  840. __be32 offset;
  841. __be64 data0;
  842. __be64 data1;
  843. } func;
  844. struct fw_ldst_pcie {
  845. u8 ctrl_to_fn;
  846. u8 bnum;
  847. u8 r;
  848. u8 ext_r;
  849. u8 select_naccess;
  850. u8 pcie_fn;
  851. __be16 nset_pkd;
  852. __be32 data[12];
  853. } pcie;
  854. struct fw_ldst_i2c_deprecated {
  855. u8 pid_pkd;
  856. u8 base;
  857. u8 boffset;
  858. u8 data;
  859. __be32 r9;
  860. } i2c_deprecated;
  861. struct fw_ldst_i2c {
  862. u8 pid;
  863. u8 did;
  864. u8 boffset;
  865. u8 blen;
  866. __be32 r9;
  867. __u8 data[48];
  868. } i2c;
  869. struct fw_ldst_le {
  870. __be32 index;
  871. __be32 r9;
  872. u8 val[33];
  873. u8 r11[7];
  874. } le;
  875. } u;
  876. };
  877. #define FW_LDST_CMD_ADDRSPACE_S 0
  878. #define FW_LDST_CMD_ADDRSPACE_V(x) ((x) << FW_LDST_CMD_ADDRSPACE_S)
  879. #define FW_LDST_CMD_MSG_S 31
  880. #define FW_LDST_CMD_MSG_V(x) ((x) << FW_LDST_CMD_MSG_S)
  881. #define FW_LDST_CMD_CTXTFLUSH_S 30
  882. #define FW_LDST_CMD_CTXTFLUSH_V(x) ((x) << FW_LDST_CMD_CTXTFLUSH_S)
  883. #define FW_LDST_CMD_CTXTFLUSH_F FW_LDST_CMD_CTXTFLUSH_V(1U)
  884. #define FW_LDST_CMD_PADDR_S 8
  885. #define FW_LDST_CMD_PADDR_V(x) ((x) << FW_LDST_CMD_PADDR_S)
  886. #define FW_LDST_CMD_MMD_S 0
  887. #define FW_LDST_CMD_MMD_V(x) ((x) << FW_LDST_CMD_MMD_S)
  888. #define FW_LDST_CMD_FID_S 15
  889. #define FW_LDST_CMD_FID_V(x) ((x) << FW_LDST_CMD_FID_S)
  890. #define FW_LDST_CMD_IDX_S 0
  891. #define FW_LDST_CMD_IDX_V(x) ((x) << FW_LDST_CMD_IDX_S)
  892. #define FW_LDST_CMD_RPLCPF_S 0
  893. #define FW_LDST_CMD_RPLCPF_V(x) ((x) << FW_LDST_CMD_RPLCPF_S)
  894. #define FW_LDST_CMD_LC_S 4
  895. #define FW_LDST_CMD_LC_V(x) ((x) << FW_LDST_CMD_LC_S)
  896. #define FW_LDST_CMD_LC_F FW_LDST_CMD_LC_V(1U)
  897. #define FW_LDST_CMD_FN_S 0
  898. #define FW_LDST_CMD_FN_V(x) ((x) << FW_LDST_CMD_FN_S)
  899. #define FW_LDST_CMD_NACCESS_S 0
  900. #define FW_LDST_CMD_NACCESS_V(x) ((x) << FW_LDST_CMD_NACCESS_S)
  901. struct fw_reset_cmd {
  902. __be32 op_to_write;
  903. __be32 retval_len16;
  904. __be32 val;
  905. __be32 halt_pkd;
  906. };
  907. #define FW_RESET_CMD_HALT_S 31
  908. #define FW_RESET_CMD_HALT_M 0x1
  909. #define FW_RESET_CMD_HALT_V(x) ((x) << FW_RESET_CMD_HALT_S)
  910. #define FW_RESET_CMD_HALT_G(x) \
  911. (((x) >> FW_RESET_CMD_HALT_S) & FW_RESET_CMD_HALT_M)
  912. #define FW_RESET_CMD_HALT_F FW_RESET_CMD_HALT_V(1U)
  913. enum fw_hellow_cmd {
  914. fw_hello_cmd_stage_os = 0x0
  915. };
  916. struct fw_hello_cmd {
  917. __be32 op_to_write;
  918. __be32 retval_len16;
  919. __be32 err_to_clearinit;
  920. __be32 fwrev;
  921. };
  922. #define FW_HELLO_CMD_ERR_S 31
  923. #define FW_HELLO_CMD_ERR_V(x) ((x) << FW_HELLO_CMD_ERR_S)
  924. #define FW_HELLO_CMD_ERR_F FW_HELLO_CMD_ERR_V(1U)
  925. #define FW_HELLO_CMD_INIT_S 30
  926. #define FW_HELLO_CMD_INIT_V(x) ((x) << FW_HELLO_CMD_INIT_S)
  927. #define FW_HELLO_CMD_INIT_F FW_HELLO_CMD_INIT_V(1U)
  928. #define FW_HELLO_CMD_MASTERDIS_S 29
  929. #define FW_HELLO_CMD_MASTERDIS_V(x) ((x) << FW_HELLO_CMD_MASTERDIS_S)
  930. #define FW_HELLO_CMD_MASTERFORCE_S 28
  931. #define FW_HELLO_CMD_MASTERFORCE_V(x) ((x) << FW_HELLO_CMD_MASTERFORCE_S)
  932. #define FW_HELLO_CMD_MBMASTER_S 24
  933. #define FW_HELLO_CMD_MBMASTER_M 0xfU
  934. #define FW_HELLO_CMD_MBMASTER_V(x) ((x) << FW_HELLO_CMD_MBMASTER_S)
  935. #define FW_HELLO_CMD_MBMASTER_G(x) \
  936. (((x) >> FW_HELLO_CMD_MBMASTER_S) & FW_HELLO_CMD_MBMASTER_M)
  937. #define FW_HELLO_CMD_MBASYNCNOTINT_S 23
  938. #define FW_HELLO_CMD_MBASYNCNOTINT_V(x) ((x) << FW_HELLO_CMD_MBASYNCNOTINT_S)
  939. #define FW_HELLO_CMD_MBASYNCNOT_S 20
  940. #define FW_HELLO_CMD_MBASYNCNOT_V(x) ((x) << FW_HELLO_CMD_MBASYNCNOT_S)
  941. #define FW_HELLO_CMD_STAGE_S 17
  942. #define FW_HELLO_CMD_STAGE_V(x) ((x) << FW_HELLO_CMD_STAGE_S)
  943. #define FW_HELLO_CMD_CLEARINIT_S 16
  944. #define FW_HELLO_CMD_CLEARINIT_V(x) ((x) << FW_HELLO_CMD_CLEARINIT_S)
  945. #define FW_HELLO_CMD_CLEARINIT_F FW_HELLO_CMD_CLEARINIT_V(1U)
  946. struct fw_bye_cmd {
  947. __be32 op_to_write;
  948. __be32 retval_len16;
  949. __be64 r3;
  950. };
  951. struct fw_initialize_cmd {
  952. __be32 op_to_write;
  953. __be32 retval_len16;
  954. __be64 r3;
  955. };
  956. enum fw_caps_config_hm {
  957. FW_CAPS_CONFIG_HM_PCIE = 0x00000001,
  958. FW_CAPS_CONFIG_HM_PL = 0x00000002,
  959. FW_CAPS_CONFIG_HM_SGE = 0x00000004,
  960. FW_CAPS_CONFIG_HM_CIM = 0x00000008,
  961. FW_CAPS_CONFIG_HM_ULPTX = 0x00000010,
  962. FW_CAPS_CONFIG_HM_TP = 0x00000020,
  963. FW_CAPS_CONFIG_HM_ULPRX = 0x00000040,
  964. FW_CAPS_CONFIG_HM_PMRX = 0x00000080,
  965. FW_CAPS_CONFIG_HM_PMTX = 0x00000100,
  966. FW_CAPS_CONFIG_HM_MC = 0x00000200,
  967. FW_CAPS_CONFIG_HM_LE = 0x00000400,
  968. FW_CAPS_CONFIG_HM_MPS = 0x00000800,
  969. FW_CAPS_CONFIG_HM_XGMAC = 0x00001000,
  970. FW_CAPS_CONFIG_HM_CPLSWITCH = 0x00002000,
  971. FW_CAPS_CONFIG_HM_T4DBG = 0x00004000,
  972. FW_CAPS_CONFIG_HM_MI = 0x00008000,
  973. FW_CAPS_CONFIG_HM_I2CM = 0x00010000,
  974. FW_CAPS_CONFIG_HM_NCSI = 0x00020000,
  975. FW_CAPS_CONFIG_HM_SMB = 0x00040000,
  976. FW_CAPS_CONFIG_HM_MA = 0x00080000,
  977. FW_CAPS_CONFIG_HM_EDRAM = 0x00100000,
  978. FW_CAPS_CONFIG_HM_PMU = 0x00200000,
  979. FW_CAPS_CONFIG_HM_UART = 0x00400000,
  980. FW_CAPS_CONFIG_HM_SF = 0x00800000,
  981. };
  982. enum fw_caps_config_nbm {
  983. FW_CAPS_CONFIG_NBM_IPMI = 0x00000001,
  984. FW_CAPS_CONFIG_NBM_NCSI = 0x00000002,
  985. };
  986. enum fw_caps_config_link {
  987. FW_CAPS_CONFIG_LINK_PPP = 0x00000001,
  988. FW_CAPS_CONFIG_LINK_QFC = 0x00000002,
  989. FW_CAPS_CONFIG_LINK_DCBX = 0x00000004,
  990. };
  991. enum fw_caps_config_switch {
  992. FW_CAPS_CONFIG_SWITCH_INGRESS = 0x00000001,
  993. FW_CAPS_CONFIG_SWITCH_EGRESS = 0x00000002,
  994. };
  995. enum fw_caps_config_nic {
  996. FW_CAPS_CONFIG_NIC = 0x00000001,
  997. FW_CAPS_CONFIG_NIC_VM = 0x00000002,
  998. FW_CAPS_CONFIG_NIC_HASHFILTER = 0x00000020,
  999. };
  1000. enum fw_caps_config_ofld {
  1001. FW_CAPS_CONFIG_OFLD = 0x00000001,
  1002. };
  1003. enum fw_caps_config_rdma {
  1004. FW_CAPS_CONFIG_RDMA_RDDP = 0x00000001,
  1005. FW_CAPS_CONFIG_RDMA_RDMAC = 0x00000002,
  1006. };
  1007. enum fw_caps_config_iscsi {
  1008. FW_CAPS_CONFIG_ISCSI_INITIATOR_PDU = 0x00000001,
  1009. FW_CAPS_CONFIG_ISCSI_TARGET_PDU = 0x00000002,
  1010. FW_CAPS_CONFIG_ISCSI_INITIATOR_CNXOFLD = 0x00000004,
  1011. FW_CAPS_CONFIG_ISCSI_TARGET_CNXOFLD = 0x00000008,
  1012. };
  1013. enum fw_caps_config_crypto {
  1014. FW_CAPS_CONFIG_CRYPTO_LOOKASIDE = 0x00000001,
  1015. FW_CAPS_CONFIG_TLS_INLINE = 0x00000002,
  1016. FW_CAPS_CONFIG_IPSEC_INLINE = 0x00000004,
  1017. };
  1018. enum fw_caps_config_fcoe {
  1019. FW_CAPS_CONFIG_FCOE_INITIATOR = 0x00000001,
  1020. FW_CAPS_CONFIG_FCOE_TARGET = 0x00000002,
  1021. FW_CAPS_CONFIG_FCOE_CTRL_OFLD = 0x00000004,
  1022. };
  1023. enum fw_memtype_cf {
  1024. FW_MEMTYPE_CF_EDC0 = 0x0,
  1025. FW_MEMTYPE_CF_EDC1 = 0x1,
  1026. FW_MEMTYPE_CF_EXTMEM = 0x2,
  1027. FW_MEMTYPE_CF_FLASH = 0x4,
  1028. FW_MEMTYPE_CF_INTERNAL = 0x5,
  1029. FW_MEMTYPE_CF_EXTMEM1 = 0x6,
  1030. FW_MEMTYPE_CF_HMA = 0x7,
  1031. };
  1032. struct fw_caps_config_cmd {
  1033. __be32 op_to_write;
  1034. __be32 cfvalid_to_len16;
  1035. __be32 r2;
  1036. __be32 hwmbitmap;
  1037. __be16 nbmcaps;
  1038. __be16 linkcaps;
  1039. __be16 switchcaps;
  1040. __be16 r3;
  1041. __be16 niccaps;
  1042. __be16 ofldcaps;
  1043. __be16 rdmacaps;
  1044. __be16 cryptocaps;
  1045. __be16 iscsicaps;
  1046. __be16 fcoecaps;
  1047. __be32 cfcsum;
  1048. __be32 finiver;
  1049. __be32 finicsum;
  1050. };
  1051. #define FW_CAPS_CONFIG_CMD_CFVALID_S 27
  1052. #define FW_CAPS_CONFIG_CMD_CFVALID_V(x) ((x) << FW_CAPS_CONFIG_CMD_CFVALID_S)
  1053. #define FW_CAPS_CONFIG_CMD_CFVALID_F FW_CAPS_CONFIG_CMD_CFVALID_V(1U)
  1054. #define FW_CAPS_CONFIG_CMD_MEMTYPE_CF_S 24
  1055. #define FW_CAPS_CONFIG_CMD_MEMTYPE_CF_V(x) \
  1056. ((x) << FW_CAPS_CONFIG_CMD_MEMTYPE_CF_S)
  1057. #define FW_CAPS_CONFIG_CMD_MEMADDR64K_CF_S 16
  1058. #define FW_CAPS_CONFIG_CMD_MEMADDR64K_CF_V(x) \
  1059. ((x) << FW_CAPS_CONFIG_CMD_MEMADDR64K_CF_S)
  1060. /*
  1061. * params command mnemonics
  1062. */
  1063. enum fw_params_mnem {
  1064. FW_PARAMS_MNEM_DEV = 1, /* device params */
  1065. FW_PARAMS_MNEM_PFVF = 2, /* function params */
  1066. FW_PARAMS_MNEM_REG = 3, /* limited register access */
  1067. FW_PARAMS_MNEM_DMAQ = 4, /* dma queue params */
  1068. FW_PARAMS_MNEM_CHNET = 5, /* chnet params */
  1069. FW_PARAMS_MNEM_LAST
  1070. };
  1071. /*
  1072. * device parameters
  1073. */
  1074. enum fw_params_param_dev {
  1075. FW_PARAMS_PARAM_DEV_CCLK = 0x00, /* chip core clock in khz */
  1076. FW_PARAMS_PARAM_DEV_PORTVEC = 0x01, /* the port vector */
  1077. FW_PARAMS_PARAM_DEV_NTID = 0x02, /* reads the number of TIDs
  1078. * allocated by the device's
  1079. * Lookup Engine
  1080. */
  1081. FW_PARAMS_PARAM_DEV_FLOWC_BUFFIFO_SZ = 0x03,
  1082. FW_PARAMS_PARAM_DEV_INTVER_NIC = 0x04,
  1083. FW_PARAMS_PARAM_DEV_INTVER_VNIC = 0x05,
  1084. FW_PARAMS_PARAM_DEV_INTVER_OFLD = 0x06,
  1085. FW_PARAMS_PARAM_DEV_INTVER_RI = 0x07,
  1086. FW_PARAMS_PARAM_DEV_INTVER_ISCSIPDU = 0x08,
  1087. FW_PARAMS_PARAM_DEV_INTVER_ISCSI = 0x09,
  1088. FW_PARAMS_PARAM_DEV_INTVER_FCOE = 0x0A,
  1089. FW_PARAMS_PARAM_DEV_FWREV = 0x0B,
  1090. FW_PARAMS_PARAM_DEV_TPREV = 0x0C,
  1091. FW_PARAMS_PARAM_DEV_CF = 0x0D,
  1092. FW_PARAMS_PARAM_DEV_PHYFW = 0x0F,
  1093. FW_PARAMS_PARAM_DEV_DIAG = 0x11,
  1094. FW_PARAMS_PARAM_DEV_MAXORDIRD_QP = 0x13, /* max supported QP IRD/ORD */
  1095. FW_PARAMS_PARAM_DEV_MAXIRD_ADAPTER = 0x14, /* max supported adap IRD */
  1096. FW_PARAMS_PARAM_DEV_ULPTX_MEMWRITE_DSGL = 0x17,
  1097. FW_PARAMS_PARAM_DEV_FWCACHE = 0x18,
  1098. FW_PARAMS_PARAM_DEV_SCFGREV = 0x1A,
  1099. FW_PARAMS_PARAM_DEV_VPDREV = 0x1B,
  1100. FW_PARAMS_PARAM_DEV_RI_FR_NSMR_TPTE_WR = 0x1C,
  1101. FW_PARAMS_PARAM_DEV_FILTER2_WR = 0x1D,
  1102. FW_PARAMS_PARAM_DEV_MPSBGMAP = 0x1E,
  1103. FW_PARAMS_PARAM_DEV_HMA_SIZE = 0x20,
  1104. FW_PARAMS_PARAM_DEV_RDMA_WRITE_WITH_IMM = 0x21,
  1105. FW_PARAMS_PARAM_DEV_RI_WRITE_CMPL_WR = 0x24,
  1106. };
  1107. /*
  1108. * physical and virtual function parameters
  1109. */
  1110. enum fw_params_param_pfvf {
  1111. FW_PARAMS_PARAM_PFVF_RWXCAPS = 0x00,
  1112. FW_PARAMS_PARAM_PFVF_ROUTE_START = 0x01,
  1113. FW_PARAMS_PARAM_PFVF_ROUTE_END = 0x02,
  1114. FW_PARAMS_PARAM_PFVF_CLIP_START = 0x03,
  1115. FW_PARAMS_PARAM_PFVF_CLIP_END = 0x04,
  1116. FW_PARAMS_PARAM_PFVF_FILTER_START = 0x05,
  1117. FW_PARAMS_PARAM_PFVF_FILTER_END = 0x06,
  1118. FW_PARAMS_PARAM_PFVF_SERVER_START = 0x07,
  1119. FW_PARAMS_PARAM_PFVF_SERVER_END = 0x08,
  1120. FW_PARAMS_PARAM_PFVF_TDDP_START = 0x09,
  1121. FW_PARAMS_PARAM_PFVF_TDDP_END = 0x0A,
  1122. FW_PARAMS_PARAM_PFVF_ISCSI_START = 0x0B,
  1123. FW_PARAMS_PARAM_PFVF_ISCSI_END = 0x0C,
  1124. FW_PARAMS_PARAM_PFVF_STAG_START = 0x0D,
  1125. FW_PARAMS_PARAM_PFVF_STAG_END = 0x0E,
  1126. FW_PARAMS_PARAM_PFVF_RQ_START = 0x1F,
  1127. FW_PARAMS_PARAM_PFVF_RQ_END = 0x10,
  1128. FW_PARAMS_PARAM_PFVF_PBL_START = 0x11,
  1129. FW_PARAMS_PARAM_PFVF_PBL_END = 0x12,
  1130. FW_PARAMS_PARAM_PFVF_L2T_START = 0x13,
  1131. FW_PARAMS_PARAM_PFVF_L2T_END = 0x14,
  1132. FW_PARAMS_PARAM_PFVF_SQRQ_START = 0x15,
  1133. FW_PARAMS_PARAM_PFVF_SQRQ_END = 0x16,
  1134. FW_PARAMS_PARAM_PFVF_CQ_START = 0x17,
  1135. FW_PARAMS_PARAM_PFVF_CQ_END = 0x18,
  1136. FW_PARAMS_PARAM_PFVF_SRQ_START = 0x19,
  1137. FW_PARAMS_PARAM_PFVF_SRQ_END = 0x1A,
  1138. FW_PARAMS_PARAM_PFVF_SCHEDCLASS_ETH = 0x20,
  1139. FW_PARAMS_PARAM_PFVF_VIID = 0x24,
  1140. FW_PARAMS_PARAM_PFVF_CPMASK = 0x25,
  1141. FW_PARAMS_PARAM_PFVF_OCQ_START = 0x26,
  1142. FW_PARAMS_PARAM_PFVF_OCQ_END = 0x27,
  1143. FW_PARAMS_PARAM_PFVF_CONM_MAP = 0x28,
  1144. FW_PARAMS_PARAM_PFVF_IQFLINT_START = 0x29,
  1145. FW_PARAMS_PARAM_PFVF_IQFLINT_END = 0x2A,
  1146. FW_PARAMS_PARAM_PFVF_EQ_START = 0x2B,
  1147. FW_PARAMS_PARAM_PFVF_EQ_END = 0x2C,
  1148. FW_PARAMS_PARAM_PFVF_ACTIVE_FILTER_START = 0x2D,
  1149. FW_PARAMS_PARAM_PFVF_ACTIVE_FILTER_END = 0x2E,
  1150. FW_PARAMS_PARAM_PFVF_ETHOFLD_START = 0x2F,
  1151. FW_PARAMS_PARAM_PFVF_ETHOFLD_END = 0x30,
  1152. FW_PARAMS_PARAM_PFVF_CPLFW4MSG_ENCAP = 0x31,
  1153. FW_PARAMS_PARAM_PFVF_HPFILTER_START = 0x32,
  1154. FW_PARAMS_PARAM_PFVF_HPFILTER_END = 0x33,
  1155. FW_PARAMS_PARAM_PFVF_TLS_START = 0x34,
  1156. FW_PARAMS_PARAM_PFVF_TLS_END = 0x35,
  1157. FW_PARAMS_PARAM_PFVF_RAWF_START = 0x36,
  1158. FW_PARAMS_PARAM_PFVF_RAWF_END = 0x37,
  1159. FW_PARAMS_PARAM_PFVF_NCRYPTO_LOOKASIDE = 0x39,
  1160. FW_PARAMS_PARAM_PFVF_PORT_CAPS32 = 0x3A,
  1161. };
  1162. /*
  1163. * dma queue parameters
  1164. */
  1165. enum fw_params_param_dmaq {
  1166. FW_PARAMS_PARAM_DMAQ_IQ_DCAEN_DCACPU = 0x00,
  1167. FW_PARAMS_PARAM_DMAQ_IQ_INTCNTTHRESH = 0x01,
  1168. FW_PARAMS_PARAM_DMAQ_EQ_CMPLIQID_MNGT = 0x10,
  1169. FW_PARAMS_PARAM_DMAQ_EQ_CMPLIQID_CTRL = 0x11,
  1170. FW_PARAMS_PARAM_DMAQ_EQ_SCHEDCLASS_ETH = 0x12,
  1171. FW_PARAMS_PARAM_DMAQ_EQ_DCBPRIO_ETH = 0x13,
  1172. FW_PARAMS_PARAM_DMAQ_CONM_CTXT = 0x20,
  1173. };
  1174. enum fw_params_param_dev_phyfw {
  1175. FW_PARAMS_PARAM_DEV_PHYFW_DOWNLOAD = 0x00,
  1176. FW_PARAMS_PARAM_DEV_PHYFW_VERSION = 0x01,
  1177. };
  1178. enum fw_params_param_dev_diag {
  1179. FW_PARAM_DEV_DIAG_TMP = 0x00,
  1180. FW_PARAM_DEV_DIAG_VDD = 0x01,
  1181. };
  1182. enum fw_params_param_dev_fwcache {
  1183. FW_PARAM_DEV_FWCACHE_FLUSH = 0x00,
  1184. FW_PARAM_DEV_FWCACHE_FLUSHINV = 0x01,
  1185. };
  1186. #define FW_PARAMS_MNEM_S 24
  1187. #define FW_PARAMS_MNEM_V(x) ((x) << FW_PARAMS_MNEM_S)
  1188. #define FW_PARAMS_PARAM_X_S 16
  1189. #define FW_PARAMS_PARAM_X_V(x) ((x) << FW_PARAMS_PARAM_X_S)
  1190. #define FW_PARAMS_PARAM_Y_S 8
  1191. #define FW_PARAMS_PARAM_Y_M 0xffU
  1192. #define FW_PARAMS_PARAM_Y_V(x) ((x) << FW_PARAMS_PARAM_Y_S)
  1193. #define FW_PARAMS_PARAM_Y_G(x) (((x) >> FW_PARAMS_PARAM_Y_S) &\
  1194. FW_PARAMS_PARAM_Y_M)
  1195. #define FW_PARAMS_PARAM_Z_S 0
  1196. #define FW_PARAMS_PARAM_Z_M 0xffu
  1197. #define FW_PARAMS_PARAM_Z_V(x) ((x) << FW_PARAMS_PARAM_Z_S)
  1198. #define FW_PARAMS_PARAM_Z_G(x) (((x) >> FW_PARAMS_PARAM_Z_S) &\
  1199. FW_PARAMS_PARAM_Z_M)
  1200. #define FW_PARAMS_PARAM_XYZ_S 0
  1201. #define FW_PARAMS_PARAM_XYZ_V(x) ((x) << FW_PARAMS_PARAM_XYZ_S)
  1202. #define FW_PARAMS_PARAM_YZ_S 0
  1203. #define FW_PARAMS_PARAM_YZ_V(x) ((x) << FW_PARAMS_PARAM_YZ_S)
  1204. struct fw_params_cmd {
  1205. __be32 op_to_vfn;
  1206. __be32 retval_len16;
  1207. struct fw_params_param {
  1208. __be32 mnem;
  1209. __be32 val;
  1210. } param[7];
  1211. };
  1212. #define FW_PARAMS_CMD_PFN_S 8
  1213. #define FW_PARAMS_CMD_PFN_V(x) ((x) << FW_PARAMS_CMD_PFN_S)
  1214. #define FW_PARAMS_CMD_VFN_S 0
  1215. #define FW_PARAMS_CMD_VFN_V(x) ((x) << FW_PARAMS_CMD_VFN_S)
  1216. struct fw_pfvf_cmd {
  1217. __be32 op_to_vfn;
  1218. __be32 retval_len16;
  1219. __be32 niqflint_niq;
  1220. __be32 type_to_neq;
  1221. __be32 tc_to_nexactf;
  1222. __be32 r_caps_to_nethctrl;
  1223. __be16 nricq;
  1224. __be16 nriqp;
  1225. __be32 r4;
  1226. };
  1227. #define FW_PFVF_CMD_PFN_S 8
  1228. #define FW_PFVF_CMD_PFN_V(x) ((x) << FW_PFVF_CMD_PFN_S)
  1229. #define FW_PFVF_CMD_VFN_S 0
  1230. #define FW_PFVF_CMD_VFN_V(x) ((x) << FW_PFVF_CMD_VFN_S)
  1231. #define FW_PFVF_CMD_NIQFLINT_S 20
  1232. #define FW_PFVF_CMD_NIQFLINT_M 0xfff
  1233. #define FW_PFVF_CMD_NIQFLINT_V(x) ((x) << FW_PFVF_CMD_NIQFLINT_S)
  1234. #define FW_PFVF_CMD_NIQFLINT_G(x) \
  1235. (((x) >> FW_PFVF_CMD_NIQFLINT_S) & FW_PFVF_CMD_NIQFLINT_M)
  1236. #define FW_PFVF_CMD_NIQ_S 0
  1237. #define FW_PFVF_CMD_NIQ_M 0xfffff
  1238. #define FW_PFVF_CMD_NIQ_V(x) ((x) << FW_PFVF_CMD_NIQ_S)
  1239. #define FW_PFVF_CMD_NIQ_G(x) \
  1240. (((x) >> FW_PFVF_CMD_NIQ_S) & FW_PFVF_CMD_NIQ_M)
  1241. #define FW_PFVF_CMD_TYPE_S 31
  1242. #define FW_PFVF_CMD_TYPE_M 0x1
  1243. #define FW_PFVF_CMD_TYPE_V(x) ((x) << FW_PFVF_CMD_TYPE_S)
  1244. #define FW_PFVF_CMD_TYPE_G(x) \
  1245. (((x) >> FW_PFVF_CMD_TYPE_S) & FW_PFVF_CMD_TYPE_M)
  1246. #define FW_PFVF_CMD_TYPE_F FW_PFVF_CMD_TYPE_V(1U)
  1247. #define FW_PFVF_CMD_CMASK_S 24
  1248. #define FW_PFVF_CMD_CMASK_M 0xf
  1249. #define FW_PFVF_CMD_CMASK_V(x) ((x) << FW_PFVF_CMD_CMASK_S)
  1250. #define FW_PFVF_CMD_CMASK_G(x) \
  1251. (((x) >> FW_PFVF_CMD_CMASK_S) & FW_PFVF_CMD_CMASK_M)
  1252. #define FW_PFVF_CMD_PMASK_S 20
  1253. #define FW_PFVF_CMD_PMASK_M 0xf
  1254. #define FW_PFVF_CMD_PMASK_V(x) ((x) << FW_PFVF_CMD_PMASK_S)
  1255. #define FW_PFVF_CMD_PMASK_G(x) \
  1256. (((x) >> FW_PFVF_CMD_PMASK_S) & FW_PFVF_CMD_PMASK_M)
  1257. #define FW_PFVF_CMD_NEQ_S 0
  1258. #define FW_PFVF_CMD_NEQ_M 0xfffff
  1259. #define FW_PFVF_CMD_NEQ_V(x) ((x) << FW_PFVF_CMD_NEQ_S)
  1260. #define FW_PFVF_CMD_NEQ_G(x) \
  1261. (((x) >> FW_PFVF_CMD_NEQ_S) & FW_PFVF_CMD_NEQ_M)
  1262. #define FW_PFVF_CMD_TC_S 24
  1263. #define FW_PFVF_CMD_TC_M 0xff
  1264. #define FW_PFVF_CMD_TC_V(x) ((x) << FW_PFVF_CMD_TC_S)
  1265. #define FW_PFVF_CMD_TC_G(x) (((x) >> FW_PFVF_CMD_TC_S) & FW_PFVF_CMD_TC_M)
  1266. #define FW_PFVF_CMD_NVI_S 16
  1267. #define FW_PFVF_CMD_NVI_M 0xff
  1268. #define FW_PFVF_CMD_NVI_V(x) ((x) << FW_PFVF_CMD_NVI_S)
  1269. #define FW_PFVF_CMD_NVI_G(x) (((x) >> FW_PFVF_CMD_NVI_S) & FW_PFVF_CMD_NVI_M)
  1270. #define FW_PFVF_CMD_NEXACTF_S 0
  1271. #define FW_PFVF_CMD_NEXACTF_M 0xffff
  1272. #define FW_PFVF_CMD_NEXACTF_V(x) ((x) << FW_PFVF_CMD_NEXACTF_S)
  1273. #define FW_PFVF_CMD_NEXACTF_G(x) \
  1274. (((x) >> FW_PFVF_CMD_NEXACTF_S) & FW_PFVF_CMD_NEXACTF_M)
  1275. #define FW_PFVF_CMD_R_CAPS_S 24
  1276. #define FW_PFVF_CMD_R_CAPS_M 0xff
  1277. #define FW_PFVF_CMD_R_CAPS_V(x) ((x) << FW_PFVF_CMD_R_CAPS_S)
  1278. #define FW_PFVF_CMD_R_CAPS_G(x) \
  1279. (((x) >> FW_PFVF_CMD_R_CAPS_S) & FW_PFVF_CMD_R_CAPS_M)
  1280. #define FW_PFVF_CMD_WX_CAPS_S 16
  1281. #define FW_PFVF_CMD_WX_CAPS_M 0xff
  1282. #define FW_PFVF_CMD_WX_CAPS_V(x) ((x) << FW_PFVF_CMD_WX_CAPS_S)
  1283. #define FW_PFVF_CMD_WX_CAPS_G(x) \
  1284. (((x) >> FW_PFVF_CMD_WX_CAPS_S) & FW_PFVF_CMD_WX_CAPS_M)
  1285. #define FW_PFVF_CMD_NETHCTRL_S 0
  1286. #define FW_PFVF_CMD_NETHCTRL_M 0xffff
  1287. #define FW_PFVF_CMD_NETHCTRL_V(x) ((x) << FW_PFVF_CMD_NETHCTRL_S)
  1288. #define FW_PFVF_CMD_NETHCTRL_G(x) \
  1289. (((x) >> FW_PFVF_CMD_NETHCTRL_S) & FW_PFVF_CMD_NETHCTRL_M)
  1290. enum fw_iq_type {
  1291. FW_IQ_TYPE_FL_INT_CAP,
  1292. FW_IQ_TYPE_NO_FL_INT_CAP
  1293. };
  1294. enum fw_iq_iqtype {
  1295. FW_IQ_IQTYPE_OTHER,
  1296. FW_IQ_IQTYPE_NIC,
  1297. FW_IQ_IQTYPE_OFLD,
  1298. };
  1299. struct fw_iq_cmd {
  1300. __be32 op_to_vfn;
  1301. __be32 alloc_to_len16;
  1302. __be16 physiqid;
  1303. __be16 iqid;
  1304. __be16 fl0id;
  1305. __be16 fl1id;
  1306. __be32 type_to_iqandstindex;
  1307. __be16 iqdroprss_to_iqesize;
  1308. __be16 iqsize;
  1309. __be64 iqaddr;
  1310. __be32 iqns_to_fl0congen;
  1311. __be16 fl0dcaen_to_fl0cidxfthresh;
  1312. __be16 fl0size;
  1313. __be64 fl0addr;
  1314. __be32 fl1cngchmap_to_fl1congen;
  1315. __be16 fl1dcaen_to_fl1cidxfthresh;
  1316. __be16 fl1size;
  1317. __be64 fl1addr;
  1318. };
  1319. #define FW_IQ_CMD_PFN_S 8
  1320. #define FW_IQ_CMD_PFN_V(x) ((x) << FW_IQ_CMD_PFN_S)
  1321. #define FW_IQ_CMD_VFN_S 0
  1322. #define FW_IQ_CMD_VFN_V(x) ((x) << FW_IQ_CMD_VFN_S)
  1323. #define FW_IQ_CMD_ALLOC_S 31
  1324. #define FW_IQ_CMD_ALLOC_V(x) ((x) << FW_IQ_CMD_ALLOC_S)
  1325. #define FW_IQ_CMD_ALLOC_F FW_IQ_CMD_ALLOC_V(1U)
  1326. #define FW_IQ_CMD_FREE_S 30
  1327. #define FW_IQ_CMD_FREE_V(x) ((x) << FW_IQ_CMD_FREE_S)
  1328. #define FW_IQ_CMD_FREE_F FW_IQ_CMD_FREE_V(1U)
  1329. #define FW_IQ_CMD_MODIFY_S 29
  1330. #define FW_IQ_CMD_MODIFY_V(x) ((x) << FW_IQ_CMD_MODIFY_S)
  1331. #define FW_IQ_CMD_MODIFY_F FW_IQ_CMD_MODIFY_V(1U)
  1332. #define FW_IQ_CMD_IQSTART_S 28
  1333. #define FW_IQ_CMD_IQSTART_V(x) ((x) << FW_IQ_CMD_IQSTART_S)
  1334. #define FW_IQ_CMD_IQSTART_F FW_IQ_CMD_IQSTART_V(1U)
  1335. #define FW_IQ_CMD_IQSTOP_S 27
  1336. #define FW_IQ_CMD_IQSTOP_V(x) ((x) << FW_IQ_CMD_IQSTOP_S)
  1337. #define FW_IQ_CMD_IQSTOP_F FW_IQ_CMD_IQSTOP_V(1U)
  1338. #define FW_IQ_CMD_TYPE_S 29
  1339. #define FW_IQ_CMD_TYPE_V(x) ((x) << FW_IQ_CMD_TYPE_S)
  1340. #define FW_IQ_CMD_IQASYNCH_S 28
  1341. #define FW_IQ_CMD_IQASYNCH_V(x) ((x) << FW_IQ_CMD_IQASYNCH_S)
  1342. #define FW_IQ_CMD_VIID_S 16
  1343. #define FW_IQ_CMD_VIID_V(x) ((x) << FW_IQ_CMD_VIID_S)
  1344. #define FW_IQ_CMD_IQANDST_S 15
  1345. #define FW_IQ_CMD_IQANDST_V(x) ((x) << FW_IQ_CMD_IQANDST_S)
  1346. #define FW_IQ_CMD_IQANUS_S 14
  1347. #define FW_IQ_CMD_IQANUS_V(x) ((x) << FW_IQ_CMD_IQANUS_S)
  1348. #define FW_IQ_CMD_IQANUD_S 12
  1349. #define FW_IQ_CMD_IQANUD_V(x) ((x) << FW_IQ_CMD_IQANUD_S)
  1350. #define FW_IQ_CMD_IQANDSTINDEX_S 0
  1351. #define FW_IQ_CMD_IQANDSTINDEX_V(x) ((x) << FW_IQ_CMD_IQANDSTINDEX_S)
  1352. #define FW_IQ_CMD_IQDROPRSS_S 15
  1353. #define FW_IQ_CMD_IQDROPRSS_V(x) ((x) << FW_IQ_CMD_IQDROPRSS_S)
  1354. #define FW_IQ_CMD_IQDROPRSS_F FW_IQ_CMD_IQDROPRSS_V(1U)
  1355. #define FW_IQ_CMD_IQGTSMODE_S 14
  1356. #define FW_IQ_CMD_IQGTSMODE_V(x) ((x) << FW_IQ_CMD_IQGTSMODE_S)
  1357. #define FW_IQ_CMD_IQGTSMODE_F FW_IQ_CMD_IQGTSMODE_V(1U)
  1358. #define FW_IQ_CMD_IQPCIECH_S 12
  1359. #define FW_IQ_CMD_IQPCIECH_V(x) ((x) << FW_IQ_CMD_IQPCIECH_S)
  1360. #define FW_IQ_CMD_IQDCAEN_S 11
  1361. #define FW_IQ_CMD_IQDCAEN_V(x) ((x) << FW_IQ_CMD_IQDCAEN_S)
  1362. #define FW_IQ_CMD_IQDCACPU_S 6
  1363. #define FW_IQ_CMD_IQDCACPU_V(x) ((x) << FW_IQ_CMD_IQDCACPU_S)
  1364. #define FW_IQ_CMD_IQINTCNTTHRESH_S 4
  1365. #define FW_IQ_CMD_IQINTCNTTHRESH_V(x) ((x) << FW_IQ_CMD_IQINTCNTTHRESH_S)
  1366. #define FW_IQ_CMD_IQO_S 3
  1367. #define FW_IQ_CMD_IQO_V(x) ((x) << FW_IQ_CMD_IQO_S)
  1368. #define FW_IQ_CMD_IQO_F FW_IQ_CMD_IQO_V(1U)
  1369. #define FW_IQ_CMD_IQCPRIO_S 2
  1370. #define FW_IQ_CMD_IQCPRIO_V(x) ((x) << FW_IQ_CMD_IQCPRIO_S)
  1371. #define FW_IQ_CMD_IQESIZE_S 0
  1372. #define FW_IQ_CMD_IQESIZE_V(x) ((x) << FW_IQ_CMD_IQESIZE_S)
  1373. #define FW_IQ_CMD_IQNS_S 31
  1374. #define FW_IQ_CMD_IQNS_V(x) ((x) << FW_IQ_CMD_IQNS_S)
  1375. #define FW_IQ_CMD_IQRO_S 30
  1376. #define FW_IQ_CMD_IQRO_V(x) ((x) << FW_IQ_CMD_IQRO_S)
  1377. #define FW_IQ_CMD_IQFLINTIQHSEN_S 28
  1378. #define FW_IQ_CMD_IQFLINTIQHSEN_V(x) ((x) << FW_IQ_CMD_IQFLINTIQHSEN_S)
  1379. #define FW_IQ_CMD_IQFLINTCONGEN_S 27
  1380. #define FW_IQ_CMD_IQFLINTCONGEN_V(x) ((x) << FW_IQ_CMD_IQFLINTCONGEN_S)
  1381. #define FW_IQ_CMD_IQFLINTCONGEN_F FW_IQ_CMD_IQFLINTCONGEN_V(1U)
  1382. #define FW_IQ_CMD_IQFLINTISCSIC_S 26
  1383. #define FW_IQ_CMD_IQFLINTISCSIC_V(x) ((x) << FW_IQ_CMD_IQFLINTISCSIC_S)
  1384. #define FW_IQ_CMD_IQTYPE_S 24
  1385. #define FW_IQ_CMD_IQTYPE_M 0x3
  1386. #define FW_IQ_CMD_IQTYPE_V(x) ((x) << FW_IQ_CMD_IQTYPE_S)
  1387. #define FW_IQ_CMD_IQTYPE_G(x) \
  1388. (((x) >> FW_IQ_CMD_IQTYPE_S) & FW_IQ_CMD_IQTYPE_M)
  1389. #define FW_IQ_CMD_FL0CNGCHMAP_S 20
  1390. #define FW_IQ_CMD_FL0CNGCHMAP_V(x) ((x) << FW_IQ_CMD_FL0CNGCHMAP_S)
  1391. #define FW_IQ_CMD_FL0CACHELOCK_S 15
  1392. #define FW_IQ_CMD_FL0CACHELOCK_V(x) ((x) << FW_IQ_CMD_FL0CACHELOCK_S)
  1393. #define FW_IQ_CMD_FL0DBP_S 14
  1394. #define FW_IQ_CMD_FL0DBP_V(x) ((x) << FW_IQ_CMD_FL0DBP_S)
  1395. #define FW_IQ_CMD_FL0DATANS_S 13
  1396. #define FW_IQ_CMD_FL0DATANS_V(x) ((x) << FW_IQ_CMD_FL0DATANS_S)
  1397. #define FW_IQ_CMD_FL0DATARO_S 12
  1398. #define FW_IQ_CMD_FL0DATARO_V(x) ((x) << FW_IQ_CMD_FL0DATARO_S)
  1399. #define FW_IQ_CMD_FL0DATARO_F FW_IQ_CMD_FL0DATARO_V(1U)
  1400. #define FW_IQ_CMD_FL0CONGCIF_S 11
  1401. #define FW_IQ_CMD_FL0CONGCIF_V(x) ((x) << FW_IQ_CMD_FL0CONGCIF_S)
  1402. #define FW_IQ_CMD_FL0CONGCIF_F FW_IQ_CMD_FL0CONGCIF_V(1U)
  1403. #define FW_IQ_CMD_FL0ONCHIP_S 10
  1404. #define FW_IQ_CMD_FL0ONCHIP_V(x) ((x) << FW_IQ_CMD_FL0ONCHIP_S)
  1405. #define FW_IQ_CMD_FL0STATUSPGNS_S 9
  1406. #define FW_IQ_CMD_FL0STATUSPGNS_V(x) ((x) << FW_IQ_CMD_FL0STATUSPGNS_S)
  1407. #define FW_IQ_CMD_FL0STATUSPGRO_S 8
  1408. #define FW_IQ_CMD_FL0STATUSPGRO_V(x) ((x) << FW_IQ_CMD_FL0STATUSPGRO_S)
  1409. #define FW_IQ_CMD_FL0FETCHNS_S 7
  1410. #define FW_IQ_CMD_FL0FETCHNS_V(x) ((x) << FW_IQ_CMD_FL0FETCHNS_S)
  1411. #define FW_IQ_CMD_FL0FETCHRO_S 6
  1412. #define FW_IQ_CMD_FL0FETCHRO_V(x) ((x) << FW_IQ_CMD_FL0FETCHRO_S)
  1413. #define FW_IQ_CMD_FL0FETCHRO_F FW_IQ_CMD_FL0FETCHRO_V(1U)
  1414. #define FW_IQ_CMD_FL0HOSTFCMODE_S 4
  1415. #define FW_IQ_CMD_FL0HOSTFCMODE_V(x) ((x) << FW_IQ_CMD_FL0HOSTFCMODE_S)
  1416. #define FW_IQ_CMD_FL0CPRIO_S 3
  1417. #define FW_IQ_CMD_FL0CPRIO_V(x) ((x) << FW_IQ_CMD_FL0CPRIO_S)
  1418. #define FW_IQ_CMD_FL0PADEN_S 2
  1419. #define FW_IQ_CMD_FL0PADEN_V(x) ((x) << FW_IQ_CMD_FL0PADEN_S)
  1420. #define FW_IQ_CMD_FL0PADEN_F FW_IQ_CMD_FL0PADEN_V(1U)
  1421. #define FW_IQ_CMD_FL0PACKEN_S 1
  1422. #define FW_IQ_CMD_FL0PACKEN_V(x) ((x) << FW_IQ_CMD_FL0PACKEN_S)
  1423. #define FW_IQ_CMD_FL0PACKEN_F FW_IQ_CMD_FL0PACKEN_V(1U)
  1424. #define FW_IQ_CMD_FL0CONGEN_S 0
  1425. #define FW_IQ_CMD_FL0CONGEN_V(x) ((x) << FW_IQ_CMD_FL0CONGEN_S)
  1426. #define FW_IQ_CMD_FL0CONGEN_F FW_IQ_CMD_FL0CONGEN_V(1U)
  1427. #define FW_IQ_CMD_FL0DCAEN_S 15
  1428. #define FW_IQ_CMD_FL0DCAEN_V(x) ((x) << FW_IQ_CMD_FL0DCAEN_S)
  1429. #define FW_IQ_CMD_FL0DCACPU_S 10
  1430. #define FW_IQ_CMD_FL0DCACPU_V(x) ((x) << FW_IQ_CMD_FL0DCACPU_S)
  1431. #define FW_IQ_CMD_FL0FBMIN_S 7
  1432. #define FW_IQ_CMD_FL0FBMIN_V(x) ((x) << FW_IQ_CMD_FL0FBMIN_S)
  1433. #define FW_IQ_CMD_FL0FBMAX_S 4
  1434. #define FW_IQ_CMD_FL0FBMAX_V(x) ((x) << FW_IQ_CMD_FL0FBMAX_S)
  1435. #define FW_IQ_CMD_FL0CIDXFTHRESHO_S 3
  1436. #define FW_IQ_CMD_FL0CIDXFTHRESHO_V(x) ((x) << FW_IQ_CMD_FL0CIDXFTHRESHO_S)
  1437. #define FW_IQ_CMD_FL0CIDXFTHRESHO_F FW_IQ_CMD_FL0CIDXFTHRESHO_V(1U)
  1438. #define FW_IQ_CMD_FL0CIDXFTHRESH_S 0
  1439. #define FW_IQ_CMD_FL0CIDXFTHRESH_V(x) ((x) << FW_IQ_CMD_FL0CIDXFTHRESH_S)
  1440. #define FW_IQ_CMD_FL1CNGCHMAP_S 20
  1441. #define FW_IQ_CMD_FL1CNGCHMAP_V(x) ((x) << FW_IQ_CMD_FL1CNGCHMAP_S)
  1442. #define FW_IQ_CMD_FL1CACHELOCK_S 15
  1443. #define FW_IQ_CMD_FL1CACHELOCK_V(x) ((x) << FW_IQ_CMD_FL1CACHELOCK_S)
  1444. #define FW_IQ_CMD_FL1DBP_S 14
  1445. #define FW_IQ_CMD_FL1DBP_V(x) ((x) << FW_IQ_CMD_FL1DBP_S)
  1446. #define FW_IQ_CMD_FL1DATANS_S 13
  1447. #define FW_IQ_CMD_FL1DATANS_V(x) ((x) << FW_IQ_CMD_FL1DATANS_S)
  1448. #define FW_IQ_CMD_FL1DATARO_S 12
  1449. #define FW_IQ_CMD_FL1DATARO_V(x) ((x) << FW_IQ_CMD_FL1DATARO_S)
  1450. #define FW_IQ_CMD_FL1CONGCIF_S 11
  1451. #define FW_IQ_CMD_FL1CONGCIF_V(x) ((x) << FW_IQ_CMD_FL1CONGCIF_S)
  1452. #define FW_IQ_CMD_FL1ONCHIP_S 10
  1453. #define FW_IQ_CMD_FL1ONCHIP_V(x) ((x) << FW_IQ_CMD_FL1ONCHIP_S)
  1454. #define FW_IQ_CMD_FL1STATUSPGNS_S 9
  1455. #define FW_IQ_CMD_FL1STATUSPGNS_V(x) ((x) << FW_IQ_CMD_FL1STATUSPGNS_S)
  1456. #define FW_IQ_CMD_FL1STATUSPGRO_S 8
  1457. #define FW_IQ_CMD_FL1STATUSPGRO_V(x) ((x) << FW_IQ_CMD_FL1STATUSPGRO_S)
  1458. #define FW_IQ_CMD_FL1FETCHNS_S 7
  1459. #define FW_IQ_CMD_FL1FETCHNS_V(x) ((x) << FW_IQ_CMD_FL1FETCHNS_S)
  1460. #define FW_IQ_CMD_FL1FETCHRO_S 6
  1461. #define FW_IQ_CMD_FL1FETCHRO_V(x) ((x) << FW_IQ_CMD_FL1FETCHRO_S)
  1462. #define FW_IQ_CMD_FL1HOSTFCMODE_S 4
  1463. #define FW_IQ_CMD_FL1HOSTFCMODE_V(x) ((x) << FW_IQ_CMD_FL1HOSTFCMODE_S)
  1464. #define FW_IQ_CMD_FL1CPRIO_S 3
  1465. #define FW_IQ_CMD_FL1CPRIO_V(x) ((x) << FW_IQ_CMD_FL1CPRIO_S)
  1466. #define FW_IQ_CMD_FL1PADEN_S 2
  1467. #define FW_IQ_CMD_FL1PADEN_V(x) ((x) << FW_IQ_CMD_FL1PADEN_S)
  1468. #define FW_IQ_CMD_FL1PADEN_F FW_IQ_CMD_FL1PADEN_V(1U)
  1469. #define FW_IQ_CMD_FL1PACKEN_S 1
  1470. #define FW_IQ_CMD_FL1PACKEN_V(x) ((x) << FW_IQ_CMD_FL1PACKEN_S)
  1471. #define FW_IQ_CMD_FL1PACKEN_F FW_IQ_CMD_FL1PACKEN_V(1U)
  1472. #define FW_IQ_CMD_FL1CONGEN_S 0
  1473. #define FW_IQ_CMD_FL1CONGEN_V(x) ((x) << FW_IQ_CMD_FL1CONGEN_S)
  1474. #define FW_IQ_CMD_FL1CONGEN_F FW_IQ_CMD_FL1CONGEN_V(1U)
  1475. #define FW_IQ_CMD_FL1DCAEN_S 15
  1476. #define FW_IQ_CMD_FL1DCAEN_V(x) ((x) << FW_IQ_CMD_FL1DCAEN_S)
  1477. #define FW_IQ_CMD_FL1DCACPU_S 10
  1478. #define FW_IQ_CMD_FL1DCACPU_V(x) ((x) << FW_IQ_CMD_FL1DCACPU_S)
  1479. #define FW_IQ_CMD_FL1FBMIN_S 7
  1480. #define FW_IQ_CMD_FL1FBMIN_V(x) ((x) << FW_IQ_CMD_FL1FBMIN_S)
  1481. #define FW_IQ_CMD_FL1FBMAX_S 4
  1482. #define FW_IQ_CMD_FL1FBMAX_V(x) ((x) << FW_IQ_CMD_FL1FBMAX_S)
  1483. #define FW_IQ_CMD_FL1CIDXFTHRESHO_S 3
  1484. #define FW_IQ_CMD_FL1CIDXFTHRESHO_V(x) ((x) << FW_IQ_CMD_FL1CIDXFTHRESHO_S)
  1485. #define FW_IQ_CMD_FL1CIDXFTHRESHO_F FW_IQ_CMD_FL1CIDXFTHRESHO_V(1U)
  1486. #define FW_IQ_CMD_FL1CIDXFTHRESH_S 0
  1487. #define FW_IQ_CMD_FL1CIDXFTHRESH_V(x) ((x) << FW_IQ_CMD_FL1CIDXFTHRESH_S)
  1488. struct fw_eq_eth_cmd {
  1489. __be32 op_to_vfn;
  1490. __be32 alloc_to_len16;
  1491. __be32 eqid_pkd;
  1492. __be32 physeqid_pkd;
  1493. __be32 fetchszm_to_iqid;
  1494. __be32 dcaen_to_eqsize;
  1495. __be64 eqaddr;
  1496. __be32 viid_pkd;
  1497. __be32 r8_lo;
  1498. __be64 r9;
  1499. };
  1500. #define FW_EQ_ETH_CMD_PFN_S 8
  1501. #define FW_EQ_ETH_CMD_PFN_V(x) ((x) << FW_EQ_ETH_CMD_PFN_S)
  1502. #define FW_EQ_ETH_CMD_VFN_S 0
  1503. #define FW_EQ_ETH_CMD_VFN_V(x) ((x) << FW_EQ_ETH_CMD_VFN_S)
  1504. #define FW_EQ_ETH_CMD_ALLOC_S 31
  1505. #define FW_EQ_ETH_CMD_ALLOC_V(x) ((x) << FW_EQ_ETH_CMD_ALLOC_S)
  1506. #define FW_EQ_ETH_CMD_ALLOC_F FW_EQ_ETH_CMD_ALLOC_V(1U)
  1507. #define FW_EQ_ETH_CMD_FREE_S 30
  1508. #define FW_EQ_ETH_CMD_FREE_V(x) ((x) << FW_EQ_ETH_CMD_FREE_S)
  1509. #define FW_EQ_ETH_CMD_FREE_F FW_EQ_ETH_CMD_FREE_V(1U)
  1510. #define FW_EQ_ETH_CMD_MODIFY_S 29
  1511. #define FW_EQ_ETH_CMD_MODIFY_V(x) ((x) << FW_EQ_ETH_CMD_MODIFY_S)
  1512. #define FW_EQ_ETH_CMD_MODIFY_F FW_EQ_ETH_CMD_MODIFY_V(1U)
  1513. #define FW_EQ_ETH_CMD_EQSTART_S 28
  1514. #define FW_EQ_ETH_CMD_EQSTART_V(x) ((x) << FW_EQ_ETH_CMD_EQSTART_S)
  1515. #define FW_EQ_ETH_CMD_EQSTART_F FW_EQ_ETH_CMD_EQSTART_V(1U)
  1516. #define FW_EQ_ETH_CMD_EQSTOP_S 27
  1517. #define FW_EQ_ETH_CMD_EQSTOP_V(x) ((x) << FW_EQ_ETH_CMD_EQSTOP_S)
  1518. #define FW_EQ_ETH_CMD_EQSTOP_F FW_EQ_ETH_CMD_EQSTOP_V(1U)
  1519. #define FW_EQ_ETH_CMD_EQID_S 0
  1520. #define FW_EQ_ETH_CMD_EQID_M 0xfffff
  1521. #define FW_EQ_ETH_CMD_EQID_V(x) ((x) << FW_EQ_ETH_CMD_EQID_S)
  1522. #define FW_EQ_ETH_CMD_EQID_G(x) \
  1523. (((x) >> FW_EQ_ETH_CMD_EQID_S) & FW_EQ_ETH_CMD_EQID_M)
  1524. #define FW_EQ_ETH_CMD_PHYSEQID_S 0
  1525. #define FW_EQ_ETH_CMD_PHYSEQID_M 0xfffff
  1526. #define FW_EQ_ETH_CMD_PHYSEQID_V(x) ((x) << FW_EQ_ETH_CMD_PHYSEQID_S)
  1527. #define FW_EQ_ETH_CMD_PHYSEQID_G(x) \
  1528. (((x) >> FW_EQ_ETH_CMD_PHYSEQID_S) & FW_EQ_ETH_CMD_PHYSEQID_M)
  1529. #define FW_EQ_ETH_CMD_FETCHSZM_S 26
  1530. #define FW_EQ_ETH_CMD_FETCHSZM_V(x) ((x) << FW_EQ_ETH_CMD_FETCHSZM_S)
  1531. #define FW_EQ_ETH_CMD_FETCHSZM_F FW_EQ_ETH_CMD_FETCHSZM_V(1U)
  1532. #define FW_EQ_ETH_CMD_STATUSPGNS_S 25
  1533. #define FW_EQ_ETH_CMD_STATUSPGNS_V(x) ((x) << FW_EQ_ETH_CMD_STATUSPGNS_S)
  1534. #define FW_EQ_ETH_CMD_STATUSPGRO_S 24
  1535. #define FW_EQ_ETH_CMD_STATUSPGRO_V(x) ((x) << FW_EQ_ETH_CMD_STATUSPGRO_S)
  1536. #define FW_EQ_ETH_CMD_FETCHNS_S 23
  1537. #define FW_EQ_ETH_CMD_FETCHNS_V(x) ((x) << FW_EQ_ETH_CMD_FETCHNS_S)
  1538. #define FW_EQ_ETH_CMD_FETCHRO_S 22
  1539. #define FW_EQ_ETH_CMD_FETCHRO_V(x) ((x) << FW_EQ_ETH_CMD_FETCHRO_S)
  1540. #define FW_EQ_ETH_CMD_FETCHRO_F FW_EQ_ETH_CMD_FETCHRO_V(1U)
  1541. #define FW_EQ_ETH_CMD_HOSTFCMODE_S 20
  1542. #define FW_EQ_ETH_CMD_HOSTFCMODE_V(x) ((x) << FW_EQ_ETH_CMD_HOSTFCMODE_S)
  1543. #define FW_EQ_ETH_CMD_CPRIO_S 19
  1544. #define FW_EQ_ETH_CMD_CPRIO_V(x) ((x) << FW_EQ_ETH_CMD_CPRIO_S)
  1545. #define FW_EQ_ETH_CMD_ONCHIP_S 18
  1546. #define FW_EQ_ETH_CMD_ONCHIP_V(x) ((x) << FW_EQ_ETH_CMD_ONCHIP_S)
  1547. #define FW_EQ_ETH_CMD_PCIECHN_S 16
  1548. #define FW_EQ_ETH_CMD_PCIECHN_V(x) ((x) << FW_EQ_ETH_CMD_PCIECHN_S)
  1549. #define FW_EQ_ETH_CMD_IQID_S 0
  1550. #define FW_EQ_ETH_CMD_IQID_V(x) ((x) << FW_EQ_ETH_CMD_IQID_S)
  1551. #define FW_EQ_ETH_CMD_DCAEN_S 31
  1552. #define FW_EQ_ETH_CMD_DCAEN_V(x) ((x) << FW_EQ_ETH_CMD_DCAEN_S)
  1553. #define FW_EQ_ETH_CMD_DCACPU_S 26
  1554. #define FW_EQ_ETH_CMD_DCACPU_V(x) ((x) << FW_EQ_ETH_CMD_DCACPU_S)
  1555. #define FW_EQ_ETH_CMD_FBMIN_S 23
  1556. #define FW_EQ_ETH_CMD_FBMIN_V(x) ((x) << FW_EQ_ETH_CMD_FBMIN_S)
  1557. #define FW_EQ_ETH_CMD_FBMAX_S 20
  1558. #define FW_EQ_ETH_CMD_FBMAX_V(x) ((x) << FW_EQ_ETH_CMD_FBMAX_S)
  1559. #define FW_EQ_ETH_CMD_CIDXFTHRESHO_S 19
  1560. #define FW_EQ_ETH_CMD_CIDXFTHRESHO_V(x) ((x) << FW_EQ_ETH_CMD_CIDXFTHRESHO_S)
  1561. #define FW_EQ_ETH_CMD_CIDXFTHRESH_S 16
  1562. #define FW_EQ_ETH_CMD_CIDXFTHRESH_V(x) ((x) << FW_EQ_ETH_CMD_CIDXFTHRESH_S)
  1563. #define FW_EQ_ETH_CMD_EQSIZE_S 0
  1564. #define FW_EQ_ETH_CMD_EQSIZE_V(x) ((x) << FW_EQ_ETH_CMD_EQSIZE_S)
  1565. #define FW_EQ_ETH_CMD_AUTOEQUEQE_S 30
  1566. #define FW_EQ_ETH_CMD_AUTOEQUEQE_V(x) ((x) << FW_EQ_ETH_CMD_AUTOEQUEQE_S)
  1567. #define FW_EQ_ETH_CMD_AUTOEQUEQE_F FW_EQ_ETH_CMD_AUTOEQUEQE_V(1U)
  1568. #define FW_EQ_ETH_CMD_VIID_S 16
  1569. #define FW_EQ_ETH_CMD_VIID_V(x) ((x) << FW_EQ_ETH_CMD_VIID_S)
  1570. struct fw_eq_ctrl_cmd {
  1571. __be32 op_to_vfn;
  1572. __be32 alloc_to_len16;
  1573. __be32 cmpliqid_eqid;
  1574. __be32 physeqid_pkd;
  1575. __be32 fetchszm_to_iqid;
  1576. __be32 dcaen_to_eqsize;
  1577. __be64 eqaddr;
  1578. };
  1579. #define FW_EQ_CTRL_CMD_PFN_S 8
  1580. #define FW_EQ_CTRL_CMD_PFN_V(x) ((x) << FW_EQ_CTRL_CMD_PFN_S)
  1581. #define FW_EQ_CTRL_CMD_VFN_S 0
  1582. #define FW_EQ_CTRL_CMD_VFN_V(x) ((x) << FW_EQ_CTRL_CMD_VFN_S)
  1583. #define FW_EQ_CTRL_CMD_ALLOC_S 31
  1584. #define FW_EQ_CTRL_CMD_ALLOC_V(x) ((x) << FW_EQ_CTRL_CMD_ALLOC_S)
  1585. #define FW_EQ_CTRL_CMD_ALLOC_F FW_EQ_CTRL_CMD_ALLOC_V(1U)
  1586. #define FW_EQ_CTRL_CMD_FREE_S 30
  1587. #define FW_EQ_CTRL_CMD_FREE_V(x) ((x) << FW_EQ_CTRL_CMD_FREE_S)
  1588. #define FW_EQ_CTRL_CMD_FREE_F FW_EQ_CTRL_CMD_FREE_V(1U)
  1589. #define FW_EQ_CTRL_CMD_MODIFY_S 29
  1590. #define FW_EQ_CTRL_CMD_MODIFY_V(x) ((x) << FW_EQ_CTRL_CMD_MODIFY_S)
  1591. #define FW_EQ_CTRL_CMD_MODIFY_F FW_EQ_CTRL_CMD_MODIFY_V(1U)
  1592. #define FW_EQ_CTRL_CMD_EQSTART_S 28
  1593. #define FW_EQ_CTRL_CMD_EQSTART_V(x) ((x) << FW_EQ_CTRL_CMD_EQSTART_S)
  1594. #define FW_EQ_CTRL_CMD_EQSTART_F FW_EQ_CTRL_CMD_EQSTART_V(1U)
  1595. #define FW_EQ_CTRL_CMD_EQSTOP_S 27
  1596. #define FW_EQ_CTRL_CMD_EQSTOP_V(x) ((x) << FW_EQ_CTRL_CMD_EQSTOP_S)
  1597. #define FW_EQ_CTRL_CMD_EQSTOP_F FW_EQ_CTRL_CMD_EQSTOP_V(1U)
  1598. #define FW_EQ_CTRL_CMD_CMPLIQID_S 20
  1599. #define FW_EQ_CTRL_CMD_CMPLIQID_V(x) ((x) << FW_EQ_CTRL_CMD_CMPLIQID_S)
  1600. #define FW_EQ_CTRL_CMD_EQID_S 0
  1601. #define FW_EQ_CTRL_CMD_EQID_M 0xfffff
  1602. #define FW_EQ_CTRL_CMD_EQID_V(x) ((x) << FW_EQ_CTRL_CMD_EQID_S)
  1603. #define FW_EQ_CTRL_CMD_EQID_G(x) \
  1604. (((x) >> FW_EQ_CTRL_CMD_EQID_S) & FW_EQ_CTRL_CMD_EQID_M)
  1605. #define FW_EQ_CTRL_CMD_PHYSEQID_S 0
  1606. #define FW_EQ_CTRL_CMD_PHYSEQID_M 0xfffff
  1607. #define FW_EQ_CTRL_CMD_PHYSEQID_G(x) \
  1608. (((x) >> FW_EQ_CTRL_CMD_PHYSEQID_S) & FW_EQ_CTRL_CMD_PHYSEQID_M)
  1609. #define FW_EQ_CTRL_CMD_FETCHSZM_S 26
  1610. #define FW_EQ_CTRL_CMD_FETCHSZM_V(x) ((x) << FW_EQ_CTRL_CMD_FETCHSZM_S)
  1611. #define FW_EQ_CTRL_CMD_FETCHSZM_F FW_EQ_CTRL_CMD_FETCHSZM_V(1U)
  1612. #define FW_EQ_CTRL_CMD_STATUSPGNS_S 25
  1613. #define FW_EQ_CTRL_CMD_STATUSPGNS_V(x) ((x) << FW_EQ_CTRL_CMD_STATUSPGNS_S)
  1614. #define FW_EQ_CTRL_CMD_STATUSPGNS_F FW_EQ_CTRL_CMD_STATUSPGNS_V(1U)
  1615. #define FW_EQ_CTRL_CMD_STATUSPGRO_S 24
  1616. #define FW_EQ_CTRL_CMD_STATUSPGRO_V(x) ((x) << FW_EQ_CTRL_CMD_STATUSPGRO_S)
  1617. #define FW_EQ_CTRL_CMD_STATUSPGRO_F FW_EQ_CTRL_CMD_STATUSPGRO_V(1U)
  1618. #define FW_EQ_CTRL_CMD_FETCHNS_S 23
  1619. #define FW_EQ_CTRL_CMD_FETCHNS_V(x) ((x) << FW_EQ_CTRL_CMD_FETCHNS_S)
  1620. #define FW_EQ_CTRL_CMD_FETCHNS_F FW_EQ_CTRL_CMD_FETCHNS_V(1U)
  1621. #define FW_EQ_CTRL_CMD_FETCHRO_S 22
  1622. #define FW_EQ_CTRL_CMD_FETCHRO_V(x) ((x) << FW_EQ_CTRL_CMD_FETCHRO_S)
  1623. #define FW_EQ_CTRL_CMD_FETCHRO_F FW_EQ_CTRL_CMD_FETCHRO_V(1U)
  1624. #define FW_EQ_CTRL_CMD_HOSTFCMODE_S 20
  1625. #define FW_EQ_CTRL_CMD_HOSTFCMODE_V(x) ((x) << FW_EQ_CTRL_CMD_HOSTFCMODE_S)
  1626. #define FW_EQ_CTRL_CMD_CPRIO_S 19
  1627. #define FW_EQ_CTRL_CMD_CPRIO_V(x) ((x) << FW_EQ_CTRL_CMD_CPRIO_S)
  1628. #define FW_EQ_CTRL_CMD_ONCHIP_S 18
  1629. #define FW_EQ_CTRL_CMD_ONCHIP_V(x) ((x) << FW_EQ_CTRL_CMD_ONCHIP_S)
  1630. #define FW_EQ_CTRL_CMD_PCIECHN_S 16
  1631. #define FW_EQ_CTRL_CMD_PCIECHN_V(x) ((x) << FW_EQ_CTRL_CMD_PCIECHN_S)
  1632. #define FW_EQ_CTRL_CMD_IQID_S 0
  1633. #define FW_EQ_CTRL_CMD_IQID_V(x) ((x) << FW_EQ_CTRL_CMD_IQID_S)
  1634. #define FW_EQ_CTRL_CMD_DCAEN_S 31
  1635. #define FW_EQ_CTRL_CMD_DCAEN_V(x) ((x) << FW_EQ_CTRL_CMD_DCAEN_S)
  1636. #define FW_EQ_CTRL_CMD_DCACPU_S 26
  1637. #define FW_EQ_CTRL_CMD_DCACPU_V(x) ((x) << FW_EQ_CTRL_CMD_DCACPU_S)
  1638. #define FW_EQ_CTRL_CMD_FBMIN_S 23
  1639. #define FW_EQ_CTRL_CMD_FBMIN_V(x) ((x) << FW_EQ_CTRL_CMD_FBMIN_S)
  1640. #define FW_EQ_CTRL_CMD_FBMAX_S 20
  1641. #define FW_EQ_CTRL_CMD_FBMAX_V(x) ((x) << FW_EQ_CTRL_CMD_FBMAX_S)
  1642. #define FW_EQ_CTRL_CMD_CIDXFTHRESHO_S 19
  1643. #define FW_EQ_CTRL_CMD_CIDXFTHRESHO_V(x) \
  1644. ((x) << FW_EQ_CTRL_CMD_CIDXFTHRESHO_S)
  1645. #define FW_EQ_CTRL_CMD_CIDXFTHRESH_S 16
  1646. #define FW_EQ_CTRL_CMD_CIDXFTHRESH_V(x) ((x) << FW_EQ_CTRL_CMD_CIDXFTHRESH_S)
  1647. #define FW_EQ_CTRL_CMD_EQSIZE_S 0
  1648. #define FW_EQ_CTRL_CMD_EQSIZE_V(x) ((x) << FW_EQ_CTRL_CMD_EQSIZE_S)
  1649. struct fw_eq_ofld_cmd {
  1650. __be32 op_to_vfn;
  1651. __be32 alloc_to_len16;
  1652. __be32 eqid_pkd;
  1653. __be32 physeqid_pkd;
  1654. __be32 fetchszm_to_iqid;
  1655. __be32 dcaen_to_eqsize;
  1656. __be64 eqaddr;
  1657. };
  1658. #define FW_EQ_OFLD_CMD_PFN_S 8
  1659. #define FW_EQ_OFLD_CMD_PFN_V(x) ((x) << FW_EQ_OFLD_CMD_PFN_S)
  1660. #define FW_EQ_OFLD_CMD_VFN_S 0
  1661. #define FW_EQ_OFLD_CMD_VFN_V(x) ((x) << FW_EQ_OFLD_CMD_VFN_S)
  1662. #define FW_EQ_OFLD_CMD_ALLOC_S 31
  1663. #define FW_EQ_OFLD_CMD_ALLOC_V(x) ((x) << FW_EQ_OFLD_CMD_ALLOC_S)
  1664. #define FW_EQ_OFLD_CMD_ALLOC_F FW_EQ_OFLD_CMD_ALLOC_V(1U)
  1665. #define FW_EQ_OFLD_CMD_FREE_S 30
  1666. #define FW_EQ_OFLD_CMD_FREE_V(x) ((x) << FW_EQ_OFLD_CMD_FREE_S)
  1667. #define FW_EQ_OFLD_CMD_FREE_F FW_EQ_OFLD_CMD_FREE_V(1U)
  1668. #define FW_EQ_OFLD_CMD_MODIFY_S 29
  1669. #define FW_EQ_OFLD_CMD_MODIFY_V(x) ((x) << FW_EQ_OFLD_CMD_MODIFY_S)
  1670. #define FW_EQ_OFLD_CMD_MODIFY_F FW_EQ_OFLD_CMD_MODIFY_V(1U)
  1671. #define FW_EQ_OFLD_CMD_EQSTART_S 28
  1672. #define FW_EQ_OFLD_CMD_EQSTART_V(x) ((x) << FW_EQ_OFLD_CMD_EQSTART_S)
  1673. #define FW_EQ_OFLD_CMD_EQSTART_F FW_EQ_OFLD_CMD_EQSTART_V(1U)
  1674. #define FW_EQ_OFLD_CMD_EQSTOP_S 27
  1675. #define FW_EQ_OFLD_CMD_EQSTOP_V(x) ((x) << FW_EQ_OFLD_CMD_EQSTOP_S)
  1676. #define FW_EQ_OFLD_CMD_EQSTOP_F FW_EQ_OFLD_CMD_EQSTOP_V(1U)
  1677. #define FW_EQ_OFLD_CMD_EQID_S 0
  1678. #define FW_EQ_OFLD_CMD_EQID_M 0xfffff
  1679. #define FW_EQ_OFLD_CMD_EQID_V(x) ((x) << FW_EQ_OFLD_CMD_EQID_S)
  1680. #define FW_EQ_OFLD_CMD_EQID_G(x) \
  1681. (((x) >> FW_EQ_OFLD_CMD_EQID_S) & FW_EQ_OFLD_CMD_EQID_M)
  1682. #define FW_EQ_OFLD_CMD_PHYSEQID_S 0
  1683. #define FW_EQ_OFLD_CMD_PHYSEQID_M 0xfffff
  1684. #define FW_EQ_OFLD_CMD_PHYSEQID_G(x) \
  1685. (((x) >> FW_EQ_OFLD_CMD_PHYSEQID_S) & FW_EQ_OFLD_CMD_PHYSEQID_M)
  1686. #define FW_EQ_OFLD_CMD_FETCHSZM_S 26
  1687. #define FW_EQ_OFLD_CMD_FETCHSZM_V(x) ((x) << FW_EQ_OFLD_CMD_FETCHSZM_S)
  1688. #define FW_EQ_OFLD_CMD_STATUSPGNS_S 25
  1689. #define FW_EQ_OFLD_CMD_STATUSPGNS_V(x) ((x) << FW_EQ_OFLD_CMD_STATUSPGNS_S)
  1690. #define FW_EQ_OFLD_CMD_STATUSPGRO_S 24
  1691. #define FW_EQ_OFLD_CMD_STATUSPGRO_V(x) ((x) << FW_EQ_OFLD_CMD_STATUSPGRO_S)
  1692. #define FW_EQ_OFLD_CMD_FETCHNS_S 23
  1693. #define FW_EQ_OFLD_CMD_FETCHNS_V(x) ((x) << FW_EQ_OFLD_CMD_FETCHNS_S)
  1694. #define FW_EQ_OFLD_CMD_FETCHRO_S 22
  1695. #define FW_EQ_OFLD_CMD_FETCHRO_V(x) ((x) << FW_EQ_OFLD_CMD_FETCHRO_S)
  1696. #define FW_EQ_OFLD_CMD_FETCHRO_F FW_EQ_OFLD_CMD_FETCHRO_V(1U)
  1697. #define FW_EQ_OFLD_CMD_HOSTFCMODE_S 20
  1698. #define FW_EQ_OFLD_CMD_HOSTFCMODE_V(x) ((x) << FW_EQ_OFLD_CMD_HOSTFCMODE_S)
  1699. #define FW_EQ_OFLD_CMD_CPRIO_S 19
  1700. #define FW_EQ_OFLD_CMD_CPRIO_V(x) ((x) << FW_EQ_OFLD_CMD_CPRIO_S)
  1701. #define FW_EQ_OFLD_CMD_ONCHIP_S 18
  1702. #define FW_EQ_OFLD_CMD_ONCHIP_V(x) ((x) << FW_EQ_OFLD_CMD_ONCHIP_S)
  1703. #define FW_EQ_OFLD_CMD_PCIECHN_S 16
  1704. #define FW_EQ_OFLD_CMD_PCIECHN_V(x) ((x) << FW_EQ_OFLD_CMD_PCIECHN_S)
  1705. #define FW_EQ_OFLD_CMD_IQID_S 0
  1706. #define FW_EQ_OFLD_CMD_IQID_V(x) ((x) << FW_EQ_OFLD_CMD_IQID_S)
  1707. #define FW_EQ_OFLD_CMD_DCAEN_S 31
  1708. #define FW_EQ_OFLD_CMD_DCAEN_V(x) ((x) << FW_EQ_OFLD_CMD_DCAEN_S)
  1709. #define FW_EQ_OFLD_CMD_DCACPU_S 26
  1710. #define FW_EQ_OFLD_CMD_DCACPU_V(x) ((x) << FW_EQ_OFLD_CMD_DCACPU_S)
  1711. #define FW_EQ_OFLD_CMD_FBMIN_S 23
  1712. #define FW_EQ_OFLD_CMD_FBMIN_V(x) ((x) << FW_EQ_OFLD_CMD_FBMIN_S)
  1713. #define FW_EQ_OFLD_CMD_FBMAX_S 20
  1714. #define FW_EQ_OFLD_CMD_FBMAX_V(x) ((x) << FW_EQ_OFLD_CMD_FBMAX_S)
  1715. #define FW_EQ_OFLD_CMD_CIDXFTHRESHO_S 19
  1716. #define FW_EQ_OFLD_CMD_CIDXFTHRESHO_V(x) \
  1717. ((x) << FW_EQ_OFLD_CMD_CIDXFTHRESHO_S)
  1718. #define FW_EQ_OFLD_CMD_CIDXFTHRESH_S 16
  1719. #define FW_EQ_OFLD_CMD_CIDXFTHRESH_V(x) ((x) << FW_EQ_OFLD_CMD_CIDXFTHRESH_S)
  1720. #define FW_EQ_OFLD_CMD_EQSIZE_S 0
  1721. #define FW_EQ_OFLD_CMD_EQSIZE_V(x) ((x) << FW_EQ_OFLD_CMD_EQSIZE_S)
  1722. /*
  1723. * Macros for VIID parsing:
  1724. * VIID - [10:8] PFN, [7] VI Valid, [6:0] VI number
  1725. */
  1726. #define FW_VIID_PFN_S 8
  1727. #define FW_VIID_PFN_M 0x7
  1728. #define FW_VIID_PFN_G(x) (((x) >> FW_VIID_PFN_S) & FW_VIID_PFN_M)
  1729. #define FW_VIID_VIVLD_S 7
  1730. #define FW_VIID_VIVLD_M 0x1
  1731. #define FW_VIID_VIVLD_G(x) (((x) >> FW_VIID_VIVLD_S) & FW_VIID_VIVLD_M)
  1732. #define FW_VIID_VIN_S 0
  1733. #define FW_VIID_VIN_M 0x7F
  1734. #define FW_VIID_VIN_G(x) (((x) >> FW_VIID_VIN_S) & FW_VIID_VIN_M)
  1735. struct fw_vi_cmd {
  1736. __be32 op_to_vfn;
  1737. __be32 alloc_to_len16;
  1738. __be16 type_viid;
  1739. u8 mac[6];
  1740. u8 portid_pkd;
  1741. u8 nmac;
  1742. u8 nmac0[6];
  1743. __be16 rsssize_pkd;
  1744. u8 nmac1[6];
  1745. __be16 idsiiq_pkd;
  1746. u8 nmac2[6];
  1747. __be16 idseiq_pkd;
  1748. u8 nmac3[6];
  1749. __be64 r9;
  1750. __be64 r10;
  1751. };
  1752. #define FW_VI_CMD_PFN_S 8
  1753. #define FW_VI_CMD_PFN_V(x) ((x) << FW_VI_CMD_PFN_S)
  1754. #define FW_VI_CMD_VFN_S 0
  1755. #define FW_VI_CMD_VFN_V(x) ((x) << FW_VI_CMD_VFN_S)
  1756. #define FW_VI_CMD_ALLOC_S 31
  1757. #define FW_VI_CMD_ALLOC_V(x) ((x) << FW_VI_CMD_ALLOC_S)
  1758. #define FW_VI_CMD_ALLOC_F FW_VI_CMD_ALLOC_V(1U)
  1759. #define FW_VI_CMD_FREE_S 30
  1760. #define FW_VI_CMD_FREE_V(x) ((x) << FW_VI_CMD_FREE_S)
  1761. #define FW_VI_CMD_FREE_F FW_VI_CMD_FREE_V(1U)
  1762. #define FW_VI_CMD_VIID_S 0
  1763. #define FW_VI_CMD_VIID_M 0xfff
  1764. #define FW_VI_CMD_VIID_V(x) ((x) << FW_VI_CMD_VIID_S)
  1765. #define FW_VI_CMD_VIID_G(x) (((x) >> FW_VI_CMD_VIID_S) & FW_VI_CMD_VIID_M)
  1766. #define FW_VI_CMD_PORTID_S 4
  1767. #define FW_VI_CMD_PORTID_M 0xf
  1768. #define FW_VI_CMD_PORTID_V(x) ((x) << FW_VI_CMD_PORTID_S)
  1769. #define FW_VI_CMD_PORTID_G(x) \
  1770. (((x) >> FW_VI_CMD_PORTID_S) & FW_VI_CMD_PORTID_M)
  1771. #define FW_VI_CMD_RSSSIZE_S 0
  1772. #define FW_VI_CMD_RSSSIZE_M 0x7ff
  1773. #define FW_VI_CMD_RSSSIZE_G(x) \
  1774. (((x) >> FW_VI_CMD_RSSSIZE_S) & FW_VI_CMD_RSSSIZE_M)
  1775. /* Special VI_MAC command index ids */
  1776. #define FW_VI_MAC_ADD_MAC 0x3FF
  1777. #define FW_VI_MAC_ADD_PERSIST_MAC 0x3FE
  1778. #define FW_VI_MAC_MAC_BASED_FREE 0x3FD
  1779. #define FW_VI_MAC_ID_BASED_FREE 0x3FC
  1780. #define FW_CLS_TCAM_NUM_ENTRIES 336
  1781. enum fw_vi_mac_smac {
  1782. FW_VI_MAC_MPS_TCAM_ENTRY,
  1783. FW_VI_MAC_MPS_TCAM_ONLY,
  1784. FW_VI_MAC_SMT_ONLY,
  1785. FW_VI_MAC_SMT_AND_MPSTCAM
  1786. };
  1787. enum fw_vi_mac_result {
  1788. FW_VI_MAC_R_SUCCESS,
  1789. FW_VI_MAC_R_F_NONEXISTENT_NOMEM,
  1790. FW_VI_MAC_R_SMAC_FAIL,
  1791. FW_VI_MAC_R_F_ACL_CHECK
  1792. };
  1793. enum fw_vi_mac_entry_types {
  1794. FW_VI_MAC_TYPE_EXACTMAC,
  1795. FW_VI_MAC_TYPE_HASHVEC,
  1796. FW_VI_MAC_TYPE_RAW,
  1797. FW_VI_MAC_TYPE_EXACTMAC_VNI,
  1798. };
  1799. struct fw_vi_mac_cmd {
  1800. __be32 op_to_viid;
  1801. __be32 freemacs_to_len16;
  1802. union fw_vi_mac {
  1803. struct fw_vi_mac_exact {
  1804. __be16 valid_to_idx;
  1805. u8 macaddr[6];
  1806. } exact[7];
  1807. struct fw_vi_mac_hash {
  1808. __be64 hashvec;
  1809. } hash;
  1810. struct fw_vi_mac_raw {
  1811. __be32 raw_idx_pkd;
  1812. __be32 data0_pkd;
  1813. __be32 data1[2];
  1814. __be64 data0m_pkd;
  1815. __be32 data1m[2];
  1816. } raw;
  1817. struct fw_vi_mac_vni {
  1818. __be16 valid_to_idx;
  1819. __u8 macaddr[6];
  1820. __be16 r7;
  1821. __u8 macaddr_mask[6];
  1822. __be32 lookup_type_to_vni;
  1823. __be32 vni_mask_pkd;
  1824. } exact_vni[2];
  1825. } u;
  1826. };
  1827. #define FW_VI_MAC_CMD_VIID_S 0
  1828. #define FW_VI_MAC_CMD_VIID_V(x) ((x) << FW_VI_MAC_CMD_VIID_S)
  1829. #define FW_VI_MAC_CMD_FREEMACS_S 31
  1830. #define FW_VI_MAC_CMD_FREEMACS_V(x) ((x) << FW_VI_MAC_CMD_FREEMACS_S)
  1831. #define FW_VI_MAC_CMD_ENTRY_TYPE_S 23
  1832. #define FW_VI_MAC_CMD_ENTRY_TYPE_M 0x7
  1833. #define FW_VI_MAC_CMD_ENTRY_TYPE_V(x) ((x) << FW_VI_MAC_CMD_ENTRY_TYPE_S)
  1834. #define FW_VI_MAC_CMD_ENTRY_TYPE_G(x) \
  1835. (((x) >> FW_VI_MAC_CMD_ENTRY_TYPE_S) & FW_VI_MAC_CMD_ENTRY_TYPE_M)
  1836. #define FW_VI_MAC_CMD_HASHVECEN_S 23
  1837. #define FW_VI_MAC_CMD_HASHVECEN_V(x) ((x) << FW_VI_MAC_CMD_HASHVECEN_S)
  1838. #define FW_VI_MAC_CMD_HASHVECEN_F FW_VI_MAC_CMD_HASHVECEN_V(1U)
  1839. #define FW_VI_MAC_CMD_HASHUNIEN_S 22
  1840. #define FW_VI_MAC_CMD_HASHUNIEN_V(x) ((x) << FW_VI_MAC_CMD_HASHUNIEN_S)
  1841. #define FW_VI_MAC_CMD_VALID_S 15
  1842. #define FW_VI_MAC_CMD_VALID_V(x) ((x) << FW_VI_MAC_CMD_VALID_S)
  1843. #define FW_VI_MAC_CMD_VALID_F FW_VI_MAC_CMD_VALID_V(1U)
  1844. #define FW_VI_MAC_CMD_PRIO_S 12
  1845. #define FW_VI_MAC_CMD_PRIO_V(x) ((x) << FW_VI_MAC_CMD_PRIO_S)
  1846. #define FW_VI_MAC_CMD_SMAC_RESULT_S 10
  1847. #define FW_VI_MAC_CMD_SMAC_RESULT_M 0x3
  1848. #define FW_VI_MAC_CMD_SMAC_RESULT_V(x) ((x) << FW_VI_MAC_CMD_SMAC_RESULT_S)
  1849. #define FW_VI_MAC_CMD_SMAC_RESULT_G(x) \
  1850. (((x) >> FW_VI_MAC_CMD_SMAC_RESULT_S) & FW_VI_MAC_CMD_SMAC_RESULT_M)
  1851. #define FW_VI_MAC_CMD_IDX_S 0
  1852. #define FW_VI_MAC_CMD_IDX_M 0x3ff
  1853. #define FW_VI_MAC_CMD_IDX_V(x) ((x) << FW_VI_MAC_CMD_IDX_S)
  1854. #define FW_VI_MAC_CMD_IDX_G(x) \
  1855. (((x) >> FW_VI_MAC_CMD_IDX_S) & FW_VI_MAC_CMD_IDX_M)
  1856. #define FW_VI_MAC_CMD_RAW_IDX_S 16
  1857. #define FW_VI_MAC_CMD_RAW_IDX_M 0xffff
  1858. #define FW_VI_MAC_CMD_RAW_IDX_V(x) ((x) << FW_VI_MAC_CMD_RAW_IDX_S)
  1859. #define FW_VI_MAC_CMD_RAW_IDX_G(x) \
  1860. (((x) >> FW_VI_MAC_CMD_RAW_IDX_S) & FW_VI_MAC_CMD_RAW_IDX_M)
  1861. #define FW_VI_MAC_CMD_LOOKUP_TYPE_S 31
  1862. #define FW_VI_MAC_CMD_LOOKUP_TYPE_M 0x1
  1863. #define FW_VI_MAC_CMD_LOOKUP_TYPE_V(x) ((x) << FW_VI_MAC_CMD_LOOKUP_TYPE_S)
  1864. #define FW_VI_MAC_CMD_LOOKUP_TYPE_G(x) \
  1865. (((x) >> FW_VI_MAC_CMD_LOOKUP_TYPE_S) & FW_VI_MAC_CMD_LOOKUP_TYPE_M)
  1866. #define FW_VI_MAC_CMD_LOOKUP_TYPE_F FW_VI_MAC_CMD_LOOKUP_TYPE_V(1U)
  1867. #define FW_VI_MAC_CMD_DIP_HIT_S 30
  1868. #define FW_VI_MAC_CMD_DIP_HIT_M 0x1
  1869. #define FW_VI_MAC_CMD_DIP_HIT_V(x) ((x) << FW_VI_MAC_CMD_DIP_HIT_S)
  1870. #define FW_VI_MAC_CMD_DIP_HIT_G(x) \
  1871. (((x) >> FW_VI_MAC_CMD_DIP_HIT_S) & FW_VI_MAC_CMD_DIP_HIT_M)
  1872. #define FW_VI_MAC_CMD_DIP_HIT_F FW_VI_MAC_CMD_DIP_HIT_V(1U)
  1873. #define FW_VI_MAC_CMD_VNI_S 0
  1874. #define FW_VI_MAC_CMD_VNI_M 0xffffff
  1875. #define FW_VI_MAC_CMD_VNI_V(x) ((x) << FW_VI_MAC_CMD_VNI_S)
  1876. #define FW_VI_MAC_CMD_VNI_G(x) \
  1877. (((x) >> FW_VI_MAC_CMD_VNI_S) & FW_VI_MAC_CMD_VNI_M)
  1878. #define FW_VI_MAC_CMD_VNI_MASK_S 0
  1879. #define FW_VI_MAC_CMD_VNI_MASK_M 0xffffff
  1880. #define FW_VI_MAC_CMD_VNI_MASK_V(x) ((x) << FW_VI_MAC_CMD_VNI_MASK_S)
  1881. #define FW_VI_MAC_CMD_VNI_MASK_G(x) \
  1882. (((x) >> FW_VI_MAC_CMD_VNI_MASK_S) & FW_VI_MAC_CMD_VNI_MASK_M)
  1883. #define FW_RXMODE_MTU_NO_CHG 65535
  1884. struct fw_vi_rxmode_cmd {
  1885. __be32 op_to_viid;
  1886. __be32 retval_len16;
  1887. __be32 mtu_to_vlanexen;
  1888. __be32 r4_lo;
  1889. };
  1890. #define FW_VI_RXMODE_CMD_VIID_S 0
  1891. #define FW_VI_RXMODE_CMD_VIID_V(x) ((x) << FW_VI_RXMODE_CMD_VIID_S)
  1892. #define FW_VI_RXMODE_CMD_MTU_S 16
  1893. #define FW_VI_RXMODE_CMD_MTU_M 0xffff
  1894. #define FW_VI_RXMODE_CMD_MTU_V(x) ((x) << FW_VI_RXMODE_CMD_MTU_S)
  1895. #define FW_VI_RXMODE_CMD_PROMISCEN_S 14
  1896. #define FW_VI_RXMODE_CMD_PROMISCEN_M 0x3
  1897. #define FW_VI_RXMODE_CMD_PROMISCEN_V(x) ((x) << FW_VI_RXMODE_CMD_PROMISCEN_S)
  1898. #define FW_VI_RXMODE_CMD_ALLMULTIEN_S 12
  1899. #define FW_VI_RXMODE_CMD_ALLMULTIEN_M 0x3
  1900. #define FW_VI_RXMODE_CMD_ALLMULTIEN_V(x) \
  1901. ((x) << FW_VI_RXMODE_CMD_ALLMULTIEN_S)
  1902. #define FW_VI_RXMODE_CMD_BROADCASTEN_S 10
  1903. #define FW_VI_RXMODE_CMD_BROADCASTEN_M 0x3
  1904. #define FW_VI_RXMODE_CMD_BROADCASTEN_V(x) \
  1905. ((x) << FW_VI_RXMODE_CMD_BROADCASTEN_S)
  1906. #define FW_VI_RXMODE_CMD_VLANEXEN_S 8
  1907. #define FW_VI_RXMODE_CMD_VLANEXEN_M 0x3
  1908. #define FW_VI_RXMODE_CMD_VLANEXEN_V(x) ((x) << FW_VI_RXMODE_CMD_VLANEXEN_S)
  1909. struct fw_vi_enable_cmd {
  1910. __be32 op_to_viid;
  1911. __be32 ien_to_len16;
  1912. __be16 blinkdur;
  1913. __be16 r3;
  1914. __be32 r4;
  1915. };
  1916. #define FW_VI_ENABLE_CMD_VIID_S 0
  1917. #define FW_VI_ENABLE_CMD_VIID_V(x) ((x) << FW_VI_ENABLE_CMD_VIID_S)
  1918. #define FW_VI_ENABLE_CMD_IEN_S 31
  1919. #define FW_VI_ENABLE_CMD_IEN_V(x) ((x) << FW_VI_ENABLE_CMD_IEN_S)
  1920. #define FW_VI_ENABLE_CMD_EEN_S 30
  1921. #define FW_VI_ENABLE_CMD_EEN_V(x) ((x) << FW_VI_ENABLE_CMD_EEN_S)
  1922. #define FW_VI_ENABLE_CMD_LED_S 29
  1923. #define FW_VI_ENABLE_CMD_LED_V(x) ((x) << FW_VI_ENABLE_CMD_LED_S)
  1924. #define FW_VI_ENABLE_CMD_LED_F FW_VI_ENABLE_CMD_LED_V(1U)
  1925. #define FW_VI_ENABLE_CMD_DCB_INFO_S 28
  1926. #define FW_VI_ENABLE_CMD_DCB_INFO_V(x) ((x) << FW_VI_ENABLE_CMD_DCB_INFO_S)
  1927. /* VI VF stats offset definitions */
  1928. #define VI_VF_NUM_STATS 16
  1929. enum fw_vi_stats_vf_index {
  1930. FW_VI_VF_STAT_TX_BCAST_BYTES_IX,
  1931. FW_VI_VF_STAT_TX_BCAST_FRAMES_IX,
  1932. FW_VI_VF_STAT_TX_MCAST_BYTES_IX,
  1933. FW_VI_VF_STAT_TX_MCAST_FRAMES_IX,
  1934. FW_VI_VF_STAT_TX_UCAST_BYTES_IX,
  1935. FW_VI_VF_STAT_TX_UCAST_FRAMES_IX,
  1936. FW_VI_VF_STAT_TX_DROP_FRAMES_IX,
  1937. FW_VI_VF_STAT_TX_OFLD_BYTES_IX,
  1938. FW_VI_VF_STAT_TX_OFLD_FRAMES_IX,
  1939. FW_VI_VF_STAT_RX_BCAST_BYTES_IX,
  1940. FW_VI_VF_STAT_RX_BCAST_FRAMES_IX,
  1941. FW_VI_VF_STAT_RX_MCAST_BYTES_IX,
  1942. FW_VI_VF_STAT_RX_MCAST_FRAMES_IX,
  1943. FW_VI_VF_STAT_RX_UCAST_BYTES_IX,
  1944. FW_VI_VF_STAT_RX_UCAST_FRAMES_IX,
  1945. FW_VI_VF_STAT_RX_ERR_FRAMES_IX
  1946. };
  1947. /* VI PF stats offset definitions */
  1948. #define VI_PF_NUM_STATS 17
  1949. enum fw_vi_stats_pf_index {
  1950. FW_VI_PF_STAT_TX_BCAST_BYTES_IX,
  1951. FW_VI_PF_STAT_TX_BCAST_FRAMES_IX,
  1952. FW_VI_PF_STAT_TX_MCAST_BYTES_IX,
  1953. FW_VI_PF_STAT_TX_MCAST_FRAMES_IX,
  1954. FW_VI_PF_STAT_TX_UCAST_BYTES_IX,
  1955. FW_VI_PF_STAT_TX_UCAST_FRAMES_IX,
  1956. FW_VI_PF_STAT_TX_OFLD_BYTES_IX,
  1957. FW_VI_PF_STAT_TX_OFLD_FRAMES_IX,
  1958. FW_VI_PF_STAT_RX_BYTES_IX,
  1959. FW_VI_PF_STAT_RX_FRAMES_IX,
  1960. FW_VI_PF_STAT_RX_BCAST_BYTES_IX,
  1961. FW_VI_PF_STAT_RX_BCAST_FRAMES_IX,
  1962. FW_VI_PF_STAT_RX_MCAST_BYTES_IX,
  1963. FW_VI_PF_STAT_RX_MCAST_FRAMES_IX,
  1964. FW_VI_PF_STAT_RX_UCAST_BYTES_IX,
  1965. FW_VI_PF_STAT_RX_UCAST_FRAMES_IX,
  1966. FW_VI_PF_STAT_RX_ERR_FRAMES_IX
  1967. };
  1968. struct fw_vi_stats_cmd {
  1969. __be32 op_to_viid;
  1970. __be32 retval_len16;
  1971. union fw_vi_stats {
  1972. struct fw_vi_stats_ctl {
  1973. __be16 nstats_ix;
  1974. __be16 r6;
  1975. __be32 r7;
  1976. __be64 stat0;
  1977. __be64 stat1;
  1978. __be64 stat2;
  1979. __be64 stat3;
  1980. __be64 stat4;
  1981. __be64 stat5;
  1982. } ctl;
  1983. struct fw_vi_stats_pf {
  1984. __be64 tx_bcast_bytes;
  1985. __be64 tx_bcast_frames;
  1986. __be64 tx_mcast_bytes;
  1987. __be64 tx_mcast_frames;
  1988. __be64 tx_ucast_bytes;
  1989. __be64 tx_ucast_frames;
  1990. __be64 tx_offload_bytes;
  1991. __be64 tx_offload_frames;
  1992. __be64 rx_pf_bytes;
  1993. __be64 rx_pf_frames;
  1994. __be64 rx_bcast_bytes;
  1995. __be64 rx_bcast_frames;
  1996. __be64 rx_mcast_bytes;
  1997. __be64 rx_mcast_frames;
  1998. __be64 rx_ucast_bytes;
  1999. __be64 rx_ucast_frames;
  2000. __be64 rx_err_frames;
  2001. } pf;
  2002. struct fw_vi_stats_vf {
  2003. __be64 tx_bcast_bytes;
  2004. __be64 tx_bcast_frames;
  2005. __be64 tx_mcast_bytes;
  2006. __be64 tx_mcast_frames;
  2007. __be64 tx_ucast_bytes;
  2008. __be64 tx_ucast_frames;
  2009. __be64 tx_drop_frames;
  2010. __be64 tx_offload_bytes;
  2011. __be64 tx_offload_frames;
  2012. __be64 rx_bcast_bytes;
  2013. __be64 rx_bcast_frames;
  2014. __be64 rx_mcast_bytes;
  2015. __be64 rx_mcast_frames;
  2016. __be64 rx_ucast_bytes;
  2017. __be64 rx_ucast_frames;
  2018. __be64 rx_err_frames;
  2019. } vf;
  2020. } u;
  2021. };
  2022. #define FW_VI_STATS_CMD_VIID_S 0
  2023. #define FW_VI_STATS_CMD_VIID_V(x) ((x) << FW_VI_STATS_CMD_VIID_S)
  2024. #define FW_VI_STATS_CMD_NSTATS_S 12
  2025. #define FW_VI_STATS_CMD_NSTATS_V(x) ((x) << FW_VI_STATS_CMD_NSTATS_S)
  2026. #define FW_VI_STATS_CMD_IX_S 0
  2027. #define FW_VI_STATS_CMD_IX_V(x) ((x) << FW_VI_STATS_CMD_IX_S)
  2028. struct fw_acl_mac_cmd {
  2029. __be32 op_to_vfn;
  2030. __be32 en_to_len16;
  2031. u8 nmac;
  2032. u8 r3[7];
  2033. __be16 r4;
  2034. u8 macaddr0[6];
  2035. __be16 r5;
  2036. u8 macaddr1[6];
  2037. __be16 r6;
  2038. u8 macaddr2[6];
  2039. __be16 r7;
  2040. u8 macaddr3[6];
  2041. };
  2042. #define FW_ACL_MAC_CMD_PFN_S 8
  2043. #define FW_ACL_MAC_CMD_PFN_V(x) ((x) << FW_ACL_MAC_CMD_PFN_S)
  2044. #define FW_ACL_MAC_CMD_VFN_S 0
  2045. #define FW_ACL_MAC_CMD_VFN_V(x) ((x) << FW_ACL_MAC_CMD_VFN_S)
  2046. #define FW_ACL_MAC_CMD_EN_S 31
  2047. #define FW_ACL_MAC_CMD_EN_V(x) ((x) << FW_ACL_MAC_CMD_EN_S)
  2048. struct fw_acl_vlan_cmd {
  2049. __be32 op_to_vfn;
  2050. __be32 en_to_len16;
  2051. u8 nvlan;
  2052. u8 dropnovlan_fm;
  2053. u8 r3_lo[6];
  2054. __be16 vlanid[16];
  2055. };
  2056. #define FW_ACL_VLAN_CMD_PFN_S 8
  2057. #define FW_ACL_VLAN_CMD_PFN_V(x) ((x) << FW_ACL_VLAN_CMD_PFN_S)
  2058. #define FW_ACL_VLAN_CMD_VFN_S 0
  2059. #define FW_ACL_VLAN_CMD_VFN_V(x) ((x) << FW_ACL_VLAN_CMD_VFN_S)
  2060. #define FW_ACL_VLAN_CMD_EN_S 31
  2061. #define FW_ACL_VLAN_CMD_EN_M 0x1
  2062. #define FW_ACL_VLAN_CMD_EN_V(x) ((x) << FW_ACL_VLAN_CMD_EN_S)
  2063. #define FW_ACL_VLAN_CMD_EN_G(x) \
  2064. (((x) >> S_FW_ACL_VLAN_CMD_EN_S) & FW_ACL_VLAN_CMD_EN_M)
  2065. #define FW_ACL_VLAN_CMD_EN_F FW_ACL_VLAN_CMD_EN_V(1U)
  2066. #define FW_ACL_VLAN_CMD_DROPNOVLAN_S 7
  2067. #define FW_ACL_VLAN_CMD_DROPNOVLAN_V(x) ((x) << FW_ACL_VLAN_CMD_DROPNOVLAN_S)
  2068. #define FW_ACL_VLAN_CMD_FM_S 6
  2069. #define FW_ACL_VLAN_CMD_FM_M 0x1
  2070. #define FW_ACL_VLAN_CMD_FM_V(x) ((x) << FW_ACL_VLAN_CMD_FM_S)
  2071. #define FW_ACL_VLAN_CMD_FM_G(x) \
  2072. (((x) >> FW_ACL_VLAN_CMD_FM_S) & FW_ACL_VLAN_CMD_FM_M)
  2073. #define FW_ACL_VLAN_CMD_FM_F FW_ACL_VLAN_CMD_FM_V(1U)
  2074. /* old 16-bit port capabilities bitmap (fw_port_cap16_t) */
  2075. enum fw_port_cap {
  2076. FW_PORT_CAP_SPEED_100M = 0x0001,
  2077. FW_PORT_CAP_SPEED_1G = 0x0002,
  2078. FW_PORT_CAP_SPEED_25G = 0x0004,
  2079. FW_PORT_CAP_SPEED_10G = 0x0008,
  2080. FW_PORT_CAP_SPEED_40G = 0x0010,
  2081. FW_PORT_CAP_SPEED_100G = 0x0020,
  2082. FW_PORT_CAP_FC_RX = 0x0040,
  2083. FW_PORT_CAP_FC_TX = 0x0080,
  2084. FW_PORT_CAP_ANEG = 0x0100,
  2085. FW_PORT_CAP_MDIAUTO = 0x0200,
  2086. FW_PORT_CAP_MDISTRAIGHT = 0x0400,
  2087. FW_PORT_CAP_FEC_RS = 0x0800,
  2088. FW_PORT_CAP_FEC_BASER_RS = 0x1000,
  2089. FW_PORT_CAP_FORCE_PAUSE = 0x2000,
  2090. FW_PORT_CAP_802_3_PAUSE = 0x4000,
  2091. FW_PORT_CAP_802_3_ASM_DIR = 0x8000,
  2092. };
  2093. #define FW_PORT_CAP_SPEED_S 0
  2094. #define FW_PORT_CAP_SPEED_M 0x3f
  2095. #define FW_PORT_CAP_SPEED_V(x) ((x) << FW_PORT_CAP_SPEED_S)
  2096. #define FW_PORT_CAP_SPEED_G(x) \
  2097. (((x) >> FW_PORT_CAP_SPEED_S) & FW_PORT_CAP_SPEED_M)
  2098. enum fw_port_mdi {
  2099. FW_PORT_CAP_MDI_UNCHANGED,
  2100. FW_PORT_CAP_MDI_AUTO,
  2101. FW_PORT_CAP_MDI_F_STRAIGHT,
  2102. FW_PORT_CAP_MDI_F_CROSSOVER
  2103. };
  2104. #define FW_PORT_CAP_MDI_S 9
  2105. #define FW_PORT_CAP_MDI_V(x) ((x) << FW_PORT_CAP_MDI_S)
  2106. /* new 32-bit port capabilities bitmap (fw_port_cap32_t) */
  2107. #define FW_PORT_CAP32_SPEED_100M 0x00000001UL
  2108. #define FW_PORT_CAP32_SPEED_1G 0x00000002UL
  2109. #define FW_PORT_CAP32_SPEED_10G 0x00000004UL
  2110. #define FW_PORT_CAP32_SPEED_25G 0x00000008UL
  2111. #define FW_PORT_CAP32_SPEED_40G 0x00000010UL
  2112. #define FW_PORT_CAP32_SPEED_50G 0x00000020UL
  2113. #define FW_PORT_CAP32_SPEED_100G 0x00000040UL
  2114. #define FW_PORT_CAP32_SPEED_200G 0x00000080UL
  2115. #define FW_PORT_CAP32_SPEED_400G 0x00000100UL
  2116. #define FW_PORT_CAP32_SPEED_RESERVED1 0x00000200UL
  2117. #define FW_PORT_CAP32_SPEED_RESERVED2 0x00000400UL
  2118. #define FW_PORT_CAP32_SPEED_RESERVED3 0x00000800UL
  2119. #define FW_PORT_CAP32_RESERVED1 0x0000f000UL
  2120. #define FW_PORT_CAP32_FC_RX 0x00010000UL
  2121. #define FW_PORT_CAP32_FC_TX 0x00020000UL
  2122. #define FW_PORT_CAP32_802_3_PAUSE 0x00040000UL
  2123. #define FW_PORT_CAP32_802_3_ASM_DIR 0x00080000UL
  2124. #define FW_PORT_CAP32_ANEG 0x00100000UL
  2125. #define FW_PORT_CAP32_MDIAUTO 0x00200000UL
  2126. #define FW_PORT_CAP32_MDISTRAIGHT 0x00400000UL
  2127. #define FW_PORT_CAP32_FEC_RS 0x00800000UL
  2128. #define FW_PORT_CAP32_FEC_BASER_RS 0x01000000UL
  2129. #define FW_PORT_CAP32_FEC_RESERVED1 0x02000000UL
  2130. #define FW_PORT_CAP32_FEC_RESERVED2 0x04000000UL
  2131. #define FW_PORT_CAP32_FEC_RESERVED3 0x08000000UL
  2132. #define FW_PORT_CAP32_FORCE_PAUSE 0x10000000UL
  2133. #define FW_PORT_CAP32_RESERVED2 0xe0000000UL
  2134. #define FW_PORT_CAP32_SPEED_S 0
  2135. #define FW_PORT_CAP32_SPEED_M 0xfff
  2136. #define FW_PORT_CAP32_SPEED_V(x) ((x) << FW_PORT_CAP32_SPEED_S)
  2137. #define FW_PORT_CAP32_SPEED_G(x) \
  2138. (((x) >> FW_PORT_CAP32_SPEED_S) & FW_PORT_CAP32_SPEED_M)
  2139. #define FW_PORT_CAP32_FC_S 16
  2140. #define FW_PORT_CAP32_FC_M 0x3
  2141. #define FW_PORT_CAP32_FC_V(x) ((x) << FW_PORT_CAP32_FC_S)
  2142. #define FW_PORT_CAP32_FC_G(x) \
  2143. (((x) >> FW_PORT_CAP32_FC_S) & FW_PORT_CAP32_FC_M)
  2144. #define FW_PORT_CAP32_802_3_S 18
  2145. #define FW_PORT_CAP32_802_3_M 0x3
  2146. #define FW_PORT_CAP32_802_3_V(x) ((x) << FW_PORT_CAP32_802_3_S)
  2147. #define FW_PORT_CAP32_802_3_G(x) \
  2148. (((x) >> FW_PORT_CAP32_802_3_S) & FW_PORT_CAP32_802_3_M)
  2149. #define FW_PORT_CAP32_ANEG_S 20
  2150. #define FW_PORT_CAP32_ANEG_M 0x1
  2151. #define FW_PORT_CAP32_ANEG_V(x) ((x) << FW_PORT_CAP32_ANEG_S)
  2152. #define FW_PORT_CAP32_ANEG_G(x) \
  2153. (((x) >> FW_PORT_CAP32_ANEG_S) & FW_PORT_CAP32_ANEG_M)
  2154. enum fw_port_mdi32 {
  2155. FW_PORT_CAP32_MDI_UNCHANGED,
  2156. FW_PORT_CAP32_MDI_AUTO,
  2157. FW_PORT_CAP32_MDI_F_STRAIGHT,
  2158. FW_PORT_CAP32_MDI_F_CROSSOVER
  2159. };
  2160. #define FW_PORT_CAP32_MDI_S 21
  2161. #define FW_PORT_CAP32_MDI_M 3
  2162. #define FW_PORT_CAP32_MDI_V(x) ((x) << FW_PORT_CAP32_MDI_S)
  2163. #define FW_PORT_CAP32_MDI_G(x) \
  2164. (((x) >> FW_PORT_CAP32_MDI_S) & FW_PORT_CAP32_MDI_M)
  2165. #define FW_PORT_CAP32_FEC_S 23
  2166. #define FW_PORT_CAP32_FEC_M 0x1f
  2167. #define FW_PORT_CAP32_FEC_V(x) ((x) << FW_PORT_CAP32_FEC_S)
  2168. #define FW_PORT_CAP32_FEC_G(x) \
  2169. (((x) >> FW_PORT_CAP32_FEC_S) & FW_PORT_CAP32_FEC_M)
  2170. /* macros to isolate various 32-bit Port Capabilities sub-fields */
  2171. #define CAP32_SPEED(__cap32) \
  2172. (FW_PORT_CAP32_SPEED_V(FW_PORT_CAP32_SPEED_M) & __cap32)
  2173. #define CAP32_FEC(__cap32) \
  2174. (FW_PORT_CAP32_FEC_V(FW_PORT_CAP32_FEC_M) & __cap32)
  2175. enum fw_port_action {
  2176. FW_PORT_ACTION_L1_CFG = 0x0001,
  2177. FW_PORT_ACTION_L2_CFG = 0x0002,
  2178. FW_PORT_ACTION_GET_PORT_INFO = 0x0003,
  2179. FW_PORT_ACTION_L2_PPP_CFG = 0x0004,
  2180. FW_PORT_ACTION_L2_DCB_CFG = 0x0005,
  2181. FW_PORT_ACTION_DCB_READ_TRANS = 0x0006,
  2182. FW_PORT_ACTION_DCB_READ_RECV = 0x0007,
  2183. FW_PORT_ACTION_DCB_READ_DET = 0x0008,
  2184. FW_PORT_ACTION_L1_CFG32 = 0x0009,
  2185. FW_PORT_ACTION_GET_PORT_INFO32 = 0x000a,
  2186. FW_PORT_ACTION_LOW_PWR_TO_NORMAL = 0x0010,
  2187. FW_PORT_ACTION_L1_LOW_PWR_EN = 0x0011,
  2188. FW_PORT_ACTION_L2_WOL_MODE_EN = 0x0012,
  2189. FW_PORT_ACTION_LPBK_TO_NORMAL = 0x0020,
  2190. FW_PORT_ACTION_L1_LPBK = 0x0021,
  2191. FW_PORT_ACTION_L1_PMA_LPBK = 0x0022,
  2192. FW_PORT_ACTION_L1_PCS_LPBK = 0x0023,
  2193. FW_PORT_ACTION_L1_PHYXS_CSIDE_LPBK = 0x0024,
  2194. FW_PORT_ACTION_L1_PHYXS_ESIDE_LPBK = 0x0025,
  2195. FW_PORT_ACTION_PHY_RESET = 0x0040,
  2196. FW_PORT_ACTION_PMA_RESET = 0x0041,
  2197. FW_PORT_ACTION_PCS_RESET = 0x0042,
  2198. FW_PORT_ACTION_PHYXS_RESET = 0x0043,
  2199. FW_PORT_ACTION_DTEXS_REEST = 0x0044,
  2200. FW_PORT_ACTION_AN_RESET = 0x0045
  2201. };
  2202. enum fw_port_l2cfg_ctlbf {
  2203. FW_PORT_L2_CTLBF_OVLAN0 = 0x01,
  2204. FW_PORT_L2_CTLBF_OVLAN1 = 0x02,
  2205. FW_PORT_L2_CTLBF_OVLAN2 = 0x04,
  2206. FW_PORT_L2_CTLBF_OVLAN3 = 0x08,
  2207. FW_PORT_L2_CTLBF_IVLAN = 0x10,
  2208. FW_PORT_L2_CTLBF_TXIPG = 0x20
  2209. };
  2210. enum fw_port_dcb_versions {
  2211. FW_PORT_DCB_VER_UNKNOWN,
  2212. FW_PORT_DCB_VER_CEE1D0,
  2213. FW_PORT_DCB_VER_CEE1D01,
  2214. FW_PORT_DCB_VER_IEEE,
  2215. FW_PORT_DCB_VER_AUTO = 7
  2216. };
  2217. enum fw_port_dcb_cfg {
  2218. FW_PORT_DCB_CFG_PG = 0x01,
  2219. FW_PORT_DCB_CFG_PFC = 0x02,
  2220. FW_PORT_DCB_CFG_APPL = 0x04
  2221. };
  2222. enum fw_port_dcb_cfg_rc {
  2223. FW_PORT_DCB_CFG_SUCCESS = 0x0,
  2224. FW_PORT_DCB_CFG_ERROR = 0x1
  2225. };
  2226. enum fw_port_dcb_type {
  2227. FW_PORT_DCB_TYPE_PGID = 0x00,
  2228. FW_PORT_DCB_TYPE_PGRATE = 0x01,
  2229. FW_PORT_DCB_TYPE_PRIORATE = 0x02,
  2230. FW_PORT_DCB_TYPE_PFC = 0x03,
  2231. FW_PORT_DCB_TYPE_APP_ID = 0x04,
  2232. FW_PORT_DCB_TYPE_CONTROL = 0x05,
  2233. };
  2234. enum fw_port_dcb_feature_state {
  2235. FW_PORT_DCB_FEATURE_STATE_PENDING = 0x0,
  2236. FW_PORT_DCB_FEATURE_STATE_SUCCESS = 0x1,
  2237. FW_PORT_DCB_FEATURE_STATE_ERROR = 0x2,
  2238. FW_PORT_DCB_FEATURE_STATE_TIMEOUT = 0x3,
  2239. };
  2240. struct fw_port_cmd {
  2241. __be32 op_to_portid;
  2242. __be32 action_to_len16;
  2243. union fw_port {
  2244. struct fw_port_l1cfg {
  2245. __be32 rcap;
  2246. __be32 r;
  2247. } l1cfg;
  2248. struct fw_port_l2cfg {
  2249. __u8 ctlbf;
  2250. __u8 ovlan3_to_ivlan0;
  2251. __be16 ivlantype;
  2252. __be16 txipg_force_pinfo;
  2253. __be16 mtu;
  2254. __be16 ovlan0mask;
  2255. __be16 ovlan0type;
  2256. __be16 ovlan1mask;
  2257. __be16 ovlan1type;
  2258. __be16 ovlan2mask;
  2259. __be16 ovlan2type;
  2260. __be16 ovlan3mask;
  2261. __be16 ovlan3type;
  2262. } l2cfg;
  2263. struct fw_port_info {
  2264. __be32 lstatus_to_modtype;
  2265. __be16 pcap;
  2266. __be16 acap;
  2267. __be16 mtu;
  2268. __u8 cbllen;
  2269. __u8 auxlinfo;
  2270. __u8 dcbxdis_pkd;
  2271. __u8 r8_lo;
  2272. __be16 lpacap;
  2273. __be64 r9;
  2274. } info;
  2275. struct fw_port_diags {
  2276. __u8 diagop;
  2277. __u8 r[3];
  2278. __be32 diagval;
  2279. } diags;
  2280. union fw_port_dcb {
  2281. struct fw_port_dcb_pgid {
  2282. __u8 type;
  2283. __u8 apply_pkd;
  2284. __u8 r10_lo[2];
  2285. __be32 pgid;
  2286. __be64 r11;
  2287. } pgid;
  2288. struct fw_port_dcb_pgrate {
  2289. __u8 type;
  2290. __u8 apply_pkd;
  2291. __u8 r10_lo[5];
  2292. __u8 num_tcs_supported;
  2293. __u8 pgrate[8];
  2294. __u8 tsa[8];
  2295. } pgrate;
  2296. struct fw_port_dcb_priorate {
  2297. __u8 type;
  2298. __u8 apply_pkd;
  2299. __u8 r10_lo[6];
  2300. __u8 strict_priorate[8];
  2301. } priorate;
  2302. struct fw_port_dcb_pfc {
  2303. __u8 type;
  2304. __u8 pfcen;
  2305. __u8 r10[5];
  2306. __u8 max_pfc_tcs;
  2307. __be64 r11;
  2308. } pfc;
  2309. struct fw_port_app_priority {
  2310. __u8 type;
  2311. __u8 r10[2];
  2312. __u8 idx;
  2313. __u8 user_prio_map;
  2314. __u8 sel_field;
  2315. __be16 protocolid;
  2316. __be64 r12;
  2317. } app_priority;
  2318. struct fw_port_dcb_control {
  2319. __u8 type;
  2320. __u8 all_syncd_pkd;
  2321. __be16 dcb_version_to_app_state;
  2322. __be32 r11;
  2323. __be64 r12;
  2324. } control;
  2325. } dcb;
  2326. struct fw_port_l1cfg32 {
  2327. __be32 rcap32;
  2328. __be32 r;
  2329. } l1cfg32;
  2330. struct fw_port_info32 {
  2331. __be32 lstatus32_to_cbllen32;
  2332. __be32 auxlinfo32_mtu32;
  2333. __be32 linkattr32;
  2334. __be32 pcaps32;
  2335. __be32 acaps32;
  2336. __be32 lpacaps32;
  2337. } info32;
  2338. } u;
  2339. };
  2340. #define FW_PORT_CMD_READ_S 22
  2341. #define FW_PORT_CMD_READ_V(x) ((x) << FW_PORT_CMD_READ_S)
  2342. #define FW_PORT_CMD_READ_F FW_PORT_CMD_READ_V(1U)
  2343. #define FW_PORT_CMD_PORTID_S 0
  2344. #define FW_PORT_CMD_PORTID_M 0xf
  2345. #define FW_PORT_CMD_PORTID_V(x) ((x) << FW_PORT_CMD_PORTID_S)
  2346. #define FW_PORT_CMD_PORTID_G(x) \
  2347. (((x) >> FW_PORT_CMD_PORTID_S) & FW_PORT_CMD_PORTID_M)
  2348. #define FW_PORT_CMD_ACTION_S 16
  2349. #define FW_PORT_CMD_ACTION_M 0xffff
  2350. #define FW_PORT_CMD_ACTION_V(x) ((x) << FW_PORT_CMD_ACTION_S)
  2351. #define FW_PORT_CMD_ACTION_G(x) \
  2352. (((x) >> FW_PORT_CMD_ACTION_S) & FW_PORT_CMD_ACTION_M)
  2353. #define FW_PORT_CMD_OVLAN3_S 7
  2354. #define FW_PORT_CMD_OVLAN3_V(x) ((x) << FW_PORT_CMD_OVLAN3_S)
  2355. #define FW_PORT_CMD_OVLAN2_S 6
  2356. #define FW_PORT_CMD_OVLAN2_V(x) ((x) << FW_PORT_CMD_OVLAN2_S)
  2357. #define FW_PORT_CMD_OVLAN1_S 5
  2358. #define FW_PORT_CMD_OVLAN1_V(x) ((x) << FW_PORT_CMD_OVLAN1_S)
  2359. #define FW_PORT_CMD_OVLAN0_S 4
  2360. #define FW_PORT_CMD_OVLAN0_V(x) ((x) << FW_PORT_CMD_OVLAN0_S)
  2361. #define FW_PORT_CMD_IVLAN0_S 3
  2362. #define FW_PORT_CMD_IVLAN0_V(x) ((x) << FW_PORT_CMD_IVLAN0_S)
  2363. #define FW_PORT_CMD_TXIPG_S 3
  2364. #define FW_PORT_CMD_TXIPG_V(x) ((x) << FW_PORT_CMD_TXIPG_S)
  2365. #define FW_PORT_CMD_LSTATUS_S 31
  2366. #define FW_PORT_CMD_LSTATUS_M 0x1
  2367. #define FW_PORT_CMD_LSTATUS_V(x) ((x) << FW_PORT_CMD_LSTATUS_S)
  2368. #define FW_PORT_CMD_LSTATUS_G(x) \
  2369. (((x) >> FW_PORT_CMD_LSTATUS_S) & FW_PORT_CMD_LSTATUS_M)
  2370. #define FW_PORT_CMD_LSTATUS_F FW_PORT_CMD_LSTATUS_V(1U)
  2371. #define FW_PORT_CMD_LSPEED_S 24
  2372. #define FW_PORT_CMD_LSPEED_M 0x3f
  2373. #define FW_PORT_CMD_LSPEED_V(x) ((x) << FW_PORT_CMD_LSPEED_S)
  2374. #define FW_PORT_CMD_LSPEED_G(x) \
  2375. (((x) >> FW_PORT_CMD_LSPEED_S) & FW_PORT_CMD_LSPEED_M)
  2376. #define FW_PORT_CMD_TXPAUSE_S 23
  2377. #define FW_PORT_CMD_TXPAUSE_V(x) ((x) << FW_PORT_CMD_TXPAUSE_S)
  2378. #define FW_PORT_CMD_TXPAUSE_F FW_PORT_CMD_TXPAUSE_V(1U)
  2379. #define FW_PORT_CMD_RXPAUSE_S 22
  2380. #define FW_PORT_CMD_RXPAUSE_V(x) ((x) << FW_PORT_CMD_RXPAUSE_S)
  2381. #define FW_PORT_CMD_RXPAUSE_F FW_PORT_CMD_RXPAUSE_V(1U)
  2382. #define FW_PORT_CMD_MDIOCAP_S 21
  2383. #define FW_PORT_CMD_MDIOCAP_V(x) ((x) << FW_PORT_CMD_MDIOCAP_S)
  2384. #define FW_PORT_CMD_MDIOCAP_F FW_PORT_CMD_MDIOCAP_V(1U)
  2385. #define FW_PORT_CMD_MDIOADDR_S 16
  2386. #define FW_PORT_CMD_MDIOADDR_M 0x1f
  2387. #define FW_PORT_CMD_MDIOADDR_G(x) \
  2388. (((x) >> FW_PORT_CMD_MDIOADDR_S) & FW_PORT_CMD_MDIOADDR_M)
  2389. #define FW_PORT_CMD_LPTXPAUSE_S 15
  2390. #define FW_PORT_CMD_LPTXPAUSE_V(x) ((x) << FW_PORT_CMD_LPTXPAUSE_S)
  2391. #define FW_PORT_CMD_LPTXPAUSE_F FW_PORT_CMD_LPTXPAUSE_V(1U)
  2392. #define FW_PORT_CMD_LPRXPAUSE_S 14
  2393. #define FW_PORT_CMD_LPRXPAUSE_V(x) ((x) << FW_PORT_CMD_LPRXPAUSE_S)
  2394. #define FW_PORT_CMD_LPRXPAUSE_F FW_PORT_CMD_LPRXPAUSE_V(1U)
  2395. #define FW_PORT_CMD_PTYPE_S 8
  2396. #define FW_PORT_CMD_PTYPE_M 0x1f
  2397. #define FW_PORT_CMD_PTYPE_G(x) \
  2398. (((x) >> FW_PORT_CMD_PTYPE_S) & FW_PORT_CMD_PTYPE_M)
  2399. #define FW_PORT_CMD_LINKDNRC_S 5
  2400. #define FW_PORT_CMD_LINKDNRC_M 0x7
  2401. #define FW_PORT_CMD_LINKDNRC_G(x) \
  2402. (((x) >> FW_PORT_CMD_LINKDNRC_S) & FW_PORT_CMD_LINKDNRC_M)
  2403. #define FW_PORT_CMD_MODTYPE_S 0
  2404. #define FW_PORT_CMD_MODTYPE_M 0x1f
  2405. #define FW_PORT_CMD_MODTYPE_V(x) ((x) << FW_PORT_CMD_MODTYPE_S)
  2406. #define FW_PORT_CMD_MODTYPE_G(x) \
  2407. (((x) >> FW_PORT_CMD_MODTYPE_S) & FW_PORT_CMD_MODTYPE_M)
  2408. #define FW_PORT_CMD_DCBXDIS_S 7
  2409. #define FW_PORT_CMD_DCBXDIS_V(x) ((x) << FW_PORT_CMD_DCBXDIS_S)
  2410. #define FW_PORT_CMD_DCBXDIS_F FW_PORT_CMD_DCBXDIS_V(1U)
  2411. #define FW_PORT_CMD_APPLY_S 7
  2412. #define FW_PORT_CMD_APPLY_V(x) ((x) << FW_PORT_CMD_APPLY_S)
  2413. #define FW_PORT_CMD_APPLY_F FW_PORT_CMD_APPLY_V(1U)
  2414. #define FW_PORT_CMD_ALL_SYNCD_S 7
  2415. #define FW_PORT_CMD_ALL_SYNCD_V(x) ((x) << FW_PORT_CMD_ALL_SYNCD_S)
  2416. #define FW_PORT_CMD_ALL_SYNCD_F FW_PORT_CMD_ALL_SYNCD_V(1U)
  2417. #define FW_PORT_CMD_DCB_VERSION_S 12
  2418. #define FW_PORT_CMD_DCB_VERSION_M 0x7
  2419. #define FW_PORT_CMD_DCB_VERSION_G(x) \
  2420. (((x) >> FW_PORT_CMD_DCB_VERSION_S) & FW_PORT_CMD_DCB_VERSION_M)
  2421. #define FW_PORT_CMD_LSTATUS32_S 31
  2422. #define FW_PORT_CMD_LSTATUS32_M 0x1
  2423. #define FW_PORT_CMD_LSTATUS32_V(x) ((x) << FW_PORT_CMD_LSTATUS32_S)
  2424. #define FW_PORT_CMD_LSTATUS32_G(x) \
  2425. (((x) >> FW_PORT_CMD_LSTATUS32_S) & FW_PORT_CMD_LSTATUS32_M)
  2426. #define FW_PORT_CMD_LSTATUS32_F FW_PORT_CMD_LSTATUS32_V(1U)
  2427. #define FW_PORT_CMD_LINKDNRC32_S 28
  2428. #define FW_PORT_CMD_LINKDNRC32_M 0x7
  2429. #define FW_PORT_CMD_LINKDNRC32_V(x) ((x) << FW_PORT_CMD_LINKDNRC32_S)
  2430. #define FW_PORT_CMD_LINKDNRC32_G(x) \
  2431. (((x) >> FW_PORT_CMD_LINKDNRC32_S) & FW_PORT_CMD_LINKDNRC32_M)
  2432. #define FW_PORT_CMD_DCBXDIS32_S 27
  2433. #define FW_PORT_CMD_DCBXDIS32_M 0x1
  2434. #define FW_PORT_CMD_DCBXDIS32_V(x) ((x) << FW_PORT_CMD_DCBXDIS32_S)
  2435. #define FW_PORT_CMD_DCBXDIS32_G(x) \
  2436. (((x) >> FW_PORT_CMD_DCBXDIS32_S) & FW_PORT_CMD_DCBXDIS32_M)
  2437. #define FW_PORT_CMD_DCBXDIS32_F FW_PORT_CMD_DCBXDIS32_V(1U)
  2438. #define FW_PORT_CMD_MDIOCAP32_S 26
  2439. #define FW_PORT_CMD_MDIOCAP32_M 0x1
  2440. #define FW_PORT_CMD_MDIOCAP32_V(x) ((x) << FW_PORT_CMD_MDIOCAP32_S)
  2441. #define FW_PORT_CMD_MDIOCAP32_G(x) \
  2442. (((x) >> FW_PORT_CMD_MDIOCAP32_S) & FW_PORT_CMD_MDIOCAP32_M)
  2443. #define FW_PORT_CMD_MDIOCAP32_F FW_PORT_CMD_MDIOCAP32_V(1U)
  2444. #define FW_PORT_CMD_MDIOADDR32_S 21
  2445. #define FW_PORT_CMD_MDIOADDR32_M 0x1f
  2446. #define FW_PORT_CMD_MDIOADDR32_V(x) ((x) << FW_PORT_CMD_MDIOADDR32_S)
  2447. #define FW_PORT_CMD_MDIOADDR32_G(x) \
  2448. (((x) >> FW_PORT_CMD_MDIOADDR32_S) & FW_PORT_CMD_MDIOADDR32_M)
  2449. #define FW_PORT_CMD_PORTTYPE32_S 13
  2450. #define FW_PORT_CMD_PORTTYPE32_M 0xff
  2451. #define FW_PORT_CMD_PORTTYPE32_V(x) ((x) << FW_PORT_CMD_PORTTYPE32_S)
  2452. #define FW_PORT_CMD_PORTTYPE32_G(x) \
  2453. (((x) >> FW_PORT_CMD_PORTTYPE32_S) & FW_PORT_CMD_PORTTYPE32_M)
  2454. #define FW_PORT_CMD_MODTYPE32_S 8
  2455. #define FW_PORT_CMD_MODTYPE32_M 0x1f
  2456. #define FW_PORT_CMD_MODTYPE32_V(x) ((x) << FW_PORT_CMD_MODTYPE32_S)
  2457. #define FW_PORT_CMD_MODTYPE32_G(x) \
  2458. (((x) >> FW_PORT_CMD_MODTYPE32_S) & FW_PORT_CMD_MODTYPE32_M)
  2459. #define FW_PORT_CMD_CBLLEN32_S 0
  2460. #define FW_PORT_CMD_CBLLEN32_M 0xff
  2461. #define FW_PORT_CMD_CBLLEN32_V(x) ((x) << FW_PORT_CMD_CBLLEN32_S)
  2462. #define FW_PORT_CMD_CBLLEN32_G(x) \
  2463. (((x) >> FW_PORT_CMD_CBLLEN32_S) & FW_PORT_CMD_CBLLEN32_M)
  2464. #define FW_PORT_CMD_AUXLINFO32_S 24
  2465. #define FW_PORT_CMD_AUXLINFO32_M 0xff
  2466. #define FW_PORT_CMD_AUXLINFO32_V(x) ((x) << FW_PORT_CMD_AUXLINFO32_S)
  2467. #define FW_PORT_CMD_AUXLINFO32_G(x) \
  2468. (((x) >> FW_PORT_CMD_AUXLINFO32_S) & FW_PORT_CMD_AUXLINFO32_M)
  2469. #define FW_PORT_AUXLINFO32_KX4_S 2
  2470. #define FW_PORT_AUXLINFO32_KX4_M 0x1
  2471. #define FW_PORT_AUXLINFO32_KX4_V(x) \
  2472. ((x) << FW_PORT_AUXLINFO32_KX4_S)
  2473. #define FW_PORT_AUXLINFO32_KX4_G(x) \
  2474. (((x) >> FW_PORT_AUXLINFO32_KX4_S) & FW_PORT_AUXLINFO32_KX4_M)
  2475. #define FW_PORT_AUXLINFO32_KX4_F FW_PORT_AUXLINFO32_KX4_V(1U)
  2476. #define FW_PORT_AUXLINFO32_KR_S 1
  2477. #define FW_PORT_AUXLINFO32_KR_M 0x1
  2478. #define FW_PORT_AUXLINFO32_KR_V(x) \
  2479. ((x) << FW_PORT_AUXLINFO32_KR_S)
  2480. #define FW_PORT_AUXLINFO32_KR_G(x) \
  2481. (((x) >> FW_PORT_AUXLINFO32_KR_S) & FW_PORT_AUXLINFO32_KR_M)
  2482. #define FW_PORT_AUXLINFO32_KR_F FW_PORT_AUXLINFO32_KR_V(1U)
  2483. #define FW_PORT_CMD_MTU32_S 0
  2484. #define FW_PORT_CMD_MTU32_M 0xffff
  2485. #define FW_PORT_CMD_MTU32_V(x) ((x) << FW_PORT_CMD_MTU32_S)
  2486. #define FW_PORT_CMD_MTU32_G(x) \
  2487. (((x) >> FW_PORT_CMD_MTU32_S) & FW_PORT_CMD_MTU32_M)
  2488. enum fw_port_type {
  2489. FW_PORT_TYPE_FIBER_XFI,
  2490. FW_PORT_TYPE_FIBER_XAUI,
  2491. FW_PORT_TYPE_BT_SGMII,
  2492. FW_PORT_TYPE_BT_XFI,
  2493. FW_PORT_TYPE_BT_XAUI,
  2494. FW_PORT_TYPE_KX4,
  2495. FW_PORT_TYPE_CX4,
  2496. FW_PORT_TYPE_KX,
  2497. FW_PORT_TYPE_KR,
  2498. FW_PORT_TYPE_SFP,
  2499. FW_PORT_TYPE_BP_AP,
  2500. FW_PORT_TYPE_BP4_AP,
  2501. FW_PORT_TYPE_QSFP_10G,
  2502. FW_PORT_TYPE_QSA,
  2503. FW_PORT_TYPE_QSFP,
  2504. FW_PORT_TYPE_BP40_BA,
  2505. FW_PORT_TYPE_KR4_100G,
  2506. FW_PORT_TYPE_CR4_QSFP,
  2507. FW_PORT_TYPE_CR_QSFP,
  2508. FW_PORT_TYPE_CR2_QSFP,
  2509. FW_PORT_TYPE_SFP28,
  2510. FW_PORT_TYPE_KR_SFP28,
  2511. FW_PORT_TYPE_KR_XLAUI,
  2512. FW_PORT_TYPE_NONE = FW_PORT_CMD_PTYPE_M
  2513. };
  2514. enum fw_port_module_type {
  2515. FW_PORT_MOD_TYPE_NA,
  2516. FW_PORT_MOD_TYPE_LR,
  2517. FW_PORT_MOD_TYPE_SR,
  2518. FW_PORT_MOD_TYPE_ER,
  2519. FW_PORT_MOD_TYPE_TWINAX_PASSIVE,
  2520. FW_PORT_MOD_TYPE_TWINAX_ACTIVE,
  2521. FW_PORT_MOD_TYPE_LRM,
  2522. FW_PORT_MOD_TYPE_ERROR = FW_PORT_CMD_MODTYPE_M - 3,
  2523. FW_PORT_MOD_TYPE_UNKNOWN = FW_PORT_CMD_MODTYPE_M - 2,
  2524. FW_PORT_MOD_TYPE_NOTSUPPORTED = FW_PORT_CMD_MODTYPE_M - 1,
  2525. FW_PORT_MOD_TYPE_NONE = FW_PORT_CMD_MODTYPE_M
  2526. };
  2527. enum fw_port_mod_sub_type {
  2528. FW_PORT_MOD_SUB_TYPE_NA,
  2529. FW_PORT_MOD_SUB_TYPE_MV88E114X = 0x1,
  2530. FW_PORT_MOD_SUB_TYPE_TN8022 = 0x2,
  2531. FW_PORT_MOD_SUB_TYPE_AQ1202 = 0x3,
  2532. FW_PORT_MOD_SUB_TYPE_88x3120 = 0x4,
  2533. FW_PORT_MOD_SUB_TYPE_BCM84834 = 0x5,
  2534. FW_PORT_MOD_SUB_TYPE_BT_VSC8634 = 0x8,
  2535. /* The following will never been in the VPD. They are TWINAX cable
  2536. * lengths decoded from SFP+ module i2c PROMs. These should
  2537. * almost certainly go somewhere else ...
  2538. */
  2539. FW_PORT_MOD_SUB_TYPE_TWINAX_1 = 0x9,
  2540. FW_PORT_MOD_SUB_TYPE_TWINAX_3 = 0xA,
  2541. FW_PORT_MOD_SUB_TYPE_TWINAX_5 = 0xB,
  2542. FW_PORT_MOD_SUB_TYPE_TWINAX_7 = 0xC,
  2543. };
  2544. enum fw_port_stats_tx_index {
  2545. FW_STAT_TX_PORT_BYTES_IX = 0,
  2546. FW_STAT_TX_PORT_FRAMES_IX,
  2547. FW_STAT_TX_PORT_BCAST_IX,
  2548. FW_STAT_TX_PORT_MCAST_IX,
  2549. FW_STAT_TX_PORT_UCAST_IX,
  2550. FW_STAT_TX_PORT_ERROR_IX,
  2551. FW_STAT_TX_PORT_64B_IX,
  2552. FW_STAT_TX_PORT_65B_127B_IX,
  2553. FW_STAT_TX_PORT_128B_255B_IX,
  2554. FW_STAT_TX_PORT_256B_511B_IX,
  2555. FW_STAT_TX_PORT_512B_1023B_IX,
  2556. FW_STAT_TX_PORT_1024B_1518B_IX,
  2557. FW_STAT_TX_PORT_1519B_MAX_IX,
  2558. FW_STAT_TX_PORT_DROP_IX,
  2559. FW_STAT_TX_PORT_PAUSE_IX,
  2560. FW_STAT_TX_PORT_PPP0_IX,
  2561. FW_STAT_TX_PORT_PPP1_IX,
  2562. FW_STAT_TX_PORT_PPP2_IX,
  2563. FW_STAT_TX_PORT_PPP3_IX,
  2564. FW_STAT_TX_PORT_PPP4_IX,
  2565. FW_STAT_TX_PORT_PPP5_IX,
  2566. FW_STAT_TX_PORT_PPP6_IX,
  2567. FW_STAT_TX_PORT_PPP7_IX,
  2568. FW_NUM_PORT_TX_STATS
  2569. };
  2570. enum fw_port_stat_rx_index {
  2571. FW_STAT_RX_PORT_BYTES_IX = 0,
  2572. FW_STAT_RX_PORT_FRAMES_IX,
  2573. FW_STAT_RX_PORT_BCAST_IX,
  2574. FW_STAT_RX_PORT_MCAST_IX,
  2575. FW_STAT_RX_PORT_UCAST_IX,
  2576. FW_STAT_RX_PORT_MTU_ERROR_IX,
  2577. FW_STAT_RX_PORT_MTU_CRC_ERROR_IX,
  2578. FW_STAT_RX_PORT_CRC_ERROR_IX,
  2579. FW_STAT_RX_PORT_LEN_ERROR_IX,
  2580. FW_STAT_RX_PORT_SYM_ERROR_IX,
  2581. FW_STAT_RX_PORT_64B_IX,
  2582. FW_STAT_RX_PORT_65B_127B_IX,
  2583. FW_STAT_RX_PORT_128B_255B_IX,
  2584. FW_STAT_RX_PORT_256B_511B_IX,
  2585. FW_STAT_RX_PORT_512B_1023B_IX,
  2586. FW_STAT_RX_PORT_1024B_1518B_IX,
  2587. FW_STAT_RX_PORT_1519B_MAX_IX,
  2588. FW_STAT_RX_PORT_PAUSE_IX,
  2589. FW_STAT_RX_PORT_PPP0_IX,
  2590. FW_STAT_RX_PORT_PPP1_IX,
  2591. FW_STAT_RX_PORT_PPP2_IX,
  2592. FW_STAT_RX_PORT_PPP3_IX,
  2593. FW_STAT_RX_PORT_PPP4_IX,
  2594. FW_STAT_RX_PORT_PPP5_IX,
  2595. FW_STAT_RX_PORT_PPP6_IX,
  2596. FW_STAT_RX_PORT_PPP7_IX,
  2597. FW_STAT_RX_PORT_LESS_64B_IX,
  2598. FW_STAT_RX_PORT_MAC_ERROR_IX,
  2599. FW_NUM_PORT_RX_STATS
  2600. };
  2601. /* port stats */
  2602. #define FW_NUM_PORT_STATS (FW_NUM_PORT_TX_STATS + FW_NUM_PORT_RX_STATS)
  2603. struct fw_port_stats_cmd {
  2604. __be32 op_to_portid;
  2605. __be32 retval_len16;
  2606. union fw_port_stats {
  2607. struct fw_port_stats_ctl {
  2608. u8 nstats_bg_bm;
  2609. u8 tx_ix;
  2610. __be16 r6;
  2611. __be32 r7;
  2612. __be64 stat0;
  2613. __be64 stat1;
  2614. __be64 stat2;
  2615. __be64 stat3;
  2616. __be64 stat4;
  2617. __be64 stat5;
  2618. } ctl;
  2619. struct fw_port_stats_all {
  2620. __be64 tx_bytes;
  2621. __be64 tx_frames;
  2622. __be64 tx_bcast;
  2623. __be64 tx_mcast;
  2624. __be64 tx_ucast;
  2625. __be64 tx_error;
  2626. __be64 tx_64b;
  2627. __be64 tx_65b_127b;
  2628. __be64 tx_128b_255b;
  2629. __be64 tx_256b_511b;
  2630. __be64 tx_512b_1023b;
  2631. __be64 tx_1024b_1518b;
  2632. __be64 tx_1519b_max;
  2633. __be64 tx_drop;
  2634. __be64 tx_pause;
  2635. __be64 tx_ppp0;
  2636. __be64 tx_ppp1;
  2637. __be64 tx_ppp2;
  2638. __be64 tx_ppp3;
  2639. __be64 tx_ppp4;
  2640. __be64 tx_ppp5;
  2641. __be64 tx_ppp6;
  2642. __be64 tx_ppp7;
  2643. __be64 rx_bytes;
  2644. __be64 rx_frames;
  2645. __be64 rx_bcast;
  2646. __be64 rx_mcast;
  2647. __be64 rx_ucast;
  2648. __be64 rx_mtu_error;
  2649. __be64 rx_mtu_crc_error;
  2650. __be64 rx_crc_error;
  2651. __be64 rx_len_error;
  2652. __be64 rx_sym_error;
  2653. __be64 rx_64b;
  2654. __be64 rx_65b_127b;
  2655. __be64 rx_128b_255b;
  2656. __be64 rx_256b_511b;
  2657. __be64 rx_512b_1023b;
  2658. __be64 rx_1024b_1518b;
  2659. __be64 rx_1519b_max;
  2660. __be64 rx_pause;
  2661. __be64 rx_ppp0;
  2662. __be64 rx_ppp1;
  2663. __be64 rx_ppp2;
  2664. __be64 rx_ppp3;
  2665. __be64 rx_ppp4;
  2666. __be64 rx_ppp5;
  2667. __be64 rx_ppp6;
  2668. __be64 rx_ppp7;
  2669. __be64 rx_less_64b;
  2670. __be64 rx_bg_drop;
  2671. __be64 rx_bg_trunc;
  2672. } all;
  2673. } u;
  2674. };
  2675. /* port loopback stats */
  2676. #define FW_NUM_LB_STATS 16
  2677. enum fw_port_lb_stats_index {
  2678. FW_STAT_LB_PORT_BYTES_IX,
  2679. FW_STAT_LB_PORT_FRAMES_IX,
  2680. FW_STAT_LB_PORT_BCAST_IX,
  2681. FW_STAT_LB_PORT_MCAST_IX,
  2682. FW_STAT_LB_PORT_UCAST_IX,
  2683. FW_STAT_LB_PORT_ERROR_IX,
  2684. FW_STAT_LB_PORT_64B_IX,
  2685. FW_STAT_LB_PORT_65B_127B_IX,
  2686. FW_STAT_LB_PORT_128B_255B_IX,
  2687. FW_STAT_LB_PORT_256B_511B_IX,
  2688. FW_STAT_LB_PORT_512B_1023B_IX,
  2689. FW_STAT_LB_PORT_1024B_1518B_IX,
  2690. FW_STAT_LB_PORT_1519B_MAX_IX,
  2691. FW_STAT_LB_PORT_DROP_FRAMES_IX
  2692. };
  2693. struct fw_port_lb_stats_cmd {
  2694. __be32 op_to_lbport;
  2695. __be32 retval_len16;
  2696. union fw_port_lb_stats {
  2697. struct fw_port_lb_stats_ctl {
  2698. u8 nstats_bg_bm;
  2699. u8 ix_pkd;
  2700. __be16 r6;
  2701. __be32 r7;
  2702. __be64 stat0;
  2703. __be64 stat1;
  2704. __be64 stat2;
  2705. __be64 stat3;
  2706. __be64 stat4;
  2707. __be64 stat5;
  2708. } ctl;
  2709. struct fw_port_lb_stats_all {
  2710. __be64 tx_bytes;
  2711. __be64 tx_frames;
  2712. __be64 tx_bcast;
  2713. __be64 tx_mcast;
  2714. __be64 tx_ucast;
  2715. __be64 tx_error;
  2716. __be64 tx_64b;
  2717. __be64 tx_65b_127b;
  2718. __be64 tx_128b_255b;
  2719. __be64 tx_256b_511b;
  2720. __be64 tx_512b_1023b;
  2721. __be64 tx_1024b_1518b;
  2722. __be64 tx_1519b_max;
  2723. __be64 rx_lb_drop;
  2724. __be64 rx_lb_trunc;
  2725. } all;
  2726. } u;
  2727. };
  2728. enum fw_ptp_subop {
  2729. /* none */
  2730. FW_PTP_SC_INIT_TIMER = 0x00,
  2731. FW_PTP_SC_TX_TYPE = 0x01,
  2732. /* init */
  2733. FW_PTP_SC_RXTIME_STAMP = 0x08,
  2734. FW_PTP_SC_RDRX_TYPE = 0x09,
  2735. /* ts */
  2736. FW_PTP_SC_ADJ_FREQ = 0x10,
  2737. FW_PTP_SC_ADJ_TIME = 0x11,
  2738. FW_PTP_SC_ADJ_FTIME = 0x12,
  2739. FW_PTP_SC_WALL_CLOCK = 0x13,
  2740. FW_PTP_SC_GET_TIME = 0x14,
  2741. FW_PTP_SC_SET_TIME = 0x15,
  2742. };
  2743. struct fw_ptp_cmd {
  2744. __be32 op_to_portid;
  2745. __be32 retval_len16;
  2746. union fw_ptp {
  2747. struct fw_ptp_sc {
  2748. __u8 sc;
  2749. __u8 r3[7];
  2750. } scmd;
  2751. struct fw_ptp_init {
  2752. __u8 sc;
  2753. __u8 txchan;
  2754. __be16 absid;
  2755. __be16 mode;
  2756. __be16 r3;
  2757. } init;
  2758. struct fw_ptp_ts {
  2759. __u8 sc;
  2760. __u8 sign;
  2761. __be16 r3;
  2762. __be32 ppb;
  2763. __be64 tm;
  2764. } ts;
  2765. } u;
  2766. __be64 r3;
  2767. };
  2768. #define FW_PTP_CMD_PORTID_S 0
  2769. #define FW_PTP_CMD_PORTID_M 0xf
  2770. #define FW_PTP_CMD_PORTID_V(x) ((x) << FW_PTP_CMD_PORTID_S)
  2771. #define FW_PTP_CMD_PORTID_G(x) \
  2772. (((x) >> FW_PTP_CMD_PORTID_S) & FW_PTP_CMD_PORTID_M)
  2773. struct fw_rss_ind_tbl_cmd {
  2774. __be32 op_to_viid;
  2775. __be32 retval_len16;
  2776. __be16 niqid;
  2777. __be16 startidx;
  2778. __be32 r3;
  2779. __be32 iq0_to_iq2;
  2780. __be32 iq3_to_iq5;
  2781. __be32 iq6_to_iq8;
  2782. __be32 iq9_to_iq11;
  2783. __be32 iq12_to_iq14;
  2784. __be32 iq15_to_iq17;
  2785. __be32 iq18_to_iq20;
  2786. __be32 iq21_to_iq23;
  2787. __be32 iq24_to_iq26;
  2788. __be32 iq27_to_iq29;
  2789. __be32 iq30_iq31;
  2790. __be32 r15_lo;
  2791. };
  2792. #define FW_RSS_IND_TBL_CMD_VIID_S 0
  2793. #define FW_RSS_IND_TBL_CMD_VIID_V(x) ((x) << FW_RSS_IND_TBL_CMD_VIID_S)
  2794. #define FW_RSS_IND_TBL_CMD_IQ0_S 20
  2795. #define FW_RSS_IND_TBL_CMD_IQ0_V(x) ((x) << FW_RSS_IND_TBL_CMD_IQ0_S)
  2796. #define FW_RSS_IND_TBL_CMD_IQ1_S 10
  2797. #define FW_RSS_IND_TBL_CMD_IQ1_V(x) ((x) << FW_RSS_IND_TBL_CMD_IQ1_S)
  2798. #define FW_RSS_IND_TBL_CMD_IQ2_S 0
  2799. #define FW_RSS_IND_TBL_CMD_IQ2_V(x) ((x) << FW_RSS_IND_TBL_CMD_IQ2_S)
  2800. struct fw_rss_glb_config_cmd {
  2801. __be32 op_to_write;
  2802. __be32 retval_len16;
  2803. union fw_rss_glb_config {
  2804. struct fw_rss_glb_config_manual {
  2805. __be32 mode_pkd;
  2806. __be32 r3;
  2807. __be64 r4;
  2808. __be64 r5;
  2809. } manual;
  2810. struct fw_rss_glb_config_basicvirtual {
  2811. __be32 mode_pkd;
  2812. __be32 synmapen_to_hashtoeplitz;
  2813. __be64 r8;
  2814. __be64 r9;
  2815. } basicvirtual;
  2816. } u;
  2817. };
  2818. #define FW_RSS_GLB_CONFIG_CMD_MODE_S 28
  2819. #define FW_RSS_GLB_CONFIG_CMD_MODE_M 0xf
  2820. #define FW_RSS_GLB_CONFIG_CMD_MODE_V(x) ((x) << FW_RSS_GLB_CONFIG_CMD_MODE_S)
  2821. #define FW_RSS_GLB_CONFIG_CMD_MODE_G(x) \
  2822. (((x) >> FW_RSS_GLB_CONFIG_CMD_MODE_S) & FW_RSS_GLB_CONFIG_CMD_MODE_M)
  2823. #define FW_RSS_GLB_CONFIG_CMD_MODE_MANUAL 0
  2824. #define FW_RSS_GLB_CONFIG_CMD_MODE_BASICVIRTUAL 1
  2825. #define FW_RSS_GLB_CONFIG_CMD_SYNMAPEN_S 8
  2826. #define FW_RSS_GLB_CONFIG_CMD_SYNMAPEN_V(x) \
  2827. ((x) << FW_RSS_GLB_CONFIG_CMD_SYNMAPEN_S)
  2828. #define FW_RSS_GLB_CONFIG_CMD_SYNMAPEN_F \
  2829. FW_RSS_GLB_CONFIG_CMD_SYNMAPEN_V(1U)
  2830. #define FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6_S 7
  2831. #define FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6_V(x) \
  2832. ((x) << FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6_S)
  2833. #define FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6_F \
  2834. FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6_V(1U)
  2835. #define FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6_S 6
  2836. #define FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6_V(x) \
  2837. ((x) << FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6_S)
  2838. #define FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6_F \
  2839. FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6_V(1U)
  2840. #define FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4_S 5
  2841. #define FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4_V(x) \
  2842. ((x) << FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4_S)
  2843. #define FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4_F \
  2844. FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4_V(1U)
  2845. #define FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4_S 4
  2846. #define FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4_V(x) \
  2847. ((x) << FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4_S)
  2848. #define FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4_F \
  2849. FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4_V(1U)
  2850. #define FW_RSS_GLB_CONFIG_CMD_OFDMAPEN_S 3
  2851. #define FW_RSS_GLB_CONFIG_CMD_OFDMAPEN_V(x) \
  2852. ((x) << FW_RSS_GLB_CONFIG_CMD_OFDMAPEN_S)
  2853. #define FW_RSS_GLB_CONFIG_CMD_OFDMAPEN_F \
  2854. FW_RSS_GLB_CONFIG_CMD_OFDMAPEN_V(1U)
  2855. #define FW_RSS_GLB_CONFIG_CMD_TNLMAPEN_S 2
  2856. #define FW_RSS_GLB_CONFIG_CMD_TNLMAPEN_V(x) \
  2857. ((x) << FW_RSS_GLB_CONFIG_CMD_TNLMAPEN_S)
  2858. #define FW_RSS_GLB_CONFIG_CMD_TNLMAPEN_F \
  2859. FW_RSS_GLB_CONFIG_CMD_TNLMAPEN_V(1U)
  2860. #define FW_RSS_GLB_CONFIG_CMD_TNLALLLKP_S 1
  2861. #define FW_RSS_GLB_CONFIG_CMD_TNLALLLKP_V(x) \
  2862. ((x) << FW_RSS_GLB_CONFIG_CMD_TNLALLLKP_S)
  2863. #define FW_RSS_GLB_CONFIG_CMD_TNLALLLKP_F \
  2864. FW_RSS_GLB_CONFIG_CMD_TNLALLLKP_V(1U)
  2865. #define FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ_S 0
  2866. #define FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ_V(x) \
  2867. ((x) << FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ_S)
  2868. #define FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ_F \
  2869. FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ_V(1U)
  2870. struct fw_rss_vi_config_cmd {
  2871. __be32 op_to_viid;
  2872. #define FW_RSS_VI_CONFIG_CMD_VIID(x) ((x) << 0)
  2873. __be32 retval_len16;
  2874. union fw_rss_vi_config {
  2875. struct fw_rss_vi_config_manual {
  2876. __be64 r3;
  2877. __be64 r4;
  2878. __be64 r5;
  2879. } manual;
  2880. struct fw_rss_vi_config_basicvirtual {
  2881. __be32 r6;
  2882. __be32 defaultq_to_udpen;
  2883. __be64 r9;
  2884. __be64 r10;
  2885. } basicvirtual;
  2886. } u;
  2887. };
  2888. #define FW_RSS_VI_CONFIG_CMD_VIID_S 0
  2889. #define FW_RSS_VI_CONFIG_CMD_VIID_V(x) ((x) << FW_RSS_VI_CONFIG_CMD_VIID_S)
  2890. #define FW_RSS_VI_CONFIG_CMD_DEFAULTQ_S 16
  2891. #define FW_RSS_VI_CONFIG_CMD_DEFAULTQ_M 0x3ff
  2892. #define FW_RSS_VI_CONFIG_CMD_DEFAULTQ_V(x) \
  2893. ((x) << FW_RSS_VI_CONFIG_CMD_DEFAULTQ_S)
  2894. #define FW_RSS_VI_CONFIG_CMD_DEFAULTQ_G(x) \
  2895. (((x) >> FW_RSS_VI_CONFIG_CMD_DEFAULTQ_S) & \
  2896. FW_RSS_VI_CONFIG_CMD_DEFAULTQ_M)
  2897. #define FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN_S 4
  2898. #define FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN_V(x) \
  2899. ((x) << FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN_S)
  2900. #define FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN_F \
  2901. FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN_V(1U)
  2902. #define FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN_S 3
  2903. #define FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN_V(x) \
  2904. ((x) << FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN_S)
  2905. #define FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN_F \
  2906. FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN_V(1U)
  2907. #define FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN_S 2
  2908. #define FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN_V(x) \
  2909. ((x) << FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN_S)
  2910. #define FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN_F \
  2911. FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN_V(1U)
  2912. #define FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN_S 1
  2913. #define FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN_V(x) \
  2914. ((x) << FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN_S)
  2915. #define FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN_F \
  2916. FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN_V(1U)
  2917. #define FW_RSS_VI_CONFIG_CMD_UDPEN_S 0
  2918. #define FW_RSS_VI_CONFIG_CMD_UDPEN_V(x) ((x) << FW_RSS_VI_CONFIG_CMD_UDPEN_S)
  2919. #define FW_RSS_VI_CONFIG_CMD_UDPEN_F FW_RSS_VI_CONFIG_CMD_UDPEN_V(1U)
  2920. enum fw_sched_sc {
  2921. FW_SCHED_SC_PARAMS = 1,
  2922. };
  2923. struct fw_sched_cmd {
  2924. __be32 op_to_write;
  2925. __be32 retval_len16;
  2926. union fw_sched {
  2927. struct fw_sched_config {
  2928. __u8 sc;
  2929. __u8 type;
  2930. __u8 minmaxen;
  2931. __u8 r3[5];
  2932. __u8 nclasses[4];
  2933. __be32 r4;
  2934. } config;
  2935. struct fw_sched_params {
  2936. __u8 sc;
  2937. __u8 type;
  2938. __u8 level;
  2939. __u8 mode;
  2940. __u8 unit;
  2941. __u8 rate;
  2942. __u8 ch;
  2943. __u8 cl;
  2944. __be32 min;
  2945. __be32 max;
  2946. __be16 weight;
  2947. __be16 pktsize;
  2948. __be16 burstsize;
  2949. __be16 r4;
  2950. } params;
  2951. } u;
  2952. };
  2953. struct fw_clip_cmd {
  2954. __be32 op_to_write;
  2955. __be32 alloc_to_len16;
  2956. __be64 ip_hi;
  2957. __be64 ip_lo;
  2958. __be32 r4[2];
  2959. };
  2960. #define FW_CLIP_CMD_ALLOC_S 31
  2961. #define FW_CLIP_CMD_ALLOC_V(x) ((x) << FW_CLIP_CMD_ALLOC_S)
  2962. #define FW_CLIP_CMD_ALLOC_F FW_CLIP_CMD_ALLOC_V(1U)
  2963. #define FW_CLIP_CMD_FREE_S 30
  2964. #define FW_CLIP_CMD_FREE_V(x) ((x) << FW_CLIP_CMD_FREE_S)
  2965. #define FW_CLIP_CMD_FREE_F FW_CLIP_CMD_FREE_V(1U)
  2966. enum fw_error_type {
  2967. FW_ERROR_TYPE_EXCEPTION = 0x0,
  2968. FW_ERROR_TYPE_HWMODULE = 0x1,
  2969. FW_ERROR_TYPE_WR = 0x2,
  2970. FW_ERROR_TYPE_ACL = 0x3,
  2971. };
  2972. struct fw_error_cmd {
  2973. __be32 op_to_type;
  2974. __be32 len16_pkd;
  2975. union fw_error {
  2976. struct fw_error_exception {
  2977. __be32 info[6];
  2978. } exception;
  2979. struct fw_error_hwmodule {
  2980. __be32 regaddr;
  2981. __be32 regval;
  2982. } hwmodule;
  2983. struct fw_error_wr {
  2984. __be16 cidx;
  2985. __be16 pfn_vfn;
  2986. __be32 eqid;
  2987. u8 wrhdr[16];
  2988. } wr;
  2989. struct fw_error_acl {
  2990. __be16 cidx;
  2991. __be16 pfn_vfn;
  2992. __be32 eqid;
  2993. __be16 mv_pkd;
  2994. u8 val[6];
  2995. __be64 r4;
  2996. } acl;
  2997. } u;
  2998. };
  2999. struct fw_debug_cmd {
  3000. __be32 op_type;
  3001. __be32 len16_pkd;
  3002. union fw_debug {
  3003. struct fw_debug_assert {
  3004. __be32 fcid;
  3005. __be32 line;
  3006. __be32 x;
  3007. __be32 y;
  3008. u8 filename_0_7[8];
  3009. u8 filename_8_15[8];
  3010. __be64 r3;
  3011. } assert;
  3012. struct fw_debug_prt {
  3013. __be16 dprtstridx;
  3014. __be16 r3[3];
  3015. __be32 dprtstrparam0;
  3016. __be32 dprtstrparam1;
  3017. __be32 dprtstrparam2;
  3018. __be32 dprtstrparam3;
  3019. } prt;
  3020. } u;
  3021. };
  3022. #define FW_DEBUG_CMD_TYPE_S 0
  3023. #define FW_DEBUG_CMD_TYPE_M 0xff
  3024. #define FW_DEBUG_CMD_TYPE_G(x) \
  3025. (((x) >> FW_DEBUG_CMD_TYPE_S) & FW_DEBUG_CMD_TYPE_M)
  3026. struct fw_hma_cmd {
  3027. __be32 op_pkd;
  3028. __be32 retval_len16;
  3029. __be32 mode_to_pcie_params;
  3030. __be32 naddr_size;
  3031. __be32 addr_size_pkd;
  3032. __be32 r6;
  3033. __be64 phy_address[5];
  3034. };
  3035. #define FW_HMA_CMD_MODE_S 31
  3036. #define FW_HMA_CMD_MODE_M 0x1
  3037. #define FW_HMA_CMD_MODE_V(x) ((x) << FW_HMA_CMD_MODE_S)
  3038. #define FW_HMA_CMD_MODE_G(x) \
  3039. (((x) >> FW_HMA_CMD_MODE_S) & FW_HMA_CMD_MODE_M)
  3040. #define FW_HMA_CMD_MODE_F FW_HMA_CMD_MODE_V(1U)
  3041. #define FW_HMA_CMD_SOC_S 30
  3042. #define FW_HMA_CMD_SOC_M 0x1
  3043. #define FW_HMA_CMD_SOC_V(x) ((x) << FW_HMA_CMD_SOC_S)
  3044. #define FW_HMA_CMD_SOC_G(x) (((x) >> FW_HMA_CMD_SOC_S) & FW_HMA_CMD_SOC_M)
  3045. #define FW_HMA_CMD_SOC_F FW_HMA_CMD_SOC_V(1U)
  3046. #define FW_HMA_CMD_EOC_S 29
  3047. #define FW_HMA_CMD_EOC_M 0x1
  3048. #define FW_HMA_CMD_EOC_V(x) ((x) << FW_HMA_CMD_EOC_S)
  3049. #define FW_HMA_CMD_EOC_G(x) (((x) >> FW_HMA_CMD_EOC_S) & FW_HMA_CMD_EOC_M)
  3050. #define FW_HMA_CMD_EOC_F FW_HMA_CMD_EOC_V(1U)
  3051. #define FW_HMA_CMD_PCIE_PARAMS_S 0
  3052. #define FW_HMA_CMD_PCIE_PARAMS_M 0x7ffffff
  3053. #define FW_HMA_CMD_PCIE_PARAMS_V(x) ((x) << FW_HMA_CMD_PCIE_PARAMS_S)
  3054. #define FW_HMA_CMD_PCIE_PARAMS_G(x) \
  3055. (((x) >> FW_HMA_CMD_PCIE_PARAMS_S) & FW_HMA_CMD_PCIE_PARAMS_M)
  3056. #define FW_HMA_CMD_NADDR_S 12
  3057. #define FW_HMA_CMD_NADDR_M 0x3f
  3058. #define FW_HMA_CMD_NADDR_V(x) ((x) << FW_HMA_CMD_NADDR_S)
  3059. #define FW_HMA_CMD_NADDR_G(x) \
  3060. (((x) >> FW_HMA_CMD_NADDR_S) & FW_HMA_CMD_NADDR_M)
  3061. #define FW_HMA_CMD_SIZE_S 0
  3062. #define FW_HMA_CMD_SIZE_M 0xfff
  3063. #define FW_HMA_CMD_SIZE_V(x) ((x) << FW_HMA_CMD_SIZE_S)
  3064. #define FW_HMA_CMD_SIZE_G(x) \
  3065. (((x) >> FW_HMA_CMD_SIZE_S) & FW_HMA_CMD_SIZE_M)
  3066. #define FW_HMA_CMD_ADDR_SIZE_S 11
  3067. #define FW_HMA_CMD_ADDR_SIZE_M 0x1fffff
  3068. #define FW_HMA_CMD_ADDR_SIZE_V(x) ((x) << FW_HMA_CMD_ADDR_SIZE_S)
  3069. #define FW_HMA_CMD_ADDR_SIZE_G(x) \
  3070. (((x) >> FW_HMA_CMD_ADDR_SIZE_S) & FW_HMA_CMD_ADDR_SIZE_M)
  3071. enum pcie_fw_eval {
  3072. PCIE_FW_EVAL_CRASH = 0,
  3073. };
  3074. #define PCIE_FW_ERR_S 31
  3075. #define PCIE_FW_ERR_V(x) ((x) << PCIE_FW_ERR_S)
  3076. #define PCIE_FW_ERR_F PCIE_FW_ERR_V(1U)
  3077. #define PCIE_FW_INIT_S 30
  3078. #define PCIE_FW_INIT_V(x) ((x) << PCIE_FW_INIT_S)
  3079. #define PCIE_FW_INIT_F PCIE_FW_INIT_V(1U)
  3080. #define PCIE_FW_HALT_S 29
  3081. #define PCIE_FW_HALT_V(x) ((x) << PCIE_FW_HALT_S)
  3082. #define PCIE_FW_HALT_F PCIE_FW_HALT_V(1U)
  3083. #define PCIE_FW_EVAL_S 24
  3084. #define PCIE_FW_EVAL_M 0x7
  3085. #define PCIE_FW_EVAL_G(x) (((x) >> PCIE_FW_EVAL_S) & PCIE_FW_EVAL_M)
  3086. #define PCIE_FW_MASTER_VLD_S 15
  3087. #define PCIE_FW_MASTER_VLD_V(x) ((x) << PCIE_FW_MASTER_VLD_S)
  3088. #define PCIE_FW_MASTER_VLD_F PCIE_FW_MASTER_VLD_V(1U)
  3089. #define PCIE_FW_MASTER_S 12
  3090. #define PCIE_FW_MASTER_M 0x7
  3091. #define PCIE_FW_MASTER_V(x) ((x) << PCIE_FW_MASTER_S)
  3092. #define PCIE_FW_MASTER_G(x) (((x) >> PCIE_FW_MASTER_S) & PCIE_FW_MASTER_M)
  3093. struct fw_hdr {
  3094. u8 ver;
  3095. u8 chip; /* terminator chip type */
  3096. __be16 len512; /* bin length in units of 512-bytes */
  3097. __be32 fw_ver; /* firmware version */
  3098. __be32 tp_microcode_ver;
  3099. u8 intfver_nic;
  3100. u8 intfver_vnic;
  3101. u8 intfver_ofld;
  3102. u8 intfver_ri;
  3103. u8 intfver_iscsipdu;
  3104. u8 intfver_iscsi;
  3105. u8 intfver_fcoepdu;
  3106. u8 intfver_fcoe;
  3107. __u32 reserved2;
  3108. __u32 reserved3;
  3109. __u32 reserved4;
  3110. __be32 flags;
  3111. __be32 reserved6[23];
  3112. };
  3113. enum fw_hdr_chip {
  3114. FW_HDR_CHIP_T4,
  3115. FW_HDR_CHIP_T5,
  3116. FW_HDR_CHIP_T6
  3117. };
  3118. #define FW_HDR_FW_VER_MAJOR_S 24
  3119. #define FW_HDR_FW_VER_MAJOR_M 0xff
  3120. #define FW_HDR_FW_VER_MAJOR_V(x) \
  3121. ((x) << FW_HDR_FW_VER_MAJOR_S)
  3122. #define FW_HDR_FW_VER_MAJOR_G(x) \
  3123. (((x) >> FW_HDR_FW_VER_MAJOR_S) & FW_HDR_FW_VER_MAJOR_M)
  3124. #define FW_HDR_FW_VER_MINOR_S 16
  3125. #define FW_HDR_FW_VER_MINOR_M 0xff
  3126. #define FW_HDR_FW_VER_MINOR_V(x) \
  3127. ((x) << FW_HDR_FW_VER_MINOR_S)
  3128. #define FW_HDR_FW_VER_MINOR_G(x) \
  3129. (((x) >> FW_HDR_FW_VER_MINOR_S) & FW_HDR_FW_VER_MINOR_M)
  3130. #define FW_HDR_FW_VER_MICRO_S 8
  3131. #define FW_HDR_FW_VER_MICRO_M 0xff
  3132. #define FW_HDR_FW_VER_MICRO_V(x) \
  3133. ((x) << FW_HDR_FW_VER_MICRO_S)
  3134. #define FW_HDR_FW_VER_MICRO_G(x) \
  3135. (((x) >> FW_HDR_FW_VER_MICRO_S) & FW_HDR_FW_VER_MICRO_M)
  3136. #define FW_HDR_FW_VER_BUILD_S 0
  3137. #define FW_HDR_FW_VER_BUILD_M 0xff
  3138. #define FW_HDR_FW_VER_BUILD_V(x) \
  3139. ((x) << FW_HDR_FW_VER_BUILD_S)
  3140. #define FW_HDR_FW_VER_BUILD_G(x) \
  3141. (((x) >> FW_HDR_FW_VER_BUILD_S) & FW_HDR_FW_VER_BUILD_M)
  3142. enum fw_hdr_intfver {
  3143. FW_HDR_INTFVER_NIC = 0x00,
  3144. FW_HDR_INTFVER_VNIC = 0x00,
  3145. FW_HDR_INTFVER_OFLD = 0x00,
  3146. FW_HDR_INTFVER_RI = 0x00,
  3147. FW_HDR_INTFVER_ISCSIPDU = 0x00,
  3148. FW_HDR_INTFVER_ISCSI = 0x00,
  3149. FW_HDR_INTFVER_FCOEPDU = 0x00,
  3150. FW_HDR_INTFVER_FCOE = 0x00,
  3151. };
  3152. enum fw_hdr_flags {
  3153. FW_HDR_FLAGS_RESET_HALT = 0x00000001,
  3154. };
  3155. /* length of the formatting string */
  3156. #define FW_DEVLOG_FMT_LEN 192
  3157. /* maximum number of the formatting string parameters */
  3158. #define FW_DEVLOG_FMT_PARAMS_NUM 8
  3159. /* priority levels */
  3160. enum fw_devlog_level {
  3161. FW_DEVLOG_LEVEL_EMERG = 0x0,
  3162. FW_DEVLOG_LEVEL_CRIT = 0x1,
  3163. FW_DEVLOG_LEVEL_ERR = 0x2,
  3164. FW_DEVLOG_LEVEL_NOTICE = 0x3,
  3165. FW_DEVLOG_LEVEL_INFO = 0x4,
  3166. FW_DEVLOG_LEVEL_DEBUG = 0x5,
  3167. FW_DEVLOG_LEVEL_MAX = 0x5,
  3168. };
  3169. /* facilities that may send a log message */
  3170. enum fw_devlog_facility {
  3171. FW_DEVLOG_FACILITY_CORE = 0x00,
  3172. FW_DEVLOG_FACILITY_CF = 0x01,
  3173. FW_DEVLOG_FACILITY_SCHED = 0x02,
  3174. FW_DEVLOG_FACILITY_TIMER = 0x04,
  3175. FW_DEVLOG_FACILITY_RES = 0x06,
  3176. FW_DEVLOG_FACILITY_HW = 0x08,
  3177. FW_DEVLOG_FACILITY_FLR = 0x10,
  3178. FW_DEVLOG_FACILITY_DMAQ = 0x12,
  3179. FW_DEVLOG_FACILITY_PHY = 0x14,
  3180. FW_DEVLOG_FACILITY_MAC = 0x16,
  3181. FW_DEVLOG_FACILITY_PORT = 0x18,
  3182. FW_DEVLOG_FACILITY_VI = 0x1A,
  3183. FW_DEVLOG_FACILITY_FILTER = 0x1C,
  3184. FW_DEVLOG_FACILITY_ACL = 0x1E,
  3185. FW_DEVLOG_FACILITY_TM = 0x20,
  3186. FW_DEVLOG_FACILITY_QFC = 0x22,
  3187. FW_DEVLOG_FACILITY_DCB = 0x24,
  3188. FW_DEVLOG_FACILITY_ETH = 0x26,
  3189. FW_DEVLOG_FACILITY_OFLD = 0x28,
  3190. FW_DEVLOG_FACILITY_RI = 0x2A,
  3191. FW_DEVLOG_FACILITY_ISCSI = 0x2C,
  3192. FW_DEVLOG_FACILITY_FCOE = 0x2E,
  3193. FW_DEVLOG_FACILITY_FOISCSI = 0x30,
  3194. FW_DEVLOG_FACILITY_FOFCOE = 0x32,
  3195. FW_DEVLOG_FACILITY_CHNET = 0x34,
  3196. FW_DEVLOG_FACILITY_MAX = 0x34,
  3197. };
  3198. /* log message format */
  3199. struct fw_devlog_e {
  3200. __be64 timestamp;
  3201. __be32 seqno;
  3202. __be16 reserved1;
  3203. __u8 level;
  3204. __u8 facility;
  3205. __u8 fmt[FW_DEVLOG_FMT_LEN];
  3206. __be32 params[FW_DEVLOG_FMT_PARAMS_NUM];
  3207. __be32 reserved3[4];
  3208. };
  3209. struct fw_devlog_cmd {
  3210. __be32 op_to_write;
  3211. __be32 retval_len16;
  3212. __u8 level;
  3213. __u8 r2[7];
  3214. __be32 memtype_devlog_memaddr16_devlog;
  3215. __be32 memsize_devlog;
  3216. __be32 r3[2];
  3217. };
  3218. #define FW_DEVLOG_CMD_MEMTYPE_DEVLOG_S 28
  3219. #define FW_DEVLOG_CMD_MEMTYPE_DEVLOG_M 0xf
  3220. #define FW_DEVLOG_CMD_MEMTYPE_DEVLOG_G(x) \
  3221. (((x) >> FW_DEVLOG_CMD_MEMTYPE_DEVLOG_S) & \
  3222. FW_DEVLOG_CMD_MEMTYPE_DEVLOG_M)
  3223. #define FW_DEVLOG_CMD_MEMADDR16_DEVLOG_S 0
  3224. #define FW_DEVLOG_CMD_MEMADDR16_DEVLOG_M 0xfffffff
  3225. #define FW_DEVLOG_CMD_MEMADDR16_DEVLOG_G(x) \
  3226. (((x) >> FW_DEVLOG_CMD_MEMADDR16_DEVLOG_S) & \
  3227. FW_DEVLOG_CMD_MEMADDR16_DEVLOG_M)
  3228. /* P C I E F W P F 7 R E G I S T E R */
  3229. /* PF7 stores the Firmware Device Log parameters which allows Host Drivers to
  3230. * access the "devlog" which needing to contact firmware. The encoding is
  3231. * mostly the same as that returned by the DEVLOG command except for the size
  3232. * which is encoded as the number of entries in multiples-1 of 128 here rather
  3233. * than the memory size as is done in the DEVLOG command. Thus, 0 means 128
  3234. * and 15 means 2048. This of course in turn constrains the allowed values
  3235. * for the devlog size ...
  3236. */
  3237. #define PCIE_FW_PF_DEVLOG 7
  3238. #define PCIE_FW_PF_DEVLOG_NENTRIES128_S 28
  3239. #define PCIE_FW_PF_DEVLOG_NENTRIES128_M 0xf
  3240. #define PCIE_FW_PF_DEVLOG_NENTRIES128_V(x) \
  3241. ((x) << PCIE_FW_PF_DEVLOG_NENTRIES128_S)
  3242. #define PCIE_FW_PF_DEVLOG_NENTRIES128_G(x) \
  3243. (((x) >> PCIE_FW_PF_DEVLOG_NENTRIES128_S) & \
  3244. PCIE_FW_PF_DEVLOG_NENTRIES128_M)
  3245. #define PCIE_FW_PF_DEVLOG_ADDR16_S 4
  3246. #define PCIE_FW_PF_DEVLOG_ADDR16_M 0xffffff
  3247. #define PCIE_FW_PF_DEVLOG_ADDR16_V(x) ((x) << PCIE_FW_PF_DEVLOG_ADDR16_S)
  3248. #define PCIE_FW_PF_DEVLOG_ADDR16_G(x) \
  3249. (((x) >> PCIE_FW_PF_DEVLOG_ADDR16_S) & PCIE_FW_PF_DEVLOG_ADDR16_M)
  3250. #define PCIE_FW_PF_DEVLOG_MEMTYPE_S 0
  3251. #define PCIE_FW_PF_DEVLOG_MEMTYPE_M 0xf
  3252. #define PCIE_FW_PF_DEVLOG_MEMTYPE_V(x) ((x) << PCIE_FW_PF_DEVLOG_MEMTYPE_S)
  3253. #define PCIE_FW_PF_DEVLOG_MEMTYPE_G(x) \
  3254. (((x) >> PCIE_FW_PF_DEVLOG_MEMTYPE_S) & PCIE_FW_PF_DEVLOG_MEMTYPE_M)
  3255. #define MAX_IMM_OFLD_TX_DATA_WR_LEN (0xff + sizeof(struct fw_ofld_tx_data_wr))
  3256. struct fw_crypto_lookaside_wr {
  3257. __be32 op_to_cctx_size;
  3258. __be32 len16_pkd;
  3259. __be32 session_id;
  3260. __be32 rx_chid_to_rx_q_id;
  3261. __be32 key_addr;
  3262. __be32 pld_size_hash_size;
  3263. __be64 cookie;
  3264. };
  3265. #define FW_CRYPTO_LOOKASIDE_WR_OPCODE_S 24
  3266. #define FW_CRYPTO_LOOKASIDE_WR_OPCODE_M 0xff
  3267. #define FW_CRYPTO_LOOKASIDE_WR_OPCODE_V(x) \
  3268. ((x) << FW_CRYPTO_LOOKASIDE_WR_OPCODE_S)
  3269. #define FW_CRYPTO_LOOKASIDE_WR_OPCODE_G(x) \
  3270. (((x) >> FW_CRYPTO_LOOKASIDE_WR_OPCODE_S) & \
  3271. FW_CRYPTO_LOOKASIDE_WR_OPCODE_M)
  3272. #define FW_CRYPTO_LOOKASIDE_WR_COMPL_S 23
  3273. #define FW_CRYPTO_LOOKASIDE_WR_COMPL_M 0x1
  3274. #define FW_CRYPTO_LOOKASIDE_WR_COMPL_V(x) \
  3275. ((x) << FW_CRYPTO_LOOKASIDE_WR_COMPL_S)
  3276. #define FW_CRYPTO_LOOKASIDE_WR_COMPL_G(x) \
  3277. (((x) >> FW_CRYPTO_LOOKASIDE_WR_COMPL_S) & \
  3278. FW_CRYPTO_LOOKASIDE_WR_COMPL_M)
  3279. #define FW_CRYPTO_LOOKASIDE_WR_COMPL_F FW_CRYPTO_LOOKASIDE_WR_COMPL_V(1U)
  3280. #define FW_CRYPTO_LOOKASIDE_WR_IMM_LEN_S 15
  3281. #define FW_CRYPTO_LOOKASIDE_WR_IMM_LEN_M 0xff
  3282. #define FW_CRYPTO_LOOKASIDE_WR_IMM_LEN_V(x) \
  3283. ((x) << FW_CRYPTO_LOOKASIDE_WR_IMM_LEN_S)
  3284. #define FW_CRYPTO_LOOKASIDE_WR_IMM_LEN_G(x) \
  3285. (((x) >> FW_CRYPTO_LOOKASIDE_WR_IMM_LEN_S) & \
  3286. FW_CRYPTO_LOOKASIDE_WR_IMM_LEN_M)
  3287. #define FW_CRYPTO_LOOKASIDE_WR_CCTX_LOC_S 5
  3288. #define FW_CRYPTO_LOOKASIDE_WR_CCTX_LOC_M 0x3
  3289. #define FW_CRYPTO_LOOKASIDE_WR_CCTX_LOC_V(x) \
  3290. ((x) << FW_CRYPTO_LOOKASIDE_WR_CCTX_LOC_S)
  3291. #define FW_CRYPTO_LOOKASIDE_WR_CCTX_LOC_G(x) \
  3292. (((x) >> FW_CRYPTO_LOOKASIDE_WR_CCTX_LOC_S) & \
  3293. FW_CRYPTO_LOOKASIDE_WR_CCTX_LOC_M)
  3294. #define FW_CRYPTO_LOOKASIDE_WR_CCTX_SIZE_S 0
  3295. #define FW_CRYPTO_LOOKASIDE_WR_CCTX_SIZE_M 0x1f
  3296. #define FW_CRYPTO_LOOKASIDE_WR_CCTX_SIZE_V(x) \
  3297. ((x) << FW_CRYPTO_LOOKASIDE_WR_CCTX_SIZE_S)
  3298. #define FW_CRYPTO_LOOKASIDE_WR_CCTX_SIZE_G(x) \
  3299. (((x) >> FW_CRYPTO_LOOKASIDE_WR_CCTX_SIZE_S) & \
  3300. FW_CRYPTO_LOOKASIDE_WR_CCTX_SIZE_M)
  3301. #define FW_CRYPTO_LOOKASIDE_WR_LEN16_S 0
  3302. #define FW_CRYPTO_LOOKASIDE_WR_LEN16_M 0xff
  3303. #define FW_CRYPTO_LOOKASIDE_WR_LEN16_V(x) \
  3304. ((x) << FW_CRYPTO_LOOKASIDE_WR_LEN16_S)
  3305. #define FW_CRYPTO_LOOKASIDE_WR_LEN16_G(x) \
  3306. (((x) >> FW_CRYPTO_LOOKASIDE_WR_LEN16_S) & \
  3307. FW_CRYPTO_LOOKASIDE_WR_LEN16_M)
  3308. #define FW_CRYPTO_LOOKASIDE_WR_RX_CHID_S 29
  3309. #define FW_CRYPTO_LOOKASIDE_WR_RX_CHID_M 0x3
  3310. #define FW_CRYPTO_LOOKASIDE_WR_RX_CHID_V(x) \
  3311. ((x) << FW_CRYPTO_LOOKASIDE_WR_RX_CHID_S)
  3312. #define FW_CRYPTO_LOOKASIDE_WR_RX_CHID_G(x) \
  3313. (((x) >> FW_CRYPTO_LOOKASIDE_WR_RX_CHID_S) & \
  3314. FW_CRYPTO_LOOKASIDE_WR_RX_CHID_M)
  3315. #define FW_CRYPTO_LOOKASIDE_WR_LCB_S 27
  3316. #define FW_CRYPTO_LOOKASIDE_WR_LCB_M 0x3
  3317. #define FW_CRYPTO_LOOKASIDE_WR_LCB_V(x) \
  3318. ((x) << FW_CRYPTO_LOOKASIDE_WR_LCB_S)
  3319. #define FW_CRYPTO_LOOKASIDE_WR_LCB_G(x) \
  3320. (((x) >> FW_CRYPTO_LOOKASIDE_WR_LCB_S) & FW_CRYPTO_LOOKASIDE_WR_LCB_M)
  3321. #define FW_CRYPTO_LOOKASIDE_WR_PHASH_S 25
  3322. #define FW_CRYPTO_LOOKASIDE_WR_PHASH_M 0x3
  3323. #define FW_CRYPTO_LOOKASIDE_WR_PHASH_V(x) \
  3324. ((x) << FW_CRYPTO_LOOKASIDE_WR_PHASH_S)
  3325. #define FW_CRYPTO_LOOKASIDE_WR_PHASH_G(x) \
  3326. (((x) >> FW_CRYPTO_LOOKASIDE_WR_PHASH_S) & \
  3327. FW_CRYPTO_LOOKASIDE_WR_PHASH_M)
  3328. #define FW_CRYPTO_LOOKASIDE_WR_IV_S 23
  3329. #define FW_CRYPTO_LOOKASIDE_WR_IV_M 0x3
  3330. #define FW_CRYPTO_LOOKASIDE_WR_IV_V(x) \
  3331. ((x) << FW_CRYPTO_LOOKASIDE_WR_IV_S)
  3332. #define FW_CRYPTO_LOOKASIDE_WR_IV_G(x) \
  3333. (((x) >> FW_CRYPTO_LOOKASIDE_WR_IV_S) & FW_CRYPTO_LOOKASIDE_WR_IV_M)
  3334. #define FW_CRYPTO_LOOKASIDE_WR_FQIDX_S 15
  3335. #define FW_CRYPTO_LOOKASIDE_WR_FQIDX_M 0xff
  3336. #define FW_CRYPTO_LOOKASIDE_WR_FQIDX_V(x) \
  3337. ((x) << FW_CRYPTO_LOOKASIDE_WR_FQIDX_S)
  3338. #define FW_CRYPTO_LOOKASIDE_WR_FQIDX_G(x) \
  3339. (((x) >> FW_CRYPTO_LOOKASIDE_WR_FQIDX_S) & \
  3340. FW_CRYPTO_LOOKASIDE_WR_FQIDX_M)
  3341. #define FW_CRYPTO_LOOKASIDE_WR_TX_CH_S 10
  3342. #define FW_CRYPTO_LOOKASIDE_WR_TX_CH_M 0x3
  3343. #define FW_CRYPTO_LOOKASIDE_WR_TX_CH_V(x) \
  3344. ((x) << FW_CRYPTO_LOOKASIDE_WR_TX_CH_S)
  3345. #define FW_CRYPTO_LOOKASIDE_WR_TX_CH_G(x) \
  3346. (((x) >> FW_CRYPTO_LOOKASIDE_WR_TX_CH_S) & \
  3347. FW_CRYPTO_LOOKASIDE_WR_TX_CH_M)
  3348. #define FW_CRYPTO_LOOKASIDE_WR_RX_Q_ID_S 0
  3349. #define FW_CRYPTO_LOOKASIDE_WR_RX_Q_ID_M 0x3ff
  3350. #define FW_CRYPTO_LOOKASIDE_WR_RX_Q_ID_V(x) \
  3351. ((x) << FW_CRYPTO_LOOKASIDE_WR_RX_Q_ID_S)
  3352. #define FW_CRYPTO_LOOKASIDE_WR_RX_Q_ID_G(x) \
  3353. (((x) >> FW_CRYPTO_LOOKASIDE_WR_RX_Q_ID_S) & \
  3354. FW_CRYPTO_LOOKASIDE_WR_RX_Q_ID_M)
  3355. #define FW_CRYPTO_LOOKASIDE_WR_PLD_SIZE_S 24
  3356. #define FW_CRYPTO_LOOKASIDE_WR_PLD_SIZE_M 0xff
  3357. #define FW_CRYPTO_LOOKASIDE_WR_PLD_SIZE_V(x) \
  3358. ((x) << FW_CRYPTO_LOOKASIDE_WR_PLD_SIZE_S)
  3359. #define FW_CRYPTO_LOOKASIDE_WR_PLD_SIZE_G(x) \
  3360. (((x) >> FW_CRYPTO_LOOKASIDE_WR_PLD_SIZE_S) & \
  3361. FW_CRYPTO_LOOKASIDE_WR_PLD_SIZE_M)
  3362. #define FW_CRYPTO_LOOKASIDE_WR_HASH_SIZE_S 17
  3363. #define FW_CRYPTO_LOOKASIDE_WR_HASH_SIZE_M 0x7f
  3364. #define FW_CRYPTO_LOOKASIDE_WR_HASH_SIZE_V(x) \
  3365. ((x) << FW_CRYPTO_LOOKASIDE_WR_HASH_SIZE_S)
  3366. #define FW_CRYPTO_LOOKASIDE_WR_HASH_SIZE_G(x) \
  3367. (((x) >> FW_CRYPTO_LOOKASIDE_WR_HASH_SIZE_S) & \
  3368. FW_CRYPTO_LOOKASIDE_WR_HASH_SIZE_M)
  3369. struct fw_tlstx_data_wr {
  3370. __be32 op_to_immdlen;
  3371. __be32 flowid_len16;
  3372. __be32 plen;
  3373. __be32 lsodisable_to_flags;
  3374. __be32 r5;
  3375. __be32 ctxloc_to_exp;
  3376. __be16 mfs;
  3377. __be16 adjustedplen_pkd;
  3378. __be16 expinplenmax_pkd;
  3379. u8 pdusinplenmax_pkd;
  3380. u8 r10;
  3381. };
  3382. #define FW_TLSTX_DATA_WR_OPCODE_S 24
  3383. #define FW_TLSTX_DATA_WR_OPCODE_M 0xff
  3384. #define FW_TLSTX_DATA_WR_OPCODE_V(x) ((x) << FW_TLSTX_DATA_WR_OPCODE_S)
  3385. #define FW_TLSTX_DATA_WR_OPCODE_G(x) \
  3386. (((x) >> FW_TLSTX_DATA_WR_OPCODE_S) & FW_TLSTX_DATA_WR_OPCODE_M)
  3387. #define FW_TLSTX_DATA_WR_COMPL_S 21
  3388. #define FW_TLSTX_DATA_WR_COMPL_M 0x1
  3389. #define FW_TLSTX_DATA_WR_COMPL_V(x) ((x) << FW_TLSTX_DATA_WR_COMPL_S)
  3390. #define FW_TLSTX_DATA_WR_COMPL_G(x) \
  3391. (((x) >> FW_TLSTX_DATA_WR_COMPL_S) & FW_TLSTX_DATA_WR_COMPL_M)
  3392. #define FW_TLSTX_DATA_WR_COMPL_F FW_TLSTX_DATA_WR_COMPL_V(1U)
  3393. #define FW_TLSTX_DATA_WR_IMMDLEN_S 0
  3394. #define FW_TLSTX_DATA_WR_IMMDLEN_M 0xff
  3395. #define FW_TLSTX_DATA_WR_IMMDLEN_V(x) ((x) << FW_TLSTX_DATA_WR_IMMDLEN_S)
  3396. #define FW_TLSTX_DATA_WR_IMMDLEN_G(x) \
  3397. (((x) >> FW_TLSTX_DATA_WR_IMMDLEN_S) & FW_TLSTX_DATA_WR_IMMDLEN_M)
  3398. #define FW_TLSTX_DATA_WR_FLOWID_S 8
  3399. #define FW_TLSTX_DATA_WR_FLOWID_M 0xfffff
  3400. #define FW_TLSTX_DATA_WR_FLOWID_V(x) ((x) << FW_TLSTX_DATA_WR_FLOWID_S)
  3401. #define FW_TLSTX_DATA_WR_FLOWID_G(x) \
  3402. (((x) >> FW_TLSTX_DATA_WR_FLOWID_S) & FW_TLSTX_DATA_WR_FLOWID_M)
  3403. #define FW_TLSTX_DATA_WR_LEN16_S 0
  3404. #define FW_TLSTX_DATA_WR_LEN16_M 0xff
  3405. #define FW_TLSTX_DATA_WR_LEN16_V(x) ((x) << FW_TLSTX_DATA_WR_LEN16_S)
  3406. #define FW_TLSTX_DATA_WR_LEN16_G(x) \
  3407. (((x) >> FW_TLSTX_DATA_WR_LEN16_S) & FW_TLSTX_DATA_WR_LEN16_M)
  3408. #define FW_TLSTX_DATA_WR_LSODISABLE_S 31
  3409. #define FW_TLSTX_DATA_WR_LSODISABLE_M 0x1
  3410. #define FW_TLSTX_DATA_WR_LSODISABLE_V(x) \
  3411. ((x) << FW_TLSTX_DATA_WR_LSODISABLE_S)
  3412. #define FW_TLSTX_DATA_WR_LSODISABLE_G(x) \
  3413. (((x) >> FW_TLSTX_DATA_WR_LSODISABLE_S) & FW_TLSTX_DATA_WR_LSODISABLE_M)
  3414. #define FW_TLSTX_DATA_WR_LSODISABLE_F FW_TLSTX_DATA_WR_LSODISABLE_V(1U)
  3415. #define FW_TLSTX_DATA_WR_ALIGNPLD_S 30
  3416. #define FW_TLSTX_DATA_WR_ALIGNPLD_M 0x1
  3417. #define FW_TLSTX_DATA_WR_ALIGNPLD_V(x) ((x) << FW_TLSTX_DATA_WR_ALIGNPLD_S)
  3418. #define FW_TLSTX_DATA_WR_ALIGNPLD_G(x) \
  3419. (((x) >> FW_TLSTX_DATA_WR_ALIGNPLD_S) & FW_TLSTX_DATA_WR_ALIGNPLD_M)
  3420. #define FW_TLSTX_DATA_WR_ALIGNPLD_F FW_TLSTX_DATA_WR_ALIGNPLD_V(1U)
  3421. #define FW_TLSTX_DATA_WR_ALIGNPLDSHOVE_S 29
  3422. #define FW_TLSTX_DATA_WR_ALIGNPLDSHOVE_M 0x1
  3423. #define FW_TLSTX_DATA_WR_ALIGNPLDSHOVE_V(x) \
  3424. ((x) << FW_TLSTX_DATA_WR_ALIGNPLDSHOVE_S)
  3425. #define FW_TLSTX_DATA_WR_ALIGNPLDSHOVE_G(x) \
  3426. (((x) >> FW_TLSTX_DATA_WR_ALIGNPLDSHOVE_S) & \
  3427. FW_TLSTX_DATA_WR_ALIGNPLDSHOVE_M)
  3428. #define FW_TLSTX_DATA_WR_ALIGNPLDSHOVE_F FW_TLSTX_DATA_WR_ALIGNPLDSHOVE_V(1U)
  3429. #define FW_TLSTX_DATA_WR_FLAGS_S 0
  3430. #define FW_TLSTX_DATA_WR_FLAGS_M 0xfffffff
  3431. #define FW_TLSTX_DATA_WR_FLAGS_V(x) ((x) << FW_TLSTX_DATA_WR_FLAGS_S)
  3432. #define FW_TLSTX_DATA_WR_FLAGS_G(x) \
  3433. (((x) >> FW_TLSTX_DATA_WR_FLAGS_S) & FW_TLSTX_DATA_WR_FLAGS_M)
  3434. #define FW_TLSTX_DATA_WR_CTXLOC_S 30
  3435. #define FW_TLSTX_DATA_WR_CTXLOC_M 0x3
  3436. #define FW_TLSTX_DATA_WR_CTXLOC_V(x) ((x) << FW_TLSTX_DATA_WR_CTXLOC_S)
  3437. #define FW_TLSTX_DATA_WR_CTXLOC_G(x) \
  3438. (((x) >> FW_TLSTX_DATA_WR_CTXLOC_S) & FW_TLSTX_DATA_WR_CTXLOC_M)
  3439. #define FW_TLSTX_DATA_WR_IVDSGL_S 29
  3440. #define FW_TLSTX_DATA_WR_IVDSGL_M 0x1
  3441. #define FW_TLSTX_DATA_WR_IVDSGL_V(x) ((x) << FW_TLSTX_DATA_WR_IVDSGL_S)
  3442. #define FW_TLSTX_DATA_WR_IVDSGL_G(x) \
  3443. (((x) >> FW_TLSTX_DATA_WR_IVDSGL_S) & FW_TLSTX_DATA_WR_IVDSGL_M)
  3444. #define FW_TLSTX_DATA_WR_IVDSGL_F FW_TLSTX_DATA_WR_IVDSGL_V(1U)
  3445. #define FW_TLSTX_DATA_WR_KEYSIZE_S 24
  3446. #define FW_TLSTX_DATA_WR_KEYSIZE_M 0x1f
  3447. #define FW_TLSTX_DATA_WR_KEYSIZE_V(x) ((x) << FW_TLSTX_DATA_WR_KEYSIZE_S)
  3448. #define FW_TLSTX_DATA_WR_KEYSIZE_G(x) \
  3449. (((x) >> FW_TLSTX_DATA_WR_KEYSIZE_S) & FW_TLSTX_DATA_WR_KEYSIZE_M)
  3450. #define FW_TLSTX_DATA_WR_NUMIVS_S 14
  3451. #define FW_TLSTX_DATA_WR_NUMIVS_M 0xff
  3452. #define FW_TLSTX_DATA_WR_NUMIVS_V(x) ((x) << FW_TLSTX_DATA_WR_NUMIVS_S)
  3453. #define FW_TLSTX_DATA_WR_NUMIVS_G(x) \
  3454. (((x) >> FW_TLSTX_DATA_WR_NUMIVS_S) & FW_TLSTX_DATA_WR_NUMIVS_M)
  3455. #define FW_TLSTX_DATA_WR_EXP_S 0
  3456. #define FW_TLSTX_DATA_WR_EXP_M 0x3fff
  3457. #define FW_TLSTX_DATA_WR_EXP_V(x) ((x) << FW_TLSTX_DATA_WR_EXP_S)
  3458. #define FW_TLSTX_DATA_WR_EXP_G(x) \
  3459. (((x) >> FW_TLSTX_DATA_WR_EXP_S) & FW_TLSTX_DATA_WR_EXP_M)
  3460. #define FW_TLSTX_DATA_WR_ADJUSTEDPLEN_S 1
  3461. #define FW_TLSTX_DATA_WR_ADJUSTEDPLEN_V(x) \
  3462. ((x) << FW_TLSTX_DATA_WR_ADJUSTEDPLEN_S)
  3463. #define FW_TLSTX_DATA_WR_EXPINPLENMAX_S 4
  3464. #define FW_TLSTX_DATA_WR_EXPINPLENMAX_V(x) \
  3465. ((x) << FW_TLSTX_DATA_WR_EXPINPLENMAX_S)
  3466. #define FW_TLSTX_DATA_WR_PDUSINPLENMAX_S 2
  3467. #define FW_TLSTX_DATA_WR_PDUSINPLENMAX_V(x) \
  3468. ((x) << FW_TLSTX_DATA_WR_PDUSINPLENMAX_S)
  3469. #endif /* _T4FW_INTERFACE_H_ */