t4fw_api.h 97 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234
  1. /*
  2. * This file is part of the Chelsio T4 Ethernet driver for Linux.
  3. *
  4. * Copyright (c) 2009-2014 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_INV_LSTAG_WR = 0x1a,
  100. FW_LASTC2E_WR = 0x70
  101. };
  102. struct fw_wr_hdr {
  103. __be32 hi;
  104. __be32 lo;
  105. };
  106. /* work request opcode (hi) */
  107. #define FW_WR_OP_S 24
  108. #define FW_WR_OP_M 0xff
  109. #define FW_WR_OP_V(x) ((x) << FW_WR_OP_S)
  110. #define FW_WR_OP_G(x) (((x) >> FW_WR_OP_S) & FW_WR_OP_M)
  111. /* atomic flag (hi) - firmware encapsulates CPLs in CPL_BARRIER */
  112. #define FW_WR_ATOMIC_S 23
  113. #define FW_WR_ATOMIC_V(x) ((x) << FW_WR_ATOMIC_S)
  114. /* flush flag (hi) - firmware flushes flushable work request buffered
  115. * in the flow context.
  116. */
  117. #define FW_WR_FLUSH_S 22
  118. #define FW_WR_FLUSH_V(x) ((x) << FW_WR_FLUSH_S)
  119. /* completion flag (hi) - firmware generates a cpl_fw6_ack */
  120. #define FW_WR_COMPL_S 21
  121. #define FW_WR_COMPL_V(x) ((x) << FW_WR_COMPL_S)
  122. #define FW_WR_COMPL_F FW_WR_COMPL_V(1U)
  123. /* work request immediate data length (hi) */
  124. #define FW_WR_IMMDLEN_S 0
  125. #define FW_WR_IMMDLEN_M 0xff
  126. #define FW_WR_IMMDLEN_V(x) ((x) << FW_WR_IMMDLEN_S)
  127. /* egress queue status update to associated ingress queue entry (lo) */
  128. #define FW_WR_EQUIQ_S 31
  129. #define FW_WR_EQUIQ_V(x) ((x) << FW_WR_EQUIQ_S)
  130. #define FW_WR_EQUIQ_F FW_WR_EQUIQ_V(1U)
  131. /* egress queue status update to egress queue status entry (lo) */
  132. #define FW_WR_EQUEQ_S 30
  133. #define FW_WR_EQUEQ_V(x) ((x) << FW_WR_EQUEQ_S)
  134. #define FW_WR_EQUEQ_F FW_WR_EQUEQ_V(1U)
  135. /* flow context identifier (lo) */
  136. #define FW_WR_FLOWID_S 8
  137. #define FW_WR_FLOWID_V(x) ((x) << FW_WR_FLOWID_S)
  138. /* length in units of 16-bytes (lo) */
  139. #define FW_WR_LEN16_S 0
  140. #define FW_WR_LEN16_V(x) ((x) << FW_WR_LEN16_S)
  141. #define HW_TPL_FR_MT_PR_IV_P_FC 0X32B
  142. #define HW_TPL_FR_MT_PR_OV_P_FC 0X327
  143. /* filter wr reply code in cookie in CPL_SET_TCB_RPL */
  144. enum fw_filter_wr_cookie {
  145. FW_FILTER_WR_SUCCESS,
  146. FW_FILTER_WR_FLT_ADDED,
  147. FW_FILTER_WR_FLT_DELETED,
  148. FW_FILTER_WR_SMT_TBL_FULL,
  149. FW_FILTER_WR_EINVAL,
  150. };
  151. struct fw_filter_wr {
  152. __be32 op_pkd;
  153. __be32 len16_pkd;
  154. __be64 r3;
  155. __be32 tid_to_iq;
  156. __be32 del_filter_to_l2tix;
  157. __be16 ethtype;
  158. __be16 ethtypem;
  159. __u8 frag_to_ovlan_vldm;
  160. __u8 smac_sel;
  161. __be16 rx_chan_rx_rpl_iq;
  162. __be32 maci_to_matchtypem;
  163. __u8 ptcl;
  164. __u8 ptclm;
  165. __u8 ttyp;
  166. __u8 ttypm;
  167. __be16 ivlan;
  168. __be16 ivlanm;
  169. __be16 ovlan;
  170. __be16 ovlanm;
  171. __u8 lip[16];
  172. __u8 lipm[16];
  173. __u8 fip[16];
  174. __u8 fipm[16];
  175. __be16 lp;
  176. __be16 lpm;
  177. __be16 fp;
  178. __be16 fpm;
  179. __be16 r7;
  180. __u8 sma[6];
  181. };
  182. #define FW_FILTER_WR_TID_S 12
  183. #define FW_FILTER_WR_TID_M 0xfffff
  184. #define FW_FILTER_WR_TID_V(x) ((x) << FW_FILTER_WR_TID_S)
  185. #define FW_FILTER_WR_TID_G(x) \
  186. (((x) >> FW_FILTER_WR_TID_S) & FW_FILTER_WR_TID_M)
  187. #define FW_FILTER_WR_RQTYPE_S 11
  188. #define FW_FILTER_WR_RQTYPE_M 0x1
  189. #define FW_FILTER_WR_RQTYPE_V(x) ((x) << FW_FILTER_WR_RQTYPE_S)
  190. #define FW_FILTER_WR_RQTYPE_G(x) \
  191. (((x) >> FW_FILTER_WR_RQTYPE_S) & FW_FILTER_WR_RQTYPE_M)
  192. #define FW_FILTER_WR_RQTYPE_F FW_FILTER_WR_RQTYPE_V(1U)
  193. #define FW_FILTER_WR_NOREPLY_S 10
  194. #define FW_FILTER_WR_NOREPLY_M 0x1
  195. #define FW_FILTER_WR_NOREPLY_V(x) ((x) << FW_FILTER_WR_NOREPLY_S)
  196. #define FW_FILTER_WR_NOREPLY_G(x) \
  197. (((x) >> FW_FILTER_WR_NOREPLY_S) & FW_FILTER_WR_NOREPLY_M)
  198. #define FW_FILTER_WR_NOREPLY_F FW_FILTER_WR_NOREPLY_V(1U)
  199. #define FW_FILTER_WR_IQ_S 0
  200. #define FW_FILTER_WR_IQ_M 0x3ff
  201. #define FW_FILTER_WR_IQ_V(x) ((x) << FW_FILTER_WR_IQ_S)
  202. #define FW_FILTER_WR_IQ_G(x) \
  203. (((x) >> FW_FILTER_WR_IQ_S) & FW_FILTER_WR_IQ_M)
  204. #define FW_FILTER_WR_DEL_FILTER_S 31
  205. #define FW_FILTER_WR_DEL_FILTER_M 0x1
  206. #define FW_FILTER_WR_DEL_FILTER_V(x) ((x) << FW_FILTER_WR_DEL_FILTER_S)
  207. #define FW_FILTER_WR_DEL_FILTER_G(x) \
  208. (((x) >> FW_FILTER_WR_DEL_FILTER_S) & FW_FILTER_WR_DEL_FILTER_M)
  209. #define FW_FILTER_WR_DEL_FILTER_F FW_FILTER_WR_DEL_FILTER_V(1U)
  210. #define FW_FILTER_WR_RPTTID_S 25
  211. #define FW_FILTER_WR_RPTTID_M 0x1
  212. #define FW_FILTER_WR_RPTTID_V(x) ((x) << FW_FILTER_WR_RPTTID_S)
  213. #define FW_FILTER_WR_RPTTID_G(x) \
  214. (((x) >> FW_FILTER_WR_RPTTID_S) & FW_FILTER_WR_RPTTID_M)
  215. #define FW_FILTER_WR_RPTTID_F FW_FILTER_WR_RPTTID_V(1U)
  216. #define FW_FILTER_WR_DROP_S 24
  217. #define FW_FILTER_WR_DROP_M 0x1
  218. #define FW_FILTER_WR_DROP_V(x) ((x) << FW_FILTER_WR_DROP_S)
  219. #define FW_FILTER_WR_DROP_G(x) \
  220. (((x) >> FW_FILTER_WR_DROP_S) & FW_FILTER_WR_DROP_M)
  221. #define FW_FILTER_WR_DROP_F FW_FILTER_WR_DROP_V(1U)
  222. #define FW_FILTER_WR_DIRSTEER_S 23
  223. #define FW_FILTER_WR_DIRSTEER_M 0x1
  224. #define FW_FILTER_WR_DIRSTEER_V(x) ((x) << FW_FILTER_WR_DIRSTEER_S)
  225. #define FW_FILTER_WR_DIRSTEER_G(x) \
  226. (((x) >> FW_FILTER_WR_DIRSTEER_S) & FW_FILTER_WR_DIRSTEER_M)
  227. #define FW_FILTER_WR_DIRSTEER_F FW_FILTER_WR_DIRSTEER_V(1U)
  228. #define FW_FILTER_WR_MASKHASH_S 22
  229. #define FW_FILTER_WR_MASKHASH_M 0x1
  230. #define FW_FILTER_WR_MASKHASH_V(x) ((x) << FW_FILTER_WR_MASKHASH_S)
  231. #define FW_FILTER_WR_MASKHASH_G(x) \
  232. (((x) >> FW_FILTER_WR_MASKHASH_S) & FW_FILTER_WR_MASKHASH_M)
  233. #define FW_FILTER_WR_MASKHASH_F FW_FILTER_WR_MASKHASH_V(1U)
  234. #define FW_FILTER_WR_DIRSTEERHASH_S 21
  235. #define FW_FILTER_WR_DIRSTEERHASH_M 0x1
  236. #define FW_FILTER_WR_DIRSTEERHASH_V(x) ((x) << FW_FILTER_WR_DIRSTEERHASH_S)
  237. #define FW_FILTER_WR_DIRSTEERHASH_G(x) \
  238. (((x) >> FW_FILTER_WR_DIRSTEERHASH_S) & FW_FILTER_WR_DIRSTEERHASH_M)
  239. #define FW_FILTER_WR_DIRSTEERHASH_F FW_FILTER_WR_DIRSTEERHASH_V(1U)
  240. #define FW_FILTER_WR_LPBK_S 20
  241. #define FW_FILTER_WR_LPBK_M 0x1
  242. #define FW_FILTER_WR_LPBK_V(x) ((x) << FW_FILTER_WR_LPBK_S)
  243. #define FW_FILTER_WR_LPBK_G(x) \
  244. (((x) >> FW_FILTER_WR_LPBK_S) & FW_FILTER_WR_LPBK_M)
  245. #define FW_FILTER_WR_LPBK_F FW_FILTER_WR_LPBK_V(1U)
  246. #define FW_FILTER_WR_DMAC_S 19
  247. #define FW_FILTER_WR_DMAC_M 0x1
  248. #define FW_FILTER_WR_DMAC_V(x) ((x) << FW_FILTER_WR_DMAC_S)
  249. #define FW_FILTER_WR_DMAC_G(x) \
  250. (((x) >> FW_FILTER_WR_DMAC_S) & FW_FILTER_WR_DMAC_M)
  251. #define FW_FILTER_WR_DMAC_F FW_FILTER_WR_DMAC_V(1U)
  252. #define FW_FILTER_WR_SMAC_S 18
  253. #define FW_FILTER_WR_SMAC_M 0x1
  254. #define FW_FILTER_WR_SMAC_V(x) ((x) << FW_FILTER_WR_SMAC_S)
  255. #define FW_FILTER_WR_SMAC_G(x) \
  256. (((x) >> FW_FILTER_WR_SMAC_S) & FW_FILTER_WR_SMAC_M)
  257. #define FW_FILTER_WR_SMAC_F FW_FILTER_WR_SMAC_V(1U)
  258. #define FW_FILTER_WR_INSVLAN_S 17
  259. #define FW_FILTER_WR_INSVLAN_M 0x1
  260. #define FW_FILTER_WR_INSVLAN_V(x) ((x) << FW_FILTER_WR_INSVLAN_S)
  261. #define FW_FILTER_WR_INSVLAN_G(x) \
  262. (((x) >> FW_FILTER_WR_INSVLAN_S) & FW_FILTER_WR_INSVLAN_M)
  263. #define FW_FILTER_WR_INSVLAN_F FW_FILTER_WR_INSVLAN_V(1U)
  264. #define FW_FILTER_WR_RMVLAN_S 16
  265. #define FW_FILTER_WR_RMVLAN_M 0x1
  266. #define FW_FILTER_WR_RMVLAN_V(x) ((x) << FW_FILTER_WR_RMVLAN_S)
  267. #define FW_FILTER_WR_RMVLAN_G(x) \
  268. (((x) >> FW_FILTER_WR_RMVLAN_S) & FW_FILTER_WR_RMVLAN_M)
  269. #define FW_FILTER_WR_RMVLAN_F FW_FILTER_WR_RMVLAN_V(1U)
  270. #define FW_FILTER_WR_HITCNTS_S 15
  271. #define FW_FILTER_WR_HITCNTS_M 0x1
  272. #define FW_FILTER_WR_HITCNTS_V(x) ((x) << FW_FILTER_WR_HITCNTS_S)
  273. #define FW_FILTER_WR_HITCNTS_G(x) \
  274. (((x) >> FW_FILTER_WR_HITCNTS_S) & FW_FILTER_WR_HITCNTS_M)
  275. #define FW_FILTER_WR_HITCNTS_F FW_FILTER_WR_HITCNTS_V(1U)
  276. #define FW_FILTER_WR_TXCHAN_S 13
  277. #define FW_FILTER_WR_TXCHAN_M 0x3
  278. #define FW_FILTER_WR_TXCHAN_V(x) ((x) << FW_FILTER_WR_TXCHAN_S)
  279. #define FW_FILTER_WR_TXCHAN_G(x) \
  280. (((x) >> FW_FILTER_WR_TXCHAN_S) & FW_FILTER_WR_TXCHAN_M)
  281. #define FW_FILTER_WR_PRIO_S 12
  282. #define FW_FILTER_WR_PRIO_M 0x1
  283. #define FW_FILTER_WR_PRIO_V(x) ((x) << FW_FILTER_WR_PRIO_S)
  284. #define FW_FILTER_WR_PRIO_G(x) \
  285. (((x) >> FW_FILTER_WR_PRIO_S) & FW_FILTER_WR_PRIO_M)
  286. #define FW_FILTER_WR_PRIO_F FW_FILTER_WR_PRIO_V(1U)
  287. #define FW_FILTER_WR_L2TIX_S 0
  288. #define FW_FILTER_WR_L2TIX_M 0xfff
  289. #define FW_FILTER_WR_L2TIX_V(x) ((x) << FW_FILTER_WR_L2TIX_S)
  290. #define FW_FILTER_WR_L2TIX_G(x) \
  291. (((x) >> FW_FILTER_WR_L2TIX_S) & FW_FILTER_WR_L2TIX_M)
  292. #define FW_FILTER_WR_FRAG_S 7
  293. #define FW_FILTER_WR_FRAG_M 0x1
  294. #define FW_FILTER_WR_FRAG_V(x) ((x) << FW_FILTER_WR_FRAG_S)
  295. #define FW_FILTER_WR_FRAG_G(x) \
  296. (((x) >> FW_FILTER_WR_FRAG_S) & FW_FILTER_WR_FRAG_M)
  297. #define FW_FILTER_WR_FRAG_F FW_FILTER_WR_FRAG_V(1U)
  298. #define FW_FILTER_WR_FRAGM_S 6
  299. #define FW_FILTER_WR_FRAGM_M 0x1
  300. #define FW_FILTER_WR_FRAGM_V(x) ((x) << FW_FILTER_WR_FRAGM_S)
  301. #define FW_FILTER_WR_FRAGM_G(x) \
  302. (((x) >> FW_FILTER_WR_FRAGM_S) & FW_FILTER_WR_FRAGM_M)
  303. #define FW_FILTER_WR_FRAGM_F FW_FILTER_WR_FRAGM_V(1U)
  304. #define FW_FILTER_WR_IVLAN_VLD_S 5
  305. #define FW_FILTER_WR_IVLAN_VLD_M 0x1
  306. #define FW_FILTER_WR_IVLAN_VLD_V(x) ((x) << FW_FILTER_WR_IVLAN_VLD_S)
  307. #define FW_FILTER_WR_IVLAN_VLD_G(x) \
  308. (((x) >> FW_FILTER_WR_IVLAN_VLD_S) & FW_FILTER_WR_IVLAN_VLD_M)
  309. #define FW_FILTER_WR_IVLAN_VLD_F FW_FILTER_WR_IVLAN_VLD_V(1U)
  310. #define FW_FILTER_WR_OVLAN_VLD_S 4
  311. #define FW_FILTER_WR_OVLAN_VLD_M 0x1
  312. #define FW_FILTER_WR_OVLAN_VLD_V(x) ((x) << FW_FILTER_WR_OVLAN_VLD_S)
  313. #define FW_FILTER_WR_OVLAN_VLD_G(x) \
  314. (((x) >> FW_FILTER_WR_OVLAN_VLD_S) & FW_FILTER_WR_OVLAN_VLD_M)
  315. #define FW_FILTER_WR_OVLAN_VLD_F FW_FILTER_WR_OVLAN_VLD_V(1U)
  316. #define FW_FILTER_WR_IVLAN_VLDM_S 3
  317. #define FW_FILTER_WR_IVLAN_VLDM_M 0x1
  318. #define FW_FILTER_WR_IVLAN_VLDM_V(x) ((x) << FW_FILTER_WR_IVLAN_VLDM_S)
  319. #define FW_FILTER_WR_IVLAN_VLDM_G(x) \
  320. (((x) >> FW_FILTER_WR_IVLAN_VLDM_S) & FW_FILTER_WR_IVLAN_VLDM_M)
  321. #define FW_FILTER_WR_IVLAN_VLDM_F FW_FILTER_WR_IVLAN_VLDM_V(1U)
  322. #define FW_FILTER_WR_OVLAN_VLDM_S 2
  323. #define FW_FILTER_WR_OVLAN_VLDM_M 0x1
  324. #define FW_FILTER_WR_OVLAN_VLDM_V(x) ((x) << FW_FILTER_WR_OVLAN_VLDM_S)
  325. #define FW_FILTER_WR_OVLAN_VLDM_G(x) \
  326. (((x) >> FW_FILTER_WR_OVLAN_VLDM_S) & FW_FILTER_WR_OVLAN_VLDM_M)
  327. #define FW_FILTER_WR_OVLAN_VLDM_F FW_FILTER_WR_OVLAN_VLDM_V(1U)
  328. #define FW_FILTER_WR_RX_CHAN_S 15
  329. #define FW_FILTER_WR_RX_CHAN_M 0x1
  330. #define FW_FILTER_WR_RX_CHAN_V(x) ((x) << FW_FILTER_WR_RX_CHAN_S)
  331. #define FW_FILTER_WR_RX_CHAN_G(x) \
  332. (((x) >> FW_FILTER_WR_RX_CHAN_S) & FW_FILTER_WR_RX_CHAN_M)
  333. #define FW_FILTER_WR_RX_CHAN_F FW_FILTER_WR_RX_CHAN_V(1U)
  334. #define FW_FILTER_WR_RX_RPL_IQ_S 0
  335. #define FW_FILTER_WR_RX_RPL_IQ_M 0x3ff
  336. #define FW_FILTER_WR_RX_RPL_IQ_V(x) ((x) << FW_FILTER_WR_RX_RPL_IQ_S)
  337. #define FW_FILTER_WR_RX_RPL_IQ_G(x) \
  338. (((x) >> FW_FILTER_WR_RX_RPL_IQ_S) & FW_FILTER_WR_RX_RPL_IQ_M)
  339. #define FW_FILTER_WR_MACI_S 23
  340. #define FW_FILTER_WR_MACI_M 0x1ff
  341. #define FW_FILTER_WR_MACI_V(x) ((x) << FW_FILTER_WR_MACI_S)
  342. #define FW_FILTER_WR_MACI_G(x) \
  343. (((x) >> FW_FILTER_WR_MACI_S) & FW_FILTER_WR_MACI_M)
  344. #define FW_FILTER_WR_MACIM_S 14
  345. #define FW_FILTER_WR_MACIM_M 0x1ff
  346. #define FW_FILTER_WR_MACIM_V(x) ((x) << FW_FILTER_WR_MACIM_S)
  347. #define FW_FILTER_WR_MACIM_G(x) \
  348. (((x) >> FW_FILTER_WR_MACIM_S) & FW_FILTER_WR_MACIM_M)
  349. #define FW_FILTER_WR_FCOE_S 13
  350. #define FW_FILTER_WR_FCOE_M 0x1
  351. #define FW_FILTER_WR_FCOE_V(x) ((x) << FW_FILTER_WR_FCOE_S)
  352. #define FW_FILTER_WR_FCOE_G(x) \
  353. (((x) >> FW_FILTER_WR_FCOE_S) & FW_FILTER_WR_FCOE_M)
  354. #define FW_FILTER_WR_FCOE_F FW_FILTER_WR_FCOE_V(1U)
  355. #define FW_FILTER_WR_FCOEM_S 12
  356. #define FW_FILTER_WR_FCOEM_M 0x1
  357. #define FW_FILTER_WR_FCOEM_V(x) ((x) << FW_FILTER_WR_FCOEM_S)
  358. #define FW_FILTER_WR_FCOEM_G(x) \
  359. (((x) >> FW_FILTER_WR_FCOEM_S) & FW_FILTER_WR_FCOEM_M)
  360. #define FW_FILTER_WR_FCOEM_F FW_FILTER_WR_FCOEM_V(1U)
  361. #define FW_FILTER_WR_PORT_S 9
  362. #define FW_FILTER_WR_PORT_M 0x7
  363. #define FW_FILTER_WR_PORT_V(x) ((x) << FW_FILTER_WR_PORT_S)
  364. #define FW_FILTER_WR_PORT_G(x) \
  365. (((x) >> FW_FILTER_WR_PORT_S) & FW_FILTER_WR_PORT_M)
  366. #define FW_FILTER_WR_PORTM_S 6
  367. #define FW_FILTER_WR_PORTM_M 0x7
  368. #define FW_FILTER_WR_PORTM_V(x) ((x) << FW_FILTER_WR_PORTM_S)
  369. #define FW_FILTER_WR_PORTM_G(x) \
  370. (((x) >> FW_FILTER_WR_PORTM_S) & FW_FILTER_WR_PORTM_M)
  371. #define FW_FILTER_WR_MATCHTYPE_S 3
  372. #define FW_FILTER_WR_MATCHTYPE_M 0x7
  373. #define FW_FILTER_WR_MATCHTYPE_V(x) ((x) << FW_FILTER_WR_MATCHTYPE_S)
  374. #define FW_FILTER_WR_MATCHTYPE_G(x) \
  375. (((x) >> FW_FILTER_WR_MATCHTYPE_S) & FW_FILTER_WR_MATCHTYPE_M)
  376. #define FW_FILTER_WR_MATCHTYPEM_S 0
  377. #define FW_FILTER_WR_MATCHTYPEM_M 0x7
  378. #define FW_FILTER_WR_MATCHTYPEM_V(x) ((x) << FW_FILTER_WR_MATCHTYPEM_S)
  379. #define FW_FILTER_WR_MATCHTYPEM_G(x) \
  380. (((x) >> FW_FILTER_WR_MATCHTYPEM_S) & FW_FILTER_WR_MATCHTYPEM_M)
  381. struct fw_ulptx_wr {
  382. __be32 op_to_compl;
  383. __be32 flowid_len16;
  384. u64 cookie;
  385. };
  386. struct fw_tp_wr {
  387. __be32 op_to_immdlen;
  388. __be32 flowid_len16;
  389. u64 cookie;
  390. };
  391. struct fw_eth_tx_pkt_wr {
  392. __be32 op_immdlen;
  393. __be32 equiq_to_len16;
  394. __be64 r3;
  395. };
  396. struct fw_ofld_connection_wr {
  397. __be32 op_compl;
  398. __be32 len16_pkd;
  399. __u64 cookie;
  400. __be64 r2;
  401. __be64 r3;
  402. struct fw_ofld_connection_le {
  403. __be32 version_cpl;
  404. __be32 filter;
  405. __be32 r1;
  406. __be16 lport;
  407. __be16 pport;
  408. union fw_ofld_connection_leip {
  409. struct fw_ofld_connection_le_ipv4 {
  410. __be32 pip;
  411. __be32 lip;
  412. __be64 r0;
  413. __be64 r1;
  414. __be64 r2;
  415. } ipv4;
  416. struct fw_ofld_connection_le_ipv6 {
  417. __be64 pip_hi;
  418. __be64 pip_lo;
  419. __be64 lip_hi;
  420. __be64 lip_lo;
  421. } ipv6;
  422. } u;
  423. } le;
  424. struct fw_ofld_connection_tcb {
  425. __be32 t_state_to_astid;
  426. __be16 cplrxdataack_cplpassacceptrpl;
  427. __be16 rcv_adv;
  428. __be32 rcv_nxt;
  429. __be32 tx_max;
  430. __be64 opt0;
  431. __be32 opt2;
  432. __be32 r1;
  433. __be64 r2;
  434. __be64 r3;
  435. } tcb;
  436. };
  437. #define FW_OFLD_CONNECTION_WR_VERSION_S 31
  438. #define FW_OFLD_CONNECTION_WR_VERSION_M 0x1
  439. #define FW_OFLD_CONNECTION_WR_VERSION_V(x) \
  440. ((x) << FW_OFLD_CONNECTION_WR_VERSION_S)
  441. #define FW_OFLD_CONNECTION_WR_VERSION_G(x) \
  442. (((x) >> FW_OFLD_CONNECTION_WR_VERSION_S) & \
  443. FW_OFLD_CONNECTION_WR_VERSION_M)
  444. #define FW_OFLD_CONNECTION_WR_VERSION_F \
  445. FW_OFLD_CONNECTION_WR_VERSION_V(1U)
  446. #define FW_OFLD_CONNECTION_WR_CPL_S 30
  447. #define FW_OFLD_CONNECTION_WR_CPL_M 0x1
  448. #define FW_OFLD_CONNECTION_WR_CPL_V(x) ((x) << FW_OFLD_CONNECTION_WR_CPL_S)
  449. #define FW_OFLD_CONNECTION_WR_CPL_G(x) \
  450. (((x) >> FW_OFLD_CONNECTION_WR_CPL_S) & FW_OFLD_CONNECTION_WR_CPL_M)
  451. #define FW_OFLD_CONNECTION_WR_CPL_F FW_OFLD_CONNECTION_WR_CPL_V(1U)
  452. #define FW_OFLD_CONNECTION_WR_T_STATE_S 28
  453. #define FW_OFLD_CONNECTION_WR_T_STATE_M 0xf
  454. #define FW_OFLD_CONNECTION_WR_T_STATE_V(x) \
  455. ((x) << FW_OFLD_CONNECTION_WR_T_STATE_S)
  456. #define FW_OFLD_CONNECTION_WR_T_STATE_G(x) \
  457. (((x) >> FW_OFLD_CONNECTION_WR_T_STATE_S) & \
  458. FW_OFLD_CONNECTION_WR_T_STATE_M)
  459. #define FW_OFLD_CONNECTION_WR_RCV_SCALE_S 24
  460. #define FW_OFLD_CONNECTION_WR_RCV_SCALE_M 0xf
  461. #define FW_OFLD_CONNECTION_WR_RCV_SCALE_V(x) \
  462. ((x) << FW_OFLD_CONNECTION_WR_RCV_SCALE_S)
  463. #define FW_OFLD_CONNECTION_WR_RCV_SCALE_G(x) \
  464. (((x) >> FW_OFLD_CONNECTION_WR_RCV_SCALE_S) & \
  465. FW_OFLD_CONNECTION_WR_RCV_SCALE_M)
  466. #define FW_OFLD_CONNECTION_WR_ASTID_S 0
  467. #define FW_OFLD_CONNECTION_WR_ASTID_M 0xffffff
  468. #define FW_OFLD_CONNECTION_WR_ASTID_V(x) \
  469. ((x) << FW_OFLD_CONNECTION_WR_ASTID_S)
  470. #define FW_OFLD_CONNECTION_WR_ASTID_G(x) \
  471. (((x) >> FW_OFLD_CONNECTION_WR_ASTID_S) & FW_OFLD_CONNECTION_WR_ASTID_M)
  472. #define FW_OFLD_CONNECTION_WR_CPLRXDATAACK_S 15
  473. #define FW_OFLD_CONNECTION_WR_CPLRXDATAACK_M 0x1
  474. #define FW_OFLD_CONNECTION_WR_CPLRXDATAACK_V(x) \
  475. ((x) << FW_OFLD_CONNECTION_WR_CPLRXDATAACK_S)
  476. #define FW_OFLD_CONNECTION_WR_CPLRXDATAACK_G(x) \
  477. (((x) >> FW_OFLD_CONNECTION_WR_CPLRXDATAACK_S) & \
  478. FW_OFLD_CONNECTION_WR_CPLRXDATAACK_M)
  479. #define FW_OFLD_CONNECTION_WR_CPLRXDATAACK_F \
  480. FW_OFLD_CONNECTION_WR_CPLRXDATAACK_V(1U)
  481. #define FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_S 14
  482. #define FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_M 0x1
  483. #define FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_V(x) \
  484. ((x) << FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_S)
  485. #define FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_G(x) \
  486. (((x) >> FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_S) & \
  487. FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_M)
  488. #define FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_F \
  489. FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_V(1U)
  490. enum fw_flowc_mnem {
  491. FW_FLOWC_MNEM_PFNVFN, /* PFN [15:8] VFN [7:0] */
  492. FW_FLOWC_MNEM_CH,
  493. FW_FLOWC_MNEM_PORT,
  494. FW_FLOWC_MNEM_IQID,
  495. FW_FLOWC_MNEM_SNDNXT,
  496. FW_FLOWC_MNEM_RCVNXT,
  497. FW_FLOWC_MNEM_SNDBUF,
  498. FW_FLOWC_MNEM_MSS,
  499. FW_FLOWC_MNEM_TXDATAPLEN_MAX,
  500. };
  501. struct fw_flowc_mnemval {
  502. u8 mnemonic;
  503. u8 r4[3];
  504. __be32 val;
  505. };
  506. struct fw_flowc_wr {
  507. __be32 op_to_nparams;
  508. __be32 flowid_len16;
  509. struct fw_flowc_mnemval mnemval[0];
  510. };
  511. #define FW_FLOWC_WR_NPARAMS_S 0
  512. #define FW_FLOWC_WR_NPARAMS_V(x) ((x) << FW_FLOWC_WR_NPARAMS_S)
  513. struct fw_ofld_tx_data_wr {
  514. __be32 op_to_immdlen;
  515. __be32 flowid_len16;
  516. __be32 plen;
  517. __be32 tunnel_to_proxy;
  518. };
  519. #define FW_OFLD_TX_DATA_WR_TUNNEL_S 19
  520. #define FW_OFLD_TX_DATA_WR_TUNNEL_V(x) ((x) << FW_OFLD_TX_DATA_WR_TUNNEL_S)
  521. #define FW_OFLD_TX_DATA_WR_SAVE_S 18
  522. #define FW_OFLD_TX_DATA_WR_SAVE_V(x) ((x) << FW_OFLD_TX_DATA_WR_SAVE_S)
  523. #define FW_OFLD_TX_DATA_WR_FLUSH_S 17
  524. #define FW_OFLD_TX_DATA_WR_FLUSH_V(x) ((x) << FW_OFLD_TX_DATA_WR_FLUSH_S)
  525. #define FW_OFLD_TX_DATA_WR_FLUSH_F FW_OFLD_TX_DATA_WR_FLUSH_V(1U)
  526. #define FW_OFLD_TX_DATA_WR_URGENT_S 16
  527. #define FW_OFLD_TX_DATA_WR_URGENT_V(x) ((x) << FW_OFLD_TX_DATA_WR_URGENT_S)
  528. #define FW_OFLD_TX_DATA_WR_MORE_S 15
  529. #define FW_OFLD_TX_DATA_WR_MORE_V(x) ((x) << FW_OFLD_TX_DATA_WR_MORE_S)
  530. #define FW_OFLD_TX_DATA_WR_SHOVE_S 14
  531. #define FW_OFLD_TX_DATA_WR_SHOVE_V(x) ((x) << FW_OFLD_TX_DATA_WR_SHOVE_S)
  532. #define FW_OFLD_TX_DATA_WR_SHOVE_F FW_OFLD_TX_DATA_WR_SHOVE_V(1U)
  533. #define FW_OFLD_TX_DATA_WR_ULPMODE_S 10
  534. #define FW_OFLD_TX_DATA_WR_ULPMODE_V(x) ((x) << FW_OFLD_TX_DATA_WR_ULPMODE_S)
  535. #define FW_OFLD_TX_DATA_WR_ULPSUBMODE_S 6
  536. #define FW_OFLD_TX_DATA_WR_ULPSUBMODE_V(x) \
  537. ((x) << FW_OFLD_TX_DATA_WR_ULPSUBMODE_S)
  538. struct fw_cmd_wr {
  539. __be32 op_dma;
  540. __be32 len16_pkd;
  541. __be64 cookie_daddr;
  542. };
  543. #define FW_CMD_WR_DMA_S 17
  544. #define FW_CMD_WR_DMA_V(x) ((x) << FW_CMD_WR_DMA_S)
  545. struct fw_eth_tx_pkt_vm_wr {
  546. __be32 op_immdlen;
  547. __be32 equiq_to_len16;
  548. __be32 r3[2];
  549. u8 ethmacdst[6];
  550. u8 ethmacsrc[6];
  551. __be16 ethtype;
  552. __be16 vlantci;
  553. };
  554. #define FW_CMD_MAX_TIMEOUT 10000
  555. /*
  556. * If a host driver does a HELLO and discovers that there's already a MASTER
  557. * selected, we may have to wait for that MASTER to finish issuing RESET,
  558. * configuration and INITIALIZE commands. Also, there's a possibility that
  559. * our own HELLO may get lost if it happens right as the MASTER is issuign a
  560. * RESET command, so we need to be willing to make a few retries of our HELLO.
  561. */
  562. #define FW_CMD_HELLO_TIMEOUT (3 * FW_CMD_MAX_TIMEOUT)
  563. #define FW_CMD_HELLO_RETRIES 3
  564. enum fw_cmd_opcodes {
  565. FW_LDST_CMD = 0x01,
  566. FW_RESET_CMD = 0x03,
  567. FW_HELLO_CMD = 0x04,
  568. FW_BYE_CMD = 0x05,
  569. FW_INITIALIZE_CMD = 0x06,
  570. FW_CAPS_CONFIG_CMD = 0x07,
  571. FW_PARAMS_CMD = 0x08,
  572. FW_PFVF_CMD = 0x09,
  573. FW_IQ_CMD = 0x10,
  574. FW_EQ_MNGT_CMD = 0x11,
  575. FW_EQ_ETH_CMD = 0x12,
  576. FW_EQ_CTRL_CMD = 0x13,
  577. FW_EQ_OFLD_CMD = 0x21,
  578. FW_VI_CMD = 0x14,
  579. FW_VI_MAC_CMD = 0x15,
  580. FW_VI_RXMODE_CMD = 0x16,
  581. FW_VI_ENABLE_CMD = 0x17,
  582. FW_ACL_MAC_CMD = 0x18,
  583. FW_ACL_VLAN_CMD = 0x19,
  584. FW_VI_STATS_CMD = 0x1a,
  585. FW_PORT_CMD = 0x1b,
  586. FW_PORT_STATS_CMD = 0x1c,
  587. FW_PORT_LB_STATS_CMD = 0x1d,
  588. FW_PORT_TRACE_CMD = 0x1e,
  589. FW_PORT_TRACE_MMAP_CMD = 0x1f,
  590. FW_RSS_IND_TBL_CMD = 0x20,
  591. FW_RSS_GLB_CONFIG_CMD = 0x22,
  592. FW_RSS_VI_CONFIG_CMD = 0x23,
  593. FW_DEVLOG_CMD = 0x25,
  594. FW_CLIP_CMD = 0x28,
  595. FW_LASTC2E_CMD = 0x40,
  596. FW_ERROR_CMD = 0x80,
  597. FW_DEBUG_CMD = 0x81,
  598. };
  599. enum fw_cmd_cap {
  600. FW_CMD_CAP_PF = 0x01,
  601. FW_CMD_CAP_DMAQ = 0x02,
  602. FW_CMD_CAP_PORT = 0x04,
  603. FW_CMD_CAP_PORTPROMISC = 0x08,
  604. FW_CMD_CAP_PORTSTATS = 0x10,
  605. FW_CMD_CAP_VF = 0x80,
  606. };
  607. /*
  608. * Generic command header flit0
  609. */
  610. struct fw_cmd_hdr {
  611. __be32 hi;
  612. __be32 lo;
  613. };
  614. #define FW_CMD_OP_S 24
  615. #define FW_CMD_OP_M 0xff
  616. #define FW_CMD_OP_V(x) ((x) << FW_CMD_OP_S)
  617. #define FW_CMD_OP_G(x) (((x) >> FW_CMD_OP_S) & FW_CMD_OP_M)
  618. #define FW_CMD_REQUEST_S 23
  619. #define FW_CMD_REQUEST_V(x) ((x) << FW_CMD_REQUEST_S)
  620. #define FW_CMD_REQUEST_F FW_CMD_REQUEST_V(1U)
  621. #define FW_CMD_READ_S 22
  622. #define FW_CMD_READ_V(x) ((x) << FW_CMD_READ_S)
  623. #define FW_CMD_READ_F FW_CMD_READ_V(1U)
  624. #define FW_CMD_WRITE_S 21
  625. #define FW_CMD_WRITE_V(x) ((x) << FW_CMD_WRITE_S)
  626. #define FW_CMD_WRITE_F FW_CMD_WRITE_V(1U)
  627. #define FW_CMD_EXEC_S 20
  628. #define FW_CMD_EXEC_V(x) ((x) << FW_CMD_EXEC_S)
  629. #define FW_CMD_EXEC_F FW_CMD_EXEC_V(1U)
  630. #define FW_CMD_RAMASK_S 20
  631. #define FW_CMD_RAMASK_V(x) ((x) << FW_CMD_RAMASK_S)
  632. #define FW_CMD_RETVAL_S 8
  633. #define FW_CMD_RETVAL_M 0xff
  634. #define FW_CMD_RETVAL_V(x) ((x) << FW_CMD_RETVAL_S)
  635. #define FW_CMD_RETVAL_G(x) (((x) >> FW_CMD_RETVAL_S) & FW_CMD_RETVAL_M)
  636. #define FW_CMD_LEN16_S 0
  637. #define FW_CMD_LEN16_V(x) ((x) << FW_CMD_LEN16_S)
  638. #define FW_LEN16(fw_struct) FW_CMD_LEN16_V(sizeof(fw_struct) / 16)
  639. enum fw_ldst_addrspc {
  640. FW_LDST_ADDRSPC_FIRMWARE = 0x0001,
  641. FW_LDST_ADDRSPC_SGE_EGRC = 0x0008,
  642. FW_LDST_ADDRSPC_SGE_INGC = 0x0009,
  643. FW_LDST_ADDRSPC_SGE_FLMC = 0x000a,
  644. FW_LDST_ADDRSPC_SGE_CONMC = 0x000b,
  645. FW_LDST_ADDRSPC_TP_PIO = 0x0010,
  646. FW_LDST_ADDRSPC_TP_TM_PIO = 0x0011,
  647. FW_LDST_ADDRSPC_TP_MIB = 0x0012,
  648. FW_LDST_ADDRSPC_MDIO = 0x0018,
  649. FW_LDST_ADDRSPC_MPS = 0x0020,
  650. FW_LDST_ADDRSPC_FUNC = 0x0028,
  651. FW_LDST_ADDRSPC_FUNC_PCIE = 0x0029,
  652. };
  653. enum fw_ldst_mps_fid {
  654. FW_LDST_MPS_ATRB,
  655. FW_LDST_MPS_RPLC
  656. };
  657. enum fw_ldst_func_access_ctl {
  658. FW_LDST_FUNC_ACC_CTL_VIID,
  659. FW_LDST_FUNC_ACC_CTL_FID
  660. };
  661. enum fw_ldst_func_mod_index {
  662. FW_LDST_FUNC_MPS
  663. };
  664. struct fw_ldst_cmd {
  665. __be32 op_to_addrspace;
  666. __be32 cycles_to_len16;
  667. union fw_ldst {
  668. struct fw_ldst_addrval {
  669. __be32 addr;
  670. __be32 val;
  671. } addrval;
  672. struct fw_ldst_idctxt {
  673. __be32 physid;
  674. __be32 msg_ctxtflush;
  675. __be32 ctxt_data7;
  676. __be32 ctxt_data6;
  677. __be32 ctxt_data5;
  678. __be32 ctxt_data4;
  679. __be32 ctxt_data3;
  680. __be32 ctxt_data2;
  681. __be32 ctxt_data1;
  682. __be32 ctxt_data0;
  683. } idctxt;
  684. struct fw_ldst_mdio {
  685. __be16 paddr_mmd;
  686. __be16 raddr;
  687. __be16 vctl;
  688. __be16 rval;
  689. } mdio;
  690. struct fw_ldst_cim_rq {
  691. u8 req_first64[8];
  692. u8 req_second64[8];
  693. u8 resp_first64[8];
  694. u8 resp_second64[8];
  695. __be32 r3[2];
  696. } cim_rq;
  697. union fw_ldst_mps {
  698. struct fw_ldst_mps_rplc {
  699. __be16 fid_idx;
  700. __be16 rplcpf_pkd;
  701. __be32 rplc255_224;
  702. __be32 rplc223_192;
  703. __be32 rplc191_160;
  704. __be32 rplc159_128;
  705. __be32 rplc127_96;
  706. __be32 rplc95_64;
  707. __be32 rplc63_32;
  708. __be32 rplc31_0;
  709. } rplc;
  710. struct fw_ldst_mps_atrb {
  711. __be16 fid_mpsid;
  712. __be16 r2[3];
  713. __be32 r3[2];
  714. __be32 r4;
  715. __be32 atrb;
  716. __be16 vlan[16];
  717. } atrb;
  718. } mps;
  719. struct fw_ldst_func {
  720. u8 access_ctl;
  721. u8 mod_index;
  722. __be16 ctl_id;
  723. __be32 offset;
  724. __be64 data0;
  725. __be64 data1;
  726. } func;
  727. struct fw_ldst_pcie {
  728. u8 ctrl_to_fn;
  729. u8 bnum;
  730. u8 r;
  731. u8 ext_r;
  732. u8 select_naccess;
  733. u8 pcie_fn;
  734. __be16 nset_pkd;
  735. __be32 data[12];
  736. } pcie;
  737. struct fw_ldst_i2c_deprecated {
  738. u8 pid_pkd;
  739. u8 base;
  740. u8 boffset;
  741. u8 data;
  742. __be32 r9;
  743. } i2c_deprecated;
  744. struct fw_ldst_i2c {
  745. u8 pid;
  746. u8 did;
  747. u8 boffset;
  748. u8 blen;
  749. __be32 r9;
  750. __u8 data[48];
  751. } i2c;
  752. struct fw_ldst_le {
  753. __be32 index;
  754. __be32 r9;
  755. u8 val[33];
  756. u8 r11[7];
  757. } le;
  758. } u;
  759. };
  760. #define FW_LDST_CMD_ADDRSPACE_S 0
  761. #define FW_LDST_CMD_ADDRSPACE_V(x) ((x) << FW_LDST_CMD_ADDRSPACE_S)
  762. #define FW_LDST_CMD_MSG_S 31
  763. #define FW_LDST_CMD_MSG_V(x) ((x) << FW_LDST_CMD_MSG_S)
  764. #define FW_LDST_CMD_CTXTFLUSH_S 30
  765. #define FW_LDST_CMD_CTXTFLUSH_V(x) ((x) << FW_LDST_CMD_CTXTFLUSH_S)
  766. #define FW_LDST_CMD_CTXTFLUSH_F FW_LDST_CMD_CTXTFLUSH_V(1U)
  767. #define FW_LDST_CMD_PADDR_S 8
  768. #define FW_LDST_CMD_PADDR_V(x) ((x) << FW_LDST_CMD_PADDR_S)
  769. #define FW_LDST_CMD_MMD_S 0
  770. #define FW_LDST_CMD_MMD_V(x) ((x) << FW_LDST_CMD_MMD_S)
  771. #define FW_LDST_CMD_FID_S 15
  772. #define FW_LDST_CMD_FID_V(x) ((x) << FW_LDST_CMD_FID_S)
  773. #define FW_LDST_CMD_IDX_S 0
  774. #define FW_LDST_CMD_IDX_V(x) ((x) << FW_LDST_CMD_IDX_S)
  775. #define FW_LDST_CMD_RPLCPF_S 0
  776. #define FW_LDST_CMD_RPLCPF_V(x) ((x) << FW_LDST_CMD_RPLCPF_S)
  777. #define FW_LDST_CMD_LC_S 4
  778. #define FW_LDST_CMD_LC_V(x) ((x) << FW_LDST_CMD_LC_S)
  779. #define FW_LDST_CMD_LC_F FW_LDST_CMD_LC_V(1U)
  780. #define FW_LDST_CMD_FN_S 0
  781. #define FW_LDST_CMD_FN_V(x) ((x) << FW_LDST_CMD_FN_S)
  782. #define FW_LDST_CMD_NACCESS_S 0
  783. #define FW_LDST_CMD_NACCESS_V(x) ((x) << FW_LDST_CMD_NACCESS_S)
  784. struct fw_reset_cmd {
  785. __be32 op_to_write;
  786. __be32 retval_len16;
  787. __be32 val;
  788. __be32 halt_pkd;
  789. };
  790. #define FW_RESET_CMD_HALT_S 31
  791. #define FW_RESET_CMD_HALT_M 0x1
  792. #define FW_RESET_CMD_HALT_V(x) ((x) << FW_RESET_CMD_HALT_S)
  793. #define FW_RESET_CMD_HALT_G(x) \
  794. (((x) >> FW_RESET_CMD_HALT_S) & FW_RESET_CMD_HALT_M)
  795. #define FW_RESET_CMD_HALT_F FW_RESET_CMD_HALT_V(1U)
  796. enum fw_hellow_cmd {
  797. fw_hello_cmd_stage_os = 0x0
  798. };
  799. struct fw_hello_cmd {
  800. __be32 op_to_write;
  801. __be32 retval_len16;
  802. __be32 err_to_clearinit;
  803. __be32 fwrev;
  804. };
  805. #define FW_HELLO_CMD_ERR_S 31
  806. #define FW_HELLO_CMD_ERR_V(x) ((x) << FW_HELLO_CMD_ERR_S)
  807. #define FW_HELLO_CMD_ERR_F FW_HELLO_CMD_ERR_V(1U)
  808. #define FW_HELLO_CMD_INIT_S 30
  809. #define FW_HELLO_CMD_INIT_V(x) ((x) << FW_HELLO_CMD_INIT_S)
  810. #define FW_HELLO_CMD_INIT_F FW_HELLO_CMD_INIT_V(1U)
  811. #define FW_HELLO_CMD_MASTERDIS_S 29
  812. #define FW_HELLO_CMD_MASTERDIS_V(x) ((x) << FW_HELLO_CMD_MASTERDIS_S)
  813. #define FW_HELLO_CMD_MASTERFORCE_S 28
  814. #define FW_HELLO_CMD_MASTERFORCE_V(x) ((x) << FW_HELLO_CMD_MASTERFORCE_S)
  815. #define FW_HELLO_CMD_MBMASTER_S 24
  816. #define FW_HELLO_CMD_MBMASTER_M 0xfU
  817. #define FW_HELLO_CMD_MBMASTER_V(x) ((x) << FW_HELLO_CMD_MBMASTER_S)
  818. #define FW_HELLO_CMD_MBMASTER_G(x) \
  819. (((x) >> FW_HELLO_CMD_MBMASTER_S) & FW_HELLO_CMD_MBMASTER_M)
  820. #define FW_HELLO_CMD_MBASYNCNOTINT_S 23
  821. #define FW_HELLO_CMD_MBASYNCNOTINT_V(x) ((x) << FW_HELLO_CMD_MBASYNCNOTINT_S)
  822. #define FW_HELLO_CMD_MBASYNCNOT_S 20
  823. #define FW_HELLO_CMD_MBASYNCNOT_V(x) ((x) << FW_HELLO_CMD_MBASYNCNOT_S)
  824. #define FW_HELLO_CMD_STAGE_S 17
  825. #define FW_HELLO_CMD_STAGE_V(x) ((x) << FW_HELLO_CMD_STAGE_S)
  826. #define FW_HELLO_CMD_CLEARINIT_S 16
  827. #define FW_HELLO_CMD_CLEARINIT_V(x) ((x) << FW_HELLO_CMD_CLEARINIT_S)
  828. #define FW_HELLO_CMD_CLEARINIT_F FW_HELLO_CMD_CLEARINIT_V(1U)
  829. struct fw_bye_cmd {
  830. __be32 op_to_write;
  831. __be32 retval_len16;
  832. __be64 r3;
  833. };
  834. struct fw_initialize_cmd {
  835. __be32 op_to_write;
  836. __be32 retval_len16;
  837. __be64 r3;
  838. };
  839. enum fw_caps_config_hm {
  840. FW_CAPS_CONFIG_HM_PCIE = 0x00000001,
  841. FW_CAPS_CONFIG_HM_PL = 0x00000002,
  842. FW_CAPS_CONFIG_HM_SGE = 0x00000004,
  843. FW_CAPS_CONFIG_HM_CIM = 0x00000008,
  844. FW_CAPS_CONFIG_HM_ULPTX = 0x00000010,
  845. FW_CAPS_CONFIG_HM_TP = 0x00000020,
  846. FW_CAPS_CONFIG_HM_ULPRX = 0x00000040,
  847. FW_CAPS_CONFIG_HM_PMRX = 0x00000080,
  848. FW_CAPS_CONFIG_HM_PMTX = 0x00000100,
  849. FW_CAPS_CONFIG_HM_MC = 0x00000200,
  850. FW_CAPS_CONFIG_HM_LE = 0x00000400,
  851. FW_CAPS_CONFIG_HM_MPS = 0x00000800,
  852. FW_CAPS_CONFIG_HM_XGMAC = 0x00001000,
  853. FW_CAPS_CONFIG_HM_CPLSWITCH = 0x00002000,
  854. FW_CAPS_CONFIG_HM_T4DBG = 0x00004000,
  855. FW_CAPS_CONFIG_HM_MI = 0x00008000,
  856. FW_CAPS_CONFIG_HM_I2CM = 0x00010000,
  857. FW_CAPS_CONFIG_HM_NCSI = 0x00020000,
  858. FW_CAPS_CONFIG_HM_SMB = 0x00040000,
  859. FW_CAPS_CONFIG_HM_MA = 0x00080000,
  860. FW_CAPS_CONFIG_HM_EDRAM = 0x00100000,
  861. FW_CAPS_CONFIG_HM_PMU = 0x00200000,
  862. FW_CAPS_CONFIG_HM_UART = 0x00400000,
  863. FW_CAPS_CONFIG_HM_SF = 0x00800000,
  864. };
  865. enum fw_caps_config_nbm {
  866. FW_CAPS_CONFIG_NBM_IPMI = 0x00000001,
  867. FW_CAPS_CONFIG_NBM_NCSI = 0x00000002,
  868. };
  869. enum fw_caps_config_link {
  870. FW_CAPS_CONFIG_LINK_PPP = 0x00000001,
  871. FW_CAPS_CONFIG_LINK_QFC = 0x00000002,
  872. FW_CAPS_CONFIG_LINK_DCBX = 0x00000004,
  873. };
  874. enum fw_caps_config_switch {
  875. FW_CAPS_CONFIG_SWITCH_INGRESS = 0x00000001,
  876. FW_CAPS_CONFIG_SWITCH_EGRESS = 0x00000002,
  877. };
  878. enum fw_caps_config_nic {
  879. FW_CAPS_CONFIG_NIC = 0x00000001,
  880. FW_CAPS_CONFIG_NIC_VM = 0x00000002,
  881. };
  882. enum fw_caps_config_ofld {
  883. FW_CAPS_CONFIG_OFLD = 0x00000001,
  884. };
  885. enum fw_caps_config_rdma {
  886. FW_CAPS_CONFIG_RDMA_RDDP = 0x00000001,
  887. FW_CAPS_CONFIG_RDMA_RDMAC = 0x00000002,
  888. };
  889. enum fw_caps_config_iscsi {
  890. FW_CAPS_CONFIG_ISCSI_INITIATOR_PDU = 0x00000001,
  891. FW_CAPS_CONFIG_ISCSI_TARGET_PDU = 0x00000002,
  892. FW_CAPS_CONFIG_ISCSI_INITIATOR_CNXOFLD = 0x00000004,
  893. FW_CAPS_CONFIG_ISCSI_TARGET_CNXOFLD = 0x00000008,
  894. };
  895. enum fw_caps_config_fcoe {
  896. FW_CAPS_CONFIG_FCOE_INITIATOR = 0x00000001,
  897. FW_CAPS_CONFIG_FCOE_TARGET = 0x00000002,
  898. FW_CAPS_CONFIG_FCOE_CTRL_OFLD = 0x00000004,
  899. };
  900. enum fw_memtype_cf {
  901. FW_MEMTYPE_CF_EDC0 = 0x0,
  902. FW_MEMTYPE_CF_EDC1 = 0x1,
  903. FW_MEMTYPE_CF_EXTMEM = 0x2,
  904. FW_MEMTYPE_CF_FLASH = 0x4,
  905. FW_MEMTYPE_CF_INTERNAL = 0x5,
  906. FW_MEMTYPE_CF_EXTMEM1 = 0x6,
  907. };
  908. struct fw_caps_config_cmd {
  909. __be32 op_to_write;
  910. __be32 cfvalid_to_len16;
  911. __be32 r2;
  912. __be32 hwmbitmap;
  913. __be16 nbmcaps;
  914. __be16 linkcaps;
  915. __be16 switchcaps;
  916. __be16 r3;
  917. __be16 niccaps;
  918. __be16 ofldcaps;
  919. __be16 rdmacaps;
  920. __be16 r4;
  921. __be16 iscsicaps;
  922. __be16 fcoecaps;
  923. __be32 cfcsum;
  924. __be32 finiver;
  925. __be32 finicsum;
  926. };
  927. #define FW_CAPS_CONFIG_CMD_CFVALID_S 27
  928. #define FW_CAPS_CONFIG_CMD_CFVALID_V(x) ((x) << FW_CAPS_CONFIG_CMD_CFVALID_S)
  929. #define FW_CAPS_CONFIG_CMD_CFVALID_F FW_CAPS_CONFIG_CMD_CFVALID_V(1U)
  930. #define FW_CAPS_CONFIG_CMD_MEMTYPE_CF_S 24
  931. #define FW_CAPS_CONFIG_CMD_MEMTYPE_CF_V(x) \
  932. ((x) << FW_CAPS_CONFIG_CMD_MEMTYPE_CF_S)
  933. #define FW_CAPS_CONFIG_CMD_MEMADDR64K_CF_S 16
  934. #define FW_CAPS_CONFIG_CMD_MEMADDR64K_CF_V(x) \
  935. ((x) << FW_CAPS_CONFIG_CMD_MEMADDR64K_CF_S)
  936. /*
  937. * params command mnemonics
  938. */
  939. enum fw_params_mnem {
  940. FW_PARAMS_MNEM_DEV = 1, /* device params */
  941. FW_PARAMS_MNEM_PFVF = 2, /* function params */
  942. FW_PARAMS_MNEM_REG = 3, /* limited register access */
  943. FW_PARAMS_MNEM_DMAQ = 4, /* dma queue params */
  944. FW_PARAMS_MNEM_CHNET = 5, /* chnet params */
  945. FW_PARAMS_MNEM_LAST
  946. };
  947. /*
  948. * device parameters
  949. */
  950. enum fw_params_param_dev {
  951. FW_PARAMS_PARAM_DEV_CCLK = 0x00, /* chip core clock in khz */
  952. FW_PARAMS_PARAM_DEV_PORTVEC = 0x01, /* the port vector */
  953. FW_PARAMS_PARAM_DEV_NTID = 0x02, /* reads the number of TIDs
  954. * allocated by the device's
  955. * Lookup Engine
  956. */
  957. FW_PARAMS_PARAM_DEV_FLOWC_BUFFIFO_SZ = 0x03,
  958. FW_PARAMS_PARAM_DEV_INTVER_NIC = 0x04,
  959. FW_PARAMS_PARAM_DEV_INTVER_VNIC = 0x05,
  960. FW_PARAMS_PARAM_DEV_INTVER_OFLD = 0x06,
  961. FW_PARAMS_PARAM_DEV_INTVER_RI = 0x07,
  962. FW_PARAMS_PARAM_DEV_INTVER_ISCSIPDU = 0x08,
  963. FW_PARAMS_PARAM_DEV_INTVER_ISCSI = 0x09,
  964. FW_PARAMS_PARAM_DEV_INTVER_FCOE = 0x0A,
  965. FW_PARAMS_PARAM_DEV_FWREV = 0x0B,
  966. FW_PARAMS_PARAM_DEV_TPREV = 0x0C,
  967. FW_PARAMS_PARAM_DEV_CF = 0x0D,
  968. FW_PARAMS_PARAM_DEV_PHYFW = 0x0F,
  969. FW_PARAMS_PARAM_DEV_DIAG = 0x11,
  970. FW_PARAMS_PARAM_DEV_MAXORDIRD_QP = 0x13, /* max supported QP IRD/ORD */
  971. FW_PARAMS_PARAM_DEV_MAXIRD_ADAPTER = 0x14, /* max supported adap IRD */
  972. FW_PARAMS_PARAM_DEV_ULPTX_MEMWRITE_DSGL = 0x17,
  973. FW_PARAMS_PARAM_DEV_FWCACHE = 0x18,
  974. };
  975. /*
  976. * physical and virtual function parameters
  977. */
  978. enum fw_params_param_pfvf {
  979. FW_PARAMS_PARAM_PFVF_RWXCAPS = 0x00,
  980. FW_PARAMS_PARAM_PFVF_ROUTE_START = 0x01,
  981. FW_PARAMS_PARAM_PFVF_ROUTE_END = 0x02,
  982. FW_PARAMS_PARAM_PFVF_CLIP_START = 0x03,
  983. FW_PARAMS_PARAM_PFVF_CLIP_END = 0x04,
  984. FW_PARAMS_PARAM_PFVF_FILTER_START = 0x05,
  985. FW_PARAMS_PARAM_PFVF_FILTER_END = 0x06,
  986. FW_PARAMS_PARAM_PFVF_SERVER_START = 0x07,
  987. FW_PARAMS_PARAM_PFVF_SERVER_END = 0x08,
  988. FW_PARAMS_PARAM_PFVF_TDDP_START = 0x09,
  989. FW_PARAMS_PARAM_PFVF_TDDP_END = 0x0A,
  990. FW_PARAMS_PARAM_PFVF_ISCSI_START = 0x0B,
  991. FW_PARAMS_PARAM_PFVF_ISCSI_END = 0x0C,
  992. FW_PARAMS_PARAM_PFVF_STAG_START = 0x0D,
  993. FW_PARAMS_PARAM_PFVF_STAG_END = 0x0E,
  994. FW_PARAMS_PARAM_PFVF_RQ_START = 0x1F,
  995. FW_PARAMS_PARAM_PFVF_RQ_END = 0x10,
  996. FW_PARAMS_PARAM_PFVF_PBL_START = 0x11,
  997. FW_PARAMS_PARAM_PFVF_PBL_END = 0x12,
  998. FW_PARAMS_PARAM_PFVF_L2T_START = 0x13,
  999. FW_PARAMS_PARAM_PFVF_L2T_END = 0x14,
  1000. FW_PARAMS_PARAM_PFVF_SQRQ_START = 0x15,
  1001. FW_PARAMS_PARAM_PFVF_SQRQ_END = 0x16,
  1002. FW_PARAMS_PARAM_PFVF_CQ_START = 0x17,
  1003. FW_PARAMS_PARAM_PFVF_CQ_END = 0x18,
  1004. FW_PARAMS_PARAM_PFVF_SCHEDCLASS_ETH = 0x20,
  1005. FW_PARAMS_PARAM_PFVF_VIID = 0x24,
  1006. FW_PARAMS_PARAM_PFVF_CPMASK = 0x25,
  1007. FW_PARAMS_PARAM_PFVF_OCQ_START = 0x26,
  1008. FW_PARAMS_PARAM_PFVF_OCQ_END = 0x27,
  1009. FW_PARAMS_PARAM_PFVF_CONM_MAP = 0x28,
  1010. FW_PARAMS_PARAM_PFVF_IQFLINT_START = 0x29,
  1011. FW_PARAMS_PARAM_PFVF_IQFLINT_END = 0x2A,
  1012. FW_PARAMS_PARAM_PFVF_EQ_START = 0x2B,
  1013. FW_PARAMS_PARAM_PFVF_EQ_END = 0x2C,
  1014. FW_PARAMS_PARAM_PFVF_ACTIVE_FILTER_START = 0x2D,
  1015. FW_PARAMS_PARAM_PFVF_ACTIVE_FILTER_END = 0x2E,
  1016. FW_PARAMS_PARAM_PFVF_ETHOFLD_END = 0x30,
  1017. FW_PARAMS_PARAM_PFVF_CPLFW4MSG_ENCAP = 0x31
  1018. };
  1019. /*
  1020. * dma queue parameters
  1021. */
  1022. enum fw_params_param_dmaq {
  1023. FW_PARAMS_PARAM_DMAQ_IQ_DCAEN_DCACPU = 0x00,
  1024. FW_PARAMS_PARAM_DMAQ_IQ_INTCNTTHRESH = 0x01,
  1025. FW_PARAMS_PARAM_DMAQ_EQ_CMPLIQID_MNGT = 0x10,
  1026. FW_PARAMS_PARAM_DMAQ_EQ_CMPLIQID_CTRL = 0x11,
  1027. FW_PARAMS_PARAM_DMAQ_EQ_SCHEDCLASS_ETH = 0x12,
  1028. FW_PARAMS_PARAM_DMAQ_EQ_DCBPRIO_ETH = 0x13,
  1029. FW_PARAMS_PARAM_DMAQ_CONM_CTXT = 0x20,
  1030. };
  1031. enum fw_params_param_dev_phyfw {
  1032. FW_PARAMS_PARAM_DEV_PHYFW_DOWNLOAD = 0x00,
  1033. FW_PARAMS_PARAM_DEV_PHYFW_VERSION = 0x01,
  1034. };
  1035. enum fw_params_param_dev_diag {
  1036. FW_PARAM_DEV_DIAG_TMP = 0x00,
  1037. FW_PARAM_DEV_DIAG_VDD = 0x01,
  1038. };
  1039. enum fw_params_param_dev_fwcache {
  1040. FW_PARAM_DEV_FWCACHE_FLUSH = 0x00,
  1041. FW_PARAM_DEV_FWCACHE_FLUSHINV = 0x01,
  1042. };
  1043. #define FW_PARAMS_MNEM_S 24
  1044. #define FW_PARAMS_MNEM_V(x) ((x) << FW_PARAMS_MNEM_S)
  1045. #define FW_PARAMS_PARAM_X_S 16
  1046. #define FW_PARAMS_PARAM_X_V(x) ((x) << FW_PARAMS_PARAM_X_S)
  1047. #define FW_PARAMS_PARAM_Y_S 8
  1048. #define FW_PARAMS_PARAM_Y_M 0xffU
  1049. #define FW_PARAMS_PARAM_Y_V(x) ((x) << FW_PARAMS_PARAM_Y_S)
  1050. #define FW_PARAMS_PARAM_Y_G(x) (((x) >> FW_PARAMS_PARAM_Y_S) &\
  1051. FW_PARAMS_PARAM_Y_M)
  1052. #define FW_PARAMS_PARAM_Z_S 0
  1053. #define FW_PARAMS_PARAM_Z_M 0xffu
  1054. #define FW_PARAMS_PARAM_Z_V(x) ((x) << FW_PARAMS_PARAM_Z_S)
  1055. #define FW_PARAMS_PARAM_Z_G(x) (((x) >> FW_PARAMS_PARAM_Z_S) &\
  1056. FW_PARAMS_PARAM_Z_M)
  1057. #define FW_PARAMS_PARAM_XYZ_S 0
  1058. #define FW_PARAMS_PARAM_XYZ_V(x) ((x) << FW_PARAMS_PARAM_XYZ_S)
  1059. #define FW_PARAMS_PARAM_YZ_S 0
  1060. #define FW_PARAMS_PARAM_YZ_V(x) ((x) << FW_PARAMS_PARAM_YZ_S)
  1061. struct fw_params_cmd {
  1062. __be32 op_to_vfn;
  1063. __be32 retval_len16;
  1064. struct fw_params_param {
  1065. __be32 mnem;
  1066. __be32 val;
  1067. } param[7];
  1068. };
  1069. #define FW_PARAMS_CMD_PFN_S 8
  1070. #define FW_PARAMS_CMD_PFN_V(x) ((x) << FW_PARAMS_CMD_PFN_S)
  1071. #define FW_PARAMS_CMD_VFN_S 0
  1072. #define FW_PARAMS_CMD_VFN_V(x) ((x) << FW_PARAMS_CMD_VFN_S)
  1073. struct fw_pfvf_cmd {
  1074. __be32 op_to_vfn;
  1075. __be32 retval_len16;
  1076. __be32 niqflint_niq;
  1077. __be32 type_to_neq;
  1078. __be32 tc_to_nexactf;
  1079. __be32 r_caps_to_nethctrl;
  1080. __be16 nricq;
  1081. __be16 nriqp;
  1082. __be32 r4;
  1083. };
  1084. #define FW_PFVF_CMD_PFN_S 8
  1085. #define FW_PFVF_CMD_PFN_V(x) ((x) << FW_PFVF_CMD_PFN_S)
  1086. #define FW_PFVF_CMD_VFN_S 0
  1087. #define FW_PFVF_CMD_VFN_V(x) ((x) << FW_PFVF_CMD_VFN_S)
  1088. #define FW_PFVF_CMD_NIQFLINT_S 20
  1089. #define FW_PFVF_CMD_NIQFLINT_M 0xfff
  1090. #define FW_PFVF_CMD_NIQFLINT_V(x) ((x) << FW_PFVF_CMD_NIQFLINT_S)
  1091. #define FW_PFVF_CMD_NIQFLINT_G(x) \
  1092. (((x) >> FW_PFVF_CMD_NIQFLINT_S) & FW_PFVF_CMD_NIQFLINT_M)
  1093. #define FW_PFVF_CMD_NIQ_S 0
  1094. #define FW_PFVF_CMD_NIQ_M 0xfffff
  1095. #define FW_PFVF_CMD_NIQ_V(x) ((x) << FW_PFVF_CMD_NIQ_S)
  1096. #define FW_PFVF_CMD_NIQ_G(x) \
  1097. (((x) >> FW_PFVF_CMD_NIQ_S) & FW_PFVF_CMD_NIQ_M)
  1098. #define FW_PFVF_CMD_TYPE_S 31
  1099. #define FW_PFVF_CMD_TYPE_M 0x1
  1100. #define FW_PFVF_CMD_TYPE_V(x) ((x) << FW_PFVF_CMD_TYPE_S)
  1101. #define FW_PFVF_CMD_TYPE_G(x) \
  1102. (((x) >> FW_PFVF_CMD_TYPE_S) & FW_PFVF_CMD_TYPE_M)
  1103. #define FW_PFVF_CMD_TYPE_F FW_PFVF_CMD_TYPE_V(1U)
  1104. #define FW_PFVF_CMD_CMASK_S 24
  1105. #define FW_PFVF_CMD_CMASK_M 0xf
  1106. #define FW_PFVF_CMD_CMASK_V(x) ((x) << FW_PFVF_CMD_CMASK_S)
  1107. #define FW_PFVF_CMD_CMASK_G(x) \
  1108. (((x) >> FW_PFVF_CMD_CMASK_S) & FW_PFVF_CMD_CMASK_M)
  1109. #define FW_PFVF_CMD_PMASK_S 20
  1110. #define FW_PFVF_CMD_PMASK_M 0xf
  1111. #define FW_PFVF_CMD_PMASK_V(x) ((x) << FW_PFVF_CMD_PMASK_S)
  1112. #define FW_PFVF_CMD_PMASK_G(x) \
  1113. (((x) >> FW_PFVF_CMD_PMASK_S) & FW_PFVF_CMD_PMASK_M)
  1114. #define FW_PFVF_CMD_NEQ_S 0
  1115. #define FW_PFVF_CMD_NEQ_M 0xfffff
  1116. #define FW_PFVF_CMD_NEQ_V(x) ((x) << FW_PFVF_CMD_NEQ_S)
  1117. #define FW_PFVF_CMD_NEQ_G(x) \
  1118. (((x) >> FW_PFVF_CMD_NEQ_S) & FW_PFVF_CMD_NEQ_M)
  1119. #define FW_PFVF_CMD_TC_S 24
  1120. #define FW_PFVF_CMD_TC_M 0xff
  1121. #define FW_PFVF_CMD_TC_V(x) ((x) << FW_PFVF_CMD_TC_S)
  1122. #define FW_PFVF_CMD_TC_G(x) (((x) >> FW_PFVF_CMD_TC_S) & FW_PFVF_CMD_TC_M)
  1123. #define FW_PFVF_CMD_NVI_S 16
  1124. #define FW_PFVF_CMD_NVI_M 0xff
  1125. #define FW_PFVF_CMD_NVI_V(x) ((x) << FW_PFVF_CMD_NVI_S)
  1126. #define FW_PFVF_CMD_NVI_G(x) (((x) >> FW_PFVF_CMD_NVI_S) & FW_PFVF_CMD_NVI_M)
  1127. #define FW_PFVF_CMD_NEXACTF_S 0
  1128. #define FW_PFVF_CMD_NEXACTF_M 0xffff
  1129. #define FW_PFVF_CMD_NEXACTF_V(x) ((x) << FW_PFVF_CMD_NEXACTF_S)
  1130. #define FW_PFVF_CMD_NEXACTF_G(x) \
  1131. (((x) >> FW_PFVF_CMD_NEXACTF_S) & FW_PFVF_CMD_NEXACTF_M)
  1132. #define FW_PFVF_CMD_R_CAPS_S 24
  1133. #define FW_PFVF_CMD_R_CAPS_M 0xff
  1134. #define FW_PFVF_CMD_R_CAPS_V(x) ((x) << FW_PFVF_CMD_R_CAPS_S)
  1135. #define FW_PFVF_CMD_R_CAPS_G(x) \
  1136. (((x) >> FW_PFVF_CMD_R_CAPS_S) & FW_PFVF_CMD_R_CAPS_M)
  1137. #define FW_PFVF_CMD_WX_CAPS_S 16
  1138. #define FW_PFVF_CMD_WX_CAPS_M 0xff
  1139. #define FW_PFVF_CMD_WX_CAPS_V(x) ((x) << FW_PFVF_CMD_WX_CAPS_S)
  1140. #define FW_PFVF_CMD_WX_CAPS_G(x) \
  1141. (((x) >> FW_PFVF_CMD_WX_CAPS_S) & FW_PFVF_CMD_WX_CAPS_M)
  1142. #define FW_PFVF_CMD_NETHCTRL_S 0
  1143. #define FW_PFVF_CMD_NETHCTRL_M 0xffff
  1144. #define FW_PFVF_CMD_NETHCTRL_V(x) ((x) << FW_PFVF_CMD_NETHCTRL_S)
  1145. #define FW_PFVF_CMD_NETHCTRL_G(x) \
  1146. (((x) >> FW_PFVF_CMD_NETHCTRL_S) & FW_PFVF_CMD_NETHCTRL_M)
  1147. enum fw_iq_type {
  1148. FW_IQ_TYPE_FL_INT_CAP,
  1149. FW_IQ_TYPE_NO_FL_INT_CAP
  1150. };
  1151. struct fw_iq_cmd {
  1152. __be32 op_to_vfn;
  1153. __be32 alloc_to_len16;
  1154. __be16 physiqid;
  1155. __be16 iqid;
  1156. __be16 fl0id;
  1157. __be16 fl1id;
  1158. __be32 type_to_iqandstindex;
  1159. __be16 iqdroprss_to_iqesize;
  1160. __be16 iqsize;
  1161. __be64 iqaddr;
  1162. __be32 iqns_to_fl0congen;
  1163. __be16 fl0dcaen_to_fl0cidxfthresh;
  1164. __be16 fl0size;
  1165. __be64 fl0addr;
  1166. __be32 fl1cngchmap_to_fl1congen;
  1167. __be16 fl1dcaen_to_fl1cidxfthresh;
  1168. __be16 fl1size;
  1169. __be64 fl1addr;
  1170. };
  1171. #define FW_IQ_CMD_PFN_S 8
  1172. #define FW_IQ_CMD_PFN_V(x) ((x) << FW_IQ_CMD_PFN_S)
  1173. #define FW_IQ_CMD_VFN_S 0
  1174. #define FW_IQ_CMD_VFN_V(x) ((x) << FW_IQ_CMD_VFN_S)
  1175. #define FW_IQ_CMD_ALLOC_S 31
  1176. #define FW_IQ_CMD_ALLOC_V(x) ((x) << FW_IQ_CMD_ALLOC_S)
  1177. #define FW_IQ_CMD_ALLOC_F FW_IQ_CMD_ALLOC_V(1U)
  1178. #define FW_IQ_CMD_FREE_S 30
  1179. #define FW_IQ_CMD_FREE_V(x) ((x) << FW_IQ_CMD_FREE_S)
  1180. #define FW_IQ_CMD_FREE_F FW_IQ_CMD_FREE_V(1U)
  1181. #define FW_IQ_CMD_MODIFY_S 29
  1182. #define FW_IQ_CMD_MODIFY_V(x) ((x) << FW_IQ_CMD_MODIFY_S)
  1183. #define FW_IQ_CMD_MODIFY_F FW_IQ_CMD_MODIFY_V(1U)
  1184. #define FW_IQ_CMD_IQSTART_S 28
  1185. #define FW_IQ_CMD_IQSTART_V(x) ((x) << FW_IQ_CMD_IQSTART_S)
  1186. #define FW_IQ_CMD_IQSTART_F FW_IQ_CMD_IQSTART_V(1U)
  1187. #define FW_IQ_CMD_IQSTOP_S 27
  1188. #define FW_IQ_CMD_IQSTOP_V(x) ((x) << FW_IQ_CMD_IQSTOP_S)
  1189. #define FW_IQ_CMD_IQSTOP_F FW_IQ_CMD_IQSTOP_V(1U)
  1190. #define FW_IQ_CMD_TYPE_S 29
  1191. #define FW_IQ_CMD_TYPE_V(x) ((x) << FW_IQ_CMD_TYPE_S)
  1192. #define FW_IQ_CMD_IQASYNCH_S 28
  1193. #define FW_IQ_CMD_IQASYNCH_V(x) ((x) << FW_IQ_CMD_IQASYNCH_S)
  1194. #define FW_IQ_CMD_VIID_S 16
  1195. #define FW_IQ_CMD_VIID_V(x) ((x) << FW_IQ_CMD_VIID_S)
  1196. #define FW_IQ_CMD_IQANDST_S 15
  1197. #define FW_IQ_CMD_IQANDST_V(x) ((x) << FW_IQ_CMD_IQANDST_S)
  1198. #define FW_IQ_CMD_IQANUS_S 14
  1199. #define FW_IQ_CMD_IQANUS_V(x) ((x) << FW_IQ_CMD_IQANUS_S)
  1200. #define FW_IQ_CMD_IQANUD_S 12
  1201. #define FW_IQ_CMD_IQANUD_V(x) ((x) << FW_IQ_CMD_IQANUD_S)
  1202. #define FW_IQ_CMD_IQANDSTINDEX_S 0
  1203. #define FW_IQ_CMD_IQANDSTINDEX_V(x) ((x) << FW_IQ_CMD_IQANDSTINDEX_S)
  1204. #define FW_IQ_CMD_IQDROPRSS_S 15
  1205. #define FW_IQ_CMD_IQDROPRSS_V(x) ((x) << FW_IQ_CMD_IQDROPRSS_S)
  1206. #define FW_IQ_CMD_IQDROPRSS_F FW_IQ_CMD_IQDROPRSS_V(1U)
  1207. #define FW_IQ_CMD_IQGTSMODE_S 14
  1208. #define FW_IQ_CMD_IQGTSMODE_V(x) ((x) << FW_IQ_CMD_IQGTSMODE_S)
  1209. #define FW_IQ_CMD_IQGTSMODE_F FW_IQ_CMD_IQGTSMODE_V(1U)
  1210. #define FW_IQ_CMD_IQPCIECH_S 12
  1211. #define FW_IQ_CMD_IQPCIECH_V(x) ((x) << FW_IQ_CMD_IQPCIECH_S)
  1212. #define FW_IQ_CMD_IQDCAEN_S 11
  1213. #define FW_IQ_CMD_IQDCAEN_V(x) ((x) << FW_IQ_CMD_IQDCAEN_S)
  1214. #define FW_IQ_CMD_IQDCACPU_S 6
  1215. #define FW_IQ_CMD_IQDCACPU_V(x) ((x) << FW_IQ_CMD_IQDCACPU_S)
  1216. #define FW_IQ_CMD_IQINTCNTTHRESH_S 4
  1217. #define FW_IQ_CMD_IQINTCNTTHRESH_V(x) ((x) << FW_IQ_CMD_IQINTCNTTHRESH_S)
  1218. #define FW_IQ_CMD_IQO_S 3
  1219. #define FW_IQ_CMD_IQO_V(x) ((x) << FW_IQ_CMD_IQO_S)
  1220. #define FW_IQ_CMD_IQO_F FW_IQ_CMD_IQO_V(1U)
  1221. #define FW_IQ_CMD_IQCPRIO_S 2
  1222. #define FW_IQ_CMD_IQCPRIO_V(x) ((x) << FW_IQ_CMD_IQCPRIO_S)
  1223. #define FW_IQ_CMD_IQESIZE_S 0
  1224. #define FW_IQ_CMD_IQESIZE_V(x) ((x) << FW_IQ_CMD_IQESIZE_S)
  1225. #define FW_IQ_CMD_IQNS_S 31
  1226. #define FW_IQ_CMD_IQNS_V(x) ((x) << FW_IQ_CMD_IQNS_S)
  1227. #define FW_IQ_CMD_IQRO_S 30
  1228. #define FW_IQ_CMD_IQRO_V(x) ((x) << FW_IQ_CMD_IQRO_S)
  1229. #define FW_IQ_CMD_IQFLINTIQHSEN_S 28
  1230. #define FW_IQ_CMD_IQFLINTIQHSEN_V(x) ((x) << FW_IQ_CMD_IQFLINTIQHSEN_S)
  1231. #define FW_IQ_CMD_IQFLINTCONGEN_S 27
  1232. #define FW_IQ_CMD_IQFLINTCONGEN_V(x) ((x) << FW_IQ_CMD_IQFLINTCONGEN_S)
  1233. #define FW_IQ_CMD_IQFLINTCONGEN_F FW_IQ_CMD_IQFLINTCONGEN_V(1U)
  1234. #define FW_IQ_CMD_IQFLINTISCSIC_S 26
  1235. #define FW_IQ_CMD_IQFLINTISCSIC_V(x) ((x) << FW_IQ_CMD_IQFLINTISCSIC_S)
  1236. #define FW_IQ_CMD_FL0CNGCHMAP_S 20
  1237. #define FW_IQ_CMD_FL0CNGCHMAP_V(x) ((x) << FW_IQ_CMD_FL0CNGCHMAP_S)
  1238. #define FW_IQ_CMD_FL0CACHELOCK_S 15
  1239. #define FW_IQ_CMD_FL0CACHELOCK_V(x) ((x) << FW_IQ_CMD_FL0CACHELOCK_S)
  1240. #define FW_IQ_CMD_FL0DBP_S 14
  1241. #define FW_IQ_CMD_FL0DBP_V(x) ((x) << FW_IQ_CMD_FL0DBP_S)
  1242. #define FW_IQ_CMD_FL0DATANS_S 13
  1243. #define FW_IQ_CMD_FL0DATANS_V(x) ((x) << FW_IQ_CMD_FL0DATANS_S)
  1244. #define FW_IQ_CMD_FL0DATARO_S 12
  1245. #define FW_IQ_CMD_FL0DATARO_V(x) ((x) << FW_IQ_CMD_FL0DATARO_S)
  1246. #define FW_IQ_CMD_FL0DATARO_F FW_IQ_CMD_FL0DATARO_V(1U)
  1247. #define FW_IQ_CMD_FL0CONGCIF_S 11
  1248. #define FW_IQ_CMD_FL0CONGCIF_V(x) ((x) << FW_IQ_CMD_FL0CONGCIF_S)
  1249. #define FW_IQ_CMD_FL0CONGCIF_F FW_IQ_CMD_FL0CONGCIF_V(1U)
  1250. #define FW_IQ_CMD_FL0ONCHIP_S 10
  1251. #define FW_IQ_CMD_FL0ONCHIP_V(x) ((x) << FW_IQ_CMD_FL0ONCHIP_S)
  1252. #define FW_IQ_CMD_FL0STATUSPGNS_S 9
  1253. #define FW_IQ_CMD_FL0STATUSPGNS_V(x) ((x) << FW_IQ_CMD_FL0STATUSPGNS_S)
  1254. #define FW_IQ_CMD_FL0STATUSPGRO_S 8
  1255. #define FW_IQ_CMD_FL0STATUSPGRO_V(x) ((x) << FW_IQ_CMD_FL0STATUSPGRO_S)
  1256. #define FW_IQ_CMD_FL0FETCHNS_S 7
  1257. #define FW_IQ_CMD_FL0FETCHNS_V(x) ((x) << FW_IQ_CMD_FL0FETCHNS_S)
  1258. #define FW_IQ_CMD_FL0FETCHRO_S 6
  1259. #define FW_IQ_CMD_FL0FETCHRO_V(x) ((x) << FW_IQ_CMD_FL0FETCHRO_S)
  1260. #define FW_IQ_CMD_FL0FETCHRO_F FW_IQ_CMD_FL0FETCHRO_V(1U)
  1261. #define FW_IQ_CMD_FL0HOSTFCMODE_S 4
  1262. #define FW_IQ_CMD_FL0HOSTFCMODE_V(x) ((x) << FW_IQ_CMD_FL0HOSTFCMODE_S)
  1263. #define FW_IQ_CMD_FL0CPRIO_S 3
  1264. #define FW_IQ_CMD_FL0CPRIO_V(x) ((x) << FW_IQ_CMD_FL0CPRIO_S)
  1265. #define FW_IQ_CMD_FL0PADEN_S 2
  1266. #define FW_IQ_CMD_FL0PADEN_V(x) ((x) << FW_IQ_CMD_FL0PADEN_S)
  1267. #define FW_IQ_CMD_FL0PADEN_F FW_IQ_CMD_FL0PADEN_V(1U)
  1268. #define FW_IQ_CMD_FL0PACKEN_S 1
  1269. #define FW_IQ_CMD_FL0PACKEN_V(x) ((x) << FW_IQ_CMD_FL0PACKEN_S)
  1270. #define FW_IQ_CMD_FL0PACKEN_F FW_IQ_CMD_FL0PACKEN_V(1U)
  1271. #define FW_IQ_CMD_FL0CONGEN_S 0
  1272. #define FW_IQ_CMD_FL0CONGEN_V(x) ((x) << FW_IQ_CMD_FL0CONGEN_S)
  1273. #define FW_IQ_CMD_FL0CONGEN_F FW_IQ_CMD_FL0CONGEN_V(1U)
  1274. #define FW_IQ_CMD_FL0DCAEN_S 15
  1275. #define FW_IQ_CMD_FL0DCAEN_V(x) ((x) << FW_IQ_CMD_FL0DCAEN_S)
  1276. #define FW_IQ_CMD_FL0DCACPU_S 10
  1277. #define FW_IQ_CMD_FL0DCACPU_V(x) ((x) << FW_IQ_CMD_FL0DCACPU_S)
  1278. #define FW_IQ_CMD_FL0FBMIN_S 7
  1279. #define FW_IQ_CMD_FL0FBMIN_V(x) ((x) << FW_IQ_CMD_FL0FBMIN_S)
  1280. #define FW_IQ_CMD_FL0FBMAX_S 4
  1281. #define FW_IQ_CMD_FL0FBMAX_V(x) ((x) << FW_IQ_CMD_FL0FBMAX_S)
  1282. #define FW_IQ_CMD_FL0CIDXFTHRESHO_S 3
  1283. #define FW_IQ_CMD_FL0CIDXFTHRESHO_V(x) ((x) << FW_IQ_CMD_FL0CIDXFTHRESHO_S)
  1284. #define FW_IQ_CMD_FL0CIDXFTHRESHO_F FW_IQ_CMD_FL0CIDXFTHRESHO_V(1U)
  1285. #define FW_IQ_CMD_FL0CIDXFTHRESH_S 0
  1286. #define FW_IQ_CMD_FL0CIDXFTHRESH_V(x) ((x) << FW_IQ_CMD_FL0CIDXFTHRESH_S)
  1287. #define FW_IQ_CMD_FL1CNGCHMAP_S 20
  1288. #define FW_IQ_CMD_FL1CNGCHMAP_V(x) ((x) << FW_IQ_CMD_FL1CNGCHMAP_S)
  1289. #define FW_IQ_CMD_FL1CACHELOCK_S 15
  1290. #define FW_IQ_CMD_FL1CACHELOCK_V(x) ((x) << FW_IQ_CMD_FL1CACHELOCK_S)
  1291. #define FW_IQ_CMD_FL1DBP_S 14
  1292. #define FW_IQ_CMD_FL1DBP_V(x) ((x) << FW_IQ_CMD_FL1DBP_S)
  1293. #define FW_IQ_CMD_FL1DATANS_S 13
  1294. #define FW_IQ_CMD_FL1DATANS_V(x) ((x) << FW_IQ_CMD_FL1DATANS_S)
  1295. #define FW_IQ_CMD_FL1DATARO_S 12
  1296. #define FW_IQ_CMD_FL1DATARO_V(x) ((x) << FW_IQ_CMD_FL1DATARO_S)
  1297. #define FW_IQ_CMD_FL1CONGCIF_S 11
  1298. #define FW_IQ_CMD_FL1CONGCIF_V(x) ((x) << FW_IQ_CMD_FL1CONGCIF_S)
  1299. #define FW_IQ_CMD_FL1ONCHIP_S 10
  1300. #define FW_IQ_CMD_FL1ONCHIP_V(x) ((x) << FW_IQ_CMD_FL1ONCHIP_S)
  1301. #define FW_IQ_CMD_FL1STATUSPGNS_S 9
  1302. #define FW_IQ_CMD_FL1STATUSPGNS_V(x) ((x) << FW_IQ_CMD_FL1STATUSPGNS_S)
  1303. #define FW_IQ_CMD_FL1STATUSPGRO_S 8
  1304. #define FW_IQ_CMD_FL1STATUSPGRO_V(x) ((x) << FW_IQ_CMD_FL1STATUSPGRO_S)
  1305. #define FW_IQ_CMD_FL1FETCHNS_S 7
  1306. #define FW_IQ_CMD_FL1FETCHNS_V(x) ((x) << FW_IQ_CMD_FL1FETCHNS_S)
  1307. #define FW_IQ_CMD_FL1FETCHRO_S 6
  1308. #define FW_IQ_CMD_FL1FETCHRO_V(x) ((x) << FW_IQ_CMD_FL1FETCHRO_S)
  1309. #define FW_IQ_CMD_FL1HOSTFCMODE_S 4
  1310. #define FW_IQ_CMD_FL1HOSTFCMODE_V(x) ((x) << FW_IQ_CMD_FL1HOSTFCMODE_S)
  1311. #define FW_IQ_CMD_FL1CPRIO_S 3
  1312. #define FW_IQ_CMD_FL1CPRIO_V(x) ((x) << FW_IQ_CMD_FL1CPRIO_S)
  1313. #define FW_IQ_CMD_FL1PADEN_S 2
  1314. #define FW_IQ_CMD_FL1PADEN_V(x) ((x) << FW_IQ_CMD_FL1PADEN_S)
  1315. #define FW_IQ_CMD_FL1PADEN_F FW_IQ_CMD_FL1PADEN_V(1U)
  1316. #define FW_IQ_CMD_FL1PACKEN_S 1
  1317. #define FW_IQ_CMD_FL1PACKEN_V(x) ((x) << FW_IQ_CMD_FL1PACKEN_S)
  1318. #define FW_IQ_CMD_FL1PACKEN_F FW_IQ_CMD_FL1PACKEN_V(1U)
  1319. #define FW_IQ_CMD_FL1CONGEN_S 0
  1320. #define FW_IQ_CMD_FL1CONGEN_V(x) ((x) << FW_IQ_CMD_FL1CONGEN_S)
  1321. #define FW_IQ_CMD_FL1CONGEN_F FW_IQ_CMD_FL1CONGEN_V(1U)
  1322. #define FW_IQ_CMD_FL1DCAEN_S 15
  1323. #define FW_IQ_CMD_FL1DCAEN_V(x) ((x) << FW_IQ_CMD_FL1DCAEN_S)
  1324. #define FW_IQ_CMD_FL1DCACPU_S 10
  1325. #define FW_IQ_CMD_FL1DCACPU_V(x) ((x) << FW_IQ_CMD_FL1DCACPU_S)
  1326. #define FW_IQ_CMD_FL1FBMIN_S 7
  1327. #define FW_IQ_CMD_FL1FBMIN_V(x) ((x) << FW_IQ_CMD_FL1FBMIN_S)
  1328. #define FW_IQ_CMD_FL1FBMAX_S 4
  1329. #define FW_IQ_CMD_FL1FBMAX_V(x) ((x) << FW_IQ_CMD_FL1FBMAX_S)
  1330. #define FW_IQ_CMD_FL1CIDXFTHRESHO_S 3
  1331. #define FW_IQ_CMD_FL1CIDXFTHRESHO_V(x) ((x) << FW_IQ_CMD_FL1CIDXFTHRESHO_S)
  1332. #define FW_IQ_CMD_FL1CIDXFTHRESHO_F FW_IQ_CMD_FL1CIDXFTHRESHO_V(1U)
  1333. #define FW_IQ_CMD_FL1CIDXFTHRESH_S 0
  1334. #define FW_IQ_CMD_FL1CIDXFTHRESH_V(x) ((x) << FW_IQ_CMD_FL1CIDXFTHRESH_S)
  1335. struct fw_eq_eth_cmd {
  1336. __be32 op_to_vfn;
  1337. __be32 alloc_to_len16;
  1338. __be32 eqid_pkd;
  1339. __be32 physeqid_pkd;
  1340. __be32 fetchszm_to_iqid;
  1341. __be32 dcaen_to_eqsize;
  1342. __be64 eqaddr;
  1343. __be32 viid_pkd;
  1344. __be32 r8_lo;
  1345. __be64 r9;
  1346. };
  1347. #define FW_EQ_ETH_CMD_PFN_S 8
  1348. #define FW_EQ_ETH_CMD_PFN_V(x) ((x) << FW_EQ_ETH_CMD_PFN_S)
  1349. #define FW_EQ_ETH_CMD_VFN_S 0
  1350. #define FW_EQ_ETH_CMD_VFN_V(x) ((x) << FW_EQ_ETH_CMD_VFN_S)
  1351. #define FW_EQ_ETH_CMD_ALLOC_S 31
  1352. #define FW_EQ_ETH_CMD_ALLOC_V(x) ((x) << FW_EQ_ETH_CMD_ALLOC_S)
  1353. #define FW_EQ_ETH_CMD_ALLOC_F FW_EQ_ETH_CMD_ALLOC_V(1U)
  1354. #define FW_EQ_ETH_CMD_FREE_S 30
  1355. #define FW_EQ_ETH_CMD_FREE_V(x) ((x) << FW_EQ_ETH_CMD_FREE_S)
  1356. #define FW_EQ_ETH_CMD_FREE_F FW_EQ_ETH_CMD_FREE_V(1U)
  1357. #define FW_EQ_ETH_CMD_MODIFY_S 29
  1358. #define FW_EQ_ETH_CMD_MODIFY_V(x) ((x) << FW_EQ_ETH_CMD_MODIFY_S)
  1359. #define FW_EQ_ETH_CMD_MODIFY_F FW_EQ_ETH_CMD_MODIFY_V(1U)
  1360. #define FW_EQ_ETH_CMD_EQSTART_S 28
  1361. #define FW_EQ_ETH_CMD_EQSTART_V(x) ((x) << FW_EQ_ETH_CMD_EQSTART_S)
  1362. #define FW_EQ_ETH_CMD_EQSTART_F FW_EQ_ETH_CMD_EQSTART_V(1U)
  1363. #define FW_EQ_ETH_CMD_EQSTOP_S 27
  1364. #define FW_EQ_ETH_CMD_EQSTOP_V(x) ((x) << FW_EQ_ETH_CMD_EQSTOP_S)
  1365. #define FW_EQ_ETH_CMD_EQSTOP_F FW_EQ_ETH_CMD_EQSTOP_V(1U)
  1366. #define FW_EQ_ETH_CMD_EQID_S 0
  1367. #define FW_EQ_ETH_CMD_EQID_M 0xfffff
  1368. #define FW_EQ_ETH_CMD_EQID_V(x) ((x) << FW_EQ_ETH_CMD_EQID_S)
  1369. #define FW_EQ_ETH_CMD_EQID_G(x) \
  1370. (((x) >> FW_EQ_ETH_CMD_EQID_S) & FW_EQ_ETH_CMD_EQID_M)
  1371. #define FW_EQ_ETH_CMD_PHYSEQID_S 0
  1372. #define FW_EQ_ETH_CMD_PHYSEQID_M 0xfffff
  1373. #define FW_EQ_ETH_CMD_PHYSEQID_V(x) ((x) << FW_EQ_ETH_CMD_PHYSEQID_S)
  1374. #define FW_EQ_ETH_CMD_PHYSEQID_G(x) \
  1375. (((x) >> FW_EQ_ETH_CMD_PHYSEQID_S) & FW_EQ_ETH_CMD_PHYSEQID_M)
  1376. #define FW_EQ_ETH_CMD_FETCHSZM_S 26
  1377. #define FW_EQ_ETH_CMD_FETCHSZM_V(x) ((x) << FW_EQ_ETH_CMD_FETCHSZM_S)
  1378. #define FW_EQ_ETH_CMD_FETCHSZM_F FW_EQ_ETH_CMD_FETCHSZM_V(1U)
  1379. #define FW_EQ_ETH_CMD_STATUSPGNS_S 25
  1380. #define FW_EQ_ETH_CMD_STATUSPGNS_V(x) ((x) << FW_EQ_ETH_CMD_STATUSPGNS_S)
  1381. #define FW_EQ_ETH_CMD_STATUSPGRO_S 24
  1382. #define FW_EQ_ETH_CMD_STATUSPGRO_V(x) ((x) << FW_EQ_ETH_CMD_STATUSPGRO_S)
  1383. #define FW_EQ_ETH_CMD_FETCHNS_S 23
  1384. #define FW_EQ_ETH_CMD_FETCHNS_V(x) ((x) << FW_EQ_ETH_CMD_FETCHNS_S)
  1385. #define FW_EQ_ETH_CMD_FETCHRO_S 22
  1386. #define FW_EQ_ETH_CMD_FETCHRO_V(x) ((x) << FW_EQ_ETH_CMD_FETCHRO_S)
  1387. #define FW_EQ_ETH_CMD_FETCHRO_F FW_EQ_ETH_CMD_FETCHRO_V(1U)
  1388. #define FW_EQ_ETH_CMD_HOSTFCMODE_S 20
  1389. #define FW_EQ_ETH_CMD_HOSTFCMODE_V(x) ((x) << FW_EQ_ETH_CMD_HOSTFCMODE_S)
  1390. #define FW_EQ_ETH_CMD_CPRIO_S 19
  1391. #define FW_EQ_ETH_CMD_CPRIO_V(x) ((x) << FW_EQ_ETH_CMD_CPRIO_S)
  1392. #define FW_EQ_ETH_CMD_ONCHIP_S 18
  1393. #define FW_EQ_ETH_CMD_ONCHIP_V(x) ((x) << FW_EQ_ETH_CMD_ONCHIP_S)
  1394. #define FW_EQ_ETH_CMD_PCIECHN_S 16
  1395. #define FW_EQ_ETH_CMD_PCIECHN_V(x) ((x) << FW_EQ_ETH_CMD_PCIECHN_S)
  1396. #define FW_EQ_ETH_CMD_IQID_S 0
  1397. #define FW_EQ_ETH_CMD_IQID_V(x) ((x) << FW_EQ_ETH_CMD_IQID_S)
  1398. #define FW_EQ_ETH_CMD_DCAEN_S 31
  1399. #define FW_EQ_ETH_CMD_DCAEN_V(x) ((x) << FW_EQ_ETH_CMD_DCAEN_S)
  1400. #define FW_EQ_ETH_CMD_DCACPU_S 26
  1401. #define FW_EQ_ETH_CMD_DCACPU_V(x) ((x) << FW_EQ_ETH_CMD_DCACPU_S)
  1402. #define FW_EQ_ETH_CMD_FBMIN_S 23
  1403. #define FW_EQ_ETH_CMD_FBMIN_V(x) ((x) << FW_EQ_ETH_CMD_FBMIN_S)
  1404. #define FW_EQ_ETH_CMD_FBMAX_S 20
  1405. #define FW_EQ_ETH_CMD_FBMAX_V(x) ((x) << FW_EQ_ETH_CMD_FBMAX_S)
  1406. #define FW_EQ_ETH_CMD_CIDXFTHRESHO_S 19
  1407. #define FW_EQ_ETH_CMD_CIDXFTHRESHO_V(x) ((x) << FW_EQ_ETH_CMD_CIDXFTHRESHO_S)
  1408. #define FW_EQ_ETH_CMD_CIDXFTHRESH_S 16
  1409. #define FW_EQ_ETH_CMD_CIDXFTHRESH_V(x) ((x) << FW_EQ_ETH_CMD_CIDXFTHRESH_S)
  1410. #define FW_EQ_ETH_CMD_EQSIZE_S 0
  1411. #define FW_EQ_ETH_CMD_EQSIZE_V(x) ((x) << FW_EQ_ETH_CMD_EQSIZE_S)
  1412. #define FW_EQ_ETH_CMD_AUTOEQUEQE_S 30
  1413. #define FW_EQ_ETH_CMD_AUTOEQUEQE_V(x) ((x) << FW_EQ_ETH_CMD_AUTOEQUEQE_S)
  1414. #define FW_EQ_ETH_CMD_AUTOEQUEQE_F FW_EQ_ETH_CMD_AUTOEQUEQE_V(1U)
  1415. #define FW_EQ_ETH_CMD_VIID_S 16
  1416. #define FW_EQ_ETH_CMD_VIID_V(x) ((x) << FW_EQ_ETH_CMD_VIID_S)
  1417. struct fw_eq_ctrl_cmd {
  1418. __be32 op_to_vfn;
  1419. __be32 alloc_to_len16;
  1420. __be32 cmpliqid_eqid;
  1421. __be32 physeqid_pkd;
  1422. __be32 fetchszm_to_iqid;
  1423. __be32 dcaen_to_eqsize;
  1424. __be64 eqaddr;
  1425. };
  1426. #define FW_EQ_CTRL_CMD_PFN_S 8
  1427. #define FW_EQ_CTRL_CMD_PFN_V(x) ((x) << FW_EQ_CTRL_CMD_PFN_S)
  1428. #define FW_EQ_CTRL_CMD_VFN_S 0
  1429. #define FW_EQ_CTRL_CMD_VFN_V(x) ((x) << FW_EQ_CTRL_CMD_VFN_S)
  1430. #define FW_EQ_CTRL_CMD_ALLOC_S 31
  1431. #define FW_EQ_CTRL_CMD_ALLOC_V(x) ((x) << FW_EQ_CTRL_CMD_ALLOC_S)
  1432. #define FW_EQ_CTRL_CMD_ALLOC_F FW_EQ_CTRL_CMD_ALLOC_V(1U)
  1433. #define FW_EQ_CTRL_CMD_FREE_S 30
  1434. #define FW_EQ_CTRL_CMD_FREE_V(x) ((x) << FW_EQ_CTRL_CMD_FREE_S)
  1435. #define FW_EQ_CTRL_CMD_FREE_F FW_EQ_CTRL_CMD_FREE_V(1U)
  1436. #define FW_EQ_CTRL_CMD_MODIFY_S 29
  1437. #define FW_EQ_CTRL_CMD_MODIFY_V(x) ((x) << FW_EQ_CTRL_CMD_MODIFY_S)
  1438. #define FW_EQ_CTRL_CMD_MODIFY_F FW_EQ_CTRL_CMD_MODIFY_V(1U)
  1439. #define FW_EQ_CTRL_CMD_EQSTART_S 28
  1440. #define FW_EQ_CTRL_CMD_EQSTART_V(x) ((x) << FW_EQ_CTRL_CMD_EQSTART_S)
  1441. #define FW_EQ_CTRL_CMD_EQSTART_F FW_EQ_CTRL_CMD_EQSTART_V(1U)
  1442. #define FW_EQ_CTRL_CMD_EQSTOP_S 27
  1443. #define FW_EQ_CTRL_CMD_EQSTOP_V(x) ((x) << FW_EQ_CTRL_CMD_EQSTOP_S)
  1444. #define FW_EQ_CTRL_CMD_EQSTOP_F FW_EQ_CTRL_CMD_EQSTOP_V(1U)
  1445. #define FW_EQ_CTRL_CMD_CMPLIQID_S 20
  1446. #define FW_EQ_CTRL_CMD_CMPLIQID_V(x) ((x) << FW_EQ_CTRL_CMD_CMPLIQID_S)
  1447. #define FW_EQ_CTRL_CMD_EQID_S 0
  1448. #define FW_EQ_CTRL_CMD_EQID_M 0xfffff
  1449. #define FW_EQ_CTRL_CMD_EQID_V(x) ((x) << FW_EQ_CTRL_CMD_EQID_S)
  1450. #define FW_EQ_CTRL_CMD_EQID_G(x) \
  1451. (((x) >> FW_EQ_CTRL_CMD_EQID_S) & FW_EQ_CTRL_CMD_EQID_M)
  1452. #define FW_EQ_CTRL_CMD_PHYSEQID_S 0
  1453. #define FW_EQ_CTRL_CMD_PHYSEQID_M 0xfffff
  1454. #define FW_EQ_CTRL_CMD_PHYSEQID_G(x) \
  1455. (((x) >> FW_EQ_CTRL_CMD_PHYSEQID_S) & FW_EQ_CTRL_CMD_PHYSEQID_M)
  1456. #define FW_EQ_CTRL_CMD_FETCHSZM_S 26
  1457. #define FW_EQ_CTRL_CMD_FETCHSZM_V(x) ((x) << FW_EQ_CTRL_CMD_FETCHSZM_S)
  1458. #define FW_EQ_CTRL_CMD_FETCHSZM_F FW_EQ_CTRL_CMD_FETCHSZM_V(1U)
  1459. #define FW_EQ_CTRL_CMD_STATUSPGNS_S 25
  1460. #define FW_EQ_CTRL_CMD_STATUSPGNS_V(x) ((x) << FW_EQ_CTRL_CMD_STATUSPGNS_S)
  1461. #define FW_EQ_CTRL_CMD_STATUSPGNS_F FW_EQ_CTRL_CMD_STATUSPGNS_V(1U)
  1462. #define FW_EQ_CTRL_CMD_STATUSPGRO_S 24
  1463. #define FW_EQ_CTRL_CMD_STATUSPGRO_V(x) ((x) << FW_EQ_CTRL_CMD_STATUSPGRO_S)
  1464. #define FW_EQ_CTRL_CMD_STATUSPGRO_F FW_EQ_CTRL_CMD_STATUSPGRO_V(1U)
  1465. #define FW_EQ_CTRL_CMD_FETCHNS_S 23
  1466. #define FW_EQ_CTRL_CMD_FETCHNS_V(x) ((x) << FW_EQ_CTRL_CMD_FETCHNS_S)
  1467. #define FW_EQ_CTRL_CMD_FETCHNS_F FW_EQ_CTRL_CMD_FETCHNS_V(1U)
  1468. #define FW_EQ_CTRL_CMD_FETCHRO_S 22
  1469. #define FW_EQ_CTRL_CMD_FETCHRO_V(x) ((x) << FW_EQ_CTRL_CMD_FETCHRO_S)
  1470. #define FW_EQ_CTRL_CMD_FETCHRO_F FW_EQ_CTRL_CMD_FETCHRO_V(1U)
  1471. #define FW_EQ_CTRL_CMD_HOSTFCMODE_S 20
  1472. #define FW_EQ_CTRL_CMD_HOSTFCMODE_V(x) ((x) << FW_EQ_CTRL_CMD_HOSTFCMODE_S)
  1473. #define FW_EQ_CTRL_CMD_CPRIO_S 19
  1474. #define FW_EQ_CTRL_CMD_CPRIO_V(x) ((x) << FW_EQ_CTRL_CMD_CPRIO_S)
  1475. #define FW_EQ_CTRL_CMD_ONCHIP_S 18
  1476. #define FW_EQ_CTRL_CMD_ONCHIP_V(x) ((x) << FW_EQ_CTRL_CMD_ONCHIP_S)
  1477. #define FW_EQ_CTRL_CMD_PCIECHN_S 16
  1478. #define FW_EQ_CTRL_CMD_PCIECHN_V(x) ((x) << FW_EQ_CTRL_CMD_PCIECHN_S)
  1479. #define FW_EQ_CTRL_CMD_IQID_S 0
  1480. #define FW_EQ_CTRL_CMD_IQID_V(x) ((x) << FW_EQ_CTRL_CMD_IQID_S)
  1481. #define FW_EQ_CTRL_CMD_DCAEN_S 31
  1482. #define FW_EQ_CTRL_CMD_DCAEN_V(x) ((x) << FW_EQ_CTRL_CMD_DCAEN_S)
  1483. #define FW_EQ_CTRL_CMD_DCACPU_S 26
  1484. #define FW_EQ_CTRL_CMD_DCACPU_V(x) ((x) << FW_EQ_CTRL_CMD_DCACPU_S)
  1485. #define FW_EQ_CTRL_CMD_FBMIN_S 23
  1486. #define FW_EQ_CTRL_CMD_FBMIN_V(x) ((x) << FW_EQ_CTRL_CMD_FBMIN_S)
  1487. #define FW_EQ_CTRL_CMD_FBMAX_S 20
  1488. #define FW_EQ_CTRL_CMD_FBMAX_V(x) ((x) << FW_EQ_CTRL_CMD_FBMAX_S)
  1489. #define FW_EQ_CTRL_CMD_CIDXFTHRESHO_S 19
  1490. #define FW_EQ_CTRL_CMD_CIDXFTHRESHO_V(x) \
  1491. ((x) << FW_EQ_CTRL_CMD_CIDXFTHRESHO_S)
  1492. #define FW_EQ_CTRL_CMD_CIDXFTHRESH_S 16
  1493. #define FW_EQ_CTRL_CMD_CIDXFTHRESH_V(x) ((x) << FW_EQ_CTRL_CMD_CIDXFTHRESH_S)
  1494. #define FW_EQ_CTRL_CMD_EQSIZE_S 0
  1495. #define FW_EQ_CTRL_CMD_EQSIZE_V(x) ((x) << FW_EQ_CTRL_CMD_EQSIZE_S)
  1496. struct fw_eq_ofld_cmd {
  1497. __be32 op_to_vfn;
  1498. __be32 alloc_to_len16;
  1499. __be32 eqid_pkd;
  1500. __be32 physeqid_pkd;
  1501. __be32 fetchszm_to_iqid;
  1502. __be32 dcaen_to_eqsize;
  1503. __be64 eqaddr;
  1504. };
  1505. #define FW_EQ_OFLD_CMD_PFN_S 8
  1506. #define FW_EQ_OFLD_CMD_PFN_V(x) ((x) << FW_EQ_OFLD_CMD_PFN_S)
  1507. #define FW_EQ_OFLD_CMD_VFN_S 0
  1508. #define FW_EQ_OFLD_CMD_VFN_V(x) ((x) << FW_EQ_OFLD_CMD_VFN_S)
  1509. #define FW_EQ_OFLD_CMD_ALLOC_S 31
  1510. #define FW_EQ_OFLD_CMD_ALLOC_V(x) ((x) << FW_EQ_OFLD_CMD_ALLOC_S)
  1511. #define FW_EQ_OFLD_CMD_ALLOC_F FW_EQ_OFLD_CMD_ALLOC_V(1U)
  1512. #define FW_EQ_OFLD_CMD_FREE_S 30
  1513. #define FW_EQ_OFLD_CMD_FREE_V(x) ((x) << FW_EQ_OFLD_CMD_FREE_S)
  1514. #define FW_EQ_OFLD_CMD_FREE_F FW_EQ_OFLD_CMD_FREE_V(1U)
  1515. #define FW_EQ_OFLD_CMD_MODIFY_S 29
  1516. #define FW_EQ_OFLD_CMD_MODIFY_V(x) ((x) << FW_EQ_OFLD_CMD_MODIFY_S)
  1517. #define FW_EQ_OFLD_CMD_MODIFY_F FW_EQ_OFLD_CMD_MODIFY_V(1U)
  1518. #define FW_EQ_OFLD_CMD_EQSTART_S 28
  1519. #define FW_EQ_OFLD_CMD_EQSTART_V(x) ((x) << FW_EQ_OFLD_CMD_EQSTART_S)
  1520. #define FW_EQ_OFLD_CMD_EQSTART_F FW_EQ_OFLD_CMD_EQSTART_V(1U)
  1521. #define FW_EQ_OFLD_CMD_EQSTOP_S 27
  1522. #define FW_EQ_OFLD_CMD_EQSTOP_V(x) ((x) << FW_EQ_OFLD_CMD_EQSTOP_S)
  1523. #define FW_EQ_OFLD_CMD_EQSTOP_F FW_EQ_OFLD_CMD_EQSTOP_V(1U)
  1524. #define FW_EQ_OFLD_CMD_EQID_S 0
  1525. #define FW_EQ_OFLD_CMD_EQID_M 0xfffff
  1526. #define FW_EQ_OFLD_CMD_EQID_V(x) ((x) << FW_EQ_OFLD_CMD_EQID_S)
  1527. #define FW_EQ_OFLD_CMD_EQID_G(x) \
  1528. (((x) >> FW_EQ_OFLD_CMD_EQID_S) & FW_EQ_OFLD_CMD_EQID_M)
  1529. #define FW_EQ_OFLD_CMD_PHYSEQID_S 0
  1530. #define FW_EQ_OFLD_CMD_PHYSEQID_M 0xfffff
  1531. #define FW_EQ_OFLD_CMD_PHYSEQID_G(x) \
  1532. (((x) >> FW_EQ_OFLD_CMD_PHYSEQID_S) & FW_EQ_OFLD_CMD_PHYSEQID_M)
  1533. #define FW_EQ_OFLD_CMD_FETCHSZM_S 26
  1534. #define FW_EQ_OFLD_CMD_FETCHSZM_V(x) ((x) << FW_EQ_OFLD_CMD_FETCHSZM_S)
  1535. #define FW_EQ_OFLD_CMD_STATUSPGNS_S 25
  1536. #define FW_EQ_OFLD_CMD_STATUSPGNS_V(x) ((x) << FW_EQ_OFLD_CMD_STATUSPGNS_S)
  1537. #define FW_EQ_OFLD_CMD_STATUSPGRO_S 24
  1538. #define FW_EQ_OFLD_CMD_STATUSPGRO_V(x) ((x) << FW_EQ_OFLD_CMD_STATUSPGRO_S)
  1539. #define FW_EQ_OFLD_CMD_FETCHNS_S 23
  1540. #define FW_EQ_OFLD_CMD_FETCHNS_V(x) ((x) << FW_EQ_OFLD_CMD_FETCHNS_S)
  1541. #define FW_EQ_OFLD_CMD_FETCHRO_S 22
  1542. #define FW_EQ_OFLD_CMD_FETCHRO_V(x) ((x) << FW_EQ_OFLD_CMD_FETCHRO_S)
  1543. #define FW_EQ_OFLD_CMD_FETCHRO_F FW_EQ_OFLD_CMD_FETCHRO_V(1U)
  1544. #define FW_EQ_OFLD_CMD_HOSTFCMODE_S 20
  1545. #define FW_EQ_OFLD_CMD_HOSTFCMODE_V(x) ((x) << FW_EQ_OFLD_CMD_HOSTFCMODE_S)
  1546. #define FW_EQ_OFLD_CMD_CPRIO_S 19
  1547. #define FW_EQ_OFLD_CMD_CPRIO_V(x) ((x) << FW_EQ_OFLD_CMD_CPRIO_S)
  1548. #define FW_EQ_OFLD_CMD_ONCHIP_S 18
  1549. #define FW_EQ_OFLD_CMD_ONCHIP_V(x) ((x) << FW_EQ_OFLD_CMD_ONCHIP_S)
  1550. #define FW_EQ_OFLD_CMD_PCIECHN_S 16
  1551. #define FW_EQ_OFLD_CMD_PCIECHN_V(x) ((x) << FW_EQ_OFLD_CMD_PCIECHN_S)
  1552. #define FW_EQ_OFLD_CMD_IQID_S 0
  1553. #define FW_EQ_OFLD_CMD_IQID_V(x) ((x) << FW_EQ_OFLD_CMD_IQID_S)
  1554. #define FW_EQ_OFLD_CMD_DCAEN_S 31
  1555. #define FW_EQ_OFLD_CMD_DCAEN_V(x) ((x) << FW_EQ_OFLD_CMD_DCAEN_S)
  1556. #define FW_EQ_OFLD_CMD_DCACPU_S 26
  1557. #define FW_EQ_OFLD_CMD_DCACPU_V(x) ((x) << FW_EQ_OFLD_CMD_DCACPU_S)
  1558. #define FW_EQ_OFLD_CMD_FBMIN_S 23
  1559. #define FW_EQ_OFLD_CMD_FBMIN_V(x) ((x) << FW_EQ_OFLD_CMD_FBMIN_S)
  1560. #define FW_EQ_OFLD_CMD_FBMAX_S 20
  1561. #define FW_EQ_OFLD_CMD_FBMAX_V(x) ((x) << FW_EQ_OFLD_CMD_FBMAX_S)
  1562. #define FW_EQ_OFLD_CMD_CIDXFTHRESHO_S 19
  1563. #define FW_EQ_OFLD_CMD_CIDXFTHRESHO_V(x) \
  1564. ((x) << FW_EQ_OFLD_CMD_CIDXFTHRESHO_S)
  1565. #define FW_EQ_OFLD_CMD_CIDXFTHRESH_S 16
  1566. #define FW_EQ_OFLD_CMD_CIDXFTHRESH_V(x) ((x) << FW_EQ_OFLD_CMD_CIDXFTHRESH_S)
  1567. #define FW_EQ_OFLD_CMD_EQSIZE_S 0
  1568. #define FW_EQ_OFLD_CMD_EQSIZE_V(x) ((x) << FW_EQ_OFLD_CMD_EQSIZE_S)
  1569. /*
  1570. * Macros for VIID parsing:
  1571. * VIID - [10:8] PFN, [7] VI Valid, [6:0] VI number
  1572. */
  1573. #define FW_VIID_PFN_S 8
  1574. #define FW_VIID_PFN_M 0x7
  1575. #define FW_VIID_PFN_G(x) (((x) >> FW_VIID_PFN_S) & FW_VIID_PFN_M)
  1576. #define FW_VIID_VIVLD_S 7
  1577. #define FW_VIID_VIVLD_M 0x1
  1578. #define FW_VIID_VIVLD_G(x) (((x) >> FW_VIID_VIVLD_S) & FW_VIID_VIVLD_M)
  1579. #define FW_VIID_VIN_S 0
  1580. #define FW_VIID_VIN_M 0x7F
  1581. #define FW_VIID_VIN_G(x) (((x) >> FW_VIID_VIN_S) & FW_VIID_VIN_M)
  1582. struct fw_vi_cmd {
  1583. __be32 op_to_vfn;
  1584. __be32 alloc_to_len16;
  1585. __be16 type_viid;
  1586. u8 mac[6];
  1587. u8 portid_pkd;
  1588. u8 nmac;
  1589. u8 nmac0[6];
  1590. __be16 rsssize_pkd;
  1591. u8 nmac1[6];
  1592. __be16 idsiiq_pkd;
  1593. u8 nmac2[6];
  1594. __be16 idseiq_pkd;
  1595. u8 nmac3[6];
  1596. __be64 r9;
  1597. __be64 r10;
  1598. };
  1599. #define FW_VI_CMD_PFN_S 8
  1600. #define FW_VI_CMD_PFN_V(x) ((x) << FW_VI_CMD_PFN_S)
  1601. #define FW_VI_CMD_VFN_S 0
  1602. #define FW_VI_CMD_VFN_V(x) ((x) << FW_VI_CMD_VFN_S)
  1603. #define FW_VI_CMD_ALLOC_S 31
  1604. #define FW_VI_CMD_ALLOC_V(x) ((x) << FW_VI_CMD_ALLOC_S)
  1605. #define FW_VI_CMD_ALLOC_F FW_VI_CMD_ALLOC_V(1U)
  1606. #define FW_VI_CMD_FREE_S 30
  1607. #define FW_VI_CMD_FREE_V(x) ((x) << FW_VI_CMD_FREE_S)
  1608. #define FW_VI_CMD_FREE_F FW_VI_CMD_FREE_V(1U)
  1609. #define FW_VI_CMD_VIID_S 0
  1610. #define FW_VI_CMD_VIID_M 0xfff
  1611. #define FW_VI_CMD_VIID_V(x) ((x) << FW_VI_CMD_VIID_S)
  1612. #define FW_VI_CMD_VIID_G(x) (((x) >> FW_VI_CMD_VIID_S) & FW_VI_CMD_VIID_M)
  1613. #define FW_VI_CMD_PORTID_S 4
  1614. #define FW_VI_CMD_PORTID_M 0xf
  1615. #define FW_VI_CMD_PORTID_V(x) ((x) << FW_VI_CMD_PORTID_S)
  1616. #define FW_VI_CMD_PORTID_G(x) \
  1617. (((x) >> FW_VI_CMD_PORTID_S) & FW_VI_CMD_PORTID_M)
  1618. #define FW_VI_CMD_RSSSIZE_S 0
  1619. #define FW_VI_CMD_RSSSIZE_M 0x7ff
  1620. #define FW_VI_CMD_RSSSIZE_G(x) \
  1621. (((x) >> FW_VI_CMD_RSSSIZE_S) & FW_VI_CMD_RSSSIZE_M)
  1622. /* Special VI_MAC command index ids */
  1623. #define FW_VI_MAC_ADD_MAC 0x3FF
  1624. #define FW_VI_MAC_ADD_PERSIST_MAC 0x3FE
  1625. #define FW_VI_MAC_MAC_BASED_FREE 0x3FD
  1626. #define FW_CLS_TCAM_NUM_ENTRIES 336
  1627. enum fw_vi_mac_smac {
  1628. FW_VI_MAC_MPS_TCAM_ENTRY,
  1629. FW_VI_MAC_MPS_TCAM_ONLY,
  1630. FW_VI_MAC_SMT_ONLY,
  1631. FW_VI_MAC_SMT_AND_MPSTCAM
  1632. };
  1633. enum fw_vi_mac_result {
  1634. FW_VI_MAC_R_SUCCESS,
  1635. FW_VI_MAC_R_F_NONEXISTENT_NOMEM,
  1636. FW_VI_MAC_R_SMAC_FAIL,
  1637. FW_VI_MAC_R_F_ACL_CHECK
  1638. };
  1639. struct fw_vi_mac_cmd {
  1640. __be32 op_to_viid;
  1641. __be32 freemacs_to_len16;
  1642. union fw_vi_mac {
  1643. struct fw_vi_mac_exact {
  1644. __be16 valid_to_idx;
  1645. u8 macaddr[6];
  1646. } exact[7];
  1647. struct fw_vi_mac_hash {
  1648. __be64 hashvec;
  1649. } hash;
  1650. } u;
  1651. };
  1652. #define FW_VI_MAC_CMD_VIID_S 0
  1653. #define FW_VI_MAC_CMD_VIID_V(x) ((x) << FW_VI_MAC_CMD_VIID_S)
  1654. #define FW_VI_MAC_CMD_FREEMACS_S 31
  1655. #define FW_VI_MAC_CMD_FREEMACS_V(x) ((x) << FW_VI_MAC_CMD_FREEMACS_S)
  1656. #define FW_VI_MAC_CMD_HASHVECEN_S 23
  1657. #define FW_VI_MAC_CMD_HASHVECEN_V(x) ((x) << FW_VI_MAC_CMD_HASHVECEN_S)
  1658. #define FW_VI_MAC_CMD_HASHVECEN_F FW_VI_MAC_CMD_HASHVECEN_V(1U)
  1659. #define FW_VI_MAC_CMD_HASHUNIEN_S 22
  1660. #define FW_VI_MAC_CMD_HASHUNIEN_V(x) ((x) << FW_VI_MAC_CMD_HASHUNIEN_S)
  1661. #define FW_VI_MAC_CMD_VALID_S 15
  1662. #define FW_VI_MAC_CMD_VALID_V(x) ((x) << FW_VI_MAC_CMD_VALID_S)
  1663. #define FW_VI_MAC_CMD_VALID_F FW_VI_MAC_CMD_VALID_V(1U)
  1664. #define FW_VI_MAC_CMD_PRIO_S 12
  1665. #define FW_VI_MAC_CMD_PRIO_V(x) ((x) << FW_VI_MAC_CMD_PRIO_S)
  1666. #define FW_VI_MAC_CMD_SMAC_RESULT_S 10
  1667. #define FW_VI_MAC_CMD_SMAC_RESULT_M 0x3
  1668. #define FW_VI_MAC_CMD_SMAC_RESULT_V(x) ((x) << FW_VI_MAC_CMD_SMAC_RESULT_S)
  1669. #define FW_VI_MAC_CMD_SMAC_RESULT_G(x) \
  1670. (((x) >> FW_VI_MAC_CMD_SMAC_RESULT_S) & FW_VI_MAC_CMD_SMAC_RESULT_M)
  1671. #define FW_VI_MAC_CMD_IDX_S 0
  1672. #define FW_VI_MAC_CMD_IDX_M 0x3ff
  1673. #define FW_VI_MAC_CMD_IDX_V(x) ((x) << FW_VI_MAC_CMD_IDX_S)
  1674. #define FW_VI_MAC_CMD_IDX_G(x) \
  1675. (((x) >> FW_VI_MAC_CMD_IDX_S) & FW_VI_MAC_CMD_IDX_M)
  1676. #define FW_RXMODE_MTU_NO_CHG 65535
  1677. struct fw_vi_rxmode_cmd {
  1678. __be32 op_to_viid;
  1679. __be32 retval_len16;
  1680. __be32 mtu_to_vlanexen;
  1681. __be32 r4_lo;
  1682. };
  1683. #define FW_VI_RXMODE_CMD_VIID_S 0
  1684. #define FW_VI_RXMODE_CMD_VIID_V(x) ((x) << FW_VI_RXMODE_CMD_VIID_S)
  1685. #define FW_VI_RXMODE_CMD_MTU_S 16
  1686. #define FW_VI_RXMODE_CMD_MTU_M 0xffff
  1687. #define FW_VI_RXMODE_CMD_MTU_V(x) ((x) << FW_VI_RXMODE_CMD_MTU_S)
  1688. #define FW_VI_RXMODE_CMD_PROMISCEN_S 14
  1689. #define FW_VI_RXMODE_CMD_PROMISCEN_M 0x3
  1690. #define FW_VI_RXMODE_CMD_PROMISCEN_V(x) ((x) << FW_VI_RXMODE_CMD_PROMISCEN_S)
  1691. #define FW_VI_RXMODE_CMD_ALLMULTIEN_S 12
  1692. #define FW_VI_RXMODE_CMD_ALLMULTIEN_M 0x3
  1693. #define FW_VI_RXMODE_CMD_ALLMULTIEN_V(x) \
  1694. ((x) << FW_VI_RXMODE_CMD_ALLMULTIEN_S)
  1695. #define FW_VI_RXMODE_CMD_BROADCASTEN_S 10
  1696. #define FW_VI_RXMODE_CMD_BROADCASTEN_M 0x3
  1697. #define FW_VI_RXMODE_CMD_BROADCASTEN_V(x) \
  1698. ((x) << FW_VI_RXMODE_CMD_BROADCASTEN_S)
  1699. #define FW_VI_RXMODE_CMD_VLANEXEN_S 8
  1700. #define FW_VI_RXMODE_CMD_VLANEXEN_M 0x3
  1701. #define FW_VI_RXMODE_CMD_VLANEXEN_V(x) ((x) << FW_VI_RXMODE_CMD_VLANEXEN_S)
  1702. struct fw_vi_enable_cmd {
  1703. __be32 op_to_viid;
  1704. __be32 ien_to_len16;
  1705. __be16 blinkdur;
  1706. __be16 r3;
  1707. __be32 r4;
  1708. };
  1709. #define FW_VI_ENABLE_CMD_VIID_S 0
  1710. #define FW_VI_ENABLE_CMD_VIID_V(x) ((x) << FW_VI_ENABLE_CMD_VIID_S)
  1711. #define FW_VI_ENABLE_CMD_IEN_S 31
  1712. #define FW_VI_ENABLE_CMD_IEN_V(x) ((x) << FW_VI_ENABLE_CMD_IEN_S)
  1713. #define FW_VI_ENABLE_CMD_EEN_S 30
  1714. #define FW_VI_ENABLE_CMD_EEN_V(x) ((x) << FW_VI_ENABLE_CMD_EEN_S)
  1715. #define FW_VI_ENABLE_CMD_LED_S 29
  1716. #define FW_VI_ENABLE_CMD_LED_V(x) ((x) << FW_VI_ENABLE_CMD_LED_S)
  1717. #define FW_VI_ENABLE_CMD_LED_F FW_VI_ENABLE_CMD_LED_V(1U)
  1718. #define FW_VI_ENABLE_CMD_DCB_INFO_S 28
  1719. #define FW_VI_ENABLE_CMD_DCB_INFO_V(x) ((x) << FW_VI_ENABLE_CMD_DCB_INFO_S)
  1720. /* VI VF stats offset definitions */
  1721. #define VI_VF_NUM_STATS 16
  1722. enum fw_vi_stats_vf_index {
  1723. FW_VI_VF_STAT_TX_BCAST_BYTES_IX,
  1724. FW_VI_VF_STAT_TX_BCAST_FRAMES_IX,
  1725. FW_VI_VF_STAT_TX_MCAST_BYTES_IX,
  1726. FW_VI_VF_STAT_TX_MCAST_FRAMES_IX,
  1727. FW_VI_VF_STAT_TX_UCAST_BYTES_IX,
  1728. FW_VI_VF_STAT_TX_UCAST_FRAMES_IX,
  1729. FW_VI_VF_STAT_TX_DROP_FRAMES_IX,
  1730. FW_VI_VF_STAT_TX_OFLD_BYTES_IX,
  1731. FW_VI_VF_STAT_TX_OFLD_FRAMES_IX,
  1732. FW_VI_VF_STAT_RX_BCAST_BYTES_IX,
  1733. FW_VI_VF_STAT_RX_BCAST_FRAMES_IX,
  1734. FW_VI_VF_STAT_RX_MCAST_BYTES_IX,
  1735. FW_VI_VF_STAT_RX_MCAST_FRAMES_IX,
  1736. FW_VI_VF_STAT_RX_UCAST_BYTES_IX,
  1737. FW_VI_VF_STAT_RX_UCAST_FRAMES_IX,
  1738. FW_VI_VF_STAT_RX_ERR_FRAMES_IX
  1739. };
  1740. /* VI PF stats offset definitions */
  1741. #define VI_PF_NUM_STATS 17
  1742. enum fw_vi_stats_pf_index {
  1743. FW_VI_PF_STAT_TX_BCAST_BYTES_IX,
  1744. FW_VI_PF_STAT_TX_BCAST_FRAMES_IX,
  1745. FW_VI_PF_STAT_TX_MCAST_BYTES_IX,
  1746. FW_VI_PF_STAT_TX_MCAST_FRAMES_IX,
  1747. FW_VI_PF_STAT_TX_UCAST_BYTES_IX,
  1748. FW_VI_PF_STAT_TX_UCAST_FRAMES_IX,
  1749. FW_VI_PF_STAT_TX_OFLD_BYTES_IX,
  1750. FW_VI_PF_STAT_TX_OFLD_FRAMES_IX,
  1751. FW_VI_PF_STAT_RX_BYTES_IX,
  1752. FW_VI_PF_STAT_RX_FRAMES_IX,
  1753. FW_VI_PF_STAT_RX_BCAST_BYTES_IX,
  1754. FW_VI_PF_STAT_RX_BCAST_FRAMES_IX,
  1755. FW_VI_PF_STAT_RX_MCAST_BYTES_IX,
  1756. FW_VI_PF_STAT_RX_MCAST_FRAMES_IX,
  1757. FW_VI_PF_STAT_RX_UCAST_BYTES_IX,
  1758. FW_VI_PF_STAT_RX_UCAST_FRAMES_IX,
  1759. FW_VI_PF_STAT_RX_ERR_FRAMES_IX
  1760. };
  1761. struct fw_vi_stats_cmd {
  1762. __be32 op_to_viid;
  1763. __be32 retval_len16;
  1764. union fw_vi_stats {
  1765. struct fw_vi_stats_ctl {
  1766. __be16 nstats_ix;
  1767. __be16 r6;
  1768. __be32 r7;
  1769. __be64 stat0;
  1770. __be64 stat1;
  1771. __be64 stat2;
  1772. __be64 stat3;
  1773. __be64 stat4;
  1774. __be64 stat5;
  1775. } ctl;
  1776. struct fw_vi_stats_pf {
  1777. __be64 tx_bcast_bytes;
  1778. __be64 tx_bcast_frames;
  1779. __be64 tx_mcast_bytes;
  1780. __be64 tx_mcast_frames;
  1781. __be64 tx_ucast_bytes;
  1782. __be64 tx_ucast_frames;
  1783. __be64 tx_offload_bytes;
  1784. __be64 tx_offload_frames;
  1785. __be64 rx_pf_bytes;
  1786. __be64 rx_pf_frames;
  1787. __be64 rx_bcast_bytes;
  1788. __be64 rx_bcast_frames;
  1789. __be64 rx_mcast_bytes;
  1790. __be64 rx_mcast_frames;
  1791. __be64 rx_ucast_bytes;
  1792. __be64 rx_ucast_frames;
  1793. __be64 rx_err_frames;
  1794. } pf;
  1795. struct fw_vi_stats_vf {
  1796. __be64 tx_bcast_bytes;
  1797. __be64 tx_bcast_frames;
  1798. __be64 tx_mcast_bytes;
  1799. __be64 tx_mcast_frames;
  1800. __be64 tx_ucast_bytes;
  1801. __be64 tx_ucast_frames;
  1802. __be64 tx_drop_frames;
  1803. __be64 tx_offload_bytes;
  1804. __be64 tx_offload_frames;
  1805. __be64 rx_bcast_bytes;
  1806. __be64 rx_bcast_frames;
  1807. __be64 rx_mcast_bytes;
  1808. __be64 rx_mcast_frames;
  1809. __be64 rx_ucast_bytes;
  1810. __be64 rx_ucast_frames;
  1811. __be64 rx_err_frames;
  1812. } vf;
  1813. } u;
  1814. };
  1815. #define FW_VI_STATS_CMD_VIID_S 0
  1816. #define FW_VI_STATS_CMD_VIID_V(x) ((x) << FW_VI_STATS_CMD_VIID_S)
  1817. #define FW_VI_STATS_CMD_NSTATS_S 12
  1818. #define FW_VI_STATS_CMD_NSTATS_V(x) ((x) << FW_VI_STATS_CMD_NSTATS_S)
  1819. #define FW_VI_STATS_CMD_IX_S 0
  1820. #define FW_VI_STATS_CMD_IX_V(x) ((x) << FW_VI_STATS_CMD_IX_S)
  1821. struct fw_acl_mac_cmd {
  1822. __be32 op_to_vfn;
  1823. __be32 en_to_len16;
  1824. u8 nmac;
  1825. u8 r3[7];
  1826. __be16 r4;
  1827. u8 macaddr0[6];
  1828. __be16 r5;
  1829. u8 macaddr1[6];
  1830. __be16 r6;
  1831. u8 macaddr2[6];
  1832. __be16 r7;
  1833. u8 macaddr3[6];
  1834. };
  1835. #define FW_ACL_MAC_CMD_PFN_S 8
  1836. #define FW_ACL_MAC_CMD_PFN_V(x) ((x) << FW_ACL_MAC_CMD_PFN_S)
  1837. #define FW_ACL_MAC_CMD_VFN_S 0
  1838. #define FW_ACL_MAC_CMD_VFN_V(x) ((x) << FW_ACL_MAC_CMD_VFN_S)
  1839. #define FW_ACL_MAC_CMD_EN_S 31
  1840. #define FW_ACL_MAC_CMD_EN_V(x) ((x) << FW_ACL_MAC_CMD_EN_S)
  1841. struct fw_acl_vlan_cmd {
  1842. __be32 op_to_vfn;
  1843. __be32 en_to_len16;
  1844. u8 nvlan;
  1845. u8 dropnovlan_fm;
  1846. u8 r3_lo[6];
  1847. __be16 vlanid[16];
  1848. };
  1849. #define FW_ACL_VLAN_CMD_PFN_S 8
  1850. #define FW_ACL_VLAN_CMD_PFN_V(x) ((x) << FW_ACL_VLAN_CMD_PFN_S)
  1851. #define FW_ACL_VLAN_CMD_VFN_S 0
  1852. #define FW_ACL_VLAN_CMD_VFN_V(x) ((x) << FW_ACL_VLAN_CMD_VFN_S)
  1853. #define FW_ACL_VLAN_CMD_EN_S 31
  1854. #define FW_ACL_VLAN_CMD_EN_V(x) ((x) << FW_ACL_VLAN_CMD_EN_S)
  1855. #define FW_ACL_VLAN_CMD_DROPNOVLAN_S 7
  1856. #define FW_ACL_VLAN_CMD_DROPNOVLAN_V(x) ((x) << FW_ACL_VLAN_CMD_DROPNOVLAN_S)
  1857. #define FW_ACL_VLAN_CMD_FM_S 6
  1858. #define FW_ACL_VLAN_CMD_FM_V(x) ((x) << FW_ACL_VLAN_CMD_FM_S)
  1859. enum fw_port_cap {
  1860. FW_PORT_CAP_SPEED_100M = 0x0001,
  1861. FW_PORT_CAP_SPEED_1G = 0x0002,
  1862. FW_PORT_CAP_SPEED_2_5G = 0x0004,
  1863. FW_PORT_CAP_SPEED_10G = 0x0008,
  1864. FW_PORT_CAP_SPEED_40G = 0x0010,
  1865. FW_PORT_CAP_SPEED_100G = 0x0020,
  1866. FW_PORT_CAP_FC_RX = 0x0040,
  1867. FW_PORT_CAP_FC_TX = 0x0080,
  1868. FW_PORT_CAP_ANEG = 0x0100,
  1869. FW_PORT_CAP_MDI_0 = 0x0200,
  1870. FW_PORT_CAP_MDI_1 = 0x0400,
  1871. FW_PORT_CAP_BEAN = 0x0800,
  1872. FW_PORT_CAP_PMA_LPBK = 0x1000,
  1873. FW_PORT_CAP_PCS_LPBK = 0x2000,
  1874. FW_PORT_CAP_PHYXS_LPBK = 0x4000,
  1875. FW_PORT_CAP_FAR_END_LPBK = 0x8000,
  1876. };
  1877. enum fw_port_mdi {
  1878. FW_PORT_CAP_MDI_UNCHANGED,
  1879. FW_PORT_CAP_MDI_AUTO,
  1880. FW_PORT_CAP_MDI_F_STRAIGHT,
  1881. FW_PORT_CAP_MDI_F_CROSSOVER
  1882. };
  1883. #define FW_PORT_CAP_MDI_S 9
  1884. #define FW_PORT_CAP_MDI_V(x) ((x) << FW_PORT_CAP_MDI_S)
  1885. enum fw_port_action {
  1886. FW_PORT_ACTION_L1_CFG = 0x0001,
  1887. FW_PORT_ACTION_L2_CFG = 0x0002,
  1888. FW_PORT_ACTION_GET_PORT_INFO = 0x0003,
  1889. FW_PORT_ACTION_L2_PPP_CFG = 0x0004,
  1890. FW_PORT_ACTION_L2_DCB_CFG = 0x0005,
  1891. FW_PORT_ACTION_DCB_READ_TRANS = 0x0006,
  1892. FW_PORT_ACTION_DCB_READ_RECV = 0x0007,
  1893. FW_PORT_ACTION_DCB_READ_DET = 0x0008,
  1894. FW_PORT_ACTION_LOW_PWR_TO_NORMAL = 0x0010,
  1895. FW_PORT_ACTION_L1_LOW_PWR_EN = 0x0011,
  1896. FW_PORT_ACTION_L2_WOL_MODE_EN = 0x0012,
  1897. FW_PORT_ACTION_LPBK_TO_NORMAL = 0x0020,
  1898. FW_PORT_ACTION_L1_LPBK = 0x0021,
  1899. FW_PORT_ACTION_L1_PMA_LPBK = 0x0022,
  1900. FW_PORT_ACTION_L1_PCS_LPBK = 0x0023,
  1901. FW_PORT_ACTION_L1_PHYXS_CSIDE_LPBK = 0x0024,
  1902. FW_PORT_ACTION_L1_PHYXS_ESIDE_LPBK = 0x0025,
  1903. FW_PORT_ACTION_PHY_RESET = 0x0040,
  1904. FW_PORT_ACTION_PMA_RESET = 0x0041,
  1905. FW_PORT_ACTION_PCS_RESET = 0x0042,
  1906. FW_PORT_ACTION_PHYXS_RESET = 0x0043,
  1907. FW_PORT_ACTION_DTEXS_REEST = 0x0044,
  1908. FW_PORT_ACTION_AN_RESET = 0x0045
  1909. };
  1910. enum fw_port_l2cfg_ctlbf {
  1911. FW_PORT_L2_CTLBF_OVLAN0 = 0x01,
  1912. FW_PORT_L2_CTLBF_OVLAN1 = 0x02,
  1913. FW_PORT_L2_CTLBF_OVLAN2 = 0x04,
  1914. FW_PORT_L2_CTLBF_OVLAN3 = 0x08,
  1915. FW_PORT_L2_CTLBF_IVLAN = 0x10,
  1916. FW_PORT_L2_CTLBF_TXIPG = 0x20
  1917. };
  1918. enum fw_port_dcb_versions {
  1919. FW_PORT_DCB_VER_UNKNOWN,
  1920. FW_PORT_DCB_VER_CEE1D0,
  1921. FW_PORT_DCB_VER_CEE1D01,
  1922. FW_PORT_DCB_VER_IEEE,
  1923. FW_PORT_DCB_VER_AUTO = 7
  1924. };
  1925. enum fw_port_dcb_cfg {
  1926. FW_PORT_DCB_CFG_PG = 0x01,
  1927. FW_PORT_DCB_CFG_PFC = 0x02,
  1928. FW_PORT_DCB_CFG_APPL = 0x04
  1929. };
  1930. enum fw_port_dcb_cfg_rc {
  1931. FW_PORT_DCB_CFG_SUCCESS = 0x0,
  1932. FW_PORT_DCB_CFG_ERROR = 0x1
  1933. };
  1934. enum fw_port_dcb_type {
  1935. FW_PORT_DCB_TYPE_PGID = 0x00,
  1936. FW_PORT_DCB_TYPE_PGRATE = 0x01,
  1937. FW_PORT_DCB_TYPE_PRIORATE = 0x02,
  1938. FW_PORT_DCB_TYPE_PFC = 0x03,
  1939. FW_PORT_DCB_TYPE_APP_ID = 0x04,
  1940. FW_PORT_DCB_TYPE_CONTROL = 0x05,
  1941. };
  1942. enum fw_port_dcb_feature_state {
  1943. FW_PORT_DCB_FEATURE_STATE_PENDING = 0x0,
  1944. FW_PORT_DCB_FEATURE_STATE_SUCCESS = 0x1,
  1945. FW_PORT_DCB_FEATURE_STATE_ERROR = 0x2,
  1946. FW_PORT_DCB_FEATURE_STATE_TIMEOUT = 0x3,
  1947. };
  1948. struct fw_port_cmd {
  1949. __be32 op_to_portid;
  1950. __be32 action_to_len16;
  1951. union fw_port {
  1952. struct fw_port_l1cfg {
  1953. __be32 rcap;
  1954. __be32 r;
  1955. } l1cfg;
  1956. struct fw_port_l2cfg {
  1957. __u8 ctlbf;
  1958. __u8 ovlan3_to_ivlan0;
  1959. __be16 ivlantype;
  1960. __be16 txipg_force_pinfo;
  1961. __be16 mtu;
  1962. __be16 ovlan0mask;
  1963. __be16 ovlan0type;
  1964. __be16 ovlan1mask;
  1965. __be16 ovlan1type;
  1966. __be16 ovlan2mask;
  1967. __be16 ovlan2type;
  1968. __be16 ovlan3mask;
  1969. __be16 ovlan3type;
  1970. } l2cfg;
  1971. struct fw_port_info {
  1972. __be32 lstatus_to_modtype;
  1973. __be16 pcap;
  1974. __be16 acap;
  1975. __be16 mtu;
  1976. __u8 cbllen;
  1977. __u8 auxlinfo;
  1978. __u8 dcbxdis_pkd;
  1979. __u8 r8_lo[3];
  1980. __be64 r9;
  1981. } info;
  1982. struct fw_port_diags {
  1983. __u8 diagop;
  1984. __u8 r[3];
  1985. __be32 diagval;
  1986. } diags;
  1987. union fw_port_dcb {
  1988. struct fw_port_dcb_pgid {
  1989. __u8 type;
  1990. __u8 apply_pkd;
  1991. __u8 r10_lo[2];
  1992. __be32 pgid;
  1993. __be64 r11;
  1994. } pgid;
  1995. struct fw_port_dcb_pgrate {
  1996. __u8 type;
  1997. __u8 apply_pkd;
  1998. __u8 r10_lo[5];
  1999. __u8 num_tcs_supported;
  2000. __u8 pgrate[8];
  2001. __u8 tsa[8];
  2002. } pgrate;
  2003. struct fw_port_dcb_priorate {
  2004. __u8 type;
  2005. __u8 apply_pkd;
  2006. __u8 r10_lo[6];
  2007. __u8 strict_priorate[8];
  2008. } priorate;
  2009. struct fw_port_dcb_pfc {
  2010. __u8 type;
  2011. __u8 pfcen;
  2012. __u8 r10[5];
  2013. __u8 max_pfc_tcs;
  2014. __be64 r11;
  2015. } pfc;
  2016. struct fw_port_app_priority {
  2017. __u8 type;
  2018. __u8 r10[2];
  2019. __u8 idx;
  2020. __u8 user_prio_map;
  2021. __u8 sel_field;
  2022. __be16 protocolid;
  2023. __be64 r12;
  2024. } app_priority;
  2025. struct fw_port_dcb_control {
  2026. __u8 type;
  2027. __u8 all_syncd_pkd;
  2028. __be16 dcb_version_to_app_state;
  2029. __be32 r11;
  2030. __be64 r12;
  2031. } control;
  2032. } dcb;
  2033. } u;
  2034. };
  2035. #define FW_PORT_CMD_READ_S 22
  2036. #define FW_PORT_CMD_READ_V(x) ((x) << FW_PORT_CMD_READ_S)
  2037. #define FW_PORT_CMD_READ_F FW_PORT_CMD_READ_V(1U)
  2038. #define FW_PORT_CMD_PORTID_S 0
  2039. #define FW_PORT_CMD_PORTID_M 0xf
  2040. #define FW_PORT_CMD_PORTID_V(x) ((x) << FW_PORT_CMD_PORTID_S)
  2041. #define FW_PORT_CMD_PORTID_G(x) \
  2042. (((x) >> FW_PORT_CMD_PORTID_S) & FW_PORT_CMD_PORTID_M)
  2043. #define FW_PORT_CMD_ACTION_S 16
  2044. #define FW_PORT_CMD_ACTION_M 0xffff
  2045. #define FW_PORT_CMD_ACTION_V(x) ((x) << FW_PORT_CMD_ACTION_S)
  2046. #define FW_PORT_CMD_ACTION_G(x) \
  2047. (((x) >> FW_PORT_CMD_ACTION_S) & FW_PORT_CMD_ACTION_M)
  2048. #define FW_PORT_CMD_OVLAN3_S 7
  2049. #define FW_PORT_CMD_OVLAN3_V(x) ((x) << FW_PORT_CMD_OVLAN3_S)
  2050. #define FW_PORT_CMD_OVLAN2_S 6
  2051. #define FW_PORT_CMD_OVLAN2_V(x) ((x) << FW_PORT_CMD_OVLAN2_S)
  2052. #define FW_PORT_CMD_OVLAN1_S 5
  2053. #define FW_PORT_CMD_OVLAN1_V(x) ((x) << FW_PORT_CMD_OVLAN1_S)
  2054. #define FW_PORT_CMD_OVLAN0_S 4
  2055. #define FW_PORT_CMD_OVLAN0_V(x) ((x) << FW_PORT_CMD_OVLAN0_S)
  2056. #define FW_PORT_CMD_IVLAN0_S 3
  2057. #define FW_PORT_CMD_IVLAN0_V(x) ((x) << FW_PORT_CMD_IVLAN0_S)
  2058. #define FW_PORT_CMD_TXIPG_S 3
  2059. #define FW_PORT_CMD_TXIPG_V(x) ((x) << FW_PORT_CMD_TXIPG_S)
  2060. #define FW_PORT_CMD_LSTATUS_S 31
  2061. #define FW_PORT_CMD_LSTATUS_M 0x1
  2062. #define FW_PORT_CMD_LSTATUS_V(x) ((x) << FW_PORT_CMD_LSTATUS_S)
  2063. #define FW_PORT_CMD_LSTATUS_G(x) \
  2064. (((x) >> FW_PORT_CMD_LSTATUS_S) & FW_PORT_CMD_LSTATUS_M)
  2065. #define FW_PORT_CMD_LSTATUS_F FW_PORT_CMD_LSTATUS_V(1U)
  2066. #define FW_PORT_CMD_LSPEED_S 24
  2067. #define FW_PORT_CMD_LSPEED_M 0x3f
  2068. #define FW_PORT_CMD_LSPEED_V(x) ((x) << FW_PORT_CMD_LSPEED_S)
  2069. #define FW_PORT_CMD_LSPEED_G(x) \
  2070. (((x) >> FW_PORT_CMD_LSPEED_S) & FW_PORT_CMD_LSPEED_M)
  2071. #define FW_PORT_CMD_TXPAUSE_S 23
  2072. #define FW_PORT_CMD_TXPAUSE_V(x) ((x) << FW_PORT_CMD_TXPAUSE_S)
  2073. #define FW_PORT_CMD_TXPAUSE_F FW_PORT_CMD_TXPAUSE_V(1U)
  2074. #define FW_PORT_CMD_RXPAUSE_S 22
  2075. #define FW_PORT_CMD_RXPAUSE_V(x) ((x) << FW_PORT_CMD_RXPAUSE_S)
  2076. #define FW_PORT_CMD_RXPAUSE_F FW_PORT_CMD_RXPAUSE_V(1U)
  2077. #define FW_PORT_CMD_MDIOCAP_S 21
  2078. #define FW_PORT_CMD_MDIOCAP_V(x) ((x) << FW_PORT_CMD_MDIOCAP_S)
  2079. #define FW_PORT_CMD_MDIOCAP_F FW_PORT_CMD_MDIOCAP_V(1U)
  2080. #define FW_PORT_CMD_MDIOADDR_S 16
  2081. #define FW_PORT_CMD_MDIOADDR_M 0x1f
  2082. #define FW_PORT_CMD_MDIOADDR_G(x) \
  2083. (((x) >> FW_PORT_CMD_MDIOADDR_S) & FW_PORT_CMD_MDIOADDR_M)
  2084. #define FW_PORT_CMD_LPTXPAUSE_S 15
  2085. #define FW_PORT_CMD_LPTXPAUSE_V(x) ((x) << FW_PORT_CMD_LPTXPAUSE_S)
  2086. #define FW_PORT_CMD_LPTXPAUSE_F FW_PORT_CMD_LPTXPAUSE_V(1U)
  2087. #define FW_PORT_CMD_LPRXPAUSE_S 14
  2088. #define FW_PORT_CMD_LPRXPAUSE_V(x) ((x) << FW_PORT_CMD_LPRXPAUSE_S)
  2089. #define FW_PORT_CMD_LPRXPAUSE_F FW_PORT_CMD_LPRXPAUSE_V(1U)
  2090. #define FW_PORT_CMD_PTYPE_S 8
  2091. #define FW_PORT_CMD_PTYPE_M 0x1f
  2092. #define FW_PORT_CMD_PTYPE_G(x) \
  2093. (((x) >> FW_PORT_CMD_PTYPE_S) & FW_PORT_CMD_PTYPE_M)
  2094. #define FW_PORT_CMD_MODTYPE_S 0
  2095. #define FW_PORT_CMD_MODTYPE_M 0x1f
  2096. #define FW_PORT_CMD_MODTYPE_V(x) ((x) << FW_PORT_CMD_MODTYPE_S)
  2097. #define FW_PORT_CMD_MODTYPE_G(x) \
  2098. (((x) >> FW_PORT_CMD_MODTYPE_S) & FW_PORT_CMD_MODTYPE_M)
  2099. #define FW_PORT_CMD_DCBXDIS_S 7
  2100. #define FW_PORT_CMD_DCBXDIS_V(x) ((x) << FW_PORT_CMD_DCBXDIS_S)
  2101. #define FW_PORT_CMD_DCBXDIS_F FW_PORT_CMD_DCBXDIS_V(1U)
  2102. #define FW_PORT_CMD_APPLY_S 7
  2103. #define FW_PORT_CMD_APPLY_V(x) ((x) << FW_PORT_CMD_APPLY_S)
  2104. #define FW_PORT_CMD_APPLY_F FW_PORT_CMD_APPLY_V(1U)
  2105. #define FW_PORT_CMD_ALL_SYNCD_S 7
  2106. #define FW_PORT_CMD_ALL_SYNCD_V(x) ((x) << FW_PORT_CMD_ALL_SYNCD_S)
  2107. #define FW_PORT_CMD_ALL_SYNCD_F FW_PORT_CMD_ALL_SYNCD_V(1U)
  2108. #define FW_PORT_CMD_DCB_VERSION_S 12
  2109. #define FW_PORT_CMD_DCB_VERSION_M 0x7
  2110. #define FW_PORT_CMD_DCB_VERSION_G(x) \
  2111. (((x) >> FW_PORT_CMD_DCB_VERSION_S) & FW_PORT_CMD_DCB_VERSION_M)
  2112. enum fw_port_type {
  2113. FW_PORT_TYPE_FIBER_XFI,
  2114. FW_PORT_TYPE_FIBER_XAUI,
  2115. FW_PORT_TYPE_BT_SGMII,
  2116. FW_PORT_TYPE_BT_XFI,
  2117. FW_PORT_TYPE_BT_XAUI,
  2118. FW_PORT_TYPE_KX4,
  2119. FW_PORT_TYPE_CX4,
  2120. FW_PORT_TYPE_KX,
  2121. FW_PORT_TYPE_KR,
  2122. FW_PORT_TYPE_SFP,
  2123. FW_PORT_TYPE_BP_AP,
  2124. FW_PORT_TYPE_BP4_AP,
  2125. FW_PORT_TYPE_QSFP_10G,
  2126. FW_PORT_TYPE_QSA,
  2127. FW_PORT_TYPE_QSFP,
  2128. FW_PORT_TYPE_BP40_BA,
  2129. FW_PORT_TYPE_NONE = FW_PORT_CMD_PTYPE_M
  2130. };
  2131. enum fw_port_module_type {
  2132. FW_PORT_MOD_TYPE_NA,
  2133. FW_PORT_MOD_TYPE_LR,
  2134. FW_PORT_MOD_TYPE_SR,
  2135. FW_PORT_MOD_TYPE_ER,
  2136. FW_PORT_MOD_TYPE_TWINAX_PASSIVE,
  2137. FW_PORT_MOD_TYPE_TWINAX_ACTIVE,
  2138. FW_PORT_MOD_TYPE_LRM,
  2139. FW_PORT_MOD_TYPE_ERROR = FW_PORT_CMD_MODTYPE_M - 3,
  2140. FW_PORT_MOD_TYPE_UNKNOWN = FW_PORT_CMD_MODTYPE_M - 2,
  2141. FW_PORT_MOD_TYPE_NOTSUPPORTED = FW_PORT_CMD_MODTYPE_M - 1,
  2142. FW_PORT_MOD_TYPE_NONE = FW_PORT_CMD_MODTYPE_M
  2143. };
  2144. enum fw_port_mod_sub_type {
  2145. FW_PORT_MOD_SUB_TYPE_NA,
  2146. FW_PORT_MOD_SUB_TYPE_MV88E114X = 0x1,
  2147. FW_PORT_MOD_SUB_TYPE_TN8022 = 0x2,
  2148. FW_PORT_MOD_SUB_TYPE_AQ1202 = 0x3,
  2149. FW_PORT_MOD_SUB_TYPE_88x3120 = 0x4,
  2150. FW_PORT_MOD_SUB_TYPE_BCM84834 = 0x5,
  2151. FW_PORT_MOD_SUB_TYPE_BT_VSC8634 = 0x8,
  2152. /* The following will never been in the VPD. They are TWINAX cable
  2153. * lengths decoded from SFP+ module i2c PROMs. These should
  2154. * almost certainly go somewhere else ...
  2155. */
  2156. FW_PORT_MOD_SUB_TYPE_TWINAX_1 = 0x9,
  2157. FW_PORT_MOD_SUB_TYPE_TWINAX_3 = 0xA,
  2158. FW_PORT_MOD_SUB_TYPE_TWINAX_5 = 0xB,
  2159. FW_PORT_MOD_SUB_TYPE_TWINAX_7 = 0xC,
  2160. };
  2161. enum fw_port_stats_tx_index {
  2162. FW_STAT_TX_PORT_BYTES_IX = 0,
  2163. FW_STAT_TX_PORT_FRAMES_IX,
  2164. FW_STAT_TX_PORT_BCAST_IX,
  2165. FW_STAT_TX_PORT_MCAST_IX,
  2166. FW_STAT_TX_PORT_UCAST_IX,
  2167. FW_STAT_TX_PORT_ERROR_IX,
  2168. FW_STAT_TX_PORT_64B_IX,
  2169. FW_STAT_TX_PORT_65B_127B_IX,
  2170. FW_STAT_TX_PORT_128B_255B_IX,
  2171. FW_STAT_TX_PORT_256B_511B_IX,
  2172. FW_STAT_TX_PORT_512B_1023B_IX,
  2173. FW_STAT_TX_PORT_1024B_1518B_IX,
  2174. FW_STAT_TX_PORT_1519B_MAX_IX,
  2175. FW_STAT_TX_PORT_DROP_IX,
  2176. FW_STAT_TX_PORT_PAUSE_IX,
  2177. FW_STAT_TX_PORT_PPP0_IX,
  2178. FW_STAT_TX_PORT_PPP1_IX,
  2179. FW_STAT_TX_PORT_PPP2_IX,
  2180. FW_STAT_TX_PORT_PPP3_IX,
  2181. FW_STAT_TX_PORT_PPP4_IX,
  2182. FW_STAT_TX_PORT_PPP5_IX,
  2183. FW_STAT_TX_PORT_PPP6_IX,
  2184. FW_STAT_TX_PORT_PPP7_IX,
  2185. FW_NUM_PORT_TX_STATS
  2186. };
  2187. enum fw_port_stat_rx_index {
  2188. FW_STAT_RX_PORT_BYTES_IX = 0,
  2189. FW_STAT_RX_PORT_FRAMES_IX,
  2190. FW_STAT_RX_PORT_BCAST_IX,
  2191. FW_STAT_RX_PORT_MCAST_IX,
  2192. FW_STAT_RX_PORT_UCAST_IX,
  2193. FW_STAT_RX_PORT_MTU_ERROR_IX,
  2194. FW_STAT_RX_PORT_MTU_CRC_ERROR_IX,
  2195. FW_STAT_RX_PORT_CRC_ERROR_IX,
  2196. FW_STAT_RX_PORT_LEN_ERROR_IX,
  2197. FW_STAT_RX_PORT_SYM_ERROR_IX,
  2198. FW_STAT_RX_PORT_64B_IX,
  2199. FW_STAT_RX_PORT_65B_127B_IX,
  2200. FW_STAT_RX_PORT_128B_255B_IX,
  2201. FW_STAT_RX_PORT_256B_511B_IX,
  2202. FW_STAT_RX_PORT_512B_1023B_IX,
  2203. FW_STAT_RX_PORT_1024B_1518B_IX,
  2204. FW_STAT_RX_PORT_1519B_MAX_IX,
  2205. FW_STAT_RX_PORT_PAUSE_IX,
  2206. FW_STAT_RX_PORT_PPP0_IX,
  2207. FW_STAT_RX_PORT_PPP1_IX,
  2208. FW_STAT_RX_PORT_PPP2_IX,
  2209. FW_STAT_RX_PORT_PPP3_IX,
  2210. FW_STAT_RX_PORT_PPP4_IX,
  2211. FW_STAT_RX_PORT_PPP5_IX,
  2212. FW_STAT_RX_PORT_PPP6_IX,
  2213. FW_STAT_RX_PORT_PPP7_IX,
  2214. FW_STAT_RX_PORT_LESS_64B_IX,
  2215. FW_STAT_RX_PORT_MAC_ERROR_IX,
  2216. FW_NUM_PORT_RX_STATS
  2217. };
  2218. /* port stats */
  2219. #define FW_NUM_PORT_STATS (FW_NUM_PORT_TX_STATS + FW_NUM_PORT_RX_STATS)
  2220. struct fw_port_stats_cmd {
  2221. __be32 op_to_portid;
  2222. __be32 retval_len16;
  2223. union fw_port_stats {
  2224. struct fw_port_stats_ctl {
  2225. u8 nstats_bg_bm;
  2226. u8 tx_ix;
  2227. __be16 r6;
  2228. __be32 r7;
  2229. __be64 stat0;
  2230. __be64 stat1;
  2231. __be64 stat2;
  2232. __be64 stat3;
  2233. __be64 stat4;
  2234. __be64 stat5;
  2235. } ctl;
  2236. struct fw_port_stats_all {
  2237. __be64 tx_bytes;
  2238. __be64 tx_frames;
  2239. __be64 tx_bcast;
  2240. __be64 tx_mcast;
  2241. __be64 tx_ucast;
  2242. __be64 tx_error;
  2243. __be64 tx_64b;
  2244. __be64 tx_65b_127b;
  2245. __be64 tx_128b_255b;
  2246. __be64 tx_256b_511b;
  2247. __be64 tx_512b_1023b;
  2248. __be64 tx_1024b_1518b;
  2249. __be64 tx_1519b_max;
  2250. __be64 tx_drop;
  2251. __be64 tx_pause;
  2252. __be64 tx_ppp0;
  2253. __be64 tx_ppp1;
  2254. __be64 tx_ppp2;
  2255. __be64 tx_ppp3;
  2256. __be64 tx_ppp4;
  2257. __be64 tx_ppp5;
  2258. __be64 tx_ppp6;
  2259. __be64 tx_ppp7;
  2260. __be64 rx_bytes;
  2261. __be64 rx_frames;
  2262. __be64 rx_bcast;
  2263. __be64 rx_mcast;
  2264. __be64 rx_ucast;
  2265. __be64 rx_mtu_error;
  2266. __be64 rx_mtu_crc_error;
  2267. __be64 rx_crc_error;
  2268. __be64 rx_len_error;
  2269. __be64 rx_sym_error;
  2270. __be64 rx_64b;
  2271. __be64 rx_65b_127b;
  2272. __be64 rx_128b_255b;
  2273. __be64 rx_256b_511b;
  2274. __be64 rx_512b_1023b;
  2275. __be64 rx_1024b_1518b;
  2276. __be64 rx_1519b_max;
  2277. __be64 rx_pause;
  2278. __be64 rx_ppp0;
  2279. __be64 rx_ppp1;
  2280. __be64 rx_ppp2;
  2281. __be64 rx_ppp3;
  2282. __be64 rx_ppp4;
  2283. __be64 rx_ppp5;
  2284. __be64 rx_ppp6;
  2285. __be64 rx_ppp7;
  2286. __be64 rx_less_64b;
  2287. __be64 rx_bg_drop;
  2288. __be64 rx_bg_trunc;
  2289. } all;
  2290. } u;
  2291. };
  2292. /* port loopback stats */
  2293. #define FW_NUM_LB_STATS 16
  2294. enum fw_port_lb_stats_index {
  2295. FW_STAT_LB_PORT_BYTES_IX,
  2296. FW_STAT_LB_PORT_FRAMES_IX,
  2297. FW_STAT_LB_PORT_BCAST_IX,
  2298. FW_STAT_LB_PORT_MCAST_IX,
  2299. FW_STAT_LB_PORT_UCAST_IX,
  2300. FW_STAT_LB_PORT_ERROR_IX,
  2301. FW_STAT_LB_PORT_64B_IX,
  2302. FW_STAT_LB_PORT_65B_127B_IX,
  2303. FW_STAT_LB_PORT_128B_255B_IX,
  2304. FW_STAT_LB_PORT_256B_511B_IX,
  2305. FW_STAT_LB_PORT_512B_1023B_IX,
  2306. FW_STAT_LB_PORT_1024B_1518B_IX,
  2307. FW_STAT_LB_PORT_1519B_MAX_IX,
  2308. FW_STAT_LB_PORT_DROP_FRAMES_IX
  2309. };
  2310. struct fw_port_lb_stats_cmd {
  2311. __be32 op_to_lbport;
  2312. __be32 retval_len16;
  2313. union fw_port_lb_stats {
  2314. struct fw_port_lb_stats_ctl {
  2315. u8 nstats_bg_bm;
  2316. u8 ix_pkd;
  2317. __be16 r6;
  2318. __be32 r7;
  2319. __be64 stat0;
  2320. __be64 stat1;
  2321. __be64 stat2;
  2322. __be64 stat3;
  2323. __be64 stat4;
  2324. __be64 stat5;
  2325. } ctl;
  2326. struct fw_port_lb_stats_all {
  2327. __be64 tx_bytes;
  2328. __be64 tx_frames;
  2329. __be64 tx_bcast;
  2330. __be64 tx_mcast;
  2331. __be64 tx_ucast;
  2332. __be64 tx_error;
  2333. __be64 tx_64b;
  2334. __be64 tx_65b_127b;
  2335. __be64 tx_128b_255b;
  2336. __be64 tx_256b_511b;
  2337. __be64 tx_512b_1023b;
  2338. __be64 tx_1024b_1518b;
  2339. __be64 tx_1519b_max;
  2340. __be64 rx_lb_drop;
  2341. __be64 rx_lb_trunc;
  2342. } all;
  2343. } u;
  2344. };
  2345. struct fw_rss_ind_tbl_cmd {
  2346. __be32 op_to_viid;
  2347. __be32 retval_len16;
  2348. __be16 niqid;
  2349. __be16 startidx;
  2350. __be32 r3;
  2351. __be32 iq0_to_iq2;
  2352. __be32 iq3_to_iq5;
  2353. __be32 iq6_to_iq8;
  2354. __be32 iq9_to_iq11;
  2355. __be32 iq12_to_iq14;
  2356. __be32 iq15_to_iq17;
  2357. __be32 iq18_to_iq20;
  2358. __be32 iq21_to_iq23;
  2359. __be32 iq24_to_iq26;
  2360. __be32 iq27_to_iq29;
  2361. __be32 iq30_iq31;
  2362. __be32 r15_lo;
  2363. };
  2364. #define FW_RSS_IND_TBL_CMD_VIID_S 0
  2365. #define FW_RSS_IND_TBL_CMD_VIID_V(x) ((x) << FW_RSS_IND_TBL_CMD_VIID_S)
  2366. #define FW_RSS_IND_TBL_CMD_IQ0_S 20
  2367. #define FW_RSS_IND_TBL_CMD_IQ0_V(x) ((x) << FW_RSS_IND_TBL_CMD_IQ0_S)
  2368. #define FW_RSS_IND_TBL_CMD_IQ1_S 10
  2369. #define FW_RSS_IND_TBL_CMD_IQ1_V(x) ((x) << FW_RSS_IND_TBL_CMD_IQ1_S)
  2370. #define FW_RSS_IND_TBL_CMD_IQ2_S 0
  2371. #define FW_RSS_IND_TBL_CMD_IQ2_V(x) ((x) << FW_RSS_IND_TBL_CMD_IQ2_S)
  2372. struct fw_rss_glb_config_cmd {
  2373. __be32 op_to_write;
  2374. __be32 retval_len16;
  2375. union fw_rss_glb_config {
  2376. struct fw_rss_glb_config_manual {
  2377. __be32 mode_pkd;
  2378. __be32 r3;
  2379. __be64 r4;
  2380. __be64 r5;
  2381. } manual;
  2382. struct fw_rss_glb_config_basicvirtual {
  2383. __be32 mode_pkd;
  2384. __be32 synmapen_to_hashtoeplitz;
  2385. __be64 r8;
  2386. __be64 r9;
  2387. } basicvirtual;
  2388. } u;
  2389. };
  2390. #define FW_RSS_GLB_CONFIG_CMD_MODE_S 28
  2391. #define FW_RSS_GLB_CONFIG_CMD_MODE_M 0xf
  2392. #define FW_RSS_GLB_CONFIG_CMD_MODE_V(x) ((x) << FW_RSS_GLB_CONFIG_CMD_MODE_S)
  2393. #define FW_RSS_GLB_CONFIG_CMD_MODE_G(x) \
  2394. (((x) >> FW_RSS_GLB_CONFIG_CMD_MODE_S) & FW_RSS_GLB_CONFIG_CMD_MODE_M)
  2395. #define FW_RSS_GLB_CONFIG_CMD_MODE_MANUAL 0
  2396. #define FW_RSS_GLB_CONFIG_CMD_MODE_BASICVIRTUAL 1
  2397. #define FW_RSS_GLB_CONFIG_CMD_SYNMAPEN_S 8
  2398. #define FW_RSS_GLB_CONFIG_CMD_SYNMAPEN_V(x) \
  2399. ((x) << FW_RSS_GLB_CONFIG_CMD_SYNMAPEN_S)
  2400. #define FW_RSS_GLB_CONFIG_CMD_SYNMAPEN_F \
  2401. FW_RSS_GLB_CONFIG_CMD_SYNMAPEN_V(1U)
  2402. #define FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6_S 7
  2403. #define FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6_V(x) \
  2404. ((x) << FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6_S)
  2405. #define FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6_F \
  2406. FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6_V(1U)
  2407. #define FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6_S 6
  2408. #define FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6_V(x) \
  2409. ((x) << FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6_S)
  2410. #define FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6_F \
  2411. FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6_V(1U)
  2412. #define FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4_S 5
  2413. #define FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4_V(x) \
  2414. ((x) << FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4_S)
  2415. #define FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4_F \
  2416. FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4_V(1U)
  2417. #define FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4_S 4
  2418. #define FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4_V(x) \
  2419. ((x) << FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4_S)
  2420. #define FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4_F \
  2421. FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4_V(1U)
  2422. #define FW_RSS_GLB_CONFIG_CMD_OFDMAPEN_S 3
  2423. #define FW_RSS_GLB_CONFIG_CMD_OFDMAPEN_V(x) \
  2424. ((x) << FW_RSS_GLB_CONFIG_CMD_OFDMAPEN_S)
  2425. #define FW_RSS_GLB_CONFIG_CMD_OFDMAPEN_F \
  2426. FW_RSS_GLB_CONFIG_CMD_OFDMAPEN_V(1U)
  2427. #define FW_RSS_GLB_CONFIG_CMD_TNLMAPEN_S 2
  2428. #define FW_RSS_GLB_CONFIG_CMD_TNLMAPEN_V(x) \
  2429. ((x) << FW_RSS_GLB_CONFIG_CMD_TNLMAPEN_S)
  2430. #define FW_RSS_GLB_CONFIG_CMD_TNLMAPEN_F \
  2431. FW_RSS_GLB_CONFIG_CMD_TNLMAPEN_V(1U)
  2432. #define FW_RSS_GLB_CONFIG_CMD_TNLALLLKP_S 1
  2433. #define FW_RSS_GLB_CONFIG_CMD_TNLALLLKP_V(x) \
  2434. ((x) << FW_RSS_GLB_CONFIG_CMD_TNLALLLKP_S)
  2435. #define FW_RSS_GLB_CONFIG_CMD_TNLALLLKP_F \
  2436. FW_RSS_GLB_CONFIG_CMD_TNLALLLKP_V(1U)
  2437. #define FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ_S 0
  2438. #define FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ_V(x) \
  2439. ((x) << FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ_S)
  2440. #define FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ_F \
  2441. FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ_V(1U)
  2442. struct fw_rss_vi_config_cmd {
  2443. __be32 op_to_viid;
  2444. #define FW_RSS_VI_CONFIG_CMD_VIID(x) ((x) << 0)
  2445. __be32 retval_len16;
  2446. union fw_rss_vi_config {
  2447. struct fw_rss_vi_config_manual {
  2448. __be64 r3;
  2449. __be64 r4;
  2450. __be64 r5;
  2451. } manual;
  2452. struct fw_rss_vi_config_basicvirtual {
  2453. __be32 r6;
  2454. __be32 defaultq_to_udpen;
  2455. __be64 r9;
  2456. __be64 r10;
  2457. } basicvirtual;
  2458. } u;
  2459. };
  2460. #define FW_RSS_VI_CONFIG_CMD_VIID_S 0
  2461. #define FW_RSS_VI_CONFIG_CMD_VIID_V(x) ((x) << FW_RSS_VI_CONFIG_CMD_VIID_S)
  2462. #define FW_RSS_VI_CONFIG_CMD_DEFAULTQ_S 16
  2463. #define FW_RSS_VI_CONFIG_CMD_DEFAULTQ_M 0x3ff
  2464. #define FW_RSS_VI_CONFIG_CMD_DEFAULTQ_V(x) \
  2465. ((x) << FW_RSS_VI_CONFIG_CMD_DEFAULTQ_S)
  2466. #define FW_RSS_VI_CONFIG_CMD_DEFAULTQ_G(x) \
  2467. (((x) >> FW_RSS_VI_CONFIG_CMD_DEFAULTQ_S) & \
  2468. FW_RSS_VI_CONFIG_CMD_DEFAULTQ_M)
  2469. #define FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN_S 4
  2470. #define FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN_V(x) \
  2471. ((x) << FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN_S)
  2472. #define FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN_F \
  2473. FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN_V(1U)
  2474. #define FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN_S 3
  2475. #define FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN_V(x) \
  2476. ((x) << FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN_S)
  2477. #define FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN_F \
  2478. FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN_V(1U)
  2479. #define FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN_S 2
  2480. #define FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN_V(x) \
  2481. ((x) << FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN_S)
  2482. #define FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN_F \
  2483. FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN_V(1U)
  2484. #define FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN_S 1
  2485. #define FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN_V(x) \
  2486. ((x) << FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN_S)
  2487. #define FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN_F \
  2488. FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN_V(1U)
  2489. #define FW_RSS_VI_CONFIG_CMD_UDPEN_S 0
  2490. #define FW_RSS_VI_CONFIG_CMD_UDPEN_V(x) ((x) << FW_RSS_VI_CONFIG_CMD_UDPEN_S)
  2491. #define FW_RSS_VI_CONFIG_CMD_UDPEN_F FW_RSS_VI_CONFIG_CMD_UDPEN_V(1U)
  2492. struct fw_clip_cmd {
  2493. __be32 op_to_write;
  2494. __be32 alloc_to_len16;
  2495. __be64 ip_hi;
  2496. __be64 ip_lo;
  2497. __be32 r4[2];
  2498. };
  2499. #define FW_CLIP_CMD_ALLOC_S 31
  2500. #define FW_CLIP_CMD_ALLOC_V(x) ((x) << FW_CLIP_CMD_ALLOC_S)
  2501. #define FW_CLIP_CMD_ALLOC_F FW_CLIP_CMD_ALLOC_V(1U)
  2502. #define FW_CLIP_CMD_FREE_S 30
  2503. #define FW_CLIP_CMD_FREE_V(x) ((x) << FW_CLIP_CMD_FREE_S)
  2504. #define FW_CLIP_CMD_FREE_F FW_CLIP_CMD_FREE_V(1U)
  2505. enum fw_error_type {
  2506. FW_ERROR_TYPE_EXCEPTION = 0x0,
  2507. FW_ERROR_TYPE_HWMODULE = 0x1,
  2508. FW_ERROR_TYPE_WR = 0x2,
  2509. FW_ERROR_TYPE_ACL = 0x3,
  2510. };
  2511. struct fw_error_cmd {
  2512. __be32 op_to_type;
  2513. __be32 len16_pkd;
  2514. union fw_error {
  2515. struct fw_error_exception {
  2516. __be32 info[6];
  2517. } exception;
  2518. struct fw_error_hwmodule {
  2519. __be32 regaddr;
  2520. __be32 regval;
  2521. } hwmodule;
  2522. struct fw_error_wr {
  2523. __be16 cidx;
  2524. __be16 pfn_vfn;
  2525. __be32 eqid;
  2526. u8 wrhdr[16];
  2527. } wr;
  2528. struct fw_error_acl {
  2529. __be16 cidx;
  2530. __be16 pfn_vfn;
  2531. __be32 eqid;
  2532. __be16 mv_pkd;
  2533. u8 val[6];
  2534. __be64 r4;
  2535. } acl;
  2536. } u;
  2537. };
  2538. struct fw_debug_cmd {
  2539. __be32 op_type;
  2540. __be32 len16_pkd;
  2541. union fw_debug {
  2542. struct fw_debug_assert {
  2543. __be32 fcid;
  2544. __be32 line;
  2545. __be32 x;
  2546. __be32 y;
  2547. u8 filename_0_7[8];
  2548. u8 filename_8_15[8];
  2549. __be64 r3;
  2550. } assert;
  2551. struct fw_debug_prt {
  2552. __be16 dprtstridx;
  2553. __be16 r3[3];
  2554. __be32 dprtstrparam0;
  2555. __be32 dprtstrparam1;
  2556. __be32 dprtstrparam2;
  2557. __be32 dprtstrparam3;
  2558. } prt;
  2559. } u;
  2560. };
  2561. #define FW_DEBUG_CMD_TYPE_S 0
  2562. #define FW_DEBUG_CMD_TYPE_M 0xff
  2563. #define FW_DEBUG_CMD_TYPE_G(x) \
  2564. (((x) >> FW_DEBUG_CMD_TYPE_S) & FW_DEBUG_CMD_TYPE_M)
  2565. #define PCIE_FW_ERR_S 31
  2566. #define PCIE_FW_ERR_V(x) ((x) << PCIE_FW_ERR_S)
  2567. #define PCIE_FW_ERR_F PCIE_FW_ERR_V(1U)
  2568. #define PCIE_FW_INIT_S 30
  2569. #define PCIE_FW_INIT_V(x) ((x) << PCIE_FW_INIT_S)
  2570. #define PCIE_FW_INIT_F PCIE_FW_INIT_V(1U)
  2571. #define PCIE_FW_HALT_S 29
  2572. #define PCIE_FW_HALT_V(x) ((x) << PCIE_FW_HALT_S)
  2573. #define PCIE_FW_HALT_F PCIE_FW_HALT_V(1U)
  2574. #define PCIE_FW_EVAL_S 24
  2575. #define PCIE_FW_EVAL_M 0x7
  2576. #define PCIE_FW_EVAL_G(x) (((x) >> PCIE_FW_EVAL_S) & PCIE_FW_EVAL_M)
  2577. #define PCIE_FW_MASTER_VLD_S 15
  2578. #define PCIE_FW_MASTER_VLD_V(x) ((x) << PCIE_FW_MASTER_VLD_S)
  2579. #define PCIE_FW_MASTER_VLD_F PCIE_FW_MASTER_VLD_V(1U)
  2580. #define PCIE_FW_MASTER_S 12
  2581. #define PCIE_FW_MASTER_M 0x7
  2582. #define PCIE_FW_MASTER_V(x) ((x) << PCIE_FW_MASTER_S)
  2583. #define PCIE_FW_MASTER_G(x) (((x) >> PCIE_FW_MASTER_S) & PCIE_FW_MASTER_M)
  2584. struct fw_hdr {
  2585. u8 ver;
  2586. u8 chip; /* terminator chip type */
  2587. __be16 len512; /* bin length in units of 512-bytes */
  2588. __be32 fw_ver; /* firmware version */
  2589. __be32 tp_microcode_ver;
  2590. u8 intfver_nic;
  2591. u8 intfver_vnic;
  2592. u8 intfver_ofld;
  2593. u8 intfver_ri;
  2594. u8 intfver_iscsipdu;
  2595. u8 intfver_iscsi;
  2596. u8 intfver_fcoepdu;
  2597. u8 intfver_fcoe;
  2598. __u32 reserved2;
  2599. __u32 reserved3;
  2600. __u32 reserved4;
  2601. __be32 flags;
  2602. __be32 reserved6[23];
  2603. };
  2604. enum fw_hdr_chip {
  2605. FW_HDR_CHIP_T4,
  2606. FW_HDR_CHIP_T5,
  2607. FW_HDR_CHIP_T6
  2608. };
  2609. #define FW_HDR_FW_VER_MAJOR_S 24
  2610. #define FW_HDR_FW_VER_MAJOR_M 0xff
  2611. #define FW_HDR_FW_VER_MAJOR_V(x) \
  2612. ((x) << FW_HDR_FW_VER_MAJOR_S)
  2613. #define FW_HDR_FW_VER_MAJOR_G(x) \
  2614. (((x) >> FW_HDR_FW_VER_MAJOR_S) & FW_HDR_FW_VER_MAJOR_M)
  2615. #define FW_HDR_FW_VER_MINOR_S 16
  2616. #define FW_HDR_FW_VER_MINOR_M 0xff
  2617. #define FW_HDR_FW_VER_MINOR_V(x) \
  2618. ((x) << FW_HDR_FW_VER_MINOR_S)
  2619. #define FW_HDR_FW_VER_MINOR_G(x) \
  2620. (((x) >> FW_HDR_FW_VER_MINOR_S) & FW_HDR_FW_VER_MINOR_M)
  2621. #define FW_HDR_FW_VER_MICRO_S 8
  2622. #define FW_HDR_FW_VER_MICRO_M 0xff
  2623. #define FW_HDR_FW_VER_MICRO_V(x) \
  2624. ((x) << FW_HDR_FW_VER_MICRO_S)
  2625. #define FW_HDR_FW_VER_MICRO_G(x) \
  2626. (((x) >> FW_HDR_FW_VER_MICRO_S) & FW_HDR_FW_VER_MICRO_M)
  2627. #define FW_HDR_FW_VER_BUILD_S 0
  2628. #define FW_HDR_FW_VER_BUILD_M 0xff
  2629. #define FW_HDR_FW_VER_BUILD_V(x) \
  2630. ((x) << FW_HDR_FW_VER_BUILD_S)
  2631. #define FW_HDR_FW_VER_BUILD_G(x) \
  2632. (((x) >> FW_HDR_FW_VER_BUILD_S) & FW_HDR_FW_VER_BUILD_M)
  2633. enum fw_hdr_intfver {
  2634. FW_HDR_INTFVER_NIC = 0x00,
  2635. FW_HDR_INTFVER_VNIC = 0x00,
  2636. FW_HDR_INTFVER_OFLD = 0x00,
  2637. FW_HDR_INTFVER_RI = 0x00,
  2638. FW_HDR_INTFVER_ISCSIPDU = 0x00,
  2639. FW_HDR_INTFVER_ISCSI = 0x00,
  2640. FW_HDR_INTFVER_FCOEPDU = 0x00,
  2641. FW_HDR_INTFVER_FCOE = 0x00,
  2642. };
  2643. enum fw_hdr_flags {
  2644. FW_HDR_FLAGS_RESET_HALT = 0x00000001,
  2645. };
  2646. /* length of the formatting string */
  2647. #define FW_DEVLOG_FMT_LEN 192
  2648. /* maximum number of the formatting string parameters */
  2649. #define FW_DEVLOG_FMT_PARAMS_NUM 8
  2650. /* priority levels */
  2651. enum fw_devlog_level {
  2652. FW_DEVLOG_LEVEL_EMERG = 0x0,
  2653. FW_DEVLOG_LEVEL_CRIT = 0x1,
  2654. FW_DEVLOG_LEVEL_ERR = 0x2,
  2655. FW_DEVLOG_LEVEL_NOTICE = 0x3,
  2656. FW_DEVLOG_LEVEL_INFO = 0x4,
  2657. FW_DEVLOG_LEVEL_DEBUG = 0x5,
  2658. FW_DEVLOG_LEVEL_MAX = 0x5,
  2659. };
  2660. /* facilities that may send a log message */
  2661. enum fw_devlog_facility {
  2662. FW_DEVLOG_FACILITY_CORE = 0x00,
  2663. FW_DEVLOG_FACILITY_CF = 0x01,
  2664. FW_DEVLOG_FACILITY_SCHED = 0x02,
  2665. FW_DEVLOG_FACILITY_TIMER = 0x04,
  2666. FW_DEVLOG_FACILITY_RES = 0x06,
  2667. FW_DEVLOG_FACILITY_HW = 0x08,
  2668. FW_DEVLOG_FACILITY_FLR = 0x10,
  2669. FW_DEVLOG_FACILITY_DMAQ = 0x12,
  2670. FW_DEVLOG_FACILITY_PHY = 0x14,
  2671. FW_DEVLOG_FACILITY_MAC = 0x16,
  2672. FW_DEVLOG_FACILITY_PORT = 0x18,
  2673. FW_DEVLOG_FACILITY_VI = 0x1A,
  2674. FW_DEVLOG_FACILITY_FILTER = 0x1C,
  2675. FW_DEVLOG_FACILITY_ACL = 0x1E,
  2676. FW_DEVLOG_FACILITY_TM = 0x20,
  2677. FW_DEVLOG_FACILITY_QFC = 0x22,
  2678. FW_DEVLOG_FACILITY_DCB = 0x24,
  2679. FW_DEVLOG_FACILITY_ETH = 0x26,
  2680. FW_DEVLOG_FACILITY_OFLD = 0x28,
  2681. FW_DEVLOG_FACILITY_RI = 0x2A,
  2682. FW_DEVLOG_FACILITY_ISCSI = 0x2C,
  2683. FW_DEVLOG_FACILITY_FCOE = 0x2E,
  2684. FW_DEVLOG_FACILITY_FOISCSI = 0x30,
  2685. FW_DEVLOG_FACILITY_FOFCOE = 0x32,
  2686. FW_DEVLOG_FACILITY_CHNET = 0x34,
  2687. FW_DEVLOG_FACILITY_MAX = 0x34,
  2688. };
  2689. /* log message format */
  2690. struct fw_devlog_e {
  2691. __be64 timestamp;
  2692. __be32 seqno;
  2693. __be16 reserved1;
  2694. __u8 level;
  2695. __u8 facility;
  2696. __u8 fmt[FW_DEVLOG_FMT_LEN];
  2697. __be32 params[FW_DEVLOG_FMT_PARAMS_NUM];
  2698. __be32 reserved3[4];
  2699. };
  2700. struct fw_devlog_cmd {
  2701. __be32 op_to_write;
  2702. __be32 retval_len16;
  2703. __u8 level;
  2704. __u8 r2[7];
  2705. __be32 memtype_devlog_memaddr16_devlog;
  2706. __be32 memsize_devlog;
  2707. __be32 r3[2];
  2708. };
  2709. #define FW_DEVLOG_CMD_MEMTYPE_DEVLOG_S 28
  2710. #define FW_DEVLOG_CMD_MEMTYPE_DEVLOG_M 0xf
  2711. #define FW_DEVLOG_CMD_MEMTYPE_DEVLOG_G(x) \
  2712. (((x) >> FW_DEVLOG_CMD_MEMTYPE_DEVLOG_S) & \
  2713. FW_DEVLOG_CMD_MEMTYPE_DEVLOG_M)
  2714. #define FW_DEVLOG_CMD_MEMADDR16_DEVLOG_S 0
  2715. #define FW_DEVLOG_CMD_MEMADDR16_DEVLOG_M 0xfffffff
  2716. #define FW_DEVLOG_CMD_MEMADDR16_DEVLOG_G(x) \
  2717. (((x) >> FW_DEVLOG_CMD_MEMADDR16_DEVLOG_S) & \
  2718. FW_DEVLOG_CMD_MEMADDR16_DEVLOG_M)
  2719. /* P C I E F W P F 7 R E G I S T E R */
  2720. /* PF7 stores the Firmware Device Log parameters which allows Host Drivers to
  2721. * access the "devlog" which needing to contact firmware. The encoding is
  2722. * mostly the same as that returned by the DEVLOG command except for the size
  2723. * which is encoded as the number of entries in multiples-1 of 128 here rather
  2724. * than the memory size as is done in the DEVLOG command. Thus, 0 means 128
  2725. * and 15 means 2048. This of course in turn constrains the allowed values
  2726. * for the devlog size ...
  2727. */
  2728. #define PCIE_FW_PF_DEVLOG 7
  2729. #define PCIE_FW_PF_DEVLOG_NENTRIES128_S 28
  2730. #define PCIE_FW_PF_DEVLOG_NENTRIES128_M 0xf
  2731. #define PCIE_FW_PF_DEVLOG_NENTRIES128_V(x) \
  2732. ((x) << PCIE_FW_PF_DEVLOG_NENTRIES128_S)
  2733. #define PCIE_FW_PF_DEVLOG_NENTRIES128_G(x) \
  2734. (((x) >> PCIE_FW_PF_DEVLOG_NENTRIES128_S) & \
  2735. PCIE_FW_PF_DEVLOG_NENTRIES128_M)
  2736. #define PCIE_FW_PF_DEVLOG_ADDR16_S 4
  2737. #define PCIE_FW_PF_DEVLOG_ADDR16_M 0xffffff
  2738. #define PCIE_FW_PF_DEVLOG_ADDR16_V(x) ((x) << PCIE_FW_PF_DEVLOG_ADDR16_S)
  2739. #define PCIE_FW_PF_DEVLOG_ADDR16_G(x) \
  2740. (((x) >> PCIE_FW_PF_DEVLOG_ADDR16_S) & PCIE_FW_PF_DEVLOG_ADDR16_M)
  2741. #define PCIE_FW_PF_DEVLOG_MEMTYPE_S 0
  2742. #define PCIE_FW_PF_DEVLOG_MEMTYPE_M 0xf
  2743. #define PCIE_FW_PF_DEVLOG_MEMTYPE_V(x) ((x) << PCIE_FW_PF_DEVLOG_MEMTYPE_S)
  2744. #define PCIE_FW_PF_DEVLOG_MEMTYPE_G(x) \
  2745. (((x) >> PCIE_FW_PF_DEVLOG_MEMTYPE_S) & PCIE_FW_PF_DEVLOG_MEMTYPE_M)
  2746. #endif /* _T4FW_INTERFACE_H_ */