cnic_defs.h 169 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463
  1. /* cnic.c: QLogic CNIC core network driver.
  2. *
  3. * Copyright (c) 2006-2014 Broadcom Corporation
  4. * Copyright (c) 2014 QLogic Corporation
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation.
  9. *
  10. */
  11. #ifndef CNIC_DEFS_H
  12. #define CNIC_DEFS_H
  13. /* KWQ (kernel work queue) request op codes */
  14. #define L2_KWQE_OPCODE_VALUE_FLUSH (4)
  15. #define L2_KWQE_OPCODE_VALUE_VM_FREE_RX_QUEUE (8)
  16. #define L4_KWQE_OPCODE_VALUE_CONNECT1 (50)
  17. #define L4_KWQE_OPCODE_VALUE_CONNECT2 (51)
  18. #define L4_KWQE_OPCODE_VALUE_CONNECT3 (52)
  19. #define L4_KWQE_OPCODE_VALUE_RESET (53)
  20. #define L4_KWQE_OPCODE_VALUE_CLOSE (54)
  21. #define L4_KWQE_OPCODE_VALUE_UPDATE_SECRET (60)
  22. #define L4_KWQE_OPCODE_VALUE_INIT_ULP (61)
  23. #define L4_KWQE_OPCODE_VALUE_OFFLOAD_PG (1)
  24. #define L4_KWQE_OPCODE_VALUE_UPDATE_PG (9)
  25. #define L4_KWQE_OPCODE_VALUE_UPLOAD_PG (14)
  26. #define L5CM_RAMROD_CMD_ID_BASE (0x80)
  27. #define L5CM_RAMROD_CMD_ID_TCP_CONNECT (L5CM_RAMROD_CMD_ID_BASE + 3)
  28. #define L5CM_RAMROD_CMD_ID_CLOSE (L5CM_RAMROD_CMD_ID_BASE + 12)
  29. #define L5CM_RAMROD_CMD_ID_ABORT (L5CM_RAMROD_CMD_ID_BASE + 13)
  30. #define L5CM_RAMROD_CMD_ID_SEARCHER_DELETE (L5CM_RAMROD_CMD_ID_BASE + 14)
  31. #define L5CM_RAMROD_CMD_ID_TERMINATE_OFFLOAD (L5CM_RAMROD_CMD_ID_BASE + 15)
  32. #define FCOE_RAMROD_CMD_ID_INIT_FUNC (FCOE_KCQE_OPCODE_INIT_FUNC)
  33. #define FCOE_RAMROD_CMD_ID_DESTROY_FUNC (FCOE_KCQE_OPCODE_DESTROY_FUNC)
  34. #define FCOE_RAMROD_CMD_ID_STAT_FUNC (FCOE_KCQE_OPCODE_STAT_FUNC)
  35. #define FCOE_RAMROD_CMD_ID_OFFLOAD_CONN (FCOE_KCQE_OPCODE_OFFLOAD_CONN)
  36. #define FCOE_RAMROD_CMD_ID_ENABLE_CONN (FCOE_KCQE_OPCODE_ENABLE_CONN)
  37. #define FCOE_RAMROD_CMD_ID_DISABLE_CONN (FCOE_KCQE_OPCODE_DISABLE_CONN)
  38. #define FCOE_RAMROD_CMD_ID_DESTROY_CONN (FCOE_KCQE_OPCODE_DESTROY_CONN)
  39. #define FCOE_RAMROD_CMD_ID_TERMINATE_CONN (0x81)
  40. /* KCQ (kernel completion queue) response op codes */
  41. #define L4_KCQE_OPCODE_VALUE_CLOSE_COMP (53)
  42. #define L4_KCQE_OPCODE_VALUE_RESET_COMP (54)
  43. #define L4_KCQE_OPCODE_VALUE_FW_TCP_UPDATE (55)
  44. #define L4_KCQE_OPCODE_VALUE_CONNECT_COMPLETE (56)
  45. #define L4_KCQE_OPCODE_VALUE_RESET_RECEIVED (57)
  46. #define L4_KCQE_OPCODE_VALUE_CLOSE_RECEIVED (58)
  47. #define L4_KCQE_OPCODE_VALUE_INIT_ULP (61)
  48. #define L4_KCQE_OPCODE_VALUE_OFFLOAD_PG (1)
  49. #define L4_KCQE_OPCODE_VALUE_UPDATE_PG (9)
  50. #define L4_KCQE_OPCODE_VALUE_UPLOAD_PG (14)
  51. /* KCQ (kernel completion queue) completion status */
  52. #define L4_KCQE_COMPLETION_STATUS_SUCCESS (0)
  53. #define L4_KCQE_COMPLETION_STATUS_NIC_ERROR (4)
  54. #define L4_KCQE_COMPLETION_STATUS_PARITY_ERROR (0x81)
  55. #define L4_KCQE_COMPLETION_STATUS_TIMEOUT (0x93)
  56. #define L4_KCQE_COMPLETION_STATUS_CTX_ALLOC_FAIL (0x83)
  57. #define L4_KCQE_COMPLETION_STATUS_OFFLOADED_PG (0x89)
  58. #define L4_KCQE_OPCODE_VALUE_OOO_EVENT_NOTIFICATION (0xa0)
  59. #define L4_KCQE_OPCODE_VALUE_OOO_FLUSH (0xa1)
  60. #define L4_LAYER_CODE (4)
  61. #define L2_LAYER_CODE (2)
  62. /*
  63. * L4 KCQ CQE
  64. */
  65. struct l4_kcq {
  66. u32 cid;
  67. u32 pg_cid;
  68. u32 conn_id;
  69. u32 pg_host_opaque;
  70. #if defined(__BIG_ENDIAN)
  71. u16 status;
  72. u16 reserved1;
  73. #elif defined(__LITTLE_ENDIAN)
  74. u16 reserved1;
  75. u16 status;
  76. #endif
  77. u32 reserved2[2];
  78. #if defined(__BIG_ENDIAN)
  79. u8 flags;
  80. #define L4_KCQ_RESERVED3 (0x7<<0)
  81. #define L4_KCQ_RESERVED3_SHIFT 0
  82. #define L4_KCQ_RAMROD_COMPLETION (0x1<<3) /* Everest only */
  83. #define L4_KCQ_RAMROD_COMPLETION_SHIFT 3
  84. #define L4_KCQ_LAYER_CODE (0x7<<4)
  85. #define L4_KCQ_LAYER_CODE_SHIFT 4
  86. #define L4_KCQ_RESERVED4 (0x1<<7)
  87. #define L4_KCQ_RESERVED4_SHIFT 7
  88. u8 op_code;
  89. u16 qe_self_seq;
  90. #elif defined(__LITTLE_ENDIAN)
  91. u16 qe_self_seq;
  92. u8 op_code;
  93. u8 flags;
  94. #define L4_KCQ_RESERVED3 (0xF<<0)
  95. #define L4_KCQ_RESERVED3_SHIFT 0
  96. #define L4_KCQ_RAMROD_COMPLETION (0x1<<3) /* Everest only */
  97. #define L4_KCQ_RAMROD_COMPLETION_SHIFT 3
  98. #define L4_KCQ_LAYER_CODE (0x7<<4)
  99. #define L4_KCQ_LAYER_CODE_SHIFT 4
  100. #define L4_KCQ_RESERVED4 (0x1<<7)
  101. #define L4_KCQ_RESERVED4_SHIFT 7
  102. #endif
  103. };
  104. /*
  105. * L4 KCQ CQE PG upload
  106. */
  107. struct l4_kcq_upload_pg {
  108. u32 pg_cid;
  109. #if defined(__BIG_ENDIAN)
  110. u16 pg_status;
  111. u16 pg_ipid_count;
  112. #elif defined(__LITTLE_ENDIAN)
  113. u16 pg_ipid_count;
  114. u16 pg_status;
  115. #endif
  116. u32 reserved1[5];
  117. #if defined(__BIG_ENDIAN)
  118. u8 flags;
  119. #define L4_KCQ_UPLOAD_PG_RESERVED3 (0xF<<0)
  120. #define L4_KCQ_UPLOAD_PG_RESERVED3_SHIFT 0
  121. #define L4_KCQ_UPLOAD_PG_LAYER_CODE (0x7<<4)
  122. #define L4_KCQ_UPLOAD_PG_LAYER_CODE_SHIFT 4
  123. #define L4_KCQ_UPLOAD_PG_RESERVED4 (0x1<<7)
  124. #define L4_KCQ_UPLOAD_PG_RESERVED4_SHIFT 7
  125. u8 op_code;
  126. u16 qe_self_seq;
  127. #elif defined(__LITTLE_ENDIAN)
  128. u16 qe_self_seq;
  129. u8 op_code;
  130. u8 flags;
  131. #define L4_KCQ_UPLOAD_PG_RESERVED3 (0xF<<0)
  132. #define L4_KCQ_UPLOAD_PG_RESERVED3_SHIFT 0
  133. #define L4_KCQ_UPLOAD_PG_LAYER_CODE (0x7<<4)
  134. #define L4_KCQ_UPLOAD_PG_LAYER_CODE_SHIFT 4
  135. #define L4_KCQ_UPLOAD_PG_RESERVED4 (0x1<<7)
  136. #define L4_KCQ_UPLOAD_PG_RESERVED4_SHIFT 7
  137. #endif
  138. };
  139. /*
  140. * Gracefully close the connection request
  141. */
  142. struct l4_kwq_close_req {
  143. #if defined(__BIG_ENDIAN)
  144. u8 flags;
  145. #define L4_KWQ_CLOSE_REQ_RESERVED1 (0xF<<0)
  146. #define L4_KWQ_CLOSE_REQ_RESERVED1_SHIFT 0
  147. #define L4_KWQ_CLOSE_REQ_LAYER_CODE (0x7<<4)
  148. #define L4_KWQ_CLOSE_REQ_LAYER_CODE_SHIFT 4
  149. #define L4_KWQ_CLOSE_REQ_LINKED_WITH_NEXT (0x1<<7)
  150. #define L4_KWQ_CLOSE_REQ_LINKED_WITH_NEXT_SHIFT 7
  151. u8 op_code;
  152. u16 reserved0;
  153. #elif defined(__LITTLE_ENDIAN)
  154. u16 reserved0;
  155. u8 op_code;
  156. u8 flags;
  157. #define L4_KWQ_CLOSE_REQ_RESERVED1 (0xF<<0)
  158. #define L4_KWQ_CLOSE_REQ_RESERVED1_SHIFT 0
  159. #define L4_KWQ_CLOSE_REQ_LAYER_CODE (0x7<<4)
  160. #define L4_KWQ_CLOSE_REQ_LAYER_CODE_SHIFT 4
  161. #define L4_KWQ_CLOSE_REQ_LINKED_WITH_NEXT (0x1<<7)
  162. #define L4_KWQ_CLOSE_REQ_LINKED_WITH_NEXT_SHIFT 7
  163. #endif
  164. u32 cid;
  165. u32 reserved2[6];
  166. };
  167. /*
  168. * The first request to be passed in order to establish connection in option2
  169. */
  170. struct l4_kwq_connect_req1 {
  171. #if defined(__BIG_ENDIAN)
  172. u8 flags;
  173. #define L4_KWQ_CONNECT_REQ1_RESERVED1 (0xF<<0)
  174. #define L4_KWQ_CONNECT_REQ1_RESERVED1_SHIFT 0
  175. #define L4_KWQ_CONNECT_REQ1_LAYER_CODE (0x7<<4)
  176. #define L4_KWQ_CONNECT_REQ1_LAYER_CODE_SHIFT 4
  177. #define L4_KWQ_CONNECT_REQ1_LINKED_WITH_NEXT (0x1<<7)
  178. #define L4_KWQ_CONNECT_REQ1_LINKED_WITH_NEXT_SHIFT 7
  179. u8 op_code;
  180. u8 reserved0;
  181. u8 conn_flags;
  182. #define L4_KWQ_CONNECT_REQ1_IS_PG_HOST_OPAQUE (0x1<<0)
  183. #define L4_KWQ_CONNECT_REQ1_IS_PG_HOST_OPAQUE_SHIFT 0
  184. #define L4_KWQ_CONNECT_REQ1_IP_V6 (0x1<<1)
  185. #define L4_KWQ_CONNECT_REQ1_IP_V6_SHIFT 1
  186. #define L4_KWQ_CONNECT_REQ1_PASSIVE_FLAG (0x1<<2)
  187. #define L4_KWQ_CONNECT_REQ1_PASSIVE_FLAG_SHIFT 2
  188. #define L4_KWQ_CONNECT_REQ1_RSRV (0x1F<<3)
  189. #define L4_KWQ_CONNECT_REQ1_RSRV_SHIFT 3
  190. #elif defined(__LITTLE_ENDIAN)
  191. u8 conn_flags;
  192. #define L4_KWQ_CONNECT_REQ1_IS_PG_HOST_OPAQUE (0x1<<0)
  193. #define L4_KWQ_CONNECT_REQ1_IS_PG_HOST_OPAQUE_SHIFT 0
  194. #define L4_KWQ_CONNECT_REQ1_IP_V6 (0x1<<1)
  195. #define L4_KWQ_CONNECT_REQ1_IP_V6_SHIFT 1
  196. #define L4_KWQ_CONNECT_REQ1_PASSIVE_FLAG (0x1<<2)
  197. #define L4_KWQ_CONNECT_REQ1_PASSIVE_FLAG_SHIFT 2
  198. #define L4_KWQ_CONNECT_REQ1_RSRV (0x1F<<3)
  199. #define L4_KWQ_CONNECT_REQ1_RSRV_SHIFT 3
  200. u8 reserved0;
  201. u8 op_code;
  202. u8 flags;
  203. #define L4_KWQ_CONNECT_REQ1_RESERVED1 (0xF<<0)
  204. #define L4_KWQ_CONNECT_REQ1_RESERVED1_SHIFT 0
  205. #define L4_KWQ_CONNECT_REQ1_LAYER_CODE (0x7<<4)
  206. #define L4_KWQ_CONNECT_REQ1_LAYER_CODE_SHIFT 4
  207. #define L4_KWQ_CONNECT_REQ1_LINKED_WITH_NEXT (0x1<<7)
  208. #define L4_KWQ_CONNECT_REQ1_LINKED_WITH_NEXT_SHIFT 7
  209. #endif
  210. u32 cid;
  211. u32 pg_cid;
  212. u32 src_ip;
  213. u32 dst_ip;
  214. #if defined(__BIG_ENDIAN)
  215. u16 dst_port;
  216. u16 src_port;
  217. #elif defined(__LITTLE_ENDIAN)
  218. u16 src_port;
  219. u16 dst_port;
  220. #endif
  221. #if defined(__BIG_ENDIAN)
  222. u8 rsrv1[3];
  223. u8 tcp_flags;
  224. #define L4_KWQ_CONNECT_REQ1_NO_DELAY_ACK (0x1<<0)
  225. #define L4_KWQ_CONNECT_REQ1_NO_DELAY_ACK_SHIFT 0
  226. #define L4_KWQ_CONNECT_REQ1_KEEP_ALIVE (0x1<<1)
  227. #define L4_KWQ_CONNECT_REQ1_KEEP_ALIVE_SHIFT 1
  228. #define L4_KWQ_CONNECT_REQ1_NAGLE_ENABLE (0x1<<2)
  229. #define L4_KWQ_CONNECT_REQ1_NAGLE_ENABLE_SHIFT 2
  230. #define L4_KWQ_CONNECT_REQ1_TIME_STAMP (0x1<<3)
  231. #define L4_KWQ_CONNECT_REQ1_TIME_STAMP_SHIFT 3
  232. #define L4_KWQ_CONNECT_REQ1_SACK (0x1<<4)
  233. #define L4_KWQ_CONNECT_REQ1_SACK_SHIFT 4
  234. #define L4_KWQ_CONNECT_REQ1_SEG_SCALING (0x1<<5)
  235. #define L4_KWQ_CONNECT_REQ1_SEG_SCALING_SHIFT 5
  236. #define L4_KWQ_CONNECT_REQ1_RESERVED2 (0x3<<6)
  237. #define L4_KWQ_CONNECT_REQ1_RESERVED2_SHIFT 6
  238. #elif defined(__LITTLE_ENDIAN)
  239. u8 tcp_flags;
  240. #define L4_KWQ_CONNECT_REQ1_NO_DELAY_ACK (0x1<<0)
  241. #define L4_KWQ_CONNECT_REQ1_NO_DELAY_ACK_SHIFT 0
  242. #define L4_KWQ_CONNECT_REQ1_KEEP_ALIVE (0x1<<1)
  243. #define L4_KWQ_CONNECT_REQ1_KEEP_ALIVE_SHIFT 1
  244. #define L4_KWQ_CONNECT_REQ1_NAGLE_ENABLE (0x1<<2)
  245. #define L4_KWQ_CONNECT_REQ1_NAGLE_ENABLE_SHIFT 2
  246. #define L4_KWQ_CONNECT_REQ1_TIME_STAMP (0x1<<3)
  247. #define L4_KWQ_CONNECT_REQ1_TIME_STAMP_SHIFT 3
  248. #define L4_KWQ_CONNECT_REQ1_SACK (0x1<<4)
  249. #define L4_KWQ_CONNECT_REQ1_SACK_SHIFT 4
  250. #define L4_KWQ_CONNECT_REQ1_SEG_SCALING (0x1<<5)
  251. #define L4_KWQ_CONNECT_REQ1_SEG_SCALING_SHIFT 5
  252. #define L4_KWQ_CONNECT_REQ1_RESERVED2 (0x3<<6)
  253. #define L4_KWQ_CONNECT_REQ1_RESERVED2_SHIFT 6
  254. u8 rsrv1[3];
  255. #endif
  256. u32 rsrv2;
  257. };
  258. /*
  259. * The second ( optional )request to be passed in order to establish
  260. * connection in option2 - for IPv6 only
  261. */
  262. struct l4_kwq_connect_req2 {
  263. #if defined(__BIG_ENDIAN)
  264. u8 flags;
  265. #define L4_KWQ_CONNECT_REQ2_RESERVED1 (0xF<<0)
  266. #define L4_KWQ_CONNECT_REQ2_RESERVED1_SHIFT 0
  267. #define L4_KWQ_CONNECT_REQ2_LAYER_CODE (0x7<<4)
  268. #define L4_KWQ_CONNECT_REQ2_LAYER_CODE_SHIFT 4
  269. #define L4_KWQ_CONNECT_REQ2_LINKED_WITH_NEXT (0x1<<7)
  270. #define L4_KWQ_CONNECT_REQ2_LINKED_WITH_NEXT_SHIFT 7
  271. u8 op_code;
  272. u8 reserved0;
  273. u8 rsrv;
  274. #elif defined(__LITTLE_ENDIAN)
  275. u8 rsrv;
  276. u8 reserved0;
  277. u8 op_code;
  278. u8 flags;
  279. #define L4_KWQ_CONNECT_REQ2_RESERVED1 (0xF<<0)
  280. #define L4_KWQ_CONNECT_REQ2_RESERVED1_SHIFT 0
  281. #define L4_KWQ_CONNECT_REQ2_LAYER_CODE (0x7<<4)
  282. #define L4_KWQ_CONNECT_REQ2_LAYER_CODE_SHIFT 4
  283. #define L4_KWQ_CONNECT_REQ2_LINKED_WITH_NEXT (0x1<<7)
  284. #define L4_KWQ_CONNECT_REQ2_LINKED_WITH_NEXT_SHIFT 7
  285. #endif
  286. u32 reserved2;
  287. u32 src_ip_v6_2;
  288. u32 src_ip_v6_3;
  289. u32 src_ip_v6_4;
  290. u32 dst_ip_v6_2;
  291. u32 dst_ip_v6_3;
  292. u32 dst_ip_v6_4;
  293. };
  294. /*
  295. * The third ( and last )request to be passed in order to establish
  296. * connection in option2
  297. */
  298. struct l4_kwq_connect_req3 {
  299. #if defined(__BIG_ENDIAN)
  300. u8 flags;
  301. #define L4_KWQ_CONNECT_REQ3_RESERVED1 (0xF<<0)
  302. #define L4_KWQ_CONNECT_REQ3_RESERVED1_SHIFT 0
  303. #define L4_KWQ_CONNECT_REQ3_LAYER_CODE (0x7<<4)
  304. #define L4_KWQ_CONNECT_REQ3_LAYER_CODE_SHIFT 4
  305. #define L4_KWQ_CONNECT_REQ3_LINKED_WITH_NEXT (0x1<<7)
  306. #define L4_KWQ_CONNECT_REQ3_LINKED_WITH_NEXT_SHIFT 7
  307. u8 op_code;
  308. u16 reserved0;
  309. #elif defined(__LITTLE_ENDIAN)
  310. u16 reserved0;
  311. u8 op_code;
  312. u8 flags;
  313. #define L4_KWQ_CONNECT_REQ3_RESERVED1 (0xF<<0)
  314. #define L4_KWQ_CONNECT_REQ3_RESERVED1_SHIFT 0
  315. #define L4_KWQ_CONNECT_REQ3_LAYER_CODE (0x7<<4)
  316. #define L4_KWQ_CONNECT_REQ3_LAYER_CODE_SHIFT 4
  317. #define L4_KWQ_CONNECT_REQ3_LINKED_WITH_NEXT (0x1<<7)
  318. #define L4_KWQ_CONNECT_REQ3_LINKED_WITH_NEXT_SHIFT 7
  319. #endif
  320. u32 ka_timeout;
  321. u32 ka_interval ;
  322. #if defined(__BIG_ENDIAN)
  323. u8 snd_seq_scale;
  324. u8 ttl;
  325. u8 tos;
  326. u8 ka_max_probe_count;
  327. #elif defined(__LITTLE_ENDIAN)
  328. u8 ka_max_probe_count;
  329. u8 tos;
  330. u8 ttl;
  331. u8 snd_seq_scale;
  332. #endif
  333. #if defined(__BIG_ENDIAN)
  334. u16 pmtu;
  335. u16 mss;
  336. #elif defined(__LITTLE_ENDIAN)
  337. u16 mss;
  338. u16 pmtu;
  339. #endif
  340. u32 rcv_buf;
  341. u32 snd_buf;
  342. u32 seed;
  343. };
  344. /*
  345. * a KWQE request to offload a PG connection
  346. */
  347. struct l4_kwq_offload_pg {
  348. #if defined(__BIG_ENDIAN)
  349. u8 flags;
  350. #define L4_KWQ_OFFLOAD_PG_RESERVED1 (0xF<<0)
  351. #define L4_KWQ_OFFLOAD_PG_RESERVED1_SHIFT 0
  352. #define L4_KWQ_OFFLOAD_PG_LAYER_CODE (0x7<<4)
  353. #define L4_KWQ_OFFLOAD_PG_LAYER_CODE_SHIFT 4
  354. #define L4_KWQ_OFFLOAD_PG_LINKED_WITH_NEXT (0x1<<7)
  355. #define L4_KWQ_OFFLOAD_PG_LINKED_WITH_NEXT_SHIFT 7
  356. u8 op_code;
  357. u16 reserved0;
  358. #elif defined(__LITTLE_ENDIAN)
  359. u16 reserved0;
  360. u8 op_code;
  361. u8 flags;
  362. #define L4_KWQ_OFFLOAD_PG_RESERVED1 (0xF<<0)
  363. #define L4_KWQ_OFFLOAD_PG_RESERVED1_SHIFT 0
  364. #define L4_KWQ_OFFLOAD_PG_LAYER_CODE (0x7<<4)
  365. #define L4_KWQ_OFFLOAD_PG_LAYER_CODE_SHIFT 4
  366. #define L4_KWQ_OFFLOAD_PG_LINKED_WITH_NEXT (0x1<<7)
  367. #define L4_KWQ_OFFLOAD_PG_LINKED_WITH_NEXT_SHIFT 7
  368. #endif
  369. #if defined(__BIG_ENDIAN)
  370. u8 l2hdr_nbytes;
  371. u8 pg_flags;
  372. #define L4_KWQ_OFFLOAD_PG_SNAP_ENCAP (0x1<<0)
  373. #define L4_KWQ_OFFLOAD_PG_SNAP_ENCAP_SHIFT 0
  374. #define L4_KWQ_OFFLOAD_PG_VLAN_TAGGING (0x1<<1)
  375. #define L4_KWQ_OFFLOAD_PG_VLAN_TAGGING_SHIFT 1
  376. #define L4_KWQ_OFFLOAD_PG_RESERVED2 (0x3F<<2)
  377. #define L4_KWQ_OFFLOAD_PG_RESERVED2_SHIFT 2
  378. u8 da0;
  379. u8 da1;
  380. #elif defined(__LITTLE_ENDIAN)
  381. u8 da1;
  382. u8 da0;
  383. u8 pg_flags;
  384. #define L4_KWQ_OFFLOAD_PG_SNAP_ENCAP (0x1<<0)
  385. #define L4_KWQ_OFFLOAD_PG_SNAP_ENCAP_SHIFT 0
  386. #define L4_KWQ_OFFLOAD_PG_VLAN_TAGGING (0x1<<1)
  387. #define L4_KWQ_OFFLOAD_PG_VLAN_TAGGING_SHIFT 1
  388. #define L4_KWQ_OFFLOAD_PG_RESERVED2 (0x3F<<2)
  389. #define L4_KWQ_OFFLOAD_PG_RESERVED2_SHIFT 2
  390. u8 l2hdr_nbytes;
  391. #endif
  392. #if defined(__BIG_ENDIAN)
  393. u8 da2;
  394. u8 da3;
  395. u8 da4;
  396. u8 da5;
  397. #elif defined(__LITTLE_ENDIAN)
  398. u8 da5;
  399. u8 da4;
  400. u8 da3;
  401. u8 da2;
  402. #endif
  403. #if defined(__BIG_ENDIAN)
  404. u8 sa0;
  405. u8 sa1;
  406. u8 sa2;
  407. u8 sa3;
  408. #elif defined(__LITTLE_ENDIAN)
  409. u8 sa3;
  410. u8 sa2;
  411. u8 sa1;
  412. u8 sa0;
  413. #endif
  414. #if defined(__BIG_ENDIAN)
  415. u8 sa4;
  416. u8 sa5;
  417. u16 etype;
  418. #elif defined(__LITTLE_ENDIAN)
  419. u16 etype;
  420. u8 sa5;
  421. u8 sa4;
  422. #endif
  423. #if defined(__BIG_ENDIAN)
  424. u16 vlan_tag;
  425. u16 ipid_start;
  426. #elif defined(__LITTLE_ENDIAN)
  427. u16 ipid_start;
  428. u16 vlan_tag;
  429. #endif
  430. #if defined(__BIG_ENDIAN)
  431. u16 ipid_count;
  432. u16 reserved3;
  433. #elif defined(__LITTLE_ENDIAN)
  434. u16 reserved3;
  435. u16 ipid_count;
  436. #endif
  437. u32 host_opaque;
  438. };
  439. /*
  440. * Abortively close the connection request
  441. */
  442. struct l4_kwq_reset_req {
  443. #if defined(__BIG_ENDIAN)
  444. u8 flags;
  445. #define L4_KWQ_RESET_REQ_RESERVED1 (0xF<<0)
  446. #define L4_KWQ_RESET_REQ_RESERVED1_SHIFT 0
  447. #define L4_KWQ_RESET_REQ_LAYER_CODE (0x7<<4)
  448. #define L4_KWQ_RESET_REQ_LAYER_CODE_SHIFT 4
  449. #define L4_KWQ_RESET_REQ_LINKED_WITH_NEXT (0x1<<7)
  450. #define L4_KWQ_RESET_REQ_LINKED_WITH_NEXT_SHIFT 7
  451. u8 op_code;
  452. u16 reserved0;
  453. #elif defined(__LITTLE_ENDIAN)
  454. u16 reserved0;
  455. u8 op_code;
  456. u8 flags;
  457. #define L4_KWQ_RESET_REQ_RESERVED1 (0xF<<0)
  458. #define L4_KWQ_RESET_REQ_RESERVED1_SHIFT 0
  459. #define L4_KWQ_RESET_REQ_LAYER_CODE (0x7<<4)
  460. #define L4_KWQ_RESET_REQ_LAYER_CODE_SHIFT 4
  461. #define L4_KWQ_RESET_REQ_LINKED_WITH_NEXT (0x1<<7)
  462. #define L4_KWQ_RESET_REQ_LINKED_WITH_NEXT_SHIFT 7
  463. #endif
  464. u32 cid;
  465. u32 reserved2[6];
  466. };
  467. /*
  468. * a KWQE request to update a PG connection
  469. */
  470. struct l4_kwq_update_pg {
  471. #if defined(__BIG_ENDIAN)
  472. u8 flags;
  473. #define L4_KWQ_UPDATE_PG_RESERVED1 (0xF<<0)
  474. #define L4_KWQ_UPDATE_PG_RESERVED1_SHIFT 0
  475. #define L4_KWQ_UPDATE_PG_LAYER_CODE (0x7<<4)
  476. #define L4_KWQ_UPDATE_PG_LAYER_CODE_SHIFT 4
  477. #define L4_KWQ_UPDATE_PG_LINKED_WITH_NEXT (0x1<<7)
  478. #define L4_KWQ_UPDATE_PG_LINKED_WITH_NEXT_SHIFT 7
  479. u8 opcode;
  480. u16 oper16;
  481. #elif defined(__LITTLE_ENDIAN)
  482. u16 oper16;
  483. u8 opcode;
  484. u8 flags;
  485. #define L4_KWQ_UPDATE_PG_RESERVED1 (0xF<<0)
  486. #define L4_KWQ_UPDATE_PG_RESERVED1_SHIFT 0
  487. #define L4_KWQ_UPDATE_PG_LAYER_CODE (0x7<<4)
  488. #define L4_KWQ_UPDATE_PG_LAYER_CODE_SHIFT 4
  489. #define L4_KWQ_UPDATE_PG_LINKED_WITH_NEXT (0x1<<7)
  490. #define L4_KWQ_UPDATE_PG_LINKED_WITH_NEXT_SHIFT 7
  491. #endif
  492. u32 pg_cid;
  493. u32 pg_host_opaque;
  494. #if defined(__BIG_ENDIAN)
  495. u8 pg_valids;
  496. #define L4_KWQ_UPDATE_PG_VALIDS_IPID_COUNT (0x1<<0)
  497. #define L4_KWQ_UPDATE_PG_VALIDS_IPID_COUNT_SHIFT 0
  498. #define L4_KWQ_UPDATE_PG_VALIDS_DA (0x1<<1)
  499. #define L4_KWQ_UPDATE_PG_VALIDS_DA_SHIFT 1
  500. #define L4_KWQ_UPDATE_PG_RESERVERD2 (0x3F<<2)
  501. #define L4_KWQ_UPDATE_PG_RESERVERD2_SHIFT 2
  502. u8 pg_unused_a;
  503. u16 pg_ipid_count;
  504. #elif defined(__LITTLE_ENDIAN)
  505. u16 pg_ipid_count;
  506. u8 pg_unused_a;
  507. u8 pg_valids;
  508. #define L4_KWQ_UPDATE_PG_VALIDS_IPID_COUNT (0x1<<0)
  509. #define L4_KWQ_UPDATE_PG_VALIDS_IPID_COUNT_SHIFT 0
  510. #define L4_KWQ_UPDATE_PG_VALIDS_DA (0x1<<1)
  511. #define L4_KWQ_UPDATE_PG_VALIDS_DA_SHIFT 1
  512. #define L4_KWQ_UPDATE_PG_RESERVERD2 (0x3F<<2)
  513. #define L4_KWQ_UPDATE_PG_RESERVERD2_SHIFT 2
  514. #endif
  515. #if defined(__BIG_ENDIAN)
  516. u16 reserverd3;
  517. u8 da0;
  518. u8 da1;
  519. #elif defined(__LITTLE_ENDIAN)
  520. u8 da1;
  521. u8 da0;
  522. u16 reserverd3;
  523. #endif
  524. #if defined(__BIG_ENDIAN)
  525. u8 da2;
  526. u8 da3;
  527. u8 da4;
  528. u8 da5;
  529. #elif defined(__LITTLE_ENDIAN)
  530. u8 da5;
  531. u8 da4;
  532. u8 da3;
  533. u8 da2;
  534. #endif
  535. u32 reserved4;
  536. u32 reserved5;
  537. };
  538. /*
  539. * a KWQE request to upload a PG or L4 context
  540. */
  541. struct l4_kwq_upload {
  542. #if defined(__BIG_ENDIAN)
  543. u8 flags;
  544. #define L4_KWQ_UPLOAD_RESERVED1 (0xF<<0)
  545. #define L4_KWQ_UPLOAD_RESERVED1_SHIFT 0
  546. #define L4_KWQ_UPLOAD_LAYER_CODE (0x7<<4)
  547. #define L4_KWQ_UPLOAD_LAYER_CODE_SHIFT 4
  548. #define L4_KWQ_UPLOAD_LINKED_WITH_NEXT (0x1<<7)
  549. #define L4_KWQ_UPLOAD_LINKED_WITH_NEXT_SHIFT 7
  550. u8 opcode;
  551. u16 oper16;
  552. #elif defined(__LITTLE_ENDIAN)
  553. u16 oper16;
  554. u8 opcode;
  555. u8 flags;
  556. #define L4_KWQ_UPLOAD_RESERVED1 (0xF<<0)
  557. #define L4_KWQ_UPLOAD_RESERVED1_SHIFT 0
  558. #define L4_KWQ_UPLOAD_LAYER_CODE (0x7<<4)
  559. #define L4_KWQ_UPLOAD_LAYER_CODE_SHIFT 4
  560. #define L4_KWQ_UPLOAD_LINKED_WITH_NEXT (0x1<<7)
  561. #define L4_KWQ_UPLOAD_LINKED_WITH_NEXT_SHIFT 7
  562. #endif
  563. u32 cid;
  564. u32 reserved2[6];
  565. };
  566. /*
  567. * bnx2x structures
  568. */
  569. /*
  570. * The iscsi aggregative context of Cstorm
  571. */
  572. struct cstorm_iscsi_ag_context {
  573. u32 agg_vars1;
  574. #define CSTORM_ISCSI_AG_CONTEXT_STATE (0xFF<<0)
  575. #define CSTORM_ISCSI_AG_CONTEXT_STATE_SHIFT 0
  576. #define __CSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM0 (0x1<<8)
  577. #define __CSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM0_SHIFT 8
  578. #define __CSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM1 (0x1<<9)
  579. #define __CSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM1_SHIFT 9
  580. #define __CSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM2 (0x1<<10)
  581. #define __CSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM2_SHIFT 10
  582. #define __CSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM3 (0x1<<11)
  583. #define __CSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM3_SHIFT 11
  584. #define __CSTORM_ISCSI_AG_CONTEXT_RESERVED_ULP_RX_SE_CF_EN (0x1<<12)
  585. #define __CSTORM_ISCSI_AG_CONTEXT_RESERVED_ULP_RX_SE_CF_EN_SHIFT 12
  586. #define __CSTORM_ISCSI_AG_CONTEXT_RESERVED_ULP_RX_INV_CF_EN (0x1<<13)
  587. #define __CSTORM_ISCSI_AG_CONTEXT_RESERVED_ULP_RX_INV_CF_EN_SHIFT 13
  588. #define __CSTORM_ISCSI_AG_CONTEXT_AUX4_CF (0x3<<14)
  589. #define __CSTORM_ISCSI_AG_CONTEXT_AUX4_CF_SHIFT 14
  590. #define __CSTORM_ISCSI_AG_CONTEXT_RESERVED66 (0x3<<16)
  591. #define __CSTORM_ISCSI_AG_CONTEXT_RESERVED66_SHIFT 16
  592. #define __CSTORM_ISCSI_AG_CONTEXT_FIN_RECEIVED_CF_EN (0x1<<18)
  593. #define __CSTORM_ISCSI_AG_CONTEXT_FIN_RECEIVED_CF_EN_SHIFT 18
  594. #define __CSTORM_ISCSI_AG_CONTEXT_AUX1_CF_EN (0x1<<19)
  595. #define __CSTORM_ISCSI_AG_CONTEXT_AUX1_CF_EN_SHIFT 19
  596. #define __CSTORM_ISCSI_AG_CONTEXT_AUX2_CF_EN (0x1<<20)
  597. #define __CSTORM_ISCSI_AG_CONTEXT_AUX2_CF_EN_SHIFT 20
  598. #define __CSTORM_ISCSI_AG_CONTEXT_AUX3_CF_EN (0x1<<21)
  599. #define __CSTORM_ISCSI_AG_CONTEXT_AUX3_CF_EN_SHIFT 21
  600. #define __CSTORM_ISCSI_AG_CONTEXT_AUX4_CF_EN (0x1<<22)
  601. #define __CSTORM_ISCSI_AG_CONTEXT_AUX4_CF_EN_SHIFT 22
  602. #define __CSTORM_ISCSI_AG_CONTEXT_REL_SEQ_RULE (0x7<<23)
  603. #define __CSTORM_ISCSI_AG_CONTEXT_REL_SEQ_RULE_SHIFT 23
  604. #define CSTORM_ISCSI_AG_CONTEXT_HQ_PROD_RULE (0x3<<26)
  605. #define CSTORM_ISCSI_AG_CONTEXT_HQ_PROD_RULE_SHIFT 26
  606. #define __CSTORM_ISCSI_AG_CONTEXT_RESERVED52 (0x3<<28)
  607. #define __CSTORM_ISCSI_AG_CONTEXT_RESERVED52_SHIFT 28
  608. #define __CSTORM_ISCSI_AG_CONTEXT_RESERVED53 (0x3<<30)
  609. #define __CSTORM_ISCSI_AG_CONTEXT_RESERVED53_SHIFT 30
  610. #if defined(__BIG_ENDIAN)
  611. u8 __aux1_th;
  612. u8 __aux1_val;
  613. u16 __agg_vars2;
  614. #elif defined(__LITTLE_ENDIAN)
  615. u16 __agg_vars2;
  616. u8 __aux1_val;
  617. u8 __aux1_th;
  618. #endif
  619. u32 rel_seq;
  620. u32 rel_seq_th;
  621. #if defined(__BIG_ENDIAN)
  622. u16 hq_cons;
  623. u16 hq_prod;
  624. #elif defined(__LITTLE_ENDIAN)
  625. u16 hq_prod;
  626. u16 hq_cons;
  627. #endif
  628. #if defined(__BIG_ENDIAN)
  629. u8 __reserved62;
  630. u8 __reserved61;
  631. u8 __reserved60;
  632. u8 __reserved59;
  633. #elif defined(__LITTLE_ENDIAN)
  634. u8 __reserved59;
  635. u8 __reserved60;
  636. u8 __reserved61;
  637. u8 __reserved62;
  638. #endif
  639. #if defined(__BIG_ENDIAN)
  640. u16 __reserved64;
  641. u16 cq_u_prod;
  642. #elif defined(__LITTLE_ENDIAN)
  643. u16 cq_u_prod;
  644. u16 __reserved64;
  645. #endif
  646. u32 __cq_u_prod1;
  647. #if defined(__BIG_ENDIAN)
  648. u16 __agg_vars3;
  649. u16 cq_u_pend;
  650. #elif defined(__LITTLE_ENDIAN)
  651. u16 cq_u_pend;
  652. u16 __agg_vars3;
  653. #endif
  654. #if defined(__BIG_ENDIAN)
  655. u16 __aux2_th;
  656. u16 aux2_val;
  657. #elif defined(__LITTLE_ENDIAN)
  658. u16 aux2_val;
  659. u16 __aux2_th;
  660. #endif
  661. };
  662. /*
  663. * The fcoe extra aggregative context section of Tstorm
  664. */
  665. struct tstorm_fcoe_extra_ag_context_section {
  666. u32 __agg_val1;
  667. #if defined(__BIG_ENDIAN)
  668. u8 __tcp_agg_vars2;
  669. u8 __agg_val3;
  670. u16 __agg_val2;
  671. #elif defined(__LITTLE_ENDIAN)
  672. u16 __agg_val2;
  673. u8 __agg_val3;
  674. u8 __tcp_agg_vars2;
  675. #endif
  676. #if defined(__BIG_ENDIAN)
  677. u16 __agg_val5;
  678. u8 __agg_val6;
  679. u8 __tcp_agg_vars3;
  680. #elif defined(__LITTLE_ENDIAN)
  681. u8 __tcp_agg_vars3;
  682. u8 __agg_val6;
  683. u16 __agg_val5;
  684. #endif
  685. u32 __lcq_prod;
  686. u32 rtt_seq;
  687. u32 rtt_time;
  688. u32 __reserved66;
  689. u32 wnd_right_edge;
  690. u32 tcp_agg_vars1;
  691. #define TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_FIN_SENT_FLAG (0x1<<0)
  692. #define TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_FIN_SENT_FLAG_SHIFT 0
  693. #define TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_LAST_PACKET_FIN_FLAG (0x1<<1)
  694. #define TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_LAST_PACKET_FIN_FLAG_SHIFT 1
  695. #define TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_WND_UPD_CF (0x3<<2)
  696. #define TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_WND_UPD_CF_SHIFT 2
  697. #define TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_TIMEOUT_CF (0x3<<4)
  698. #define TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_TIMEOUT_CF_SHIFT 4
  699. #define TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_WND_UPD_CF_EN (0x1<<6)
  700. #define TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_WND_UPD_CF_EN_SHIFT 6
  701. #define TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_TIMEOUT_CF_EN (0x1<<7)
  702. #define TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_TIMEOUT_CF_EN_SHIFT 7
  703. #define TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RETRANSMIT_SEQ_EN (0x1<<8)
  704. #define TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RETRANSMIT_SEQ_EN_SHIFT 8
  705. #define __TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_LCQ_SND_EN (0x1<<9)
  706. #define __TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_LCQ_SND_EN_SHIFT 9
  707. #define TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_AUX1_FLAG (0x1<<10)
  708. #define TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_AUX1_FLAG_SHIFT 10
  709. #define TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_AUX2_FLAG (0x1<<11)
  710. #define TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_AUX2_FLAG_SHIFT 11
  711. #define TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_AUX1_CF_EN (0x1<<12)
  712. #define TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_AUX1_CF_EN_SHIFT 12
  713. #define TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_AUX2_CF_EN (0x1<<13)
  714. #define TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_AUX2_CF_EN_SHIFT 13
  715. #define TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_AUX1_CF (0x3<<14)
  716. #define TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_AUX1_CF_SHIFT 14
  717. #define TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_AUX2_CF (0x3<<16)
  718. #define TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_AUX2_CF_SHIFT 16
  719. #define TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_TX_BLOCKED (0x1<<18)
  720. #define TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_TX_BLOCKED_SHIFT 18
  721. #define __TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_AUX10_CF_EN (0x1<<19)
  722. #define __TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_AUX10_CF_EN_SHIFT 19
  723. #define __TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_AUX11_CF_EN (0x1<<20)
  724. #define __TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_AUX11_CF_EN_SHIFT 20
  725. #define __TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_AUX12_CF_EN (0x1<<21)
  726. #define __TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_AUX12_CF_EN_SHIFT 21
  727. #define __TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED1 (0x3<<22)
  728. #define __TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED1_SHIFT 22
  729. #define TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RETRANSMIT_PEND_SEQ (0xF<<24)
  730. #define TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RETRANSMIT_PEND_SEQ_SHIFT 24
  731. #define TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RETRANSMIT_DONE_SEQ (0xF<<28)
  732. #define TSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RETRANSMIT_DONE_SEQ_SHIFT 28
  733. u32 snd_max;
  734. u32 __lcq_cons;
  735. u32 __reserved2;
  736. };
  737. /*
  738. * The fcoe aggregative context of Tstorm
  739. */
  740. struct tstorm_fcoe_ag_context {
  741. #if defined(__BIG_ENDIAN)
  742. u16 ulp_credit;
  743. u8 agg_vars1;
  744. #define TSTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM0 (0x1<<0)
  745. #define TSTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM0_SHIFT 0
  746. #define TSTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM1 (0x1<<1)
  747. #define TSTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM1_SHIFT 1
  748. #define TSTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM2 (0x1<<2)
  749. #define TSTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM2_SHIFT 2
  750. #define TSTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM3 (0x1<<3)
  751. #define TSTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM3_SHIFT 3
  752. #define __TSTORM_FCOE_AG_CONTEXT_QUEUE0_FLUSH_CF (0x3<<4)
  753. #define __TSTORM_FCOE_AG_CONTEXT_QUEUE0_FLUSH_CF_SHIFT 4
  754. #define __TSTORM_FCOE_AG_CONTEXT_AUX3_FLAG (0x1<<6)
  755. #define __TSTORM_FCOE_AG_CONTEXT_AUX3_FLAG_SHIFT 6
  756. #define __TSTORM_FCOE_AG_CONTEXT_AUX4_FLAG (0x1<<7)
  757. #define __TSTORM_FCOE_AG_CONTEXT_AUX4_FLAG_SHIFT 7
  758. u8 state;
  759. #elif defined(__LITTLE_ENDIAN)
  760. u8 state;
  761. u8 agg_vars1;
  762. #define TSTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM0 (0x1<<0)
  763. #define TSTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM0_SHIFT 0
  764. #define TSTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM1 (0x1<<1)
  765. #define TSTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM1_SHIFT 1
  766. #define TSTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM2 (0x1<<2)
  767. #define TSTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM2_SHIFT 2
  768. #define TSTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM3 (0x1<<3)
  769. #define TSTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM3_SHIFT 3
  770. #define __TSTORM_FCOE_AG_CONTEXT_QUEUE0_FLUSH_CF (0x3<<4)
  771. #define __TSTORM_FCOE_AG_CONTEXT_QUEUE0_FLUSH_CF_SHIFT 4
  772. #define __TSTORM_FCOE_AG_CONTEXT_AUX3_FLAG (0x1<<6)
  773. #define __TSTORM_FCOE_AG_CONTEXT_AUX3_FLAG_SHIFT 6
  774. #define __TSTORM_FCOE_AG_CONTEXT_AUX4_FLAG (0x1<<7)
  775. #define __TSTORM_FCOE_AG_CONTEXT_AUX4_FLAG_SHIFT 7
  776. u16 ulp_credit;
  777. #endif
  778. #if defined(__BIG_ENDIAN)
  779. u16 __agg_val4;
  780. u16 agg_vars2;
  781. #define __TSTORM_FCOE_AG_CONTEXT_AUX5_FLAG (0x1<<0)
  782. #define __TSTORM_FCOE_AG_CONTEXT_AUX5_FLAG_SHIFT 0
  783. #define __TSTORM_FCOE_AG_CONTEXT_AUX6_FLAG (0x1<<1)
  784. #define __TSTORM_FCOE_AG_CONTEXT_AUX6_FLAG_SHIFT 1
  785. #define __TSTORM_FCOE_AG_CONTEXT_AUX4_CF (0x3<<2)
  786. #define __TSTORM_FCOE_AG_CONTEXT_AUX4_CF_SHIFT 2
  787. #define __TSTORM_FCOE_AG_CONTEXT_AUX5_CF (0x3<<4)
  788. #define __TSTORM_FCOE_AG_CONTEXT_AUX5_CF_SHIFT 4
  789. #define __TSTORM_FCOE_AG_CONTEXT_AUX6_CF (0x3<<6)
  790. #define __TSTORM_FCOE_AG_CONTEXT_AUX6_CF_SHIFT 6
  791. #define __TSTORM_FCOE_AG_CONTEXT_AUX7_CF (0x3<<8)
  792. #define __TSTORM_FCOE_AG_CONTEXT_AUX7_CF_SHIFT 8
  793. #define __TSTORM_FCOE_AG_CONTEXT_AUX7_FLAG (0x1<<10)
  794. #define __TSTORM_FCOE_AG_CONTEXT_AUX7_FLAG_SHIFT 10
  795. #define __TSTORM_FCOE_AG_CONTEXT_QUEUE0_FLUSH_CF_EN (0x1<<11)
  796. #define __TSTORM_FCOE_AG_CONTEXT_QUEUE0_FLUSH_CF_EN_SHIFT 11
  797. #define TSTORM_FCOE_AG_CONTEXT_AUX4_CF_EN (0x1<<12)
  798. #define TSTORM_FCOE_AG_CONTEXT_AUX4_CF_EN_SHIFT 12
  799. #define TSTORM_FCOE_AG_CONTEXT_AUX5_CF_EN (0x1<<13)
  800. #define TSTORM_FCOE_AG_CONTEXT_AUX5_CF_EN_SHIFT 13
  801. #define TSTORM_FCOE_AG_CONTEXT_AUX6_CF_EN (0x1<<14)
  802. #define TSTORM_FCOE_AG_CONTEXT_AUX6_CF_EN_SHIFT 14
  803. #define TSTORM_FCOE_AG_CONTEXT_AUX7_CF_EN (0x1<<15)
  804. #define TSTORM_FCOE_AG_CONTEXT_AUX7_CF_EN_SHIFT 15
  805. #elif defined(__LITTLE_ENDIAN)
  806. u16 agg_vars2;
  807. #define __TSTORM_FCOE_AG_CONTEXT_AUX5_FLAG (0x1<<0)
  808. #define __TSTORM_FCOE_AG_CONTEXT_AUX5_FLAG_SHIFT 0
  809. #define __TSTORM_FCOE_AG_CONTEXT_AUX6_FLAG (0x1<<1)
  810. #define __TSTORM_FCOE_AG_CONTEXT_AUX6_FLAG_SHIFT 1
  811. #define __TSTORM_FCOE_AG_CONTEXT_AUX4_CF (0x3<<2)
  812. #define __TSTORM_FCOE_AG_CONTEXT_AUX4_CF_SHIFT 2
  813. #define __TSTORM_FCOE_AG_CONTEXT_AUX5_CF (0x3<<4)
  814. #define __TSTORM_FCOE_AG_CONTEXT_AUX5_CF_SHIFT 4
  815. #define __TSTORM_FCOE_AG_CONTEXT_AUX6_CF (0x3<<6)
  816. #define __TSTORM_FCOE_AG_CONTEXT_AUX6_CF_SHIFT 6
  817. #define __TSTORM_FCOE_AG_CONTEXT_AUX7_CF (0x3<<8)
  818. #define __TSTORM_FCOE_AG_CONTEXT_AUX7_CF_SHIFT 8
  819. #define __TSTORM_FCOE_AG_CONTEXT_AUX7_FLAG (0x1<<10)
  820. #define __TSTORM_FCOE_AG_CONTEXT_AUX7_FLAG_SHIFT 10
  821. #define __TSTORM_FCOE_AG_CONTEXT_QUEUE0_FLUSH_CF_EN (0x1<<11)
  822. #define __TSTORM_FCOE_AG_CONTEXT_QUEUE0_FLUSH_CF_EN_SHIFT 11
  823. #define TSTORM_FCOE_AG_CONTEXT_AUX4_CF_EN (0x1<<12)
  824. #define TSTORM_FCOE_AG_CONTEXT_AUX4_CF_EN_SHIFT 12
  825. #define TSTORM_FCOE_AG_CONTEXT_AUX5_CF_EN (0x1<<13)
  826. #define TSTORM_FCOE_AG_CONTEXT_AUX5_CF_EN_SHIFT 13
  827. #define TSTORM_FCOE_AG_CONTEXT_AUX6_CF_EN (0x1<<14)
  828. #define TSTORM_FCOE_AG_CONTEXT_AUX6_CF_EN_SHIFT 14
  829. #define TSTORM_FCOE_AG_CONTEXT_AUX7_CF_EN (0x1<<15)
  830. #define TSTORM_FCOE_AG_CONTEXT_AUX7_CF_EN_SHIFT 15
  831. u16 __agg_val4;
  832. #endif
  833. struct tstorm_fcoe_extra_ag_context_section __extra_section;
  834. };
  835. /*
  836. * The tcp aggregative context section of Tstorm
  837. */
  838. struct tstorm_tcp_tcp_ag_context_section {
  839. u32 __agg_val1;
  840. #if defined(__BIG_ENDIAN)
  841. u8 __tcp_agg_vars2;
  842. u8 __agg_val3;
  843. u16 __agg_val2;
  844. #elif defined(__LITTLE_ENDIAN)
  845. u16 __agg_val2;
  846. u8 __agg_val3;
  847. u8 __tcp_agg_vars2;
  848. #endif
  849. #if defined(__BIG_ENDIAN)
  850. u16 __agg_val5;
  851. u8 __agg_val6;
  852. u8 __tcp_agg_vars3;
  853. #elif defined(__LITTLE_ENDIAN)
  854. u8 __tcp_agg_vars3;
  855. u8 __agg_val6;
  856. u16 __agg_val5;
  857. #endif
  858. u32 snd_nxt;
  859. u32 rtt_seq;
  860. u32 rtt_time;
  861. u32 wnd_right_edge_local;
  862. u32 wnd_right_edge;
  863. u32 tcp_agg_vars1;
  864. #define TSTORM_TCP_TCP_AG_CONTEXT_SECTION_FIN_SENT_FLAG (0x1<<0)
  865. #define TSTORM_TCP_TCP_AG_CONTEXT_SECTION_FIN_SENT_FLAG_SHIFT 0
  866. #define TSTORM_TCP_TCP_AG_CONTEXT_SECTION_LAST_PACKET_FIN_FLAG (0x1<<1)
  867. #define TSTORM_TCP_TCP_AG_CONTEXT_SECTION_LAST_PACKET_FIN_FLAG_SHIFT 1
  868. #define TSTORM_TCP_TCP_AG_CONTEXT_SECTION_WND_UPD_CF (0x3<<2)
  869. #define TSTORM_TCP_TCP_AG_CONTEXT_SECTION_WND_UPD_CF_SHIFT 2
  870. #define TSTORM_TCP_TCP_AG_CONTEXT_SECTION_TIMEOUT_CF (0x3<<4)
  871. #define TSTORM_TCP_TCP_AG_CONTEXT_SECTION_TIMEOUT_CF_SHIFT 4
  872. #define TSTORM_TCP_TCP_AG_CONTEXT_SECTION_WND_UPD_CF_EN (0x1<<6)
  873. #define TSTORM_TCP_TCP_AG_CONTEXT_SECTION_WND_UPD_CF_EN_SHIFT 6
  874. #define TSTORM_TCP_TCP_AG_CONTEXT_SECTION_TIMEOUT_CF_EN (0x1<<7)
  875. #define TSTORM_TCP_TCP_AG_CONTEXT_SECTION_TIMEOUT_CF_EN_SHIFT 7
  876. #define TSTORM_TCP_TCP_AG_CONTEXT_SECTION_RETRANSMIT_SEQ_EN (0x1<<8)
  877. #define TSTORM_TCP_TCP_AG_CONTEXT_SECTION_RETRANSMIT_SEQ_EN_SHIFT 8
  878. #define TSTORM_TCP_TCP_AG_CONTEXT_SECTION_SND_NXT_EN (0x1<<9)
  879. #define TSTORM_TCP_TCP_AG_CONTEXT_SECTION_SND_NXT_EN_SHIFT 9
  880. #define TSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX1_FLAG (0x1<<10)
  881. #define TSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX1_FLAG_SHIFT 10
  882. #define TSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX2_FLAG (0x1<<11)
  883. #define TSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX2_FLAG_SHIFT 11
  884. #define TSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX1_CF_EN (0x1<<12)
  885. #define TSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX1_CF_EN_SHIFT 12
  886. #define TSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX2_CF_EN (0x1<<13)
  887. #define TSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX2_CF_EN_SHIFT 13
  888. #define TSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX1_CF (0x3<<14)
  889. #define TSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX1_CF_SHIFT 14
  890. #define TSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX2_CF (0x3<<16)
  891. #define TSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX2_CF_SHIFT 16
  892. #define TSTORM_TCP_TCP_AG_CONTEXT_SECTION_TX_BLOCKED (0x1<<18)
  893. #define TSTORM_TCP_TCP_AG_CONTEXT_SECTION_TX_BLOCKED_SHIFT 18
  894. #define __TSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX10_CF_EN (0x1<<19)
  895. #define __TSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX10_CF_EN_SHIFT 19
  896. #define __TSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX11_CF_EN (0x1<<20)
  897. #define __TSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX11_CF_EN_SHIFT 20
  898. #define __TSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX12_CF_EN (0x1<<21)
  899. #define __TSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX12_CF_EN_SHIFT 21
  900. #define __TSTORM_TCP_TCP_AG_CONTEXT_SECTION_RESERVED1 (0x3<<22)
  901. #define __TSTORM_TCP_TCP_AG_CONTEXT_SECTION_RESERVED1_SHIFT 22
  902. #define TSTORM_TCP_TCP_AG_CONTEXT_SECTION_RETRANSMIT_PEND_SEQ (0xF<<24)
  903. #define TSTORM_TCP_TCP_AG_CONTEXT_SECTION_RETRANSMIT_PEND_SEQ_SHIFT 24
  904. #define TSTORM_TCP_TCP_AG_CONTEXT_SECTION_RETRANSMIT_DONE_SEQ (0xF<<28)
  905. #define TSTORM_TCP_TCP_AG_CONTEXT_SECTION_RETRANSMIT_DONE_SEQ_SHIFT 28
  906. u32 snd_max;
  907. u32 snd_una;
  908. u32 __reserved2;
  909. };
  910. /*
  911. * The iscsi aggregative context of Tstorm
  912. */
  913. struct tstorm_iscsi_ag_context {
  914. #if defined(__BIG_ENDIAN)
  915. u16 ulp_credit;
  916. u8 agg_vars1;
  917. #define TSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM0 (0x1<<0)
  918. #define TSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM0_SHIFT 0
  919. #define TSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM1 (0x1<<1)
  920. #define TSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM1_SHIFT 1
  921. #define TSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM2 (0x1<<2)
  922. #define TSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM2_SHIFT 2
  923. #define TSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM3 (0x1<<3)
  924. #define TSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM3_SHIFT 3
  925. #define __TSTORM_ISCSI_AG_CONTEXT_QUEUES_FLUSH_Q0_CF (0x3<<4)
  926. #define __TSTORM_ISCSI_AG_CONTEXT_QUEUES_FLUSH_Q0_CF_SHIFT 4
  927. #define __TSTORM_ISCSI_AG_CONTEXT_AUX3_FLAG (0x1<<6)
  928. #define __TSTORM_ISCSI_AG_CONTEXT_AUX3_FLAG_SHIFT 6
  929. #define __TSTORM_ISCSI_AG_CONTEXT_ACK_ON_FIN_SENT_FLAG (0x1<<7)
  930. #define __TSTORM_ISCSI_AG_CONTEXT_ACK_ON_FIN_SENT_FLAG_SHIFT 7
  931. u8 state;
  932. #elif defined(__LITTLE_ENDIAN)
  933. u8 state;
  934. u8 agg_vars1;
  935. #define TSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM0 (0x1<<0)
  936. #define TSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM0_SHIFT 0
  937. #define TSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM1 (0x1<<1)
  938. #define TSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM1_SHIFT 1
  939. #define TSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM2 (0x1<<2)
  940. #define TSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM2_SHIFT 2
  941. #define TSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM3 (0x1<<3)
  942. #define TSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM3_SHIFT 3
  943. #define __TSTORM_ISCSI_AG_CONTEXT_QUEUES_FLUSH_Q0_CF (0x3<<4)
  944. #define __TSTORM_ISCSI_AG_CONTEXT_QUEUES_FLUSH_Q0_CF_SHIFT 4
  945. #define __TSTORM_ISCSI_AG_CONTEXT_AUX3_FLAG (0x1<<6)
  946. #define __TSTORM_ISCSI_AG_CONTEXT_AUX3_FLAG_SHIFT 6
  947. #define __TSTORM_ISCSI_AG_CONTEXT_ACK_ON_FIN_SENT_FLAG (0x1<<7)
  948. #define __TSTORM_ISCSI_AG_CONTEXT_ACK_ON_FIN_SENT_FLAG_SHIFT 7
  949. u16 ulp_credit;
  950. #endif
  951. #if defined(__BIG_ENDIAN)
  952. u16 __agg_val4;
  953. u16 agg_vars2;
  954. #define __TSTORM_ISCSI_AG_CONTEXT_MSL_TIMER_SET_FLAG (0x1<<0)
  955. #define __TSTORM_ISCSI_AG_CONTEXT_MSL_TIMER_SET_FLAG_SHIFT 0
  956. #define __TSTORM_ISCSI_AG_CONTEXT_FIN_SENT_FIRST_FLAG (0x1<<1)
  957. #define __TSTORM_ISCSI_AG_CONTEXT_FIN_SENT_FIRST_FLAG_SHIFT 1
  958. #define __TSTORM_ISCSI_AG_CONTEXT_RST_SENT_CF (0x3<<2)
  959. #define __TSTORM_ISCSI_AG_CONTEXT_RST_SENT_CF_SHIFT 2
  960. #define __TSTORM_ISCSI_AG_CONTEXT_WAKEUP_CALL_CF (0x3<<4)
  961. #define __TSTORM_ISCSI_AG_CONTEXT_WAKEUP_CALL_CF_SHIFT 4
  962. #define __TSTORM_ISCSI_AG_CONTEXT_AUX6_CF (0x3<<6)
  963. #define __TSTORM_ISCSI_AG_CONTEXT_AUX6_CF_SHIFT 6
  964. #define __TSTORM_ISCSI_AG_CONTEXT_AUX7_CF (0x3<<8)
  965. #define __TSTORM_ISCSI_AG_CONTEXT_AUX7_CF_SHIFT 8
  966. #define __TSTORM_ISCSI_AG_CONTEXT_AUX7_FLAG (0x1<<10)
  967. #define __TSTORM_ISCSI_AG_CONTEXT_AUX7_FLAG_SHIFT 10
  968. #define __TSTORM_ISCSI_AG_CONTEXT_QUEUES_FLUSH_Q0_CF_EN (0x1<<11)
  969. #define __TSTORM_ISCSI_AG_CONTEXT_QUEUES_FLUSH_Q0_CF_EN_SHIFT 11
  970. #define __TSTORM_ISCSI_AG_CONTEXT_RST_SENT_CF_EN (0x1<<12)
  971. #define __TSTORM_ISCSI_AG_CONTEXT_RST_SENT_CF_EN_SHIFT 12
  972. #define __TSTORM_ISCSI_AG_CONTEXT_WAKEUP_CALL_CF_EN (0x1<<13)
  973. #define __TSTORM_ISCSI_AG_CONTEXT_WAKEUP_CALL_CF_EN_SHIFT 13
  974. #define TSTORM_ISCSI_AG_CONTEXT_AUX6_CF_EN (0x1<<14)
  975. #define TSTORM_ISCSI_AG_CONTEXT_AUX6_CF_EN_SHIFT 14
  976. #define TSTORM_ISCSI_AG_CONTEXT_AUX7_CF_EN (0x1<<15)
  977. #define TSTORM_ISCSI_AG_CONTEXT_AUX7_CF_EN_SHIFT 15
  978. #elif defined(__LITTLE_ENDIAN)
  979. u16 agg_vars2;
  980. #define __TSTORM_ISCSI_AG_CONTEXT_MSL_TIMER_SET_FLAG (0x1<<0)
  981. #define __TSTORM_ISCSI_AG_CONTEXT_MSL_TIMER_SET_FLAG_SHIFT 0
  982. #define __TSTORM_ISCSI_AG_CONTEXT_FIN_SENT_FIRST_FLAG (0x1<<1)
  983. #define __TSTORM_ISCSI_AG_CONTEXT_FIN_SENT_FIRST_FLAG_SHIFT 1
  984. #define __TSTORM_ISCSI_AG_CONTEXT_RST_SENT_CF (0x3<<2)
  985. #define __TSTORM_ISCSI_AG_CONTEXT_RST_SENT_CF_SHIFT 2
  986. #define __TSTORM_ISCSI_AG_CONTEXT_WAKEUP_CALL_CF (0x3<<4)
  987. #define __TSTORM_ISCSI_AG_CONTEXT_WAKEUP_CALL_CF_SHIFT 4
  988. #define __TSTORM_ISCSI_AG_CONTEXT_AUX6_CF (0x3<<6)
  989. #define __TSTORM_ISCSI_AG_CONTEXT_AUX6_CF_SHIFT 6
  990. #define __TSTORM_ISCSI_AG_CONTEXT_AUX7_CF (0x3<<8)
  991. #define __TSTORM_ISCSI_AG_CONTEXT_AUX7_CF_SHIFT 8
  992. #define __TSTORM_ISCSI_AG_CONTEXT_AUX7_FLAG (0x1<<10)
  993. #define __TSTORM_ISCSI_AG_CONTEXT_AUX7_FLAG_SHIFT 10
  994. #define __TSTORM_ISCSI_AG_CONTEXT_QUEUES_FLUSH_Q0_CF_EN (0x1<<11)
  995. #define __TSTORM_ISCSI_AG_CONTEXT_QUEUES_FLUSH_Q0_CF_EN_SHIFT 11
  996. #define __TSTORM_ISCSI_AG_CONTEXT_RST_SENT_CF_EN (0x1<<12)
  997. #define __TSTORM_ISCSI_AG_CONTEXT_RST_SENT_CF_EN_SHIFT 12
  998. #define __TSTORM_ISCSI_AG_CONTEXT_WAKEUP_CALL_CF_EN (0x1<<13)
  999. #define __TSTORM_ISCSI_AG_CONTEXT_WAKEUP_CALL_CF_EN_SHIFT 13
  1000. #define TSTORM_ISCSI_AG_CONTEXT_AUX6_CF_EN (0x1<<14)
  1001. #define TSTORM_ISCSI_AG_CONTEXT_AUX6_CF_EN_SHIFT 14
  1002. #define TSTORM_ISCSI_AG_CONTEXT_AUX7_CF_EN (0x1<<15)
  1003. #define TSTORM_ISCSI_AG_CONTEXT_AUX7_CF_EN_SHIFT 15
  1004. u16 __agg_val4;
  1005. #endif
  1006. struct tstorm_tcp_tcp_ag_context_section tcp;
  1007. };
  1008. /*
  1009. * The fcoe aggregative context of Ustorm
  1010. */
  1011. struct ustorm_fcoe_ag_context {
  1012. #if defined(__BIG_ENDIAN)
  1013. u8 __aux_counter_flags;
  1014. u8 agg_vars2;
  1015. #define USTORM_FCOE_AG_CONTEXT_TX_CF (0x3<<0)
  1016. #define USTORM_FCOE_AG_CONTEXT_TX_CF_SHIFT 0
  1017. #define __USTORM_FCOE_AG_CONTEXT_TIMER_CF (0x3<<2)
  1018. #define __USTORM_FCOE_AG_CONTEXT_TIMER_CF_SHIFT 2
  1019. #define USTORM_FCOE_AG_CONTEXT_AGG_MISC4_RULE (0x7<<4)
  1020. #define USTORM_FCOE_AG_CONTEXT_AGG_MISC4_RULE_SHIFT 4
  1021. #define __USTORM_FCOE_AG_CONTEXT_AGG_VAL2_MASK (0x1<<7)
  1022. #define __USTORM_FCOE_AG_CONTEXT_AGG_VAL2_MASK_SHIFT 7
  1023. u8 agg_vars1;
  1024. #define __USTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM0 (0x1<<0)
  1025. #define __USTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM0_SHIFT 0
  1026. #define USTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM1 (0x1<<1)
  1027. #define USTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM1_SHIFT 1
  1028. #define USTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM2 (0x1<<2)
  1029. #define USTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM2_SHIFT 2
  1030. #define USTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM3 (0x1<<3)
  1031. #define USTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM3_SHIFT 3
  1032. #define USTORM_FCOE_AG_CONTEXT_INV_CF (0x3<<4)
  1033. #define USTORM_FCOE_AG_CONTEXT_INV_CF_SHIFT 4
  1034. #define USTORM_FCOE_AG_CONTEXT_COMPLETION_CF (0x3<<6)
  1035. #define USTORM_FCOE_AG_CONTEXT_COMPLETION_CF_SHIFT 6
  1036. u8 state;
  1037. #elif defined(__LITTLE_ENDIAN)
  1038. u8 state;
  1039. u8 agg_vars1;
  1040. #define __USTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM0 (0x1<<0)
  1041. #define __USTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM0_SHIFT 0
  1042. #define USTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM1 (0x1<<1)
  1043. #define USTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM1_SHIFT 1
  1044. #define USTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM2 (0x1<<2)
  1045. #define USTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM2_SHIFT 2
  1046. #define USTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM3 (0x1<<3)
  1047. #define USTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM3_SHIFT 3
  1048. #define USTORM_FCOE_AG_CONTEXT_INV_CF (0x3<<4)
  1049. #define USTORM_FCOE_AG_CONTEXT_INV_CF_SHIFT 4
  1050. #define USTORM_FCOE_AG_CONTEXT_COMPLETION_CF (0x3<<6)
  1051. #define USTORM_FCOE_AG_CONTEXT_COMPLETION_CF_SHIFT 6
  1052. u8 agg_vars2;
  1053. #define USTORM_FCOE_AG_CONTEXT_TX_CF (0x3<<0)
  1054. #define USTORM_FCOE_AG_CONTEXT_TX_CF_SHIFT 0
  1055. #define __USTORM_FCOE_AG_CONTEXT_TIMER_CF (0x3<<2)
  1056. #define __USTORM_FCOE_AG_CONTEXT_TIMER_CF_SHIFT 2
  1057. #define USTORM_FCOE_AG_CONTEXT_AGG_MISC4_RULE (0x7<<4)
  1058. #define USTORM_FCOE_AG_CONTEXT_AGG_MISC4_RULE_SHIFT 4
  1059. #define __USTORM_FCOE_AG_CONTEXT_AGG_VAL2_MASK (0x1<<7)
  1060. #define __USTORM_FCOE_AG_CONTEXT_AGG_VAL2_MASK_SHIFT 7
  1061. u8 __aux_counter_flags;
  1062. #endif
  1063. #if defined(__BIG_ENDIAN)
  1064. u8 cdu_usage;
  1065. u8 agg_misc2;
  1066. u16 pbf_tx_seq_ack;
  1067. #elif defined(__LITTLE_ENDIAN)
  1068. u16 pbf_tx_seq_ack;
  1069. u8 agg_misc2;
  1070. u8 cdu_usage;
  1071. #endif
  1072. u32 agg_misc4;
  1073. #if defined(__BIG_ENDIAN)
  1074. u8 agg_val3_th;
  1075. u8 agg_val3;
  1076. u16 agg_misc3;
  1077. #elif defined(__LITTLE_ENDIAN)
  1078. u16 agg_misc3;
  1079. u8 agg_val3;
  1080. u8 agg_val3_th;
  1081. #endif
  1082. u32 expired_task_id;
  1083. u32 agg_misc4_th;
  1084. #if defined(__BIG_ENDIAN)
  1085. u16 cq_prod;
  1086. u16 cq_cons;
  1087. #elif defined(__LITTLE_ENDIAN)
  1088. u16 cq_cons;
  1089. u16 cq_prod;
  1090. #endif
  1091. #if defined(__BIG_ENDIAN)
  1092. u16 __reserved2;
  1093. u8 decision_rules;
  1094. #define USTORM_FCOE_AG_CONTEXT_CQ_DEC_RULE (0x7<<0)
  1095. #define USTORM_FCOE_AG_CONTEXT_CQ_DEC_RULE_SHIFT 0
  1096. #define __USTORM_FCOE_AG_CONTEXT_AGG_VAL3_RULE (0x7<<3)
  1097. #define __USTORM_FCOE_AG_CONTEXT_AGG_VAL3_RULE_SHIFT 3
  1098. #define USTORM_FCOE_AG_CONTEXT_CQ_ARM_N_FLAG (0x1<<6)
  1099. #define USTORM_FCOE_AG_CONTEXT_CQ_ARM_N_FLAG_SHIFT 6
  1100. #define __USTORM_FCOE_AG_CONTEXT_RESERVED1 (0x1<<7)
  1101. #define __USTORM_FCOE_AG_CONTEXT_RESERVED1_SHIFT 7
  1102. u8 decision_rule_enable_bits;
  1103. #define __USTORM_FCOE_AG_CONTEXT_RESERVED_INV_CF_EN (0x1<<0)
  1104. #define __USTORM_FCOE_AG_CONTEXT_RESERVED_INV_CF_EN_SHIFT 0
  1105. #define USTORM_FCOE_AG_CONTEXT_COMPLETION_CF_EN (0x1<<1)
  1106. #define USTORM_FCOE_AG_CONTEXT_COMPLETION_CF_EN_SHIFT 1
  1107. #define USTORM_FCOE_AG_CONTEXT_TX_CF_EN (0x1<<2)
  1108. #define USTORM_FCOE_AG_CONTEXT_TX_CF_EN_SHIFT 2
  1109. #define __USTORM_FCOE_AG_CONTEXT_TIMER_CF_EN (0x1<<3)
  1110. #define __USTORM_FCOE_AG_CONTEXT_TIMER_CF_EN_SHIFT 3
  1111. #define __USTORM_FCOE_AG_CONTEXT_AUX1_CF_EN (0x1<<4)
  1112. #define __USTORM_FCOE_AG_CONTEXT_AUX1_CF_EN_SHIFT 4
  1113. #define __USTORM_FCOE_AG_CONTEXT_QUEUE0_CF_EN (0x1<<5)
  1114. #define __USTORM_FCOE_AG_CONTEXT_QUEUE0_CF_EN_SHIFT 5
  1115. #define __USTORM_FCOE_AG_CONTEXT_AUX3_CF_EN (0x1<<6)
  1116. #define __USTORM_FCOE_AG_CONTEXT_AUX3_CF_EN_SHIFT 6
  1117. #define __USTORM_FCOE_AG_CONTEXT_DQ_CF_EN (0x1<<7)
  1118. #define __USTORM_FCOE_AG_CONTEXT_DQ_CF_EN_SHIFT 7
  1119. #elif defined(__LITTLE_ENDIAN)
  1120. u8 decision_rule_enable_bits;
  1121. #define __USTORM_FCOE_AG_CONTEXT_RESERVED_INV_CF_EN (0x1<<0)
  1122. #define __USTORM_FCOE_AG_CONTEXT_RESERVED_INV_CF_EN_SHIFT 0
  1123. #define USTORM_FCOE_AG_CONTEXT_COMPLETION_CF_EN (0x1<<1)
  1124. #define USTORM_FCOE_AG_CONTEXT_COMPLETION_CF_EN_SHIFT 1
  1125. #define USTORM_FCOE_AG_CONTEXT_TX_CF_EN (0x1<<2)
  1126. #define USTORM_FCOE_AG_CONTEXT_TX_CF_EN_SHIFT 2
  1127. #define __USTORM_FCOE_AG_CONTEXT_TIMER_CF_EN (0x1<<3)
  1128. #define __USTORM_FCOE_AG_CONTEXT_TIMER_CF_EN_SHIFT 3
  1129. #define __USTORM_FCOE_AG_CONTEXT_AUX1_CF_EN (0x1<<4)
  1130. #define __USTORM_FCOE_AG_CONTEXT_AUX1_CF_EN_SHIFT 4
  1131. #define __USTORM_FCOE_AG_CONTEXT_QUEUE0_CF_EN (0x1<<5)
  1132. #define __USTORM_FCOE_AG_CONTEXT_QUEUE0_CF_EN_SHIFT 5
  1133. #define __USTORM_FCOE_AG_CONTEXT_AUX3_CF_EN (0x1<<6)
  1134. #define __USTORM_FCOE_AG_CONTEXT_AUX3_CF_EN_SHIFT 6
  1135. #define __USTORM_FCOE_AG_CONTEXT_DQ_CF_EN (0x1<<7)
  1136. #define __USTORM_FCOE_AG_CONTEXT_DQ_CF_EN_SHIFT 7
  1137. u8 decision_rules;
  1138. #define USTORM_FCOE_AG_CONTEXT_CQ_DEC_RULE (0x7<<0)
  1139. #define USTORM_FCOE_AG_CONTEXT_CQ_DEC_RULE_SHIFT 0
  1140. #define __USTORM_FCOE_AG_CONTEXT_AGG_VAL3_RULE (0x7<<3)
  1141. #define __USTORM_FCOE_AG_CONTEXT_AGG_VAL3_RULE_SHIFT 3
  1142. #define USTORM_FCOE_AG_CONTEXT_CQ_ARM_N_FLAG (0x1<<6)
  1143. #define USTORM_FCOE_AG_CONTEXT_CQ_ARM_N_FLAG_SHIFT 6
  1144. #define __USTORM_FCOE_AG_CONTEXT_RESERVED1 (0x1<<7)
  1145. #define __USTORM_FCOE_AG_CONTEXT_RESERVED1_SHIFT 7
  1146. u16 __reserved2;
  1147. #endif
  1148. };
  1149. /*
  1150. * The iscsi aggregative context of Ustorm
  1151. */
  1152. struct ustorm_iscsi_ag_context {
  1153. #if defined(__BIG_ENDIAN)
  1154. u8 __aux_counter_flags;
  1155. u8 agg_vars2;
  1156. #define USTORM_ISCSI_AG_CONTEXT_TX_CF (0x3<<0)
  1157. #define USTORM_ISCSI_AG_CONTEXT_TX_CF_SHIFT 0
  1158. #define __USTORM_ISCSI_AG_CONTEXT_TIMER_CF (0x3<<2)
  1159. #define __USTORM_ISCSI_AG_CONTEXT_TIMER_CF_SHIFT 2
  1160. #define USTORM_ISCSI_AG_CONTEXT_AGG_MISC4_RULE (0x7<<4)
  1161. #define USTORM_ISCSI_AG_CONTEXT_AGG_MISC4_RULE_SHIFT 4
  1162. #define __USTORM_ISCSI_AG_CONTEXT_AGG_VAL2_MASK (0x1<<7)
  1163. #define __USTORM_ISCSI_AG_CONTEXT_AGG_VAL2_MASK_SHIFT 7
  1164. u8 agg_vars1;
  1165. #define __USTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM0 (0x1<<0)
  1166. #define __USTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM0_SHIFT 0
  1167. #define USTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM1 (0x1<<1)
  1168. #define USTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM1_SHIFT 1
  1169. #define USTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM2 (0x1<<2)
  1170. #define USTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM2_SHIFT 2
  1171. #define USTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM3 (0x1<<3)
  1172. #define USTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM3_SHIFT 3
  1173. #define USTORM_ISCSI_AG_CONTEXT_INV_CF (0x3<<4)
  1174. #define USTORM_ISCSI_AG_CONTEXT_INV_CF_SHIFT 4
  1175. #define USTORM_ISCSI_AG_CONTEXT_COMPLETION_CF (0x3<<6)
  1176. #define USTORM_ISCSI_AG_CONTEXT_COMPLETION_CF_SHIFT 6
  1177. u8 state;
  1178. #elif defined(__LITTLE_ENDIAN)
  1179. u8 state;
  1180. u8 agg_vars1;
  1181. #define __USTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM0 (0x1<<0)
  1182. #define __USTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM0_SHIFT 0
  1183. #define USTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM1 (0x1<<1)
  1184. #define USTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM1_SHIFT 1
  1185. #define USTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM2 (0x1<<2)
  1186. #define USTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM2_SHIFT 2
  1187. #define USTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM3 (0x1<<3)
  1188. #define USTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM3_SHIFT 3
  1189. #define USTORM_ISCSI_AG_CONTEXT_INV_CF (0x3<<4)
  1190. #define USTORM_ISCSI_AG_CONTEXT_INV_CF_SHIFT 4
  1191. #define USTORM_ISCSI_AG_CONTEXT_COMPLETION_CF (0x3<<6)
  1192. #define USTORM_ISCSI_AG_CONTEXT_COMPLETION_CF_SHIFT 6
  1193. u8 agg_vars2;
  1194. #define USTORM_ISCSI_AG_CONTEXT_TX_CF (0x3<<0)
  1195. #define USTORM_ISCSI_AG_CONTEXT_TX_CF_SHIFT 0
  1196. #define __USTORM_ISCSI_AG_CONTEXT_TIMER_CF (0x3<<2)
  1197. #define __USTORM_ISCSI_AG_CONTEXT_TIMER_CF_SHIFT 2
  1198. #define USTORM_ISCSI_AG_CONTEXT_AGG_MISC4_RULE (0x7<<4)
  1199. #define USTORM_ISCSI_AG_CONTEXT_AGG_MISC4_RULE_SHIFT 4
  1200. #define __USTORM_ISCSI_AG_CONTEXT_AGG_VAL2_MASK (0x1<<7)
  1201. #define __USTORM_ISCSI_AG_CONTEXT_AGG_VAL2_MASK_SHIFT 7
  1202. u8 __aux_counter_flags;
  1203. #endif
  1204. #if defined(__BIG_ENDIAN)
  1205. u8 cdu_usage;
  1206. u8 agg_misc2;
  1207. u16 __cq_local_comp_itt_val;
  1208. #elif defined(__LITTLE_ENDIAN)
  1209. u16 __cq_local_comp_itt_val;
  1210. u8 agg_misc2;
  1211. u8 cdu_usage;
  1212. #endif
  1213. u32 agg_misc4;
  1214. #if defined(__BIG_ENDIAN)
  1215. u8 agg_val3_th;
  1216. u8 agg_val3;
  1217. u16 agg_misc3;
  1218. #elif defined(__LITTLE_ENDIAN)
  1219. u16 agg_misc3;
  1220. u8 agg_val3;
  1221. u8 agg_val3_th;
  1222. #endif
  1223. u32 agg_val1;
  1224. u32 agg_misc4_th;
  1225. #if defined(__BIG_ENDIAN)
  1226. u16 agg_val2_th;
  1227. u16 agg_val2;
  1228. #elif defined(__LITTLE_ENDIAN)
  1229. u16 agg_val2;
  1230. u16 agg_val2_th;
  1231. #endif
  1232. #if defined(__BIG_ENDIAN)
  1233. u16 __reserved2;
  1234. u8 decision_rules;
  1235. #define USTORM_ISCSI_AG_CONTEXT_AGG_VAL2_RULE (0x7<<0)
  1236. #define USTORM_ISCSI_AG_CONTEXT_AGG_VAL2_RULE_SHIFT 0
  1237. #define __USTORM_ISCSI_AG_CONTEXT_AGG_VAL3_RULE (0x7<<3)
  1238. #define __USTORM_ISCSI_AG_CONTEXT_AGG_VAL3_RULE_SHIFT 3
  1239. #define USTORM_ISCSI_AG_CONTEXT_AGG_VAL2_ARM_N_FLAG (0x1<<6)
  1240. #define USTORM_ISCSI_AG_CONTEXT_AGG_VAL2_ARM_N_FLAG_SHIFT 6
  1241. #define __USTORM_ISCSI_AG_CONTEXT_RESERVED1 (0x1<<7)
  1242. #define __USTORM_ISCSI_AG_CONTEXT_RESERVED1_SHIFT 7
  1243. u8 decision_rule_enable_bits;
  1244. #define USTORM_ISCSI_AG_CONTEXT_INV_CF_EN (0x1<<0)
  1245. #define USTORM_ISCSI_AG_CONTEXT_INV_CF_EN_SHIFT 0
  1246. #define USTORM_ISCSI_AG_CONTEXT_COMPLETION_CF_EN (0x1<<1)
  1247. #define USTORM_ISCSI_AG_CONTEXT_COMPLETION_CF_EN_SHIFT 1
  1248. #define USTORM_ISCSI_AG_CONTEXT_TX_CF_EN (0x1<<2)
  1249. #define USTORM_ISCSI_AG_CONTEXT_TX_CF_EN_SHIFT 2
  1250. #define __USTORM_ISCSI_AG_CONTEXT_TIMER_CF_EN (0x1<<3)
  1251. #define __USTORM_ISCSI_AG_CONTEXT_TIMER_CF_EN_SHIFT 3
  1252. #define __USTORM_ISCSI_AG_CONTEXT_CQ_LOCAL_COMP_CF_EN (0x1<<4)
  1253. #define __USTORM_ISCSI_AG_CONTEXT_CQ_LOCAL_COMP_CF_EN_SHIFT 4
  1254. #define __USTORM_ISCSI_AG_CONTEXT_QUEUES_FLUSH_Q0_CF_EN (0x1<<5)
  1255. #define __USTORM_ISCSI_AG_CONTEXT_QUEUES_FLUSH_Q0_CF_EN_SHIFT 5
  1256. #define __USTORM_ISCSI_AG_CONTEXT_AUX3_CF_EN (0x1<<6)
  1257. #define __USTORM_ISCSI_AG_CONTEXT_AUX3_CF_EN_SHIFT 6
  1258. #define __USTORM_ISCSI_AG_CONTEXT_DQ_CF_EN (0x1<<7)
  1259. #define __USTORM_ISCSI_AG_CONTEXT_DQ_CF_EN_SHIFT 7
  1260. #elif defined(__LITTLE_ENDIAN)
  1261. u8 decision_rule_enable_bits;
  1262. #define USTORM_ISCSI_AG_CONTEXT_INV_CF_EN (0x1<<0)
  1263. #define USTORM_ISCSI_AG_CONTEXT_INV_CF_EN_SHIFT 0
  1264. #define USTORM_ISCSI_AG_CONTEXT_COMPLETION_CF_EN (0x1<<1)
  1265. #define USTORM_ISCSI_AG_CONTEXT_COMPLETION_CF_EN_SHIFT 1
  1266. #define USTORM_ISCSI_AG_CONTEXT_TX_CF_EN (0x1<<2)
  1267. #define USTORM_ISCSI_AG_CONTEXT_TX_CF_EN_SHIFT 2
  1268. #define __USTORM_ISCSI_AG_CONTEXT_TIMER_CF_EN (0x1<<3)
  1269. #define __USTORM_ISCSI_AG_CONTEXT_TIMER_CF_EN_SHIFT 3
  1270. #define __USTORM_ISCSI_AG_CONTEXT_CQ_LOCAL_COMP_CF_EN (0x1<<4)
  1271. #define __USTORM_ISCSI_AG_CONTEXT_CQ_LOCAL_COMP_CF_EN_SHIFT 4
  1272. #define __USTORM_ISCSI_AG_CONTEXT_QUEUES_FLUSH_Q0_CF_EN (0x1<<5)
  1273. #define __USTORM_ISCSI_AG_CONTEXT_QUEUES_FLUSH_Q0_CF_EN_SHIFT 5
  1274. #define __USTORM_ISCSI_AG_CONTEXT_AUX3_CF_EN (0x1<<6)
  1275. #define __USTORM_ISCSI_AG_CONTEXT_AUX3_CF_EN_SHIFT 6
  1276. #define __USTORM_ISCSI_AG_CONTEXT_DQ_CF_EN (0x1<<7)
  1277. #define __USTORM_ISCSI_AG_CONTEXT_DQ_CF_EN_SHIFT 7
  1278. u8 decision_rules;
  1279. #define USTORM_ISCSI_AG_CONTEXT_AGG_VAL2_RULE (0x7<<0)
  1280. #define USTORM_ISCSI_AG_CONTEXT_AGG_VAL2_RULE_SHIFT 0
  1281. #define __USTORM_ISCSI_AG_CONTEXT_AGG_VAL3_RULE (0x7<<3)
  1282. #define __USTORM_ISCSI_AG_CONTEXT_AGG_VAL3_RULE_SHIFT 3
  1283. #define USTORM_ISCSI_AG_CONTEXT_AGG_VAL2_ARM_N_FLAG (0x1<<6)
  1284. #define USTORM_ISCSI_AG_CONTEXT_AGG_VAL2_ARM_N_FLAG_SHIFT 6
  1285. #define __USTORM_ISCSI_AG_CONTEXT_RESERVED1 (0x1<<7)
  1286. #define __USTORM_ISCSI_AG_CONTEXT_RESERVED1_SHIFT 7
  1287. u16 __reserved2;
  1288. #endif
  1289. };
  1290. /*
  1291. * The fcoe aggregative context section of Xstorm
  1292. */
  1293. struct xstorm_fcoe_extra_ag_context_section {
  1294. #if defined(__BIG_ENDIAN)
  1295. u8 tcp_agg_vars1;
  1296. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED51 (0x3<<0)
  1297. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED51_SHIFT 0
  1298. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_ACK_TO_FE_UPDATED (0x3<<2)
  1299. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_ACK_TO_FE_UPDATED_SHIFT 2
  1300. #define XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_SIDEBAND_SENT_CF (0x3<<4)
  1301. #define XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_SIDEBAND_SENT_CF_SHIFT 4
  1302. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED_CLEAR_DA_TIMER_EN (0x1<<6)
  1303. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED_CLEAR_DA_TIMER_EN_SHIFT 6
  1304. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED_DA_EXPIRATION_FLAG (0x1<<7)
  1305. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED_DA_EXPIRATION_FLAG_SHIFT 7
  1306. u8 __reserved_da_cnt;
  1307. u16 __mtu;
  1308. #elif defined(__LITTLE_ENDIAN)
  1309. u16 __mtu;
  1310. u8 __reserved_da_cnt;
  1311. u8 tcp_agg_vars1;
  1312. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED51 (0x3<<0)
  1313. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED51_SHIFT 0
  1314. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_ACK_TO_FE_UPDATED (0x3<<2)
  1315. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_ACK_TO_FE_UPDATED_SHIFT 2
  1316. #define XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_SIDEBAND_SENT_CF (0x3<<4)
  1317. #define XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_SIDEBAND_SENT_CF_SHIFT 4
  1318. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED_CLEAR_DA_TIMER_EN (0x1<<6)
  1319. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED_CLEAR_DA_TIMER_EN_SHIFT 6
  1320. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED_DA_EXPIRATION_FLAG (0x1<<7)
  1321. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED_DA_EXPIRATION_FLAG_SHIFT 7
  1322. #endif
  1323. u32 snd_nxt;
  1324. u32 __xfrqe_bd_addr_lo;
  1325. u32 __xfrqe_bd_addr_hi;
  1326. u32 __xfrqe_data1;
  1327. #if defined(__BIG_ENDIAN)
  1328. u8 __agg_val8_th;
  1329. u8 __tx_dest;
  1330. u16 tcp_agg_vars2;
  1331. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED57 (0x1<<0)
  1332. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED57_SHIFT 0
  1333. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED58 (0x1<<1)
  1334. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED58_SHIFT 1
  1335. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED59 (0x1<<2)
  1336. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED59_SHIFT 2
  1337. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_AUX3_FLAG (0x1<<3)
  1338. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_AUX3_FLAG_SHIFT 3
  1339. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_AUX4_FLAG (0x1<<4)
  1340. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_AUX4_FLAG_SHIFT 4
  1341. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED60 (0x1<<5)
  1342. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED60_SHIFT 5
  1343. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED_ACK_TO_FE_UPDATED_EN (0x1<<6)
  1344. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED_ACK_TO_FE_UPDATED_EN_SHIFT 6
  1345. #define XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_SIDEBAND_SENT_CF_EN (0x1<<7)
  1346. #define XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_SIDEBAND_SENT_CF_EN_SHIFT 7
  1347. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED_TX_FIN_FLAG_EN (0x1<<8)
  1348. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED_TX_FIN_FLAG_EN_SHIFT 8
  1349. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_AUX1_FLAG (0x1<<9)
  1350. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_AUX1_FLAG_SHIFT 9
  1351. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_SET_RTO_CF (0x3<<10)
  1352. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_SET_RTO_CF_SHIFT 10
  1353. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_TS_TO_ECHO_UPDATED_CF (0x3<<12)
  1354. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_TS_TO_ECHO_UPDATED_CF_SHIFT 12
  1355. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_TX_DEST_UPDATED_CF (0x3<<14)
  1356. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_TX_DEST_UPDATED_CF_SHIFT 14
  1357. #elif defined(__LITTLE_ENDIAN)
  1358. u16 tcp_agg_vars2;
  1359. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED57 (0x1<<0)
  1360. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED57_SHIFT 0
  1361. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED58 (0x1<<1)
  1362. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED58_SHIFT 1
  1363. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED59 (0x1<<2)
  1364. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED59_SHIFT 2
  1365. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_AUX3_FLAG (0x1<<3)
  1366. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_AUX3_FLAG_SHIFT 3
  1367. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_AUX4_FLAG (0x1<<4)
  1368. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_AUX4_FLAG_SHIFT 4
  1369. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED60 (0x1<<5)
  1370. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED60_SHIFT 5
  1371. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED_ACK_TO_FE_UPDATED_EN (0x1<<6)
  1372. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED_ACK_TO_FE_UPDATED_EN_SHIFT 6
  1373. #define XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_SIDEBAND_SENT_CF_EN (0x1<<7)
  1374. #define XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_SIDEBAND_SENT_CF_EN_SHIFT 7
  1375. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED_TX_FIN_FLAG_EN (0x1<<8)
  1376. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_RESERVED_TX_FIN_FLAG_EN_SHIFT 8
  1377. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_AUX1_FLAG (0x1<<9)
  1378. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_AUX1_FLAG_SHIFT 9
  1379. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_SET_RTO_CF (0x3<<10)
  1380. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_SET_RTO_CF_SHIFT 10
  1381. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_TS_TO_ECHO_UPDATED_CF (0x3<<12)
  1382. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_TS_TO_ECHO_UPDATED_CF_SHIFT 12
  1383. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_TX_DEST_UPDATED_CF (0x3<<14)
  1384. #define __XSTORM_FCOE_EXTRA_AG_CONTEXT_SECTION_TX_DEST_UPDATED_CF_SHIFT 14
  1385. u8 __tx_dest;
  1386. u8 __agg_val8_th;
  1387. #endif
  1388. u32 __sq_base_addr_lo;
  1389. u32 __sq_base_addr_hi;
  1390. u32 __xfrq_base_addr_lo;
  1391. u32 __xfrq_base_addr_hi;
  1392. #if defined(__BIG_ENDIAN)
  1393. u16 __xfrq_cons;
  1394. u16 __xfrq_prod;
  1395. #elif defined(__LITTLE_ENDIAN)
  1396. u16 __xfrq_prod;
  1397. u16 __xfrq_cons;
  1398. #endif
  1399. #if defined(__BIG_ENDIAN)
  1400. u8 __tcp_agg_vars5;
  1401. u8 __tcp_agg_vars4;
  1402. u8 __tcp_agg_vars3;
  1403. u8 __reserved_force_pure_ack_cnt;
  1404. #elif defined(__LITTLE_ENDIAN)
  1405. u8 __reserved_force_pure_ack_cnt;
  1406. u8 __tcp_agg_vars3;
  1407. u8 __tcp_agg_vars4;
  1408. u8 __tcp_agg_vars5;
  1409. #endif
  1410. u32 __tcp_agg_vars6;
  1411. #if defined(__BIG_ENDIAN)
  1412. u16 __xfrqe_mng;
  1413. u16 __tcp_agg_vars7;
  1414. #elif defined(__LITTLE_ENDIAN)
  1415. u16 __tcp_agg_vars7;
  1416. u16 __xfrqe_mng;
  1417. #endif
  1418. u32 __xfrqe_data0;
  1419. u32 __agg_val10_th;
  1420. #if defined(__BIG_ENDIAN)
  1421. u16 __reserved3;
  1422. u8 __reserved2;
  1423. u8 __da_only_cnt;
  1424. #elif defined(__LITTLE_ENDIAN)
  1425. u8 __da_only_cnt;
  1426. u8 __reserved2;
  1427. u16 __reserved3;
  1428. #endif
  1429. };
  1430. /*
  1431. * The fcoe aggregative context of Xstorm
  1432. */
  1433. struct xstorm_fcoe_ag_context {
  1434. #if defined(__BIG_ENDIAN)
  1435. u16 agg_val1;
  1436. u8 agg_vars1;
  1437. #define __XSTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM0 (0x1<<0)
  1438. #define __XSTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM0_SHIFT 0
  1439. #define __XSTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM1 (0x1<<1)
  1440. #define __XSTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM1_SHIFT 1
  1441. #define __XSTORM_FCOE_AG_CONTEXT_RESERVED51 (0x1<<2)
  1442. #define __XSTORM_FCOE_AG_CONTEXT_RESERVED51_SHIFT 2
  1443. #define __XSTORM_FCOE_AG_CONTEXT_RESERVED52 (0x1<<3)
  1444. #define __XSTORM_FCOE_AG_CONTEXT_RESERVED52_SHIFT 3
  1445. #define __XSTORM_FCOE_AG_CONTEXT_MORE_TO_SEND_EN (0x1<<4)
  1446. #define __XSTORM_FCOE_AG_CONTEXT_MORE_TO_SEND_EN_SHIFT 4
  1447. #define XSTORM_FCOE_AG_CONTEXT_NAGLE_EN (0x1<<5)
  1448. #define XSTORM_FCOE_AG_CONTEXT_NAGLE_EN_SHIFT 5
  1449. #define __XSTORM_FCOE_AG_CONTEXT_DQ_SPARE_FLAG (0x1<<6)
  1450. #define __XSTORM_FCOE_AG_CONTEXT_DQ_SPARE_FLAG_SHIFT 6
  1451. #define __XSTORM_FCOE_AG_CONTEXT_RESERVED_UNA_GT_NXT_EN (0x1<<7)
  1452. #define __XSTORM_FCOE_AG_CONTEXT_RESERVED_UNA_GT_NXT_EN_SHIFT 7
  1453. u8 __state;
  1454. #elif defined(__LITTLE_ENDIAN)
  1455. u8 __state;
  1456. u8 agg_vars1;
  1457. #define __XSTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM0 (0x1<<0)
  1458. #define __XSTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM0_SHIFT 0
  1459. #define __XSTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM1 (0x1<<1)
  1460. #define __XSTORM_FCOE_AG_CONTEXT_EXISTS_IN_QM1_SHIFT 1
  1461. #define __XSTORM_FCOE_AG_CONTEXT_RESERVED51 (0x1<<2)
  1462. #define __XSTORM_FCOE_AG_CONTEXT_RESERVED51_SHIFT 2
  1463. #define __XSTORM_FCOE_AG_CONTEXT_RESERVED52 (0x1<<3)
  1464. #define __XSTORM_FCOE_AG_CONTEXT_RESERVED52_SHIFT 3
  1465. #define __XSTORM_FCOE_AG_CONTEXT_MORE_TO_SEND_EN (0x1<<4)
  1466. #define __XSTORM_FCOE_AG_CONTEXT_MORE_TO_SEND_EN_SHIFT 4
  1467. #define XSTORM_FCOE_AG_CONTEXT_NAGLE_EN (0x1<<5)
  1468. #define XSTORM_FCOE_AG_CONTEXT_NAGLE_EN_SHIFT 5
  1469. #define __XSTORM_FCOE_AG_CONTEXT_DQ_SPARE_FLAG (0x1<<6)
  1470. #define __XSTORM_FCOE_AG_CONTEXT_DQ_SPARE_FLAG_SHIFT 6
  1471. #define __XSTORM_FCOE_AG_CONTEXT_RESERVED_UNA_GT_NXT_EN (0x1<<7)
  1472. #define __XSTORM_FCOE_AG_CONTEXT_RESERVED_UNA_GT_NXT_EN_SHIFT 7
  1473. u16 agg_val1;
  1474. #endif
  1475. #if defined(__BIG_ENDIAN)
  1476. u8 cdu_reserved;
  1477. u8 __agg_vars4;
  1478. u8 agg_vars3;
  1479. #define XSTORM_FCOE_AG_CONTEXT_PHYSICAL_QUEUE_NUM2 (0x3F<<0)
  1480. #define XSTORM_FCOE_AG_CONTEXT_PHYSICAL_QUEUE_NUM2_SHIFT 0
  1481. #define __XSTORM_FCOE_AG_CONTEXT_AUX19_CF (0x3<<6)
  1482. #define __XSTORM_FCOE_AG_CONTEXT_AUX19_CF_SHIFT 6
  1483. u8 agg_vars2;
  1484. #define __XSTORM_FCOE_AG_CONTEXT_DQ_CF (0x3<<0)
  1485. #define __XSTORM_FCOE_AG_CONTEXT_DQ_CF_SHIFT 0
  1486. #define __XSTORM_FCOE_AG_CONTEXT_DQ_SPARE_FLAG_EN (0x1<<2)
  1487. #define __XSTORM_FCOE_AG_CONTEXT_DQ_SPARE_FLAG_EN_SHIFT 2
  1488. #define __XSTORM_FCOE_AG_CONTEXT_AUX8_FLAG (0x1<<3)
  1489. #define __XSTORM_FCOE_AG_CONTEXT_AUX8_FLAG_SHIFT 3
  1490. #define __XSTORM_FCOE_AG_CONTEXT_AUX9_FLAG (0x1<<4)
  1491. #define __XSTORM_FCOE_AG_CONTEXT_AUX9_FLAG_SHIFT 4
  1492. #define XSTORM_FCOE_AG_CONTEXT_DECISION_RULE1 (0x3<<5)
  1493. #define XSTORM_FCOE_AG_CONTEXT_DECISION_RULE1_SHIFT 5
  1494. #define __XSTORM_FCOE_AG_CONTEXT_DQ_CF_EN (0x1<<7)
  1495. #define __XSTORM_FCOE_AG_CONTEXT_DQ_CF_EN_SHIFT 7
  1496. #elif defined(__LITTLE_ENDIAN)
  1497. u8 agg_vars2;
  1498. #define __XSTORM_FCOE_AG_CONTEXT_DQ_CF (0x3<<0)
  1499. #define __XSTORM_FCOE_AG_CONTEXT_DQ_CF_SHIFT 0
  1500. #define __XSTORM_FCOE_AG_CONTEXT_DQ_SPARE_FLAG_EN (0x1<<2)
  1501. #define __XSTORM_FCOE_AG_CONTEXT_DQ_SPARE_FLAG_EN_SHIFT 2
  1502. #define __XSTORM_FCOE_AG_CONTEXT_AUX8_FLAG (0x1<<3)
  1503. #define __XSTORM_FCOE_AG_CONTEXT_AUX8_FLAG_SHIFT 3
  1504. #define __XSTORM_FCOE_AG_CONTEXT_AUX9_FLAG (0x1<<4)
  1505. #define __XSTORM_FCOE_AG_CONTEXT_AUX9_FLAG_SHIFT 4
  1506. #define XSTORM_FCOE_AG_CONTEXT_DECISION_RULE1 (0x3<<5)
  1507. #define XSTORM_FCOE_AG_CONTEXT_DECISION_RULE1_SHIFT 5
  1508. #define __XSTORM_FCOE_AG_CONTEXT_DQ_CF_EN (0x1<<7)
  1509. #define __XSTORM_FCOE_AG_CONTEXT_DQ_CF_EN_SHIFT 7
  1510. u8 agg_vars3;
  1511. #define XSTORM_FCOE_AG_CONTEXT_PHYSICAL_QUEUE_NUM2 (0x3F<<0)
  1512. #define XSTORM_FCOE_AG_CONTEXT_PHYSICAL_QUEUE_NUM2_SHIFT 0
  1513. #define __XSTORM_FCOE_AG_CONTEXT_AUX19_CF (0x3<<6)
  1514. #define __XSTORM_FCOE_AG_CONTEXT_AUX19_CF_SHIFT 6
  1515. u8 __agg_vars4;
  1516. u8 cdu_reserved;
  1517. #endif
  1518. u32 more_to_send;
  1519. #if defined(__BIG_ENDIAN)
  1520. u16 agg_vars5;
  1521. #define XSTORM_FCOE_AG_CONTEXT_DECISION_RULE5 (0x3<<0)
  1522. #define XSTORM_FCOE_AG_CONTEXT_DECISION_RULE5_SHIFT 0
  1523. #define XSTORM_FCOE_AG_CONTEXT_PHYSICAL_QUEUE_NUM0 (0x3F<<2)
  1524. #define XSTORM_FCOE_AG_CONTEXT_PHYSICAL_QUEUE_NUM0_SHIFT 2
  1525. #define XSTORM_FCOE_AG_CONTEXT_PHYSICAL_QUEUE_NUM1 (0x3F<<8)
  1526. #define XSTORM_FCOE_AG_CONTEXT_PHYSICAL_QUEUE_NUM1_SHIFT 8
  1527. #define __XSTORM_FCOE_AG_CONTEXT_CONFQ_DEC_RULE (0x3<<14)
  1528. #define __XSTORM_FCOE_AG_CONTEXT_CONFQ_DEC_RULE_SHIFT 14
  1529. u16 sq_cons;
  1530. #elif defined(__LITTLE_ENDIAN)
  1531. u16 sq_cons;
  1532. u16 agg_vars5;
  1533. #define XSTORM_FCOE_AG_CONTEXT_DECISION_RULE5 (0x3<<0)
  1534. #define XSTORM_FCOE_AG_CONTEXT_DECISION_RULE5_SHIFT 0
  1535. #define XSTORM_FCOE_AG_CONTEXT_PHYSICAL_QUEUE_NUM0 (0x3F<<2)
  1536. #define XSTORM_FCOE_AG_CONTEXT_PHYSICAL_QUEUE_NUM0_SHIFT 2
  1537. #define XSTORM_FCOE_AG_CONTEXT_PHYSICAL_QUEUE_NUM1 (0x3F<<8)
  1538. #define XSTORM_FCOE_AG_CONTEXT_PHYSICAL_QUEUE_NUM1_SHIFT 8
  1539. #define __XSTORM_FCOE_AG_CONTEXT_CONFQ_DEC_RULE (0x3<<14)
  1540. #define __XSTORM_FCOE_AG_CONTEXT_CONFQ_DEC_RULE_SHIFT 14
  1541. #endif
  1542. struct xstorm_fcoe_extra_ag_context_section __extra_section;
  1543. #if defined(__BIG_ENDIAN)
  1544. u16 agg_vars7;
  1545. #define __XSTORM_FCOE_AG_CONTEXT_AGG_VAL11_DECISION_RULE (0x7<<0)
  1546. #define __XSTORM_FCOE_AG_CONTEXT_AGG_VAL11_DECISION_RULE_SHIFT 0
  1547. #define __XSTORM_FCOE_AG_CONTEXT_AUX13_FLAG (0x1<<3)
  1548. #define __XSTORM_FCOE_AG_CONTEXT_AUX13_FLAG_SHIFT 3
  1549. #define __XSTORM_FCOE_AG_CONTEXT_QUEUE0_CF (0x3<<4)
  1550. #define __XSTORM_FCOE_AG_CONTEXT_QUEUE0_CF_SHIFT 4
  1551. #define XSTORM_FCOE_AG_CONTEXT_DECISION_RULE3 (0x3<<6)
  1552. #define XSTORM_FCOE_AG_CONTEXT_DECISION_RULE3_SHIFT 6
  1553. #define XSTORM_FCOE_AG_CONTEXT_AUX1_CF (0x3<<8)
  1554. #define XSTORM_FCOE_AG_CONTEXT_AUX1_CF_SHIFT 8
  1555. #define __XSTORM_FCOE_AG_CONTEXT_RESERVED62 (0x1<<10)
  1556. #define __XSTORM_FCOE_AG_CONTEXT_RESERVED62_SHIFT 10
  1557. #define __XSTORM_FCOE_AG_CONTEXT_AUX1_CF_EN (0x1<<11)
  1558. #define __XSTORM_FCOE_AG_CONTEXT_AUX1_CF_EN_SHIFT 11
  1559. #define __XSTORM_FCOE_AG_CONTEXT_AUX10_FLAG (0x1<<12)
  1560. #define __XSTORM_FCOE_AG_CONTEXT_AUX10_FLAG_SHIFT 12
  1561. #define __XSTORM_FCOE_AG_CONTEXT_AUX11_FLAG (0x1<<13)
  1562. #define __XSTORM_FCOE_AG_CONTEXT_AUX11_FLAG_SHIFT 13
  1563. #define __XSTORM_FCOE_AG_CONTEXT_AUX12_FLAG (0x1<<14)
  1564. #define __XSTORM_FCOE_AG_CONTEXT_AUX12_FLAG_SHIFT 14
  1565. #define __XSTORM_FCOE_AG_CONTEXT_AUX2_FLAG (0x1<<15)
  1566. #define __XSTORM_FCOE_AG_CONTEXT_AUX2_FLAG_SHIFT 15
  1567. u8 agg_val3_th;
  1568. u8 agg_vars6;
  1569. #define XSTORM_FCOE_AG_CONTEXT_DECISION_RULE6 (0x7<<0)
  1570. #define XSTORM_FCOE_AG_CONTEXT_DECISION_RULE6_SHIFT 0
  1571. #define __XSTORM_FCOE_AG_CONTEXT_XFRQ_DEC_RULE (0x7<<3)
  1572. #define __XSTORM_FCOE_AG_CONTEXT_XFRQ_DEC_RULE_SHIFT 3
  1573. #define __XSTORM_FCOE_AG_CONTEXT_SQ_DEC_RULE (0x3<<6)
  1574. #define __XSTORM_FCOE_AG_CONTEXT_SQ_DEC_RULE_SHIFT 6
  1575. #elif defined(__LITTLE_ENDIAN)
  1576. u8 agg_vars6;
  1577. #define XSTORM_FCOE_AG_CONTEXT_DECISION_RULE6 (0x7<<0)
  1578. #define XSTORM_FCOE_AG_CONTEXT_DECISION_RULE6_SHIFT 0
  1579. #define __XSTORM_FCOE_AG_CONTEXT_XFRQ_DEC_RULE (0x7<<3)
  1580. #define __XSTORM_FCOE_AG_CONTEXT_XFRQ_DEC_RULE_SHIFT 3
  1581. #define __XSTORM_FCOE_AG_CONTEXT_SQ_DEC_RULE (0x3<<6)
  1582. #define __XSTORM_FCOE_AG_CONTEXT_SQ_DEC_RULE_SHIFT 6
  1583. u8 agg_val3_th;
  1584. u16 agg_vars7;
  1585. #define __XSTORM_FCOE_AG_CONTEXT_AGG_VAL11_DECISION_RULE (0x7<<0)
  1586. #define __XSTORM_FCOE_AG_CONTEXT_AGG_VAL11_DECISION_RULE_SHIFT 0
  1587. #define __XSTORM_FCOE_AG_CONTEXT_AUX13_FLAG (0x1<<3)
  1588. #define __XSTORM_FCOE_AG_CONTEXT_AUX13_FLAG_SHIFT 3
  1589. #define __XSTORM_FCOE_AG_CONTEXT_QUEUE0_CF (0x3<<4)
  1590. #define __XSTORM_FCOE_AG_CONTEXT_QUEUE0_CF_SHIFT 4
  1591. #define XSTORM_FCOE_AG_CONTEXT_DECISION_RULE3 (0x3<<6)
  1592. #define XSTORM_FCOE_AG_CONTEXT_DECISION_RULE3_SHIFT 6
  1593. #define XSTORM_FCOE_AG_CONTEXT_AUX1_CF (0x3<<8)
  1594. #define XSTORM_FCOE_AG_CONTEXT_AUX1_CF_SHIFT 8
  1595. #define __XSTORM_FCOE_AG_CONTEXT_RESERVED62 (0x1<<10)
  1596. #define __XSTORM_FCOE_AG_CONTEXT_RESERVED62_SHIFT 10
  1597. #define __XSTORM_FCOE_AG_CONTEXT_AUX1_CF_EN (0x1<<11)
  1598. #define __XSTORM_FCOE_AG_CONTEXT_AUX1_CF_EN_SHIFT 11
  1599. #define __XSTORM_FCOE_AG_CONTEXT_AUX10_FLAG (0x1<<12)
  1600. #define __XSTORM_FCOE_AG_CONTEXT_AUX10_FLAG_SHIFT 12
  1601. #define __XSTORM_FCOE_AG_CONTEXT_AUX11_FLAG (0x1<<13)
  1602. #define __XSTORM_FCOE_AG_CONTEXT_AUX11_FLAG_SHIFT 13
  1603. #define __XSTORM_FCOE_AG_CONTEXT_AUX12_FLAG (0x1<<14)
  1604. #define __XSTORM_FCOE_AG_CONTEXT_AUX12_FLAG_SHIFT 14
  1605. #define __XSTORM_FCOE_AG_CONTEXT_AUX2_FLAG (0x1<<15)
  1606. #define __XSTORM_FCOE_AG_CONTEXT_AUX2_FLAG_SHIFT 15
  1607. #endif
  1608. #if defined(__BIG_ENDIAN)
  1609. u16 __agg_val11_th;
  1610. u16 __agg_val11;
  1611. #elif defined(__LITTLE_ENDIAN)
  1612. u16 __agg_val11;
  1613. u16 __agg_val11_th;
  1614. #endif
  1615. #if defined(__BIG_ENDIAN)
  1616. u8 __reserved1;
  1617. u8 __agg_val6_th;
  1618. u16 __agg_val9;
  1619. #elif defined(__LITTLE_ENDIAN)
  1620. u16 __agg_val9;
  1621. u8 __agg_val6_th;
  1622. u8 __reserved1;
  1623. #endif
  1624. #if defined(__BIG_ENDIAN)
  1625. u16 confq_cons;
  1626. u16 confq_prod;
  1627. #elif defined(__LITTLE_ENDIAN)
  1628. u16 confq_prod;
  1629. u16 confq_cons;
  1630. #endif
  1631. u32 agg_vars8;
  1632. #define XSTORM_FCOE_AG_CONTEXT_AGG_MISC2 (0xFFFFFF<<0)
  1633. #define XSTORM_FCOE_AG_CONTEXT_AGG_MISC2_SHIFT 0
  1634. #define XSTORM_FCOE_AG_CONTEXT_AGG_MISC3 (0xFF<<24)
  1635. #define XSTORM_FCOE_AG_CONTEXT_AGG_MISC3_SHIFT 24
  1636. #if defined(__BIG_ENDIAN)
  1637. u16 __cache_wqe_db;
  1638. u16 sq_prod;
  1639. #elif defined(__LITTLE_ENDIAN)
  1640. u16 sq_prod;
  1641. u16 __cache_wqe_db;
  1642. #endif
  1643. #if defined(__BIG_ENDIAN)
  1644. u8 agg_val3;
  1645. u8 agg_val6;
  1646. u8 agg_val5_th;
  1647. u8 agg_val5;
  1648. #elif defined(__LITTLE_ENDIAN)
  1649. u8 agg_val5;
  1650. u8 agg_val5_th;
  1651. u8 agg_val6;
  1652. u8 agg_val3;
  1653. #endif
  1654. #if defined(__BIG_ENDIAN)
  1655. u16 __agg_misc1;
  1656. u16 agg_limit1;
  1657. #elif defined(__LITTLE_ENDIAN)
  1658. u16 agg_limit1;
  1659. u16 __agg_misc1;
  1660. #endif
  1661. u32 completion_seq;
  1662. u32 confq_pbl_base_lo;
  1663. u32 confq_pbl_base_hi;
  1664. };
  1665. /*
  1666. * The tcp aggregative context section of Xstorm
  1667. */
  1668. struct xstorm_tcp_tcp_ag_context_section {
  1669. #if defined(__BIG_ENDIAN)
  1670. u8 tcp_agg_vars1;
  1671. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_SET_DA_TIMER_CF (0x3<<0)
  1672. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_SET_DA_TIMER_CF_SHIFT 0
  1673. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_ACK_TO_FE_UPDATED (0x3<<2)
  1674. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_ACK_TO_FE_UPDATED_SHIFT 2
  1675. #define XSTORM_TCP_TCP_AG_CONTEXT_SECTION_SIDEBAND_SENT_CF (0x3<<4)
  1676. #define XSTORM_TCP_TCP_AG_CONTEXT_SECTION_SIDEBAND_SENT_CF_SHIFT 4
  1677. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_CLEAR_DA_TIMER_EN (0x1<<6)
  1678. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_CLEAR_DA_TIMER_EN_SHIFT 6
  1679. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_DA_EXPIRATION_FLAG (0x1<<7)
  1680. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_DA_EXPIRATION_FLAG_SHIFT 7
  1681. u8 __da_cnt;
  1682. u16 mss;
  1683. #elif defined(__LITTLE_ENDIAN)
  1684. u16 mss;
  1685. u8 __da_cnt;
  1686. u8 tcp_agg_vars1;
  1687. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_SET_DA_TIMER_CF (0x3<<0)
  1688. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_SET_DA_TIMER_CF_SHIFT 0
  1689. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_ACK_TO_FE_UPDATED (0x3<<2)
  1690. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_ACK_TO_FE_UPDATED_SHIFT 2
  1691. #define XSTORM_TCP_TCP_AG_CONTEXT_SECTION_SIDEBAND_SENT_CF (0x3<<4)
  1692. #define XSTORM_TCP_TCP_AG_CONTEXT_SECTION_SIDEBAND_SENT_CF_SHIFT 4
  1693. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_CLEAR_DA_TIMER_EN (0x1<<6)
  1694. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_CLEAR_DA_TIMER_EN_SHIFT 6
  1695. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_DA_EXPIRATION_FLAG (0x1<<7)
  1696. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_DA_EXPIRATION_FLAG_SHIFT 7
  1697. #endif
  1698. u32 snd_nxt;
  1699. u32 tx_wnd;
  1700. u32 snd_una;
  1701. u32 local_adv_wnd;
  1702. #if defined(__BIG_ENDIAN)
  1703. u8 __agg_val8_th;
  1704. u8 __tx_dest;
  1705. u16 tcp_agg_vars2;
  1706. #define XSTORM_TCP_TCP_AG_CONTEXT_SECTION_TX_FIN_FLAG (0x1<<0)
  1707. #define XSTORM_TCP_TCP_AG_CONTEXT_SECTION_TX_FIN_FLAG_SHIFT 0
  1708. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_TX_UNBLOCKED (0x1<<1)
  1709. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_TX_UNBLOCKED_SHIFT 1
  1710. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_DA_TIMER_ACTIVE (0x1<<2)
  1711. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_DA_TIMER_ACTIVE_SHIFT 2
  1712. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX3_FLAG (0x1<<3)
  1713. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX3_FLAG_SHIFT 3
  1714. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX4_FLAG (0x1<<4)
  1715. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX4_FLAG_SHIFT 4
  1716. #define XSTORM_TCP_TCP_AG_CONTEXT_SECTION_DA_ENABLE (0x1<<5)
  1717. #define XSTORM_TCP_TCP_AG_CONTEXT_SECTION_DA_ENABLE_SHIFT 5
  1718. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_ACK_TO_FE_UPDATED_EN (0x1<<6)
  1719. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_ACK_TO_FE_UPDATED_EN_SHIFT 6
  1720. #define XSTORM_TCP_TCP_AG_CONTEXT_SECTION_SIDEBAND_SENT_CF_EN (0x1<<7)
  1721. #define XSTORM_TCP_TCP_AG_CONTEXT_SECTION_SIDEBAND_SENT_CF_EN_SHIFT 7
  1722. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_TX_FIN_FLAG_EN (0x1<<8)
  1723. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_TX_FIN_FLAG_EN_SHIFT 8
  1724. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX1_FLAG (0x1<<9)
  1725. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX1_FLAG_SHIFT 9
  1726. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_SET_RTO_CF (0x3<<10)
  1727. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_SET_RTO_CF_SHIFT 10
  1728. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_TS_TO_ECHO_UPDATED_CF (0x3<<12)
  1729. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_TS_TO_ECHO_UPDATED_CF_SHIFT 12
  1730. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_TX_DEST_UPDATED_CF (0x3<<14)
  1731. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_TX_DEST_UPDATED_CF_SHIFT 14
  1732. #elif defined(__LITTLE_ENDIAN)
  1733. u16 tcp_agg_vars2;
  1734. #define XSTORM_TCP_TCP_AG_CONTEXT_SECTION_TX_FIN_FLAG (0x1<<0)
  1735. #define XSTORM_TCP_TCP_AG_CONTEXT_SECTION_TX_FIN_FLAG_SHIFT 0
  1736. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_TX_UNBLOCKED (0x1<<1)
  1737. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_TX_UNBLOCKED_SHIFT 1
  1738. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_DA_TIMER_ACTIVE (0x1<<2)
  1739. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_DA_TIMER_ACTIVE_SHIFT 2
  1740. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX3_FLAG (0x1<<3)
  1741. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX3_FLAG_SHIFT 3
  1742. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX4_FLAG (0x1<<4)
  1743. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX4_FLAG_SHIFT 4
  1744. #define XSTORM_TCP_TCP_AG_CONTEXT_SECTION_DA_ENABLE (0x1<<5)
  1745. #define XSTORM_TCP_TCP_AG_CONTEXT_SECTION_DA_ENABLE_SHIFT 5
  1746. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_ACK_TO_FE_UPDATED_EN (0x1<<6)
  1747. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_ACK_TO_FE_UPDATED_EN_SHIFT 6
  1748. #define XSTORM_TCP_TCP_AG_CONTEXT_SECTION_SIDEBAND_SENT_CF_EN (0x1<<7)
  1749. #define XSTORM_TCP_TCP_AG_CONTEXT_SECTION_SIDEBAND_SENT_CF_EN_SHIFT 7
  1750. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_TX_FIN_FLAG_EN (0x1<<8)
  1751. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_TX_FIN_FLAG_EN_SHIFT 8
  1752. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX1_FLAG (0x1<<9)
  1753. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX1_FLAG_SHIFT 9
  1754. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_SET_RTO_CF (0x3<<10)
  1755. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_SET_RTO_CF_SHIFT 10
  1756. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_TS_TO_ECHO_UPDATED_CF (0x3<<12)
  1757. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_TS_TO_ECHO_UPDATED_CF_SHIFT 12
  1758. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_TX_DEST_UPDATED_CF (0x3<<14)
  1759. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_TX_DEST_UPDATED_CF_SHIFT 14
  1760. u8 __tx_dest;
  1761. u8 __agg_val8_th;
  1762. #endif
  1763. u32 ack_to_far_end;
  1764. u32 rto_timer;
  1765. u32 ka_timer;
  1766. u32 ts_to_echo;
  1767. #if defined(__BIG_ENDIAN)
  1768. u16 __agg_val7_th;
  1769. u16 __agg_val7;
  1770. #elif defined(__LITTLE_ENDIAN)
  1771. u16 __agg_val7;
  1772. u16 __agg_val7_th;
  1773. #endif
  1774. #if defined(__BIG_ENDIAN)
  1775. u8 __tcp_agg_vars5;
  1776. u8 __tcp_agg_vars4;
  1777. u8 __tcp_agg_vars3;
  1778. u8 __force_pure_ack_cnt;
  1779. #elif defined(__LITTLE_ENDIAN)
  1780. u8 __force_pure_ack_cnt;
  1781. u8 __tcp_agg_vars3;
  1782. u8 __tcp_agg_vars4;
  1783. u8 __tcp_agg_vars5;
  1784. #endif
  1785. u32 tcp_agg_vars6;
  1786. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_TS_TO_ECHO_CF_EN (0x1<<0)
  1787. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_TS_TO_ECHO_CF_EN_SHIFT 0
  1788. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_TX_DEST_UPDATED_CF_EN (0x1<<1)
  1789. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_TX_DEST_UPDATED_CF_EN_SHIFT 1
  1790. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX9_CF_EN (0x1<<2)
  1791. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX9_CF_EN_SHIFT 2
  1792. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX10_CF_EN (0x1<<3)
  1793. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX10_CF_EN_SHIFT 3
  1794. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX6_FLAG (0x1<<4)
  1795. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX6_FLAG_SHIFT 4
  1796. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX7_FLAG (0x1<<5)
  1797. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX7_FLAG_SHIFT 5
  1798. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX5_CF (0x3<<6)
  1799. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX5_CF_SHIFT 6
  1800. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX9_CF (0x3<<8)
  1801. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX9_CF_SHIFT 8
  1802. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX10_CF (0x3<<10)
  1803. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX10_CF_SHIFT 10
  1804. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX11_CF (0x3<<12)
  1805. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX11_CF_SHIFT 12
  1806. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX12_CF (0x3<<14)
  1807. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX12_CF_SHIFT 14
  1808. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX13_CF (0x3<<16)
  1809. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX13_CF_SHIFT 16
  1810. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX14_CF (0x3<<18)
  1811. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX14_CF_SHIFT 18
  1812. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX15_CF (0x3<<20)
  1813. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX15_CF_SHIFT 20
  1814. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX16_CF (0x3<<22)
  1815. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX16_CF_SHIFT 22
  1816. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX17_CF (0x3<<24)
  1817. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_AUX17_CF_SHIFT 24
  1818. #define XSTORM_TCP_TCP_AG_CONTEXT_SECTION_ECE_FLAG (0x1<<26)
  1819. #define XSTORM_TCP_TCP_AG_CONTEXT_SECTION_ECE_FLAG_SHIFT 26
  1820. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_RESERVED71 (0x1<<27)
  1821. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_RESERVED71_SHIFT 27
  1822. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_FORCE_PURE_ACK_CNT_DIRTY (0x1<<28)
  1823. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_FORCE_PURE_ACK_CNT_DIRTY_SHIFT 28
  1824. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_TCP_AUTO_STOP_FLAG (0x1<<29)
  1825. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_TCP_AUTO_STOP_FLAG_SHIFT 29
  1826. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_DO_TS_UPDATE_FLAG (0x1<<30)
  1827. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_DO_TS_UPDATE_FLAG_SHIFT 30
  1828. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_CANCEL_RETRANSMIT_FLAG (0x1<<31)
  1829. #define __XSTORM_TCP_TCP_AG_CONTEXT_SECTION_CANCEL_RETRANSMIT_FLAG_SHIFT 31
  1830. #if defined(__BIG_ENDIAN)
  1831. u16 __agg_misc6;
  1832. u16 __tcp_agg_vars7;
  1833. #elif defined(__LITTLE_ENDIAN)
  1834. u16 __tcp_agg_vars7;
  1835. u16 __agg_misc6;
  1836. #endif
  1837. u32 __agg_val10;
  1838. u32 __agg_val10_th;
  1839. #if defined(__BIG_ENDIAN)
  1840. u16 __reserved3;
  1841. u8 __reserved2;
  1842. u8 __da_only_cnt;
  1843. #elif defined(__LITTLE_ENDIAN)
  1844. u8 __da_only_cnt;
  1845. u8 __reserved2;
  1846. u16 __reserved3;
  1847. #endif
  1848. };
  1849. /*
  1850. * The iscsi aggregative context of Xstorm
  1851. */
  1852. struct xstorm_iscsi_ag_context {
  1853. #if defined(__BIG_ENDIAN)
  1854. u16 agg_val1;
  1855. u8 agg_vars1;
  1856. #define __XSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM0 (0x1<<0)
  1857. #define __XSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM0_SHIFT 0
  1858. #define XSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM1 (0x1<<1)
  1859. #define XSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM1_SHIFT 1
  1860. #define XSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM2 (0x1<<2)
  1861. #define XSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM2_SHIFT 2
  1862. #define XSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM3 (0x1<<3)
  1863. #define XSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM3_SHIFT 3
  1864. #define __XSTORM_ISCSI_AG_CONTEXT_MORE_TO_SEND_EN (0x1<<4)
  1865. #define __XSTORM_ISCSI_AG_CONTEXT_MORE_TO_SEND_EN_SHIFT 4
  1866. #define XSTORM_ISCSI_AG_CONTEXT_NAGLE_EN (0x1<<5)
  1867. #define XSTORM_ISCSI_AG_CONTEXT_NAGLE_EN_SHIFT 5
  1868. #define __XSTORM_ISCSI_AG_CONTEXT_DQ_SPARE_FLAG (0x1<<6)
  1869. #define __XSTORM_ISCSI_AG_CONTEXT_DQ_SPARE_FLAG_SHIFT 6
  1870. #define __XSTORM_ISCSI_AG_CONTEXT_UNA_GT_NXT_EN (0x1<<7)
  1871. #define __XSTORM_ISCSI_AG_CONTEXT_UNA_GT_NXT_EN_SHIFT 7
  1872. u8 state;
  1873. #elif defined(__LITTLE_ENDIAN)
  1874. u8 state;
  1875. u8 agg_vars1;
  1876. #define __XSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM0 (0x1<<0)
  1877. #define __XSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM0_SHIFT 0
  1878. #define XSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM1 (0x1<<1)
  1879. #define XSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM1_SHIFT 1
  1880. #define XSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM2 (0x1<<2)
  1881. #define XSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM2_SHIFT 2
  1882. #define XSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM3 (0x1<<3)
  1883. #define XSTORM_ISCSI_AG_CONTEXT_EXISTS_IN_QM3_SHIFT 3
  1884. #define __XSTORM_ISCSI_AG_CONTEXT_MORE_TO_SEND_EN (0x1<<4)
  1885. #define __XSTORM_ISCSI_AG_CONTEXT_MORE_TO_SEND_EN_SHIFT 4
  1886. #define XSTORM_ISCSI_AG_CONTEXT_NAGLE_EN (0x1<<5)
  1887. #define XSTORM_ISCSI_AG_CONTEXT_NAGLE_EN_SHIFT 5
  1888. #define __XSTORM_ISCSI_AG_CONTEXT_DQ_SPARE_FLAG (0x1<<6)
  1889. #define __XSTORM_ISCSI_AG_CONTEXT_DQ_SPARE_FLAG_SHIFT 6
  1890. #define __XSTORM_ISCSI_AG_CONTEXT_UNA_GT_NXT_EN (0x1<<7)
  1891. #define __XSTORM_ISCSI_AG_CONTEXT_UNA_GT_NXT_EN_SHIFT 7
  1892. u16 agg_val1;
  1893. #endif
  1894. #if defined(__BIG_ENDIAN)
  1895. u8 cdu_reserved;
  1896. u8 __agg_vars4;
  1897. u8 agg_vars3;
  1898. #define XSTORM_ISCSI_AG_CONTEXT_PHYSICAL_QUEUE_NUM2 (0x3F<<0)
  1899. #define XSTORM_ISCSI_AG_CONTEXT_PHYSICAL_QUEUE_NUM2_SHIFT 0
  1900. #define __XSTORM_ISCSI_AG_CONTEXT_RX_TS_EN_CF (0x3<<6)
  1901. #define __XSTORM_ISCSI_AG_CONTEXT_RX_TS_EN_CF_SHIFT 6
  1902. u8 agg_vars2;
  1903. #define __XSTORM_ISCSI_AG_CONTEXT_DQ_CF (0x3<<0)
  1904. #define __XSTORM_ISCSI_AG_CONTEXT_DQ_CF_SHIFT 0
  1905. #define __XSTORM_ISCSI_AG_CONTEXT_DQ_SPARE_FLAG_EN (0x1<<2)
  1906. #define __XSTORM_ISCSI_AG_CONTEXT_DQ_SPARE_FLAG_EN_SHIFT 2
  1907. #define __XSTORM_ISCSI_AG_CONTEXT_AUX8_FLAG (0x1<<3)
  1908. #define __XSTORM_ISCSI_AG_CONTEXT_AUX8_FLAG_SHIFT 3
  1909. #define __XSTORM_ISCSI_AG_CONTEXT_AUX9_FLAG (0x1<<4)
  1910. #define __XSTORM_ISCSI_AG_CONTEXT_AUX9_FLAG_SHIFT 4
  1911. #define XSTORM_ISCSI_AG_CONTEXT_DECISION_RULE1 (0x3<<5)
  1912. #define XSTORM_ISCSI_AG_CONTEXT_DECISION_RULE1_SHIFT 5
  1913. #define __XSTORM_ISCSI_AG_CONTEXT_DQ_CF_EN (0x1<<7)
  1914. #define __XSTORM_ISCSI_AG_CONTEXT_DQ_CF_EN_SHIFT 7
  1915. #elif defined(__LITTLE_ENDIAN)
  1916. u8 agg_vars2;
  1917. #define __XSTORM_ISCSI_AG_CONTEXT_DQ_CF (0x3<<0)
  1918. #define __XSTORM_ISCSI_AG_CONTEXT_DQ_CF_SHIFT 0
  1919. #define __XSTORM_ISCSI_AG_CONTEXT_DQ_SPARE_FLAG_EN (0x1<<2)
  1920. #define __XSTORM_ISCSI_AG_CONTEXT_DQ_SPARE_FLAG_EN_SHIFT 2
  1921. #define __XSTORM_ISCSI_AG_CONTEXT_AUX8_FLAG (0x1<<3)
  1922. #define __XSTORM_ISCSI_AG_CONTEXT_AUX8_FLAG_SHIFT 3
  1923. #define __XSTORM_ISCSI_AG_CONTEXT_AUX9_FLAG (0x1<<4)
  1924. #define __XSTORM_ISCSI_AG_CONTEXT_AUX9_FLAG_SHIFT 4
  1925. #define XSTORM_ISCSI_AG_CONTEXT_DECISION_RULE1 (0x3<<5)
  1926. #define XSTORM_ISCSI_AG_CONTEXT_DECISION_RULE1_SHIFT 5
  1927. #define __XSTORM_ISCSI_AG_CONTEXT_DQ_CF_EN (0x1<<7)
  1928. #define __XSTORM_ISCSI_AG_CONTEXT_DQ_CF_EN_SHIFT 7
  1929. u8 agg_vars3;
  1930. #define XSTORM_ISCSI_AG_CONTEXT_PHYSICAL_QUEUE_NUM2 (0x3F<<0)
  1931. #define XSTORM_ISCSI_AG_CONTEXT_PHYSICAL_QUEUE_NUM2_SHIFT 0
  1932. #define __XSTORM_ISCSI_AG_CONTEXT_RX_TS_EN_CF (0x3<<6)
  1933. #define __XSTORM_ISCSI_AG_CONTEXT_RX_TS_EN_CF_SHIFT 6
  1934. u8 __agg_vars4;
  1935. u8 cdu_reserved;
  1936. #endif
  1937. u32 more_to_send;
  1938. #if defined(__BIG_ENDIAN)
  1939. u16 agg_vars5;
  1940. #define XSTORM_ISCSI_AG_CONTEXT_DECISION_RULE5 (0x3<<0)
  1941. #define XSTORM_ISCSI_AG_CONTEXT_DECISION_RULE5_SHIFT 0
  1942. #define XSTORM_ISCSI_AG_CONTEXT_PHYSICAL_QUEUE_NUM0 (0x3F<<2)
  1943. #define XSTORM_ISCSI_AG_CONTEXT_PHYSICAL_QUEUE_NUM0_SHIFT 2
  1944. #define XSTORM_ISCSI_AG_CONTEXT_PHYSICAL_QUEUE_NUM1 (0x3F<<8)
  1945. #define XSTORM_ISCSI_AG_CONTEXT_PHYSICAL_QUEUE_NUM1_SHIFT 8
  1946. #define XSTORM_ISCSI_AG_CONTEXT_DECISION_RULE2 (0x3<<14)
  1947. #define XSTORM_ISCSI_AG_CONTEXT_DECISION_RULE2_SHIFT 14
  1948. u16 sq_cons;
  1949. #elif defined(__LITTLE_ENDIAN)
  1950. u16 sq_cons;
  1951. u16 agg_vars5;
  1952. #define XSTORM_ISCSI_AG_CONTEXT_DECISION_RULE5 (0x3<<0)
  1953. #define XSTORM_ISCSI_AG_CONTEXT_DECISION_RULE5_SHIFT 0
  1954. #define XSTORM_ISCSI_AG_CONTEXT_PHYSICAL_QUEUE_NUM0 (0x3F<<2)
  1955. #define XSTORM_ISCSI_AG_CONTEXT_PHYSICAL_QUEUE_NUM0_SHIFT 2
  1956. #define XSTORM_ISCSI_AG_CONTEXT_PHYSICAL_QUEUE_NUM1 (0x3F<<8)
  1957. #define XSTORM_ISCSI_AG_CONTEXT_PHYSICAL_QUEUE_NUM1_SHIFT 8
  1958. #define XSTORM_ISCSI_AG_CONTEXT_DECISION_RULE2 (0x3<<14)
  1959. #define XSTORM_ISCSI_AG_CONTEXT_DECISION_RULE2_SHIFT 14
  1960. #endif
  1961. struct xstorm_tcp_tcp_ag_context_section tcp;
  1962. #if defined(__BIG_ENDIAN)
  1963. u16 agg_vars7;
  1964. #define __XSTORM_ISCSI_AG_CONTEXT_AGG_VAL11_DECISION_RULE (0x7<<0)
  1965. #define __XSTORM_ISCSI_AG_CONTEXT_AGG_VAL11_DECISION_RULE_SHIFT 0
  1966. #define __XSTORM_ISCSI_AG_CONTEXT_AUX13_FLAG (0x1<<3)
  1967. #define __XSTORM_ISCSI_AG_CONTEXT_AUX13_FLAG_SHIFT 3
  1968. #define __XSTORM_ISCSI_AG_CONTEXT_STORMS_SYNC_CF (0x3<<4)
  1969. #define __XSTORM_ISCSI_AG_CONTEXT_STORMS_SYNC_CF_SHIFT 4
  1970. #define XSTORM_ISCSI_AG_CONTEXT_DECISION_RULE3 (0x3<<6)
  1971. #define XSTORM_ISCSI_AG_CONTEXT_DECISION_RULE3_SHIFT 6
  1972. #define XSTORM_ISCSI_AG_CONTEXT_AUX1_CF (0x3<<8)
  1973. #define XSTORM_ISCSI_AG_CONTEXT_AUX1_CF_SHIFT 8
  1974. #define __XSTORM_ISCSI_AG_CONTEXT_COMPLETION_SEQ_DECISION_MASK (0x1<<10)
  1975. #define __XSTORM_ISCSI_AG_CONTEXT_COMPLETION_SEQ_DECISION_MASK_SHIFT 10
  1976. #define __XSTORM_ISCSI_AG_CONTEXT_AUX1_CF_EN (0x1<<11)
  1977. #define __XSTORM_ISCSI_AG_CONTEXT_AUX1_CF_EN_SHIFT 11
  1978. #define __XSTORM_ISCSI_AG_CONTEXT_AUX10_FLAG (0x1<<12)
  1979. #define __XSTORM_ISCSI_AG_CONTEXT_AUX10_FLAG_SHIFT 12
  1980. #define __XSTORM_ISCSI_AG_CONTEXT_AUX11_FLAG (0x1<<13)
  1981. #define __XSTORM_ISCSI_AG_CONTEXT_AUX11_FLAG_SHIFT 13
  1982. #define __XSTORM_ISCSI_AG_CONTEXT_AUX12_FLAG (0x1<<14)
  1983. #define __XSTORM_ISCSI_AG_CONTEXT_AUX12_FLAG_SHIFT 14
  1984. #define __XSTORM_ISCSI_AG_CONTEXT_RX_WND_SCL_EN (0x1<<15)
  1985. #define __XSTORM_ISCSI_AG_CONTEXT_RX_WND_SCL_EN_SHIFT 15
  1986. u8 agg_val3_th;
  1987. u8 agg_vars6;
  1988. #define XSTORM_ISCSI_AG_CONTEXT_DECISION_RULE6 (0x7<<0)
  1989. #define XSTORM_ISCSI_AG_CONTEXT_DECISION_RULE6_SHIFT 0
  1990. #define XSTORM_ISCSI_AG_CONTEXT_DECISION_RULE7 (0x7<<3)
  1991. #define XSTORM_ISCSI_AG_CONTEXT_DECISION_RULE7_SHIFT 3
  1992. #define XSTORM_ISCSI_AG_CONTEXT_DECISION_RULE4 (0x3<<6)
  1993. #define XSTORM_ISCSI_AG_CONTEXT_DECISION_RULE4_SHIFT 6
  1994. #elif defined(__LITTLE_ENDIAN)
  1995. u8 agg_vars6;
  1996. #define XSTORM_ISCSI_AG_CONTEXT_DECISION_RULE6 (0x7<<0)
  1997. #define XSTORM_ISCSI_AG_CONTEXT_DECISION_RULE6_SHIFT 0
  1998. #define XSTORM_ISCSI_AG_CONTEXT_DECISION_RULE7 (0x7<<3)
  1999. #define XSTORM_ISCSI_AG_CONTEXT_DECISION_RULE7_SHIFT 3
  2000. #define XSTORM_ISCSI_AG_CONTEXT_DECISION_RULE4 (0x3<<6)
  2001. #define XSTORM_ISCSI_AG_CONTEXT_DECISION_RULE4_SHIFT 6
  2002. u8 agg_val3_th;
  2003. u16 agg_vars7;
  2004. #define __XSTORM_ISCSI_AG_CONTEXT_AGG_VAL11_DECISION_RULE (0x7<<0)
  2005. #define __XSTORM_ISCSI_AG_CONTEXT_AGG_VAL11_DECISION_RULE_SHIFT 0
  2006. #define __XSTORM_ISCSI_AG_CONTEXT_AUX13_FLAG (0x1<<3)
  2007. #define __XSTORM_ISCSI_AG_CONTEXT_AUX13_FLAG_SHIFT 3
  2008. #define __XSTORM_ISCSI_AG_CONTEXT_STORMS_SYNC_CF (0x3<<4)
  2009. #define __XSTORM_ISCSI_AG_CONTEXT_STORMS_SYNC_CF_SHIFT 4
  2010. #define XSTORM_ISCSI_AG_CONTEXT_DECISION_RULE3 (0x3<<6)
  2011. #define XSTORM_ISCSI_AG_CONTEXT_DECISION_RULE3_SHIFT 6
  2012. #define XSTORM_ISCSI_AG_CONTEXT_AUX1_CF (0x3<<8)
  2013. #define XSTORM_ISCSI_AG_CONTEXT_AUX1_CF_SHIFT 8
  2014. #define __XSTORM_ISCSI_AG_CONTEXT_COMPLETION_SEQ_DECISION_MASK (0x1<<10)
  2015. #define __XSTORM_ISCSI_AG_CONTEXT_COMPLETION_SEQ_DECISION_MASK_SHIFT 10
  2016. #define __XSTORM_ISCSI_AG_CONTEXT_AUX1_CF_EN (0x1<<11)
  2017. #define __XSTORM_ISCSI_AG_CONTEXT_AUX1_CF_EN_SHIFT 11
  2018. #define __XSTORM_ISCSI_AG_CONTEXT_AUX10_FLAG (0x1<<12)
  2019. #define __XSTORM_ISCSI_AG_CONTEXT_AUX10_FLAG_SHIFT 12
  2020. #define __XSTORM_ISCSI_AG_CONTEXT_AUX11_FLAG (0x1<<13)
  2021. #define __XSTORM_ISCSI_AG_CONTEXT_AUX11_FLAG_SHIFT 13
  2022. #define __XSTORM_ISCSI_AG_CONTEXT_AUX12_FLAG (0x1<<14)
  2023. #define __XSTORM_ISCSI_AG_CONTEXT_AUX12_FLAG_SHIFT 14
  2024. #define __XSTORM_ISCSI_AG_CONTEXT_RX_WND_SCL_EN (0x1<<15)
  2025. #define __XSTORM_ISCSI_AG_CONTEXT_RX_WND_SCL_EN_SHIFT 15
  2026. #endif
  2027. #if defined(__BIG_ENDIAN)
  2028. u16 __agg_val11_th;
  2029. u16 __gen_data;
  2030. #elif defined(__LITTLE_ENDIAN)
  2031. u16 __gen_data;
  2032. u16 __agg_val11_th;
  2033. #endif
  2034. #if defined(__BIG_ENDIAN)
  2035. u8 __reserved1;
  2036. u8 __agg_val6_th;
  2037. u16 __agg_val9;
  2038. #elif defined(__LITTLE_ENDIAN)
  2039. u16 __agg_val9;
  2040. u8 __agg_val6_th;
  2041. u8 __reserved1;
  2042. #endif
  2043. #if defined(__BIG_ENDIAN)
  2044. u16 hq_prod;
  2045. u16 hq_cons;
  2046. #elif defined(__LITTLE_ENDIAN)
  2047. u16 hq_cons;
  2048. u16 hq_prod;
  2049. #endif
  2050. u32 agg_vars8;
  2051. #define XSTORM_ISCSI_AG_CONTEXT_AGG_MISC2 (0xFFFFFF<<0)
  2052. #define XSTORM_ISCSI_AG_CONTEXT_AGG_MISC2_SHIFT 0
  2053. #define XSTORM_ISCSI_AG_CONTEXT_AGG_MISC3 (0xFF<<24)
  2054. #define XSTORM_ISCSI_AG_CONTEXT_AGG_MISC3_SHIFT 24
  2055. #if defined(__BIG_ENDIAN)
  2056. u16 r2tq_prod;
  2057. u16 sq_prod;
  2058. #elif defined(__LITTLE_ENDIAN)
  2059. u16 sq_prod;
  2060. u16 r2tq_prod;
  2061. #endif
  2062. #if defined(__BIG_ENDIAN)
  2063. u8 agg_val3;
  2064. u8 agg_val6;
  2065. u8 agg_val5_th;
  2066. u8 agg_val5;
  2067. #elif defined(__LITTLE_ENDIAN)
  2068. u8 agg_val5;
  2069. u8 agg_val5_th;
  2070. u8 agg_val6;
  2071. u8 agg_val3;
  2072. #endif
  2073. #if defined(__BIG_ENDIAN)
  2074. u16 __agg_misc1;
  2075. u16 agg_limit1;
  2076. #elif defined(__LITTLE_ENDIAN)
  2077. u16 agg_limit1;
  2078. u16 __agg_misc1;
  2079. #endif
  2080. u32 hq_cons_tcp_seq;
  2081. u32 exp_stat_sn;
  2082. u32 rst_seq_num;
  2083. };
  2084. /*
  2085. * The L5cm aggregative context of XStorm
  2086. */
  2087. struct xstorm_l5cm_ag_context {
  2088. #if defined(__BIG_ENDIAN)
  2089. u16 agg_val1;
  2090. u8 agg_vars1;
  2091. #define __XSTORM_L5CM_AG_CONTEXT_EXISTS_IN_QM0 (0x1<<0)
  2092. #define __XSTORM_L5CM_AG_CONTEXT_EXISTS_IN_QM0_SHIFT 0
  2093. #define XSTORM_L5CM_AG_CONTEXT_EXISTS_IN_QM1 (0x1<<1)
  2094. #define XSTORM_L5CM_AG_CONTEXT_EXISTS_IN_QM1_SHIFT 1
  2095. #define XSTORM_L5CM_AG_CONTEXT_EXISTS_IN_QM2 (0x1<<2)
  2096. #define XSTORM_L5CM_AG_CONTEXT_EXISTS_IN_QM2_SHIFT 2
  2097. #define XSTORM_L5CM_AG_CONTEXT_EXISTS_IN_QM3 (0x1<<3)
  2098. #define XSTORM_L5CM_AG_CONTEXT_EXISTS_IN_QM3_SHIFT 3
  2099. #define __XSTORM_L5CM_AG_CONTEXT_MORE_TO_SEND_EN (0x1<<4)
  2100. #define __XSTORM_L5CM_AG_CONTEXT_MORE_TO_SEND_EN_SHIFT 4
  2101. #define XSTORM_L5CM_AG_CONTEXT_NAGLE_EN (0x1<<5)
  2102. #define XSTORM_L5CM_AG_CONTEXT_NAGLE_EN_SHIFT 5
  2103. #define __XSTORM_L5CM_AG_CONTEXT_DQ_SPARE_FLAG (0x1<<6)
  2104. #define __XSTORM_L5CM_AG_CONTEXT_DQ_SPARE_FLAG_SHIFT 6
  2105. #define __XSTORM_L5CM_AG_CONTEXT_UNA_GT_NXT_EN (0x1<<7)
  2106. #define __XSTORM_L5CM_AG_CONTEXT_UNA_GT_NXT_EN_SHIFT 7
  2107. u8 state;
  2108. #elif defined(__LITTLE_ENDIAN)
  2109. u8 state;
  2110. u8 agg_vars1;
  2111. #define __XSTORM_L5CM_AG_CONTEXT_EXISTS_IN_QM0 (0x1<<0)
  2112. #define __XSTORM_L5CM_AG_CONTEXT_EXISTS_IN_QM0_SHIFT 0
  2113. #define XSTORM_L5CM_AG_CONTEXT_EXISTS_IN_QM1 (0x1<<1)
  2114. #define XSTORM_L5CM_AG_CONTEXT_EXISTS_IN_QM1_SHIFT 1
  2115. #define XSTORM_L5CM_AG_CONTEXT_EXISTS_IN_QM2 (0x1<<2)
  2116. #define XSTORM_L5CM_AG_CONTEXT_EXISTS_IN_QM2_SHIFT 2
  2117. #define XSTORM_L5CM_AG_CONTEXT_EXISTS_IN_QM3 (0x1<<3)
  2118. #define XSTORM_L5CM_AG_CONTEXT_EXISTS_IN_QM3_SHIFT 3
  2119. #define __XSTORM_L5CM_AG_CONTEXT_MORE_TO_SEND_EN (0x1<<4)
  2120. #define __XSTORM_L5CM_AG_CONTEXT_MORE_TO_SEND_EN_SHIFT 4
  2121. #define XSTORM_L5CM_AG_CONTEXT_NAGLE_EN (0x1<<5)
  2122. #define XSTORM_L5CM_AG_CONTEXT_NAGLE_EN_SHIFT 5
  2123. #define __XSTORM_L5CM_AG_CONTEXT_DQ_SPARE_FLAG (0x1<<6)
  2124. #define __XSTORM_L5CM_AG_CONTEXT_DQ_SPARE_FLAG_SHIFT 6
  2125. #define __XSTORM_L5CM_AG_CONTEXT_UNA_GT_NXT_EN (0x1<<7)
  2126. #define __XSTORM_L5CM_AG_CONTEXT_UNA_GT_NXT_EN_SHIFT 7
  2127. u16 agg_val1;
  2128. #endif
  2129. #if defined(__BIG_ENDIAN)
  2130. u8 cdu_reserved;
  2131. u8 __agg_vars4;
  2132. u8 agg_vars3;
  2133. #define XSTORM_L5CM_AG_CONTEXT_PHYSICAL_QUEUE_NUM2 (0x3F<<0)
  2134. #define XSTORM_L5CM_AG_CONTEXT_PHYSICAL_QUEUE_NUM2_SHIFT 0
  2135. #define __XSTORM_L5CM_AG_CONTEXT_RX_TS_EN_CF (0x3<<6)
  2136. #define __XSTORM_L5CM_AG_CONTEXT_RX_TS_EN_CF_SHIFT 6
  2137. u8 agg_vars2;
  2138. #define XSTORM_L5CM_AG_CONTEXT_AUX4_CF (0x3<<0)
  2139. #define XSTORM_L5CM_AG_CONTEXT_AUX4_CF_SHIFT 0
  2140. #define __XSTORM_L5CM_AG_CONTEXT_DQ_SPARE_FLAG_EN (0x1<<2)
  2141. #define __XSTORM_L5CM_AG_CONTEXT_DQ_SPARE_FLAG_EN_SHIFT 2
  2142. #define __XSTORM_L5CM_AG_CONTEXT_AUX8_FLAG (0x1<<3)
  2143. #define __XSTORM_L5CM_AG_CONTEXT_AUX8_FLAG_SHIFT 3
  2144. #define __XSTORM_L5CM_AG_CONTEXT_AUX9_FLAG (0x1<<4)
  2145. #define __XSTORM_L5CM_AG_CONTEXT_AUX9_FLAG_SHIFT 4
  2146. #define XSTORM_L5CM_AG_CONTEXT_DECISION_RULE1 (0x3<<5)
  2147. #define XSTORM_L5CM_AG_CONTEXT_DECISION_RULE1_SHIFT 5
  2148. #define XSTORM_L5CM_AG_CONTEXT_AUX4_CF_EN (0x1<<7)
  2149. #define XSTORM_L5CM_AG_CONTEXT_AUX4_CF_EN_SHIFT 7
  2150. #elif defined(__LITTLE_ENDIAN)
  2151. u8 agg_vars2;
  2152. #define XSTORM_L5CM_AG_CONTEXT_AUX4_CF (0x3<<0)
  2153. #define XSTORM_L5CM_AG_CONTEXT_AUX4_CF_SHIFT 0
  2154. #define __XSTORM_L5CM_AG_CONTEXT_DQ_SPARE_FLAG_EN (0x1<<2)
  2155. #define __XSTORM_L5CM_AG_CONTEXT_DQ_SPARE_FLAG_EN_SHIFT 2
  2156. #define __XSTORM_L5CM_AG_CONTEXT_AUX8_FLAG (0x1<<3)
  2157. #define __XSTORM_L5CM_AG_CONTEXT_AUX8_FLAG_SHIFT 3
  2158. #define __XSTORM_L5CM_AG_CONTEXT_AUX9_FLAG (0x1<<4)
  2159. #define __XSTORM_L5CM_AG_CONTEXT_AUX9_FLAG_SHIFT 4
  2160. #define XSTORM_L5CM_AG_CONTEXT_DECISION_RULE1 (0x3<<5)
  2161. #define XSTORM_L5CM_AG_CONTEXT_DECISION_RULE1_SHIFT 5
  2162. #define XSTORM_L5CM_AG_CONTEXT_AUX4_CF_EN (0x1<<7)
  2163. #define XSTORM_L5CM_AG_CONTEXT_AUX4_CF_EN_SHIFT 7
  2164. u8 agg_vars3;
  2165. #define XSTORM_L5CM_AG_CONTEXT_PHYSICAL_QUEUE_NUM2 (0x3F<<0)
  2166. #define XSTORM_L5CM_AG_CONTEXT_PHYSICAL_QUEUE_NUM2_SHIFT 0
  2167. #define __XSTORM_L5CM_AG_CONTEXT_RX_TS_EN_CF (0x3<<6)
  2168. #define __XSTORM_L5CM_AG_CONTEXT_RX_TS_EN_CF_SHIFT 6
  2169. u8 __agg_vars4;
  2170. u8 cdu_reserved;
  2171. #endif
  2172. u32 more_to_send;
  2173. #if defined(__BIG_ENDIAN)
  2174. u16 agg_vars5;
  2175. #define XSTORM_L5CM_AG_CONTEXT_DECISION_RULE5 (0x3<<0)
  2176. #define XSTORM_L5CM_AG_CONTEXT_DECISION_RULE5_SHIFT 0
  2177. #define XSTORM_L5CM_AG_CONTEXT_PHYSICAL_QUEUE_NUM0 (0x3F<<2)
  2178. #define XSTORM_L5CM_AG_CONTEXT_PHYSICAL_QUEUE_NUM0_SHIFT 2
  2179. #define XSTORM_L5CM_AG_CONTEXT_PHYSICAL_QUEUE_NUM1 (0x3F<<8)
  2180. #define XSTORM_L5CM_AG_CONTEXT_PHYSICAL_QUEUE_NUM1_SHIFT 8
  2181. #define XSTORM_L5CM_AG_CONTEXT_DECISION_RULE2 (0x3<<14)
  2182. #define XSTORM_L5CM_AG_CONTEXT_DECISION_RULE2_SHIFT 14
  2183. u16 agg_val4_th;
  2184. #elif defined(__LITTLE_ENDIAN)
  2185. u16 agg_val4_th;
  2186. u16 agg_vars5;
  2187. #define XSTORM_L5CM_AG_CONTEXT_DECISION_RULE5 (0x3<<0)
  2188. #define XSTORM_L5CM_AG_CONTEXT_DECISION_RULE5_SHIFT 0
  2189. #define XSTORM_L5CM_AG_CONTEXT_PHYSICAL_QUEUE_NUM0 (0x3F<<2)
  2190. #define XSTORM_L5CM_AG_CONTEXT_PHYSICAL_QUEUE_NUM0_SHIFT 2
  2191. #define XSTORM_L5CM_AG_CONTEXT_PHYSICAL_QUEUE_NUM1 (0x3F<<8)
  2192. #define XSTORM_L5CM_AG_CONTEXT_PHYSICAL_QUEUE_NUM1_SHIFT 8
  2193. #define XSTORM_L5CM_AG_CONTEXT_DECISION_RULE2 (0x3<<14)
  2194. #define XSTORM_L5CM_AG_CONTEXT_DECISION_RULE2_SHIFT 14
  2195. #endif
  2196. struct xstorm_tcp_tcp_ag_context_section tcp;
  2197. #if defined(__BIG_ENDIAN)
  2198. u16 agg_vars7;
  2199. #define __XSTORM_L5CM_AG_CONTEXT_AGG_VAL11_DECISION_RULE (0x7<<0)
  2200. #define __XSTORM_L5CM_AG_CONTEXT_AGG_VAL11_DECISION_RULE_SHIFT 0
  2201. #define __XSTORM_L5CM_AG_CONTEXT_AUX13_FLAG (0x1<<3)
  2202. #define __XSTORM_L5CM_AG_CONTEXT_AUX13_FLAG_SHIFT 3
  2203. #define __XSTORM_L5CM_AG_CONTEXT_STORMS_SYNC_CF (0x3<<4)
  2204. #define __XSTORM_L5CM_AG_CONTEXT_STORMS_SYNC_CF_SHIFT 4
  2205. #define XSTORM_L5CM_AG_CONTEXT_DECISION_RULE3 (0x3<<6)
  2206. #define XSTORM_L5CM_AG_CONTEXT_DECISION_RULE3_SHIFT 6
  2207. #define XSTORM_L5CM_AG_CONTEXT_AUX1_CF (0x3<<8)
  2208. #define XSTORM_L5CM_AG_CONTEXT_AUX1_CF_SHIFT 8
  2209. #define __XSTORM_L5CM_AG_CONTEXT_COMPLETION_SEQ_DECISION_MASK (0x1<<10)
  2210. #define __XSTORM_L5CM_AG_CONTEXT_COMPLETION_SEQ_DECISION_MASK_SHIFT 10
  2211. #define __XSTORM_L5CM_AG_CONTEXT_AUX1_CF_EN (0x1<<11)
  2212. #define __XSTORM_L5CM_AG_CONTEXT_AUX1_CF_EN_SHIFT 11
  2213. #define __XSTORM_L5CM_AG_CONTEXT_AUX10_FLAG (0x1<<12)
  2214. #define __XSTORM_L5CM_AG_CONTEXT_AUX10_FLAG_SHIFT 12
  2215. #define __XSTORM_L5CM_AG_CONTEXT_AUX11_FLAG (0x1<<13)
  2216. #define __XSTORM_L5CM_AG_CONTEXT_AUX11_FLAG_SHIFT 13
  2217. #define __XSTORM_L5CM_AG_CONTEXT_AUX12_FLAG (0x1<<14)
  2218. #define __XSTORM_L5CM_AG_CONTEXT_AUX12_FLAG_SHIFT 14
  2219. #define __XSTORM_L5CM_AG_CONTEXT_RX_WND_SCL_EN (0x1<<15)
  2220. #define __XSTORM_L5CM_AG_CONTEXT_RX_WND_SCL_EN_SHIFT 15
  2221. u8 agg_val3_th;
  2222. u8 agg_vars6;
  2223. #define XSTORM_L5CM_AG_CONTEXT_DECISION_RULE6 (0x7<<0)
  2224. #define XSTORM_L5CM_AG_CONTEXT_DECISION_RULE6_SHIFT 0
  2225. #define XSTORM_L5CM_AG_CONTEXT_DECISION_RULE7 (0x7<<3)
  2226. #define XSTORM_L5CM_AG_CONTEXT_DECISION_RULE7_SHIFT 3
  2227. #define XSTORM_L5CM_AG_CONTEXT_DECISION_RULE4 (0x3<<6)
  2228. #define XSTORM_L5CM_AG_CONTEXT_DECISION_RULE4_SHIFT 6
  2229. #elif defined(__LITTLE_ENDIAN)
  2230. u8 agg_vars6;
  2231. #define XSTORM_L5CM_AG_CONTEXT_DECISION_RULE6 (0x7<<0)
  2232. #define XSTORM_L5CM_AG_CONTEXT_DECISION_RULE6_SHIFT 0
  2233. #define XSTORM_L5CM_AG_CONTEXT_DECISION_RULE7 (0x7<<3)
  2234. #define XSTORM_L5CM_AG_CONTEXT_DECISION_RULE7_SHIFT 3
  2235. #define XSTORM_L5CM_AG_CONTEXT_DECISION_RULE4 (0x3<<6)
  2236. #define XSTORM_L5CM_AG_CONTEXT_DECISION_RULE4_SHIFT 6
  2237. u8 agg_val3_th;
  2238. u16 agg_vars7;
  2239. #define __XSTORM_L5CM_AG_CONTEXT_AGG_VAL11_DECISION_RULE (0x7<<0)
  2240. #define __XSTORM_L5CM_AG_CONTEXT_AGG_VAL11_DECISION_RULE_SHIFT 0
  2241. #define __XSTORM_L5CM_AG_CONTEXT_AUX13_FLAG (0x1<<3)
  2242. #define __XSTORM_L5CM_AG_CONTEXT_AUX13_FLAG_SHIFT 3
  2243. #define __XSTORM_L5CM_AG_CONTEXT_STORMS_SYNC_CF (0x3<<4)
  2244. #define __XSTORM_L5CM_AG_CONTEXT_STORMS_SYNC_CF_SHIFT 4
  2245. #define XSTORM_L5CM_AG_CONTEXT_DECISION_RULE3 (0x3<<6)
  2246. #define XSTORM_L5CM_AG_CONTEXT_DECISION_RULE3_SHIFT 6
  2247. #define XSTORM_L5CM_AG_CONTEXT_AUX1_CF (0x3<<8)
  2248. #define XSTORM_L5CM_AG_CONTEXT_AUX1_CF_SHIFT 8
  2249. #define __XSTORM_L5CM_AG_CONTEXT_COMPLETION_SEQ_DECISION_MASK (0x1<<10)
  2250. #define __XSTORM_L5CM_AG_CONTEXT_COMPLETION_SEQ_DECISION_MASK_SHIFT 10
  2251. #define __XSTORM_L5CM_AG_CONTEXT_AUX1_CF_EN (0x1<<11)
  2252. #define __XSTORM_L5CM_AG_CONTEXT_AUX1_CF_EN_SHIFT 11
  2253. #define __XSTORM_L5CM_AG_CONTEXT_AUX10_FLAG (0x1<<12)
  2254. #define __XSTORM_L5CM_AG_CONTEXT_AUX10_FLAG_SHIFT 12
  2255. #define __XSTORM_L5CM_AG_CONTEXT_AUX11_FLAG (0x1<<13)
  2256. #define __XSTORM_L5CM_AG_CONTEXT_AUX11_FLAG_SHIFT 13
  2257. #define __XSTORM_L5CM_AG_CONTEXT_AUX12_FLAG (0x1<<14)
  2258. #define __XSTORM_L5CM_AG_CONTEXT_AUX12_FLAG_SHIFT 14
  2259. #define __XSTORM_L5CM_AG_CONTEXT_RX_WND_SCL_EN (0x1<<15)
  2260. #define __XSTORM_L5CM_AG_CONTEXT_RX_WND_SCL_EN_SHIFT 15
  2261. #endif
  2262. #if defined(__BIG_ENDIAN)
  2263. u16 __agg_val11_th;
  2264. u16 __gen_data;
  2265. #elif defined(__LITTLE_ENDIAN)
  2266. u16 __gen_data;
  2267. u16 __agg_val11_th;
  2268. #endif
  2269. #if defined(__BIG_ENDIAN)
  2270. u8 __reserved1;
  2271. u8 __agg_val6_th;
  2272. u16 __agg_val9;
  2273. #elif defined(__LITTLE_ENDIAN)
  2274. u16 __agg_val9;
  2275. u8 __agg_val6_th;
  2276. u8 __reserved1;
  2277. #endif
  2278. #if defined(__BIG_ENDIAN)
  2279. u16 agg_val2_th;
  2280. u16 agg_val2;
  2281. #elif defined(__LITTLE_ENDIAN)
  2282. u16 agg_val2;
  2283. u16 agg_val2_th;
  2284. #endif
  2285. u32 agg_vars8;
  2286. #define XSTORM_L5CM_AG_CONTEXT_AGG_MISC2 (0xFFFFFF<<0)
  2287. #define XSTORM_L5CM_AG_CONTEXT_AGG_MISC2_SHIFT 0
  2288. #define XSTORM_L5CM_AG_CONTEXT_AGG_MISC3 (0xFF<<24)
  2289. #define XSTORM_L5CM_AG_CONTEXT_AGG_MISC3_SHIFT 24
  2290. #if defined(__BIG_ENDIAN)
  2291. u16 agg_misc0;
  2292. u16 agg_val4;
  2293. #elif defined(__LITTLE_ENDIAN)
  2294. u16 agg_val4;
  2295. u16 agg_misc0;
  2296. #endif
  2297. #if defined(__BIG_ENDIAN)
  2298. u8 agg_val3;
  2299. u8 agg_val6;
  2300. u8 agg_val5_th;
  2301. u8 agg_val5;
  2302. #elif defined(__LITTLE_ENDIAN)
  2303. u8 agg_val5;
  2304. u8 agg_val5_th;
  2305. u8 agg_val6;
  2306. u8 agg_val3;
  2307. #endif
  2308. #if defined(__BIG_ENDIAN)
  2309. u16 __agg_misc1;
  2310. u16 agg_limit1;
  2311. #elif defined(__LITTLE_ENDIAN)
  2312. u16 agg_limit1;
  2313. u16 __agg_misc1;
  2314. #endif
  2315. u32 completion_seq;
  2316. u32 agg_misc4;
  2317. u32 rst_seq_num;
  2318. };
  2319. /*
  2320. * ABTS info $$KEEP_ENDIANNESS$$
  2321. */
  2322. struct fcoe_abts_info {
  2323. __le16 aborted_task_id;
  2324. __le16 reserved0;
  2325. __le32 reserved1;
  2326. };
  2327. /*
  2328. * Fixed size structure in order to plant it in Union structure
  2329. * $$KEEP_ENDIANNESS$$
  2330. */
  2331. struct fcoe_abts_rsp_union {
  2332. u8 r_ctl;
  2333. u8 rsrv[3];
  2334. __le32 abts_rsp_payload[7];
  2335. };
  2336. /*
  2337. * 4 regs size $$KEEP_ENDIANNESS$$
  2338. */
  2339. struct fcoe_bd_ctx {
  2340. __le32 buf_addr_hi;
  2341. __le32 buf_addr_lo;
  2342. __le16 buf_len;
  2343. __le16 rsrv0;
  2344. __le16 flags;
  2345. __le16 rsrv1;
  2346. };
  2347. /*
  2348. * FCoE cached sges context $$KEEP_ENDIANNESS$$
  2349. */
  2350. struct fcoe_cached_sge_ctx {
  2351. struct regpair cur_buf_addr;
  2352. __le16 cur_buf_rem;
  2353. __le16 second_buf_rem;
  2354. struct regpair second_buf_addr;
  2355. };
  2356. /*
  2357. * Cleanup info $$KEEP_ENDIANNESS$$
  2358. */
  2359. struct fcoe_cleanup_info {
  2360. __le16 cleaned_task_id;
  2361. __le16 rolled_tx_seq_cnt;
  2362. __le32 rolled_tx_data_offset;
  2363. };
  2364. /*
  2365. * Fcp RSP flags $$KEEP_ENDIANNESS$$
  2366. */
  2367. struct fcoe_fcp_rsp_flags {
  2368. u8 flags;
  2369. #define FCOE_FCP_RSP_FLAGS_FCP_RSP_LEN_VALID (0x1<<0)
  2370. #define FCOE_FCP_RSP_FLAGS_FCP_RSP_LEN_VALID_SHIFT 0
  2371. #define FCOE_FCP_RSP_FLAGS_FCP_SNS_LEN_VALID (0x1<<1)
  2372. #define FCOE_FCP_RSP_FLAGS_FCP_SNS_LEN_VALID_SHIFT 1
  2373. #define FCOE_FCP_RSP_FLAGS_FCP_RESID_OVER (0x1<<2)
  2374. #define FCOE_FCP_RSP_FLAGS_FCP_RESID_OVER_SHIFT 2
  2375. #define FCOE_FCP_RSP_FLAGS_FCP_RESID_UNDER (0x1<<3)
  2376. #define FCOE_FCP_RSP_FLAGS_FCP_RESID_UNDER_SHIFT 3
  2377. #define FCOE_FCP_RSP_FLAGS_FCP_CONF_REQ (0x1<<4)
  2378. #define FCOE_FCP_RSP_FLAGS_FCP_CONF_REQ_SHIFT 4
  2379. #define FCOE_FCP_RSP_FLAGS_FCP_BIDI_FLAGS (0x7<<5)
  2380. #define FCOE_FCP_RSP_FLAGS_FCP_BIDI_FLAGS_SHIFT 5
  2381. };
  2382. /*
  2383. * Fcp RSP payload $$KEEP_ENDIANNESS$$
  2384. */
  2385. struct fcoe_fcp_rsp_payload {
  2386. struct regpair reserved0;
  2387. __le32 fcp_resid;
  2388. u8 scsi_status_code;
  2389. struct fcoe_fcp_rsp_flags fcp_flags;
  2390. __le16 retry_delay_timer;
  2391. __le32 fcp_rsp_len;
  2392. __le32 fcp_sns_len;
  2393. };
  2394. /*
  2395. * Fixed size structure in order to plant it in Union structure
  2396. * $$KEEP_ENDIANNESS$$
  2397. */
  2398. struct fcoe_fcp_rsp_union {
  2399. struct fcoe_fcp_rsp_payload payload;
  2400. struct regpair reserved0;
  2401. };
  2402. /*
  2403. * FC header $$KEEP_ENDIANNESS$$
  2404. */
  2405. struct fcoe_fc_hdr {
  2406. u8 s_id[3];
  2407. u8 cs_ctl;
  2408. u8 d_id[3];
  2409. u8 r_ctl;
  2410. __le16 seq_cnt;
  2411. u8 df_ctl;
  2412. u8 seq_id;
  2413. u8 f_ctl[3];
  2414. u8 type;
  2415. __le32 parameters;
  2416. __le16 rx_id;
  2417. __le16 ox_id;
  2418. };
  2419. /*
  2420. * FC header union $$KEEP_ENDIANNESS$$
  2421. */
  2422. struct fcoe_mp_rsp_union {
  2423. struct fcoe_fc_hdr fc_hdr;
  2424. __le32 mp_payload_len;
  2425. __le32 rsrv;
  2426. };
  2427. /*
  2428. * Completion information $$KEEP_ENDIANNESS$$
  2429. */
  2430. union fcoe_comp_flow_info {
  2431. struct fcoe_fcp_rsp_union fcp_rsp;
  2432. struct fcoe_abts_rsp_union abts_rsp;
  2433. struct fcoe_mp_rsp_union mp_rsp;
  2434. __le32 opaque[8];
  2435. };
  2436. /*
  2437. * External ABTS info $$KEEP_ENDIANNESS$$
  2438. */
  2439. struct fcoe_ext_abts_info {
  2440. __le32 rsrv0[6];
  2441. struct fcoe_abts_info ctx;
  2442. };
  2443. /*
  2444. * External cleanup info $$KEEP_ENDIANNESS$$
  2445. */
  2446. struct fcoe_ext_cleanup_info {
  2447. __le32 rsrv0[6];
  2448. struct fcoe_cleanup_info ctx;
  2449. };
  2450. /*
  2451. * Fcoe FW Tx sequence context $$KEEP_ENDIANNESS$$
  2452. */
  2453. struct fcoe_fw_tx_seq_ctx {
  2454. __le32 data_offset;
  2455. __le16 seq_cnt;
  2456. __le16 rsrv0;
  2457. };
  2458. /*
  2459. * Fcoe external FW Tx sequence context $$KEEP_ENDIANNESS$$
  2460. */
  2461. struct fcoe_ext_fw_tx_seq_ctx {
  2462. __le32 rsrv0[6];
  2463. struct fcoe_fw_tx_seq_ctx ctx;
  2464. };
  2465. /*
  2466. * FCoE multiple sges context $$KEEP_ENDIANNESS$$
  2467. */
  2468. struct fcoe_mul_sges_ctx {
  2469. struct regpair cur_sge_addr;
  2470. __le16 cur_sge_off;
  2471. u8 cur_sge_idx;
  2472. u8 sgl_size;
  2473. };
  2474. /*
  2475. * FCoE external multiple sges context $$KEEP_ENDIANNESS$$
  2476. */
  2477. struct fcoe_ext_mul_sges_ctx {
  2478. struct fcoe_mul_sges_ctx mul_sgl;
  2479. struct regpair rsrv0;
  2480. };
  2481. /*
  2482. * FCP CMD payload $$KEEP_ENDIANNESS$$
  2483. */
  2484. struct fcoe_fcp_cmd_payload {
  2485. __le32 opaque[8];
  2486. };
  2487. /*
  2488. * Fcp xfr rdy payload $$KEEP_ENDIANNESS$$
  2489. */
  2490. struct fcoe_fcp_xfr_rdy_payload {
  2491. __le32 burst_len;
  2492. __le32 data_ro;
  2493. };
  2494. /*
  2495. * FC frame $$KEEP_ENDIANNESS$$
  2496. */
  2497. struct fcoe_fc_frame {
  2498. struct fcoe_fc_hdr fc_hdr;
  2499. __le32 reserved0[2];
  2500. };
  2501. /*
  2502. * FCoE KCQ CQE parameters $$KEEP_ENDIANNESS$$
  2503. */
  2504. union fcoe_kcqe_params {
  2505. __le32 reserved0[4];
  2506. };
  2507. /*
  2508. * FCoE KCQ CQE $$KEEP_ENDIANNESS$$
  2509. */
  2510. struct fcoe_kcqe {
  2511. __le32 fcoe_conn_id;
  2512. __le32 completion_status;
  2513. __le32 fcoe_conn_context_id;
  2514. union fcoe_kcqe_params params;
  2515. __le16 qe_self_seq;
  2516. u8 op_code;
  2517. u8 flags;
  2518. #define FCOE_KCQE_RESERVED0 (0x7<<0)
  2519. #define FCOE_KCQE_RESERVED0_SHIFT 0
  2520. #define FCOE_KCQE_RAMROD_COMPLETION (0x1<<3)
  2521. #define FCOE_KCQE_RAMROD_COMPLETION_SHIFT 3
  2522. #define FCOE_KCQE_LAYER_CODE (0x7<<4)
  2523. #define FCOE_KCQE_LAYER_CODE_SHIFT 4
  2524. #define FCOE_KCQE_LINKED_WITH_NEXT (0x1<<7)
  2525. #define FCOE_KCQE_LINKED_WITH_NEXT_SHIFT 7
  2526. };
  2527. /*
  2528. * FCoE KWQE header $$KEEP_ENDIANNESS$$
  2529. */
  2530. struct fcoe_kwqe_header {
  2531. u8 op_code;
  2532. u8 flags;
  2533. #define FCOE_KWQE_HEADER_RESERVED0 (0xF<<0)
  2534. #define FCOE_KWQE_HEADER_RESERVED0_SHIFT 0
  2535. #define FCOE_KWQE_HEADER_LAYER_CODE (0x7<<4)
  2536. #define FCOE_KWQE_HEADER_LAYER_CODE_SHIFT 4
  2537. #define FCOE_KWQE_HEADER_RESERVED1 (0x1<<7)
  2538. #define FCOE_KWQE_HEADER_RESERVED1_SHIFT 7
  2539. };
  2540. /*
  2541. * FCoE firmware init request 1 $$KEEP_ENDIANNESS$$
  2542. */
  2543. struct fcoe_kwqe_init1 {
  2544. __le16 num_tasks;
  2545. struct fcoe_kwqe_header hdr;
  2546. __le32 task_list_pbl_addr_lo;
  2547. __le32 task_list_pbl_addr_hi;
  2548. __le32 dummy_buffer_addr_lo;
  2549. __le32 dummy_buffer_addr_hi;
  2550. __le16 sq_num_wqes;
  2551. __le16 rq_num_wqes;
  2552. __le16 rq_buffer_log_size;
  2553. __le16 cq_num_wqes;
  2554. __le16 mtu;
  2555. u8 num_sessions_log;
  2556. u8 flags;
  2557. #define FCOE_KWQE_INIT1_LOG_PAGE_SIZE (0xF<<0)
  2558. #define FCOE_KWQE_INIT1_LOG_PAGE_SIZE_SHIFT 0
  2559. #define FCOE_KWQE_INIT1_LOG_CACHED_PBES_PER_FUNC (0x7<<4)
  2560. #define FCOE_KWQE_INIT1_LOG_CACHED_PBES_PER_FUNC_SHIFT 4
  2561. #define FCOE_KWQE_INIT1_RESERVED1 (0x1<<7)
  2562. #define FCOE_KWQE_INIT1_RESERVED1_SHIFT 7
  2563. };
  2564. /*
  2565. * FCoE firmware init request 2 $$KEEP_ENDIANNESS$$
  2566. */
  2567. struct fcoe_kwqe_init2 {
  2568. u8 hsi_major_version;
  2569. u8 hsi_minor_version;
  2570. struct fcoe_kwqe_header hdr;
  2571. __le32 hash_tbl_pbl_addr_lo;
  2572. __le32 hash_tbl_pbl_addr_hi;
  2573. __le32 t2_hash_tbl_addr_lo;
  2574. __le32 t2_hash_tbl_addr_hi;
  2575. __le32 t2_ptr_hash_tbl_addr_lo;
  2576. __le32 t2_ptr_hash_tbl_addr_hi;
  2577. __le32 free_list_count;
  2578. };
  2579. /*
  2580. * FCoE firmware init request 3 $$KEEP_ENDIANNESS$$
  2581. */
  2582. struct fcoe_kwqe_init3 {
  2583. __le16 reserved0;
  2584. struct fcoe_kwqe_header hdr;
  2585. __le32 error_bit_map_lo;
  2586. __le32 error_bit_map_hi;
  2587. u8 perf_config;
  2588. u8 reserved21[3];
  2589. __le32 reserved2[4];
  2590. };
  2591. /*
  2592. * FCoE connection offload request 1 $$KEEP_ENDIANNESS$$
  2593. */
  2594. struct fcoe_kwqe_conn_offload1 {
  2595. __le16 fcoe_conn_id;
  2596. struct fcoe_kwqe_header hdr;
  2597. __le32 sq_addr_lo;
  2598. __le32 sq_addr_hi;
  2599. __le32 rq_pbl_addr_lo;
  2600. __le32 rq_pbl_addr_hi;
  2601. __le32 rq_first_pbe_addr_lo;
  2602. __le32 rq_first_pbe_addr_hi;
  2603. __le16 rq_prod;
  2604. __le16 reserved0;
  2605. };
  2606. /*
  2607. * FCoE connection offload request 2 $$KEEP_ENDIANNESS$$
  2608. */
  2609. struct fcoe_kwqe_conn_offload2 {
  2610. __le16 tx_max_fc_pay_len;
  2611. struct fcoe_kwqe_header hdr;
  2612. __le32 cq_addr_lo;
  2613. __le32 cq_addr_hi;
  2614. __le32 xferq_addr_lo;
  2615. __le32 xferq_addr_hi;
  2616. __le32 conn_db_addr_lo;
  2617. __le32 conn_db_addr_hi;
  2618. __le32 reserved1;
  2619. };
  2620. /*
  2621. * FCoE connection offload request 3 $$KEEP_ENDIANNESS$$
  2622. */
  2623. struct fcoe_kwqe_conn_offload3 {
  2624. __le16 vlan_tag;
  2625. #define FCOE_KWQE_CONN_OFFLOAD3_VLAN_ID (0xFFF<<0)
  2626. #define FCOE_KWQE_CONN_OFFLOAD3_VLAN_ID_SHIFT 0
  2627. #define FCOE_KWQE_CONN_OFFLOAD3_CFI (0x1<<12)
  2628. #define FCOE_KWQE_CONN_OFFLOAD3_CFI_SHIFT 12
  2629. #define FCOE_KWQE_CONN_OFFLOAD3_PRIORITY (0x7<<13)
  2630. #define FCOE_KWQE_CONN_OFFLOAD3_PRIORITY_SHIFT 13
  2631. struct fcoe_kwqe_header hdr;
  2632. u8 s_id[3];
  2633. u8 tx_max_conc_seqs_c3;
  2634. u8 d_id[3];
  2635. u8 flags;
  2636. #define FCOE_KWQE_CONN_OFFLOAD3_B_MUL_N_PORT_IDS (0x1<<0)
  2637. #define FCOE_KWQE_CONN_OFFLOAD3_B_MUL_N_PORT_IDS_SHIFT 0
  2638. #define FCOE_KWQE_CONN_OFFLOAD3_B_E_D_TOV_RES (0x1<<1)
  2639. #define FCOE_KWQE_CONN_OFFLOAD3_B_E_D_TOV_RES_SHIFT 1
  2640. #define FCOE_KWQE_CONN_OFFLOAD3_B_CONT_INCR_SEQ_CNT (0x1<<2)
  2641. #define FCOE_KWQE_CONN_OFFLOAD3_B_CONT_INCR_SEQ_CNT_SHIFT 2
  2642. #define FCOE_KWQE_CONN_OFFLOAD3_B_CONF_REQ (0x1<<3)
  2643. #define FCOE_KWQE_CONN_OFFLOAD3_B_CONF_REQ_SHIFT 3
  2644. #define FCOE_KWQE_CONN_OFFLOAD3_B_REC_VALID (0x1<<4)
  2645. #define FCOE_KWQE_CONN_OFFLOAD3_B_REC_VALID_SHIFT 4
  2646. #define FCOE_KWQE_CONN_OFFLOAD3_B_C2_VALID (0x1<<5)
  2647. #define FCOE_KWQE_CONN_OFFLOAD3_B_C2_VALID_SHIFT 5
  2648. #define FCOE_KWQE_CONN_OFFLOAD3_B_ACK_0 (0x1<<6)
  2649. #define FCOE_KWQE_CONN_OFFLOAD3_B_ACK_0_SHIFT 6
  2650. #define FCOE_KWQE_CONN_OFFLOAD3_B_VLAN_FLAG (0x1<<7)
  2651. #define FCOE_KWQE_CONN_OFFLOAD3_B_VLAN_FLAG_SHIFT 7
  2652. __le32 reserved;
  2653. __le32 confq_first_pbe_addr_lo;
  2654. __le32 confq_first_pbe_addr_hi;
  2655. __le16 tx_total_conc_seqs;
  2656. __le16 rx_max_fc_pay_len;
  2657. __le16 rx_total_conc_seqs;
  2658. u8 rx_max_conc_seqs_c3;
  2659. u8 rx_open_seqs_exch_c3;
  2660. };
  2661. /*
  2662. * FCoE connection offload request 4 $$KEEP_ENDIANNESS$$
  2663. */
  2664. struct fcoe_kwqe_conn_offload4 {
  2665. u8 e_d_tov_timer_val;
  2666. u8 reserved2;
  2667. struct fcoe_kwqe_header hdr;
  2668. u8 src_mac_addr_lo[2];
  2669. u8 src_mac_addr_mid[2];
  2670. u8 src_mac_addr_hi[2];
  2671. u8 dst_mac_addr_hi[2];
  2672. u8 dst_mac_addr_lo[2];
  2673. u8 dst_mac_addr_mid[2];
  2674. __le32 lcq_addr_lo;
  2675. __le32 lcq_addr_hi;
  2676. __le32 confq_pbl_base_addr_lo;
  2677. __le32 confq_pbl_base_addr_hi;
  2678. };
  2679. /*
  2680. * FCoE connection enable request $$KEEP_ENDIANNESS$$
  2681. */
  2682. struct fcoe_kwqe_conn_enable_disable {
  2683. __le16 reserved0;
  2684. struct fcoe_kwqe_header hdr;
  2685. u8 src_mac_addr_lo[2];
  2686. u8 src_mac_addr_mid[2];
  2687. u8 src_mac_addr_hi[2];
  2688. u16 vlan_tag;
  2689. #define FCOE_KWQE_CONN_ENABLE_DISABLE_VLAN_ID (0xFFF<<0)
  2690. #define FCOE_KWQE_CONN_ENABLE_DISABLE_VLAN_ID_SHIFT 0
  2691. #define FCOE_KWQE_CONN_ENABLE_DISABLE_CFI (0x1<<12)
  2692. #define FCOE_KWQE_CONN_ENABLE_DISABLE_CFI_SHIFT 12
  2693. #define FCOE_KWQE_CONN_ENABLE_DISABLE_PRIORITY (0x7<<13)
  2694. #define FCOE_KWQE_CONN_ENABLE_DISABLE_PRIORITY_SHIFT 13
  2695. u8 dst_mac_addr_lo[2];
  2696. u8 dst_mac_addr_mid[2];
  2697. u8 dst_mac_addr_hi[2];
  2698. __le16 reserved1;
  2699. u8 s_id[3];
  2700. u8 vlan_flag;
  2701. u8 d_id[3];
  2702. u8 reserved3;
  2703. __le32 context_id;
  2704. __le32 conn_id;
  2705. __le32 reserved4;
  2706. };
  2707. /*
  2708. * FCoE connection destroy request $$KEEP_ENDIANNESS$$
  2709. */
  2710. struct fcoe_kwqe_conn_destroy {
  2711. __le16 reserved0;
  2712. struct fcoe_kwqe_header hdr;
  2713. __le32 context_id;
  2714. __le32 conn_id;
  2715. __le32 reserved1[5];
  2716. };
  2717. /*
  2718. * FCoe destroy request $$KEEP_ENDIANNESS$$
  2719. */
  2720. struct fcoe_kwqe_destroy {
  2721. __le16 reserved0;
  2722. struct fcoe_kwqe_header hdr;
  2723. __le32 reserved1[7];
  2724. };
  2725. /*
  2726. * FCoe statistics request $$KEEP_ENDIANNESS$$
  2727. */
  2728. struct fcoe_kwqe_stat {
  2729. __le16 reserved0;
  2730. struct fcoe_kwqe_header hdr;
  2731. __le32 stat_params_addr_lo;
  2732. __le32 stat_params_addr_hi;
  2733. __le32 reserved1[5];
  2734. };
  2735. /*
  2736. * FCoE KWQ WQE $$KEEP_ENDIANNESS$$
  2737. */
  2738. union fcoe_kwqe {
  2739. struct fcoe_kwqe_init1 init1;
  2740. struct fcoe_kwqe_init2 init2;
  2741. struct fcoe_kwqe_init3 init3;
  2742. struct fcoe_kwqe_conn_offload1 conn_offload1;
  2743. struct fcoe_kwqe_conn_offload2 conn_offload2;
  2744. struct fcoe_kwqe_conn_offload3 conn_offload3;
  2745. struct fcoe_kwqe_conn_offload4 conn_offload4;
  2746. struct fcoe_kwqe_conn_enable_disable conn_enable_disable;
  2747. struct fcoe_kwqe_conn_destroy conn_destroy;
  2748. struct fcoe_kwqe_destroy destroy;
  2749. struct fcoe_kwqe_stat statistics;
  2750. };
  2751. /*
  2752. * TX SGL context $$KEEP_ENDIANNESS$$
  2753. */
  2754. union fcoe_sgl_union_ctx {
  2755. struct fcoe_cached_sge_ctx cached_sge;
  2756. struct fcoe_ext_mul_sges_ctx sgl;
  2757. __le32 opaque[5];
  2758. };
  2759. /*
  2760. * Data-In/ELS/BLS information $$KEEP_ENDIANNESS$$
  2761. */
  2762. struct fcoe_read_flow_info {
  2763. union fcoe_sgl_union_ctx sgl_ctx;
  2764. __le32 rsrv0[3];
  2765. };
  2766. /*
  2767. * Fcoe stat context $$KEEP_ENDIANNESS$$
  2768. */
  2769. struct fcoe_s_stat_ctx {
  2770. u8 flags;
  2771. #define FCOE_S_STAT_CTX_ACTIVE (0x1<<0)
  2772. #define FCOE_S_STAT_CTX_ACTIVE_SHIFT 0
  2773. #define FCOE_S_STAT_CTX_ACK_ABORT_SEQ_COND (0x1<<1)
  2774. #define FCOE_S_STAT_CTX_ACK_ABORT_SEQ_COND_SHIFT 1
  2775. #define FCOE_S_STAT_CTX_ABTS_PERFORMED (0x1<<2)
  2776. #define FCOE_S_STAT_CTX_ABTS_PERFORMED_SHIFT 2
  2777. #define FCOE_S_STAT_CTX_SEQ_TIMEOUT (0x1<<3)
  2778. #define FCOE_S_STAT_CTX_SEQ_TIMEOUT_SHIFT 3
  2779. #define FCOE_S_STAT_CTX_P_RJT (0x1<<4)
  2780. #define FCOE_S_STAT_CTX_P_RJT_SHIFT 4
  2781. #define FCOE_S_STAT_CTX_ACK_EOFT (0x1<<5)
  2782. #define FCOE_S_STAT_CTX_ACK_EOFT_SHIFT 5
  2783. #define FCOE_S_STAT_CTX_RSRV1 (0x3<<6)
  2784. #define FCOE_S_STAT_CTX_RSRV1_SHIFT 6
  2785. };
  2786. /*
  2787. * Fcoe rx seq context $$KEEP_ENDIANNESS$$
  2788. */
  2789. struct fcoe_rx_seq_ctx {
  2790. u8 seq_id;
  2791. struct fcoe_s_stat_ctx s_stat;
  2792. __le16 seq_cnt;
  2793. __le32 low_exp_ro;
  2794. __le32 high_exp_ro;
  2795. };
  2796. /*
  2797. * Fcoe rx_wr union context $$KEEP_ENDIANNESS$$
  2798. */
  2799. union fcoe_rx_wr_union_ctx {
  2800. struct fcoe_read_flow_info read_info;
  2801. union fcoe_comp_flow_info comp_info;
  2802. __le32 opaque[8];
  2803. };
  2804. /*
  2805. * FCoE SQ element $$KEEP_ENDIANNESS$$
  2806. */
  2807. struct fcoe_sqe {
  2808. __le16 wqe;
  2809. #define FCOE_SQE_TASK_ID (0x7FFF<<0)
  2810. #define FCOE_SQE_TASK_ID_SHIFT 0
  2811. #define FCOE_SQE_TOGGLE_BIT (0x1<<15)
  2812. #define FCOE_SQE_TOGGLE_BIT_SHIFT 15
  2813. };
  2814. /*
  2815. * 14 regs $$KEEP_ENDIANNESS$$
  2816. */
  2817. struct fcoe_tce_tx_only {
  2818. union fcoe_sgl_union_ctx sgl_ctx;
  2819. __le32 rsrv0;
  2820. };
  2821. /*
  2822. * 32 bytes (8 regs) used for TX only purposes $$KEEP_ENDIANNESS$$
  2823. */
  2824. union fcoe_tx_wr_rx_rd_union_ctx {
  2825. struct fcoe_fc_frame tx_frame;
  2826. struct fcoe_fcp_cmd_payload fcp_cmd;
  2827. struct fcoe_ext_cleanup_info cleanup;
  2828. struct fcoe_ext_abts_info abts;
  2829. struct fcoe_ext_fw_tx_seq_ctx tx_seq;
  2830. __le32 opaque[8];
  2831. };
  2832. /*
  2833. * tce_tx_wr_rx_rd_const $$KEEP_ENDIANNESS$$
  2834. */
  2835. struct fcoe_tce_tx_wr_rx_rd_const {
  2836. u8 init_flags;
  2837. #define FCOE_TCE_TX_WR_RX_RD_CONST_TASK_TYPE (0x7<<0)
  2838. #define FCOE_TCE_TX_WR_RX_RD_CONST_TASK_TYPE_SHIFT 0
  2839. #define FCOE_TCE_TX_WR_RX_RD_CONST_DEV_TYPE (0x1<<3)
  2840. #define FCOE_TCE_TX_WR_RX_RD_CONST_DEV_TYPE_SHIFT 3
  2841. #define FCOE_TCE_TX_WR_RX_RD_CONST_CLASS_TYPE (0x1<<4)
  2842. #define FCOE_TCE_TX_WR_RX_RD_CONST_CLASS_TYPE_SHIFT 4
  2843. #define FCOE_TCE_TX_WR_RX_RD_CONST_CACHED_SGE (0x3<<5)
  2844. #define FCOE_TCE_TX_WR_RX_RD_CONST_CACHED_SGE_SHIFT 5
  2845. #define FCOE_TCE_TX_WR_RX_RD_CONST_SUPPORT_REC_TOV (0x1<<7)
  2846. #define FCOE_TCE_TX_WR_RX_RD_CONST_SUPPORT_REC_TOV_SHIFT 7
  2847. u8 tx_flags;
  2848. #define FCOE_TCE_TX_WR_RX_RD_CONST_TX_VALID (0x1<<0)
  2849. #define FCOE_TCE_TX_WR_RX_RD_CONST_TX_VALID_SHIFT 0
  2850. #define FCOE_TCE_TX_WR_RX_RD_CONST_TX_STATE (0xF<<1)
  2851. #define FCOE_TCE_TX_WR_RX_RD_CONST_TX_STATE_SHIFT 1
  2852. #define FCOE_TCE_TX_WR_RX_RD_CONST_RSRV1 (0x1<<5)
  2853. #define FCOE_TCE_TX_WR_RX_RD_CONST_RSRV1_SHIFT 5
  2854. #define FCOE_TCE_TX_WR_RX_RD_CONST_TX_SEQ_INIT (0x1<<6)
  2855. #define FCOE_TCE_TX_WR_RX_RD_CONST_TX_SEQ_INIT_SHIFT 6
  2856. #define FCOE_TCE_TX_WR_RX_RD_CONST_TX_COMP_TRNS (0x1<<7)
  2857. #define FCOE_TCE_TX_WR_RX_RD_CONST_TX_COMP_TRNS_SHIFT 7
  2858. __le16 rsrv3;
  2859. __le32 verify_tx_seq;
  2860. };
  2861. /*
  2862. * tce_tx_wr_rx_rd $$KEEP_ENDIANNESS$$
  2863. */
  2864. struct fcoe_tce_tx_wr_rx_rd {
  2865. union fcoe_tx_wr_rx_rd_union_ctx union_ctx;
  2866. struct fcoe_tce_tx_wr_rx_rd_const const_ctx;
  2867. };
  2868. /*
  2869. * tce_rx_wr_tx_rd_const $$KEEP_ENDIANNESS$$
  2870. */
  2871. struct fcoe_tce_rx_wr_tx_rd_const {
  2872. __le32 data_2_trns;
  2873. __le32 init_flags;
  2874. #define FCOE_TCE_RX_WR_TX_RD_CONST_CID (0xFFFFFF<<0)
  2875. #define FCOE_TCE_RX_WR_TX_RD_CONST_CID_SHIFT 0
  2876. #define FCOE_TCE_RX_WR_TX_RD_CONST_RSRV0 (0xFF<<24)
  2877. #define FCOE_TCE_RX_WR_TX_RD_CONST_RSRV0_SHIFT 24
  2878. };
  2879. /*
  2880. * tce_rx_wr_tx_rd_var $$KEEP_ENDIANNESS$$
  2881. */
  2882. struct fcoe_tce_rx_wr_tx_rd_var {
  2883. __le16 rx_flags;
  2884. #define FCOE_TCE_RX_WR_TX_RD_VAR_RSRV1 (0xF<<0)
  2885. #define FCOE_TCE_RX_WR_TX_RD_VAR_RSRV1_SHIFT 0
  2886. #define FCOE_TCE_RX_WR_TX_RD_VAR_NUM_RQ_WQE (0x7<<4)
  2887. #define FCOE_TCE_RX_WR_TX_RD_VAR_NUM_RQ_WQE_SHIFT 4
  2888. #define FCOE_TCE_RX_WR_TX_RD_VAR_CONF_REQ (0x1<<7)
  2889. #define FCOE_TCE_RX_WR_TX_RD_VAR_CONF_REQ_SHIFT 7
  2890. #define FCOE_TCE_RX_WR_TX_RD_VAR_RX_STATE (0xF<<8)
  2891. #define FCOE_TCE_RX_WR_TX_RD_VAR_RX_STATE_SHIFT 8
  2892. #define FCOE_TCE_RX_WR_TX_RD_VAR_EXP_FIRST_FRAME (0x1<<12)
  2893. #define FCOE_TCE_RX_WR_TX_RD_VAR_EXP_FIRST_FRAME_SHIFT 12
  2894. #define FCOE_TCE_RX_WR_TX_RD_VAR_RX_SEQ_INIT (0x1<<13)
  2895. #define FCOE_TCE_RX_WR_TX_RD_VAR_RX_SEQ_INIT_SHIFT 13
  2896. #define FCOE_TCE_RX_WR_TX_RD_VAR_RSRV2 (0x1<<14)
  2897. #define FCOE_TCE_RX_WR_TX_RD_VAR_RSRV2_SHIFT 14
  2898. #define FCOE_TCE_RX_WR_TX_RD_VAR_RX_VALID (0x1<<15)
  2899. #define FCOE_TCE_RX_WR_TX_RD_VAR_RX_VALID_SHIFT 15
  2900. __le16 rx_id;
  2901. struct fcoe_fcp_xfr_rdy_payload fcp_xfr_rdy;
  2902. };
  2903. /*
  2904. * tce_rx_wr_tx_rd $$KEEP_ENDIANNESS$$
  2905. */
  2906. struct fcoe_tce_rx_wr_tx_rd {
  2907. struct fcoe_tce_rx_wr_tx_rd_const const_ctx;
  2908. struct fcoe_tce_rx_wr_tx_rd_var var_ctx;
  2909. };
  2910. /*
  2911. * tce_rx_only $$KEEP_ENDIANNESS$$
  2912. */
  2913. struct fcoe_tce_rx_only {
  2914. struct fcoe_rx_seq_ctx rx_seq_ctx;
  2915. union fcoe_rx_wr_union_ctx union_ctx;
  2916. };
  2917. /*
  2918. * task_ctx_entry $$KEEP_ENDIANNESS$$
  2919. */
  2920. struct fcoe_task_ctx_entry {
  2921. struct fcoe_tce_tx_only txwr_only;
  2922. struct fcoe_tce_tx_wr_rx_rd txwr_rxrd;
  2923. struct fcoe_tce_rx_wr_tx_rd rxwr_txrd;
  2924. struct fcoe_tce_rx_only rxwr_only;
  2925. };
  2926. /*
  2927. * FCoE XFRQ element $$KEEP_ENDIANNESS$$
  2928. */
  2929. struct fcoe_xfrqe {
  2930. __le16 wqe;
  2931. #define FCOE_XFRQE_TASK_ID (0x7FFF<<0)
  2932. #define FCOE_XFRQE_TASK_ID_SHIFT 0
  2933. #define FCOE_XFRQE_TOGGLE_BIT (0x1<<15)
  2934. #define FCOE_XFRQE_TOGGLE_BIT_SHIFT 15
  2935. };
  2936. /*
  2937. * Cached SGEs $$KEEP_ENDIANNESS$$
  2938. */
  2939. struct common_fcoe_sgl {
  2940. struct fcoe_bd_ctx sge[3];
  2941. };
  2942. /*
  2943. * FCoE SQ\XFRQ element
  2944. */
  2945. struct fcoe_cached_wqe {
  2946. struct fcoe_sqe sqe;
  2947. struct fcoe_xfrqe xfrqe;
  2948. };
  2949. /*
  2950. * FCoE connection enable\disable params passed by driver to FW in FCoE enable
  2951. * ramrod $$KEEP_ENDIANNESS$$
  2952. */
  2953. struct fcoe_conn_enable_disable_ramrod_params {
  2954. struct fcoe_kwqe_conn_enable_disable enable_disable_kwqe;
  2955. };
  2956. /*
  2957. * FCoE connection offload params passed by driver to FW in FCoE offload ramrod
  2958. * $$KEEP_ENDIANNESS$$
  2959. */
  2960. struct fcoe_conn_offload_ramrod_params {
  2961. struct fcoe_kwqe_conn_offload1 offload_kwqe1;
  2962. struct fcoe_kwqe_conn_offload2 offload_kwqe2;
  2963. struct fcoe_kwqe_conn_offload3 offload_kwqe3;
  2964. struct fcoe_kwqe_conn_offload4 offload_kwqe4;
  2965. };
  2966. struct ustorm_fcoe_mng_ctx {
  2967. #if defined(__BIG_ENDIAN)
  2968. u8 mid_seq_proc_flag;
  2969. u8 tce_in_cam_flag;
  2970. u8 tce_on_ior_flag;
  2971. u8 en_cached_tce_flag;
  2972. #elif defined(__LITTLE_ENDIAN)
  2973. u8 en_cached_tce_flag;
  2974. u8 tce_on_ior_flag;
  2975. u8 tce_in_cam_flag;
  2976. u8 mid_seq_proc_flag;
  2977. #endif
  2978. #if defined(__BIG_ENDIAN)
  2979. u8 tce_cam_addr;
  2980. u8 cached_conn_flag;
  2981. u16 rsrv0;
  2982. #elif defined(__LITTLE_ENDIAN)
  2983. u16 rsrv0;
  2984. u8 cached_conn_flag;
  2985. u8 tce_cam_addr;
  2986. #endif
  2987. #if defined(__BIG_ENDIAN)
  2988. u16 dma_tce_ram_addr;
  2989. u16 tce_ram_addr;
  2990. #elif defined(__LITTLE_ENDIAN)
  2991. u16 tce_ram_addr;
  2992. u16 dma_tce_ram_addr;
  2993. #endif
  2994. #if defined(__BIG_ENDIAN)
  2995. u16 ox_id;
  2996. u16 wr_done_seq;
  2997. #elif defined(__LITTLE_ENDIAN)
  2998. u16 wr_done_seq;
  2999. u16 ox_id;
  3000. #endif
  3001. struct regpair task_addr;
  3002. };
  3003. /*
  3004. * Parameters initialized during offloaded according to FLOGI/PLOGI/PRLI and
  3005. * used in FCoE context section
  3006. */
  3007. struct ustorm_fcoe_params {
  3008. #if defined(__BIG_ENDIAN)
  3009. u16 fcoe_conn_id;
  3010. u16 flags;
  3011. #define USTORM_FCOE_PARAMS_B_MUL_N_PORT_IDS (0x1<<0)
  3012. #define USTORM_FCOE_PARAMS_B_MUL_N_PORT_IDS_SHIFT 0
  3013. #define USTORM_FCOE_PARAMS_B_E_D_TOV_RES (0x1<<1)
  3014. #define USTORM_FCOE_PARAMS_B_E_D_TOV_RES_SHIFT 1
  3015. #define USTORM_FCOE_PARAMS_B_CONT_INCR_SEQ_CNT (0x1<<2)
  3016. #define USTORM_FCOE_PARAMS_B_CONT_INCR_SEQ_CNT_SHIFT 2
  3017. #define USTORM_FCOE_PARAMS_B_CONF_REQ (0x1<<3)
  3018. #define USTORM_FCOE_PARAMS_B_CONF_REQ_SHIFT 3
  3019. #define USTORM_FCOE_PARAMS_B_REC_VALID (0x1<<4)
  3020. #define USTORM_FCOE_PARAMS_B_REC_VALID_SHIFT 4
  3021. #define USTORM_FCOE_PARAMS_B_CQ_TOGGLE_BIT (0x1<<5)
  3022. #define USTORM_FCOE_PARAMS_B_CQ_TOGGLE_BIT_SHIFT 5
  3023. #define USTORM_FCOE_PARAMS_B_XFRQ_TOGGLE_BIT (0x1<<6)
  3024. #define USTORM_FCOE_PARAMS_B_XFRQ_TOGGLE_BIT_SHIFT 6
  3025. #define USTORM_FCOE_PARAMS_RSRV0 (0x1FF<<7)
  3026. #define USTORM_FCOE_PARAMS_RSRV0_SHIFT 7
  3027. #elif defined(__LITTLE_ENDIAN)
  3028. u16 flags;
  3029. #define USTORM_FCOE_PARAMS_B_MUL_N_PORT_IDS (0x1<<0)
  3030. #define USTORM_FCOE_PARAMS_B_MUL_N_PORT_IDS_SHIFT 0
  3031. #define USTORM_FCOE_PARAMS_B_E_D_TOV_RES (0x1<<1)
  3032. #define USTORM_FCOE_PARAMS_B_E_D_TOV_RES_SHIFT 1
  3033. #define USTORM_FCOE_PARAMS_B_CONT_INCR_SEQ_CNT (0x1<<2)
  3034. #define USTORM_FCOE_PARAMS_B_CONT_INCR_SEQ_CNT_SHIFT 2
  3035. #define USTORM_FCOE_PARAMS_B_CONF_REQ (0x1<<3)
  3036. #define USTORM_FCOE_PARAMS_B_CONF_REQ_SHIFT 3
  3037. #define USTORM_FCOE_PARAMS_B_REC_VALID (0x1<<4)
  3038. #define USTORM_FCOE_PARAMS_B_REC_VALID_SHIFT 4
  3039. #define USTORM_FCOE_PARAMS_B_CQ_TOGGLE_BIT (0x1<<5)
  3040. #define USTORM_FCOE_PARAMS_B_CQ_TOGGLE_BIT_SHIFT 5
  3041. #define USTORM_FCOE_PARAMS_B_XFRQ_TOGGLE_BIT (0x1<<6)
  3042. #define USTORM_FCOE_PARAMS_B_XFRQ_TOGGLE_BIT_SHIFT 6
  3043. #define USTORM_FCOE_PARAMS_RSRV0 (0x1FF<<7)
  3044. #define USTORM_FCOE_PARAMS_RSRV0_SHIFT 7
  3045. u16 fcoe_conn_id;
  3046. #endif
  3047. #if defined(__BIG_ENDIAN)
  3048. u8 hc_csdm_byte_en;
  3049. u8 func_id;
  3050. u8 port_id;
  3051. u8 vnic_id;
  3052. #elif defined(__LITTLE_ENDIAN)
  3053. u8 vnic_id;
  3054. u8 port_id;
  3055. u8 func_id;
  3056. u8 hc_csdm_byte_en;
  3057. #endif
  3058. #if defined(__BIG_ENDIAN)
  3059. u16 rx_total_conc_seqs;
  3060. u16 rx_max_fc_pay_len;
  3061. #elif defined(__LITTLE_ENDIAN)
  3062. u16 rx_max_fc_pay_len;
  3063. u16 rx_total_conc_seqs;
  3064. #endif
  3065. #if defined(__BIG_ENDIAN)
  3066. u8 task_pbe_idx_off;
  3067. u8 task_in_page_log_size;
  3068. u16 rx_max_conc_seqs;
  3069. #elif defined(__LITTLE_ENDIAN)
  3070. u16 rx_max_conc_seqs;
  3071. u8 task_in_page_log_size;
  3072. u8 task_pbe_idx_off;
  3073. #endif
  3074. };
  3075. /*
  3076. * FCoE 16-bits index structure
  3077. */
  3078. struct fcoe_idx16_fields {
  3079. u16 fields;
  3080. #define FCOE_IDX16_FIELDS_IDX (0x7FFF<<0)
  3081. #define FCOE_IDX16_FIELDS_IDX_SHIFT 0
  3082. #define FCOE_IDX16_FIELDS_MSB (0x1<<15)
  3083. #define FCOE_IDX16_FIELDS_MSB_SHIFT 15
  3084. };
  3085. /*
  3086. * FCoE 16-bits index union
  3087. */
  3088. union fcoe_idx16_field_union {
  3089. struct fcoe_idx16_fields fields;
  3090. u16 val;
  3091. };
  3092. /*
  3093. * Parameters required for placement according to SGL
  3094. */
  3095. struct ustorm_fcoe_data_place_mng {
  3096. #if defined(__BIG_ENDIAN)
  3097. u16 sge_off;
  3098. u8 num_sges;
  3099. u8 sge_idx;
  3100. #elif defined(__LITTLE_ENDIAN)
  3101. u8 sge_idx;
  3102. u8 num_sges;
  3103. u16 sge_off;
  3104. #endif
  3105. };
  3106. /*
  3107. * Parameters required for placement according to SGL
  3108. */
  3109. struct ustorm_fcoe_data_place {
  3110. struct ustorm_fcoe_data_place_mng cached_mng;
  3111. struct fcoe_bd_ctx cached_sge[2];
  3112. };
  3113. /*
  3114. * TX processing shall write and RX processing shall read from this section
  3115. */
  3116. union fcoe_u_tce_tx_wr_rx_rd_union {
  3117. struct fcoe_abts_info abts;
  3118. struct fcoe_cleanup_info cleanup;
  3119. struct fcoe_fw_tx_seq_ctx tx_seq_ctx;
  3120. u32 opaque[2];
  3121. };
  3122. /*
  3123. * TX processing shall write and RX processing shall read from this section
  3124. */
  3125. struct fcoe_u_tce_tx_wr_rx_rd {
  3126. union fcoe_u_tce_tx_wr_rx_rd_union union_ctx;
  3127. struct fcoe_tce_tx_wr_rx_rd_const const_ctx;
  3128. };
  3129. struct ustorm_fcoe_tce {
  3130. struct fcoe_u_tce_tx_wr_rx_rd txwr_rxrd;
  3131. struct fcoe_tce_rx_wr_tx_rd rxwr_txrd;
  3132. struct fcoe_tce_rx_only rxwr;
  3133. };
  3134. struct ustorm_fcoe_cache_ctx {
  3135. u32 rsrv0;
  3136. struct ustorm_fcoe_data_place data_place;
  3137. struct ustorm_fcoe_tce tce;
  3138. };
  3139. /*
  3140. * Ustorm FCoE Storm Context
  3141. */
  3142. struct ustorm_fcoe_st_context {
  3143. struct ustorm_fcoe_mng_ctx mng_ctx;
  3144. struct ustorm_fcoe_params fcoe_params;
  3145. struct regpair cq_base_addr;
  3146. struct regpair rq_pbl_base;
  3147. struct regpair rq_cur_page_addr;
  3148. struct regpair confq_pbl_base_addr;
  3149. struct regpair conn_db_base;
  3150. struct regpair xfrq_base_addr;
  3151. struct regpair lcq_base_addr;
  3152. #if defined(__BIG_ENDIAN)
  3153. union fcoe_idx16_field_union rq_cons;
  3154. union fcoe_idx16_field_union rq_prod;
  3155. #elif defined(__LITTLE_ENDIAN)
  3156. union fcoe_idx16_field_union rq_prod;
  3157. union fcoe_idx16_field_union rq_cons;
  3158. #endif
  3159. #if defined(__BIG_ENDIAN)
  3160. u16 xfrq_prod;
  3161. u16 cq_cons;
  3162. #elif defined(__LITTLE_ENDIAN)
  3163. u16 cq_cons;
  3164. u16 xfrq_prod;
  3165. #endif
  3166. #if defined(__BIG_ENDIAN)
  3167. u16 lcq_cons;
  3168. u16 hc_cram_address;
  3169. #elif defined(__LITTLE_ENDIAN)
  3170. u16 hc_cram_address;
  3171. u16 lcq_cons;
  3172. #endif
  3173. #if defined(__BIG_ENDIAN)
  3174. u16 sq_xfrq_lcq_confq_size;
  3175. u16 confq_prod;
  3176. #elif defined(__LITTLE_ENDIAN)
  3177. u16 confq_prod;
  3178. u16 sq_xfrq_lcq_confq_size;
  3179. #endif
  3180. #if defined(__BIG_ENDIAN)
  3181. u8 hc_csdm_agg_int;
  3182. u8 rsrv2;
  3183. u8 available_rqes;
  3184. u8 sp_q_flush_cnt;
  3185. #elif defined(__LITTLE_ENDIAN)
  3186. u8 sp_q_flush_cnt;
  3187. u8 available_rqes;
  3188. u8 rsrv2;
  3189. u8 hc_csdm_agg_int;
  3190. #endif
  3191. #if defined(__BIG_ENDIAN)
  3192. u16 num_pend_tasks;
  3193. u16 pbf_ack_ram_addr;
  3194. #elif defined(__LITTLE_ENDIAN)
  3195. u16 pbf_ack_ram_addr;
  3196. u16 num_pend_tasks;
  3197. #endif
  3198. struct ustorm_fcoe_cache_ctx cache_ctx;
  3199. };
  3200. /*
  3201. * The FCoE non-aggregative context of Tstorm
  3202. */
  3203. struct tstorm_fcoe_st_context {
  3204. struct regpair reserved0;
  3205. struct regpair reserved1;
  3206. };
  3207. /*
  3208. * Ethernet context section
  3209. */
  3210. struct xstorm_fcoe_eth_context_section {
  3211. #if defined(__BIG_ENDIAN)
  3212. u8 remote_addr_4;
  3213. u8 remote_addr_5;
  3214. u8 local_addr_0;
  3215. u8 local_addr_1;
  3216. #elif defined(__LITTLE_ENDIAN)
  3217. u8 local_addr_1;
  3218. u8 local_addr_0;
  3219. u8 remote_addr_5;
  3220. u8 remote_addr_4;
  3221. #endif
  3222. #if defined(__BIG_ENDIAN)
  3223. u8 remote_addr_0;
  3224. u8 remote_addr_1;
  3225. u8 remote_addr_2;
  3226. u8 remote_addr_3;
  3227. #elif defined(__LITTLE_ENDIAN)
  3228. u8 remote_addr_3;
  3229. u8 remote_addr_2;
  3230. u8 remote_addr_1;
  3231. u8 remote_addr_0;
  3232. #endif
  3233. #if defined(__BIG_ENDIAN)
  3234. u16 reserved_vlan_type;
  3235. u16 params;
  3236. #define XSTORM_FCOE_ETH_CONTEXT_SECTION_VLAN_ID (0xFFF<<0)
  3237. #define XSTORM_FCOE_ETH_CONTEXT_SECTION_VLAN_ID_SHIFT 0
  3238. #define XSTORM_FCOE_ETH_CONTEXT_SECTION_CFI (0x1<<12)
  3239. #define XSTORM_FCOE_ETH_CONTEXT_SECTION_CFI_SHIFT 12
  3240. #define XSTORM_FCOE_ETH_CONTEXT_SECTION_PRIORITY (0x7<<13)
  3241. #define XSTORM_FCOE_ETH_CONTEXT_SECTION_PRIORITY_SHIFT 13
  3242. #elif defined(__LITTLE_ENDIAN)
  3243. u16 params;
  3244. #define XSTORM_FCOE_ETH_CONTEXT_SECTION_VLAN_ID (0xFFF<<0)
  3245. #define XSTORM_FCOE_ETH_CONTEXT_SECTION_VLAN_ID_SHIFT 0
  3246. #define XSTORM_FCOE_ETH_CONTEXT_SECTION_CFI (0x1<<12)
  3247. #define XSTORM_FCOE_ETH_CONTEXT_SECTION_CFI_SHIFT 12
  3248. #define XSTORM_FCOE_ETH_CONTEXT_SECTION_PRIORITY (0x7<<13)
  3249. #define XSTORM_FCOE_ETH_CONTEXT_SECTION_PRIORITY_SHIFT 13
  3250. u16 reserved_vlan_type;
  3251. #endif
  3252. #if defined(__BIG_ENDIAN)
  3253. u8 local_addr_2;
  3254. u8 local_addr_3;
  3255. u8 local_addr_4;
  3256. u8 local_addr_5;
  3257. #elif defined(__LITTLE_ENDIAN)
  3258. u8 local_addr_5;
  3259. u8 local_addr_4;
  3260. u8 local_addr_3;
  3261. u8 local_addr_2;
  3262. #endif
  3263. };
  3264. /*
  3265. * Flags used in FCoE context section - 1 byte
  3266. */
  3267. struct xstorm_fcoe_context_flags {
  3268. u8 flags;
  3269. #define XSTORM_FCOE_CONTEXT_FLAGS_B_PROC_Q (0x3<<0)
  3270. #define XSTORM_FCOE_CONTEXT_FLAGS_B_PROC_Q_SHIFT 0
  3271. #define XSTORM_FCOE_CONTEXT_FLAGS_B_MID_SEQ (0x1<<2)
  3272. #define XSTORM_FCOE_CONTEXT_FLAGS_B_MID_SEQ_SHIFT 2
  3273. #define XSTORM_FCOE_CONTEXT_FLAGS_B_BLOCK_SQ (0x1<<3)
  3274. #define XSTORM_FCOE_CONTEXT_FLAGS_B_BLOCK_SQ_SHIFT 3
  3275. #define XSTORM_FCOE_CONTEXT_FLAGS_B_REC_SUPPORT (0x1<<4)
  3276. #define XSTORM_FCOE_CONTEXT_FLAGS_B_REC_SUPPORT_SHIFT 4
  3277. #define XSTORM_FCOE_CONTEXT_FLAGS_B_SQ_TOGGLE (0x1<<5)
  3278. #define XSTORM_FCOE_CONTEXT_FLAGS_B_SQ_TOGGLE_SHIFT 5
  3279. #define XSTORM_FCOE_CONTEXT_FLAGS_B_XFRQ_TOGGLE (0x1<<6)
  3280. #define XSTORM_FCOE_CONTEXT_FLAGS_B_XFRQ_TOGGLE_SHIFT 6
  3281. #define XSTORM_FCOE_CONTEXT_FLAGS_B_VNTAG_VLAN (0x1<<7)
  3282. #define XSTORM_FCOE_CONTEXT_FLAGS_B_VNTAG_VLAN_SHIFT 7
  3283. };
  3284. struct xstorm_fcoe_tce {
  3285. struct fcoe_tce_tx_only txwr;
  3286. struct fcoe_tce_tx_wr_rx_rd txwr_rxrd;
  3287. };
  3288. /*
  3289. * FCP_DATA parameters required for transmission
  3290. */
  3291. struct xstorm_fcoe_fcp_data {
  3292. u32 io_rem;
  3293. #if defined(__BIG_ENDIAN)
  3294. u16 cached_sge_off;
  3295. u8 cached_num_sges;
  3296. u8 cached_sge_idx;
  3297. #elif defined(__LITTLE_ENDIAN)
  3298. u8 cached_sge_idx;
  3299. u8 cached_num_sges;
  3300. u16 cached_sge_off;
  3301. #endif
  3302. u32 buf_addr_hi_0;
  3303. u32 buf_addr_lo_0;
  3304. #if defined(__BIG_ENDIAN)
  3305. u16 num_of_pending_tasks;
  3306. u16 buf_len_0;
  3307. #elif defined(__LITTLE_ENDIAN)
  3308. u16 buf_len_0;
  3309. u16 num_of_pending_tasks;
  3310. #endif
  3311. u32 buf_addr_hi_1;
  3312. u32 buf_addr_lo_1;
  3313. #if defined(__BIG_ENDIAN)
  3314. u16 task_pbe_idx_off;
  3315. u16 buf_len_1;
  3316. #elif defined(__LITTLE_ENDIAN)
  3317. u16 buf_len_1;
  3318. u16 task_pbe_idx_off;
  3319. #endif
  3320. u32 buf_addr_hi_2;
  3321. u32 buf_addr_lo_2;
  3322. #if defined(__BIG_ENDIAN)
  3323. u16 ox_id;
  3324. u16 buf_len_2;
  3325. #elif defined(__LITTLE_ENDIAN)
  3326. u16 buf_len_2;
  3327. u16 ox_id;
  3328. #endif
  3329. };
  3330. /*
  3331. * vlan configuration
  3332. */
  3333. struct xstorm_fcoe_vlan_conf {
  3334. u8 vlan_conf;
  3335. #define XSTORM_FCOE_VLAN_CONF_PRIORITY (0x7<<0)
  3336. #define XSTORM_FCOE_VLAN_CONF_PRIORITY_SHIFT 0
  3337. #define XSTORM_FCOE_VLAN_CONF_INNER_VLAN_FLAG (0x1<<3)
  3338. #define XSTORM_FCOE_VLAN_CONF_INNER_VLAN_FLAG_SHIFT 3
  3339. #define XSTORM_FCOE_VLAN_CONF_RESERVED (0xF<<4)
  3340. #define XSTORM_FCOE_VLAN_CONF_RESERVED_SHIFT 4
  3341. };
  3342. /*
  3343. * FCoE 16-bits vlan structure
  3344. */
  3345. struct fcoe_vlan_fields {
  3346. u16 fields;
  3347. #define FCOE_VLAN_FIELDS_VID (0xFFF<<0)
  3348. #define FCOE_VLAN_FIELDS_VID_SHIFT 0
  3349. #define FCOE_VLAN_FIELDS_CLI (0x1<<12)
  3350. #define FCOE_VLAN_FIELDS_CLI_SHIFT 12
  3351. #define FCOE_VLAN_FIELDS_PRI (0x7<<13)
  3352. #define FCOE_VLAN_FIELDS_PRI_SHIFT 13
  3353. };
  3354. /*
  3355. * FCoE 16-bits vlan union
  3356. */
  3357. union fcoe_vlan_field_union {
  3358. struct fcoe_vlan_fields fields;
  3359. u16 val;
  3360. };
  3361. /*
  3362. * FCoE 16-bits vlan, vif union
  3363. */
  3364. union fcoe_vlan_vif_field_union {
  3365. union fcoe_vlan_field_union vlan;
  3366. u16 vif;
  3367. };
  3368. /*
  3369. * FCoE context section
  3370. */
  3371. struct xstorm_fcoe_context_section {
  3372. #if defined(__BIG_ENDIAN)
  3373. u8 cs_ctl;
  3374. u8 s_id[3];
  3375. #elif defined(__LITTLE_ENDIAN)
  3376. u8 s_id[3];
  3377. u8 cs_ctl;
  3378. #endif
  3379. #if defined(__BIG_ENDIAN)
  3380. u8 rctl;
  3381. u8 d_id[3];
  3382. #elif defined(__LITTLE_ENDIAN)
  3383. u8 d_id[3];
  3384. u8 rctl;
  3385. #endif
  3386. #if defined(__BIG_ENDIAN)
  3387. u16 sq_xfrq_lcq_confq_size;
  3388. u16 tx_max_fc_pay_len;
  3389. #elif defined(__LITTLE_ENDIAN)
  3390. u16 tx_max_fc_pay_len;
  3391. u16 sq_xfrq_lcq_confq_size;
  3392. #endif
  3393. u32 lcq_prod;
  3394. #if defined(__BIG_ENDIAN)
  3395. u8 port_id;
  3396. u8 func_id;
  3397. u8 seq_id;
  3398. struct xstorm_fcoe_context_flags tx_flags;
  3399. #elif defined(__LITTLE_ENDIAN)
  3400. struct xstorm_fcoe_context_flags tx_flags;
  3401. u8 seq_id;
  3402. u8 func_id;
  3403. u8 port_id;
  3404. #endif
  3405. #if defined(__BIG_ENDIAN)
  3406. u16 mtu;
  3407. u8 func_mode;
  3408. u8 vnic_id;
  3409. #elif defined(__LITTLE_ENDIAN)
  3410. u8 vnic_id;
  3411. u8 func_mode;
  3412. u16 mtu;
  3413. #endif
  3414. struct regpair confq_curr_page_addr;
  3415. struct fcoe_cached_wqe cached_wqe[8];
  3416. struct regpair lcq_base_addr;
  3417. struct xstorm_fcoe_tce tce;
  3418. struct xstorm_fcoe_fcp_data fcp_data;
  3419. #if defined(__BIG_ENDIAN)
  3420. u8 tx_max_conc_seqs_c3;
  3421. u8 vlan_flag;
  3422. u8 dcb_val;
  3423. u8 data_pb_cmd_size;
  3424. #elif defined(__LITTLE_ENDIAN)
  3425. u8 data_pb_cmd_size;
  3426. u8 dcb_val;
  3427. u8 vlan_flag;
  3428. u8 tx_max_conc_seqs_c3;
  3429. #endif
  3430. #if defined(__BIG_ENDIAN)
  3431. u16 fcoe_tx_stat_params_ram_addr;
  3432. u16 fcoe_tx_fc_seq_ram_addr;
  3433. #elif defined(__LITTLE_ENDIAN)
  3434. u16 fcoe_tx_fc_seq_ram_addr;
  3435. u16 fcoe_tx_stat_params_ram_addr;
  3436. #endif
  3437. #if defined(__BIG_ENDIAN)
  3438. u8 fcp_cmd_line_credit;
  3439. u8 eth_hdr_size;
  3440. u16 pbf_addr;
  3441. #elif defined(__LITTLE_ENDIAN)
  3442. u16 pbf_addr;
  3443. u8 eth_hdr_size;
  3444. u8 fcp_cmd_line_credit;
  3445. #endif
  3446. #if defined(__BIG_ENDIAN)
  3447. union fcoe_vlan_vif_field_union multi_func_val;
  3448. u8 page_log_size;
  3449. struct xstorm_fcoe_vlan_conf orig_vlan_conf;
  3450. #elif defined(__LITTLE_ENDIAN)
  3451. struct xstorm_fcoe_vlan_conf orig_vlan_conf;
  3452. u8 page_log_size;
  3453. union fcoe_vlan_vif_field_union multi_func_val;
  3454. #endif
  3455. #if defined(__BIG_ENDIAN)
  3456. u16 fcp_cmd_frame_size;
  3457. u16 pbf_addr_ff;
  3458. #elif defined(__LITTLE_ENDIAN)
  3459. u16 pbf_addr_ff;
  3460. u16 fcp_cmd_frame_size;
  3461. #endif
  3462. #if defined(__BIG_ENDIAN)
  3463. u8 vlan_num;
  3464. u8 cos;
  3465. u8 cache_xfrq_cons;
  3466. u8 cache_sq_cons;
  3467. #elif defined(__LITTLE_ENDIAN)
  3468. u8 cache_sq_cons;
  3469. u8 cache_xfrq_cons;
  3470. u8 cos;
  3471. u8 vlan_num;
  3472. #endif
  3473. u32 verify_tx_seq;
  3474. };
  3475. /*
  3476. * Xstorm FCoE Storm Context
  3477. */
  3478. struct xstorm_fcoe_st_context {
  3479. struct xstorm_fcoe_eth_context_section eth;
  3480. struct xstorm_fcoe_context_section fcoe;
  3481. };
  3482. /*
  3483. * Fcoe connection context
  3484. */
  3485. struct fcoe_context {
  3486. struct ustorm_fcoe_st_context ustorm_st_context;
  3487. struct tstorm_fcoe_st_context tstorm_st_context;
  3488. struct xstorm_fcoe_ag_context xstorm_ag_context;
  3489. struct tstorm_fcoe_ag_context tstorm_ag_context;
  3490. struct ustorm_fcoe_ag_context ustorm_ag_context;
  3491. struct timers_block_context timers_context;
  3492. struct xstorm_fcoe_st_context xstorm_st_context;
  3493. };
  3494. /*
  3495. * FCoE init params passed by driver to FW in FCoE init ramrod
  3496. * $$KEEP_ENDIANNESS$$
  3497. */
  3498. struct fcoe_init_ramrod_params {
  3499. struct fcoe_kwqe_init1 init_kwqe1;
  3500. struct fcoe_kwqe_init2 init_kwqe2;
  3501. struct fcoe_kwqe_init3 init_kwqe3;
  3502. struct regpair eq_pbl_base;
  3503. __le32 eq_pbl_size;
  3504. __le32 reserved2;
  3505. __le16 eq_prod;
  3506. __le16 sb_num;
  3507. u8 sb_id;
  3508. u8 reserved0;
  3509. __le16 reserved1;
  3510. };
  3511. /*
  3512. * FCoE statistics params buffer passed by driver to FW in FCoE statistics
  3513. * ramrod $$KEEP_ENDIANNESS$$
  3514. */
  3515. struct fcoe_stat_ramrod_params {
  3516. struct fcoe_kwqe_stat stat_kwqe;
  3517. };
  3518. /*
  3519. * CQ DB CQ producer and pending completion counter
  3520. */
  3521. struct iscsi_cq_db_prod_pnd_cmpltn_cnt {
  3522. #if defined(__BIG_ENDIAN)
  3523. u16 cntr;
  3524. u16 prod;
  3525. #elif defined(__LITTLE_ENDIAN)
  3526. u16 prod;
  3527. u16 cntr;
  3528. #endif
  3529. };
  3530. /*
  3531. * CQ DB pending completion ITT array
  3532. */
  3533. struct iscsi_cq_db_prod_pnd_cmpltn_cnt_arr {
  3534. struct iscsi_cq_db_prod_pnd_cmpltn_cnt prod_pend_comp[8];
  3535. };
  3536. /*
  3537. * Cstorm CQ sequence to notify array, updated by driver
  3538. */
  3539. struct iscsi_cq_db_sqn_2_notify_arr {
  3540. u16 sqn[8];
  3541. };
  3542. /*
  3543. * Cstorm iSCSI Storm Context
  3544. */
  3545. struct cstorm_iscsi_st_context {
  3546. struct iscsi_cq_db_prod_pnd_cmpltn_cnt_arr cq_c_prod_pend_comp_ctr_arr;
  3547. struct iscsi_cq_db_sqn_2_notify_arr cq_c_prod_sqn_arr;
  3548. struct iscsi_cq_db_sqn_2_notify_arr cq_c_sqn_2_notify_arr;
  3549. struct regpair hq_pbl_base;
  3550. struct regpair hq_curr_pbe;
  3551. struct regpair task_pbl_base;
  3552. struct regpair cq_db_base;
  3553. #if defined(__BIG_ENDIAN)
  3554. u16 hq_bd_itt;
  3555. u16 iscsi_conn_id;
  3556. #elif defined(__LITTLE_ENDIAN)
  3557. u16 iscsi_conn_id;
  3558. u16 hq_bd_itt;
  3559. #endif
  3560. u32 hq_bd_data_segment_len;
  3561. u32 hq_bd_buffer_offset;
  3562. #if defined(__BIG_ENDIAN)
  3563. u8 rsrv;
  3564. u8 cq_proc_en_bit_map;
  3565. u8 cq_pend_comp_itt_valid_bit_map;
  3566. u8 hq_bd_opcode;
  3567. #elif defined(__LITTLE_ENDIAN)
  3568. u8 hq_bd_opcode;
  3569. u8 cq_pend_comp_itt_valid_bit_map;
  3570. u8 cq_proc_en_bit_map;
  3571. u8 rsrv;
  3572. #endif
  3573. u32 hq_tcp_seq;
  3574. #if defined(__BIG_ENDIAN)
  3575. u16 flags;
  3576. #define CSTORM_ISCSI_ST_CONTEXT_DATA_DIGEST_EN (0x1<<0)
  3577. #define CSTORM_ISCSI_ST_CONTEXT_DATA_DIGEST_EN_SHIFT 0
  3578. #define CSTORM_ISCSI_ST_CONTEXT_HDR_DIGEST_EN (0x1<<1)
  3579. #define CSTORM_ISCSI_ST_CONTEXT_HDR_DIGEST_EN_SHIFT 1
  3580. #define CSTORM_ISCSI_ST_CONTEXT_HQ_BD_CTXT_VALID (0x1<<2)
  3581. #define CSTORM_ISCSI_ST_CONTEXT_HQ_BD_CTXT_VALID_SHIFT 2
  3582. #define CSTORM_ISCSI_ST_CONTEXT_HQ_BD_LCL_CMPLN_FLG (0x1<<3)
  3583. #define CSTORM_ISCSI_ST_CONTEXT_HQ_BD_LCL_CMPLN_FLG_SHIFT 3
  3584. #define CSTORM_ISCSI_ST_CONTEXT_HQ_BD_WRITE_TASK (0x1<<4)
  3585. #define CSTORM_ISCSI_ST_CONTEXT_HQ_BD_WRITE_TASK_SHIFT 4
  3586. #define CSTORM_ISCSI_ST_CONTEXT_CTRL_FLAGS_RSRV (0x7FF<<5)
  3587. #define CSTORM_ISCSI_ST_CONTEXT_CTRL_FLAGS_RSRV_SHIFT 5
  3588. u16 hq_cons;
  3589. #elif defined(__LITTLE_ENDIAN)
  3590. u16 hq_cons;
  3591. u16 flags;
  3592. #define CSTORM_ISCSI_ST_CONTEXT_DATA_DIGEST_EN (0x1<<0)
  3593. #define CSTORM_ISCSI_ST_CONTEXT_DATA_DIGEST_EN_SHIFT 0
  3594. #define CSTORM_ISCSI_ST_CONTEXT_HDR_DIGEST_EN (0x1<<1)
  3595. #define CSTORM_ISCSI_ST_CONTEXT_HDR_DIGEST_EN_SHIFT 1
  3596. #define CSTORM_ISCSI_ST_CONTEXT_HQ_BD_CTXT_VALID (0x1<<2)
  3597. #define CSTORM_ISCSI_ST_CONTEXT_HQ_BD_CTXT_VALID_SHIFT 2
  3598. #define CSTORM_ISCSI_ST_CONTEXT_HQ_BD_LCL_CMPLN_FLG (0x1<<3)
  3599. #define CSTORM_ISCSI_ST_CONTEXT_HQ_BD_LCL_CMPLN_FLG_SHIFT 3
  3600. #define CSTORM_ISCSI_ST_CONTEXT_HQ_BD_WRITE_TASK (0x1<<4)
  3601. #define CSTORM_ISCSI_ST_CONTEXT_HQ_BD_WRITE_TASK_SHIFT 4
  3602. #define CSTORM_ISCSI_ST_CONTEXT_CTRL_FLAGS_RSRV (0x7FF<<5)
  3603. #define CSTORM_ISCSI_ST_CONTEXT_CTRL_FLAGS_RSRV_SHIFT 5
  3604. #endif
  3605. struct regpair rsrv1;
  3606. };
  3607. /*
  3608. * SCSI read/write SQ WQE
  3609. */
  3610. struct iscsi_cmd_pdu_hdr_little_endian {
  3611. #if defined(__BIG_ENDIAN)
  3612. u8 opcode;
  3613. u8 op_attr;
  3614. #define ISCSI_CMD_PDU_HDR_LITTLE_ENDIAN_ATTRIBUTES (0x7<<0)
  3615. #define ISCSI_CMD_PDU_HDR_LITTLE_ENDIAN_ATTRIBUTES_SHIFT 0
  3616. #define ISCSI_CMD_PDU_HDR_LITTLE_ENDIAN_RSRV1 (0x3<<3)
  3617. #define ISCSI_CMD_PDU_HDR_LITTLE_ENDIAN_RSRV1_SHIFT 3
  3618. #define ISCSI_CMD_PDU_HDR_LITTLE_ENDIAN_WRITE_FLAG (0x1<<5)
  3619. #define ISCSI_CMD_PDU_HDR_LITTLE_ENDIAN_WRITE_FLAG_SHIFT 5
  3620. #define ISCSI_CMD_PDU_HDR_LITTLE_ENDIAN_READ_FLAG (0x1<<6)
  3621. #define ISCSI_CMD_PDU_HDR_LITTLE_ENDIAN_READ_FLAG_SHIFT 6
  3622. #define ISCSI_CMD_PDU_HDR_LITTLE_ENDIAN_FINAL_FLAG (0x1<<7)
  3623. #define ISCSI_CMD_PDU_HDR_LITTLE_ENDIAN_FINAL_FLAG_SHIFT 7
  3624. u16 rsrv0;
  3625. #elif defined(__LITTLE_ENDIAN)
  3626. u16 rsrv0;
  3627. u8 op_attr;
  3628. #define ISCSI_CMD_PDU_HDR_LITTLE_ENDIAN_ATTRIBUTES (0x7<<0)
  3629. #define ISCSI_CMD_PDU_HDR_LITTLE_ENDIAN_ATTRIBUTES_SHIFT 0
  3630. #define ISCSI_CMD_PDU_HDR_LITTLE_ENDIAN_RSRV1 (0x3<<3)
  3631. #define ISCSI_CMD_PDU_HDR_LITTLE_ENDIAN_RSRV1_SHIFT 3
  3632. #define ISCSI_CMD_PDU_HDR_LITTLE_ENDIAN_WRITE_FLAG (0x1<<5)
  3633. #define ISCSI_CMD_PDU_HDR_LITTLE_ENDIAN_WRITE_FLAG_SHIFT 5
  3634. #define ISCSI_CMD_PDU_HDR_LITTLE_ENDIAN_READ_FLAG (0x1<<6)
  3635. #define ISCSI_CMD_PDU_HDR_LITTLE_ENDIAN_READ_FLAG_SHIFT 6
  3636. #define ISCSI_CMD_PDU_HDR_LITTLE_ENDIAN_FINAL_FLAG (0x1<<7)
  3637. #define ISCSI_CMD_PDU_HDR_LITTLE_ENDIAN_FINAL_FLAG_SHIFT 7
  3638. u8 opcode;
  3639. #endif
  3640. u32 data_fields;
  3641. #define ISCSI_CMD_PDU_HDR_LITTLE_ENDIAN_DATA_SEGMENT_LENGTH (0xFFFFFF<<0)
  3642. #define ISCSI_CMD_PDU_HDR_LITTLE_ENDIAN_DATA_SEGMENT_LENGTH_SHIFT 0
  3643. #define ISCSI_CMD_PDU_HDR_LITTLE_ENDIAN_TOTAL_AHS_LENGTH (0xFF<<24)
  3644. #define ISCSI_CMD_PDU_HDR_LITTLE_ENDIAN_TOTAL_AHS_LENGTH_SHIFT 24
  3645. struct regpair lun;
  3646. u32 itt;
  3647. u32 expected_data_transfer_length;
  3648. u32 cmd_sn;
  3649. u32 exp_stat_sn;
  3650. u32 scsi_command_block[4];
  3651. };
  3652. /*
  3653. * Buffer per connection, used in Tstorm
  3654. */
  3655. struct iscsi_conn_buf {
  3656. struct regpair reserved[8];
  3657. };
  3658. /*
  3659. * iSCSI context region, used only in iSCSI
  3660. */
  3661. struct ustorm_iscsi_rq_db {
  3662. struct regpair pbl_base;
  3663. struct regpair curr_pbe;
  3664. };
  3665. /*
  3666. * iSCSI context region, used only in iSCSI
  3667. */
  3668. struct ustorm_iscsi_r2tq_db {
  3669. struct regpair pbl_base;
  3670. struct regpair curr_pbe;
  3671. };
  3672. /*
  3673. * iSCSI context region, used only in iSCSI
  3674. */
  3675. struct ustorm_iscsi_cq_db {
  3676. #if defined(__BIG_ENDIAN)
  3677. u16 cq_sn;
  3678. u16 prod;
  3679. #elif defined(__LITTLE_ENDIAN)
  3680. u16 prod;
  3681. u16 cq_sn;
  3682. #endif
  3683. struct regpair curr_pbe;
  3684. };
  3685. /*
  3686. * iSCSI context region, used only in iSCSI
  3687. */
  3688. struct rings_db {
  3689. struct ustorm_iscsi_rq_db rq;
  3690. struct ustorm_iscsi_r2tq_db r2tq;
  3691. struct ustorm_iscsi_cq_db cq[8];
  3692. #if defined(__BIG_ENDIAN)
  3693. u16 rq_prod;
  3694. u16 r2tq_prod;
  3695. #elif defined(__LITTLE_ENDIAN)
  3696. u16 r2tq_prod;
  3697. u16 rq_prod;
  3698. #endif
  3699. struct regpair cq_pbl_base;
  3700. };
  3701. /*
  3702. * iSCSI context region, used only in iSCSI
  3703. */
  3704. struct ustorm_iscsi_placement_db {
  3705. u32 sgl_base_lo;
  3706. u32 sgl_base_hi;
  3707. u32 local_sge_0_address_hi;
  3708. u32 local_sge_0_address_lo;
  3709. #if defined(__BIG_ENDIAN)
  3710. u16 curr_sge_offset;
  3711. u16 local_sge_0_size;
  3712. #elif defined(__LITTLE_ENDIAN)
  3713. u16 local_sge_0_size;
  3714. u16 curr_sge_offset;
  3715. #endif
  3716. u32 local_sge_1_address_hi;
  3717. u32 local_sge_1_address_lo;
  3718. #if defined(__BIG_ENDIAN)
  3719. u8 exp_padding_2b;
  3720. u8 nal_len_3b;
  3721. u16 local_sge_1_size;
  3722. #elif defined(__LITTLE_ENDIAN)
  3723. u16 local_sge_1_size;
  3724. u8 nal_len_3b;
  3725. u8 exp_padding_2b;
  3726. #endif
  3727. #if defined(__BIG_ENDIAN)
  3728. u8 sgl_size;
  3729. u8 local_sge_index_2b;
  3730. u16 reserved7;
  3731. #elif defined(__LITTLE_ENDIAN)
  3732. u16 reserved7;
  3733. u8 local_sge_index_2b;
  3734. u8 sgl_size;
  3735. #endif
  3736. u32 rem_pdu;
  3737. u32 place_db_bitfield_1;
  3738. #define USTORM_ISCSI_PLACEMENT_DB_REM_PDU_PAYLOAD (0xFFFFFF<<0)
  3739. #define USTORM_ISCSI_PLACEMENT_DB_REM_PDU_PAYLOAD_SHIFT 0
  3740. #define USTORM_ISCSI_PLACEMENT_DB_CQ_ID (0xFF<<24)
  3741. #define USTORM_ISCSI_PLACEMENT_DB_CQ_ID_SHIFT 24
  3742. u32 place_db_bitfield_2;
  3743. #define USTORM_ISCSI_PLACEMENT_DB_BYTES_2_TRUNCATE (0xFFFFFF<<0)
  3744. #define USTORM_ISCSI_PLACEMENT_DB_BYTES_2_TRUNCATE_SHIFT 0
  3745. #define USTORM_ISCSI_PLACEMENT_DB_HOST_SGE_INDEX (0xFF<<24)
  3746. #define USTORM_ISCSI_PLACEMENT_DB_HOST_SGE_INDEX_SHIFT 24
  3747. u32 nal;
  3748. #define USTORM_ISCSI_PLACEMENT_DB_REM_SGE_SIZE (0xFFFFFF<<0)
  3749. #define USTORM_ISCSI_PLACEMENT_DB_REM_SGE_SIZE_SHIFT 0
  3750. #define USTORM_ISCSI_PLACEMENT_DB_EXP_DIGEST_3B (0xFF<<24)
  3751. #define USTORM_ISCSI_PLACEMENT_DB_EXP_DIGEST_3B_SHIFT 24
  3752. };
  3753. /*
  3754. * Ustorm iSCSI Storm Context
  3755. */
  3756. struct ustorm_iscsi_st_context {
  3757. u32 exp_stat_sn;
  3758. u32 exp_data_sn;
  3759. struct rings_db ring;
  3760. struct regpair task_pbl_base;
  3761. struct regpair tce_phy_addr;
  3762. struct ustorm_iscsi_placement_db place_db;
  3763. u32 reserved8;
  3764. u32 rem_rcv_len;
  3765. #if defined(__BIG_ENDIAN)
  3766. u16 hdr_itt;
  3767. u16 iscsi_conn_id;
  3768. #elif defined(__LITTLE_ENDIAN)
  3769. u16 iscsi_conn_id;
  3770. u16 hdr_itt;
  3771. #endif
  3772. u32 nal_bytes;
  3773. #if defined(__BIG_ENDIAN)
  3774. u8 hdr_second_byte_union;
  3775. u8 bitfield_0;
  3776. #define USTORM_ISCSI_ST_CONTEXT_BMIDDLEOFPDU (0x1<<0)
  3777. #define USTORM_ISCSI_ST_CONTEXT_BMIDDLEOFPDU_SHIFT 0
  3778. #define USTORM_ISCSI_ST_CONTEXT_BFENCECQE (0x1<<1)
  3779. #define USTORM_ISCSI_ST_CONTEXT_BFENCECQE_SHIFT 1
  3780. #define USTORM_ISCSI_ST_CONTEXT_BRESETCRC (0x1<<2)
  3781. #define USTORM_ISCSI_ST_CONTEXT_BRESETCRC_SHIFT 2
  3782. #define USTORM_ISCSI_ST_CONTEXT_RESERVED1 (0x1F<<3)
  3783. #define USTORM_ISCSI_ST_CONTEXT_RESERVED1_SHIFT 3
  3784. u8 task_pdu_cache_index;
  3785. u8 task_pbe_cache_index;
  3786. #elif defined(__LITTLE_ENDIAN)
  3787. u8 task_pbe_cache_index;
  3788. u8 task_pdu_cache_index;
  3789. u8 bitfield_0;
  3790. #define USTORM_ISCSI_ST_CONTEXT_BMIDDLEOFPDU (0x1<<0)
  3791. #define USTORM_ISCSI_ST_CONTEXT_BMIDDLEOFPDU_SHIFT 0
  3792. #define USTORM_ISCSI_ST_CONTEXT_BFENCECQE (0x1<<1)
  3793. #define USTORM_ISCSI_ST_CONTEXT_BFENCECQE_SHIFT 1
  3794. #define USTORM_ISCSI_ST_CONTEXT_BRESETCRC (0x1<<2)
  3795. #define USTORM_ISCSI_ST_CONTEXT_BRESETCRC_SHIFT 2
  3796. #define USTORM_ISCSI_ST_CONTEXT_RESERVED1 (0x1F<<3)
  3797. #define USTORM_ISCSI_ST_CONTEXT_RESERVED1_SHIFT 3
  3798. u8 hdr_second_byte_union;
  3799. #endif
  3800. #if defined(__BIG_ENDIAN)
  3801. u16 reserved3;
  3802. u8 reserved2;
  3803. u8 acDecrement;
  3804. #elif defined(__LITTLE_ENDIAN)
  3805. u8 acDecrement;
  3806. u8 reserved2;
  3807. u16 reserved3;
  3808. #endif
  3809. u32 task_stat;
  3810. #if defined(__BIG_ENDIAN)
  3811. u8 hdr_opcode;
  3812. u8 num_cqs;
  3813. u16 reserved5;
  3814. #elif defined(__LITTLE_ENDIAN)
  3815. u16 reserved5;
  3816. u8 num_cqs;
  3817. u8 hdr_opcode;
  3818. #endif
  3819. u32 negotiated_rx;
  3820. #define USTORM_ISCSI_ST_CONTEXT_MAX_RECV_PDU_LENGTH (0xFFFFFF<<0)
  3821. #define USTORM_ISCSI_ST_CONTEXT_MAX_RECV_PDU_LENGTH_SHIFT 0
  3822. #define USTORM_ISCSI_ST_CONTEXT_MAX_OUTSTANDING_R2TS (0xFF<<24)
  3823. #define USTORM_ISCSI_ST_CONTEXT_MAX_OUTSTANDING_R2TS_SHIFT 24
  3824. u32 negotiated_rx_and_flags;
  3825. #define USTORM_ISCSI_ST_CONTEXT_MAX_BURST_LENGTH (0xFFFFFF<<0)
  3826. #define USTORM_ISCSI_ST_CONTEXT_MAX_BURST_LENGTH_SHIFT 0
  3827. #define USTORM_ISCSI_ST_CONTEXT_B_CQE_POSTED_OR_HEADER_CACHED (0x1<<24)
  3828. #define USTORM_ISCSI_ST_CONTEXT_B_CQE_POSTED_OR_HEADER_CACHED_SHIFT 24
  3829. #define USTORM_ISCSI_ST_CONTEXT_B_HDR_DIGEST_EN (0x1<<25)
  3830. #define USTORM_ISCSI_ST_CONTEXT_B_HDR_DIGEST_EN_SHIFT 25
  3831. #define USTORM_ISCSI_ST_CONTEXT_B_DATA_DIGEST_EN (0x1<<26)
  3832. #define USTORM_ISCSI_ST_CONTEXT_B_DATA_DIGEST_EN_SHIFT 26
  3833. #define USTORM_ISCSI_ST_CONTEXT_B_PROTOCOL_ERROR (0x1<<27)
  3834. #define USTORM_ISCSI_ST_CONTEXT_B_PROTOCOL_ERROR_SHIFT 27
  3835. #define USTORM_ISCSI_ST_CONTEXT_B_TASK_VALID (0x1<<28)
  3836. #define USTORM_ISCSI_ST_CONTEXT_B_TASK_VALID_SHIFT 28
  3837. #define USTORM_ISCSI_ST_CONTEXT_TASK_TYPE (0x3<<29)
  3838. #define USTORM_ISCSI_ST_CONTEXT_TASK_TYPE_SHIFT 29
  3839. #define USTORM_ISCSI_ST_CONTEXT_B_ALL_DATA_ACKED (0x1<<31)
  3840. #define USTORM_ISCSI_ST_CONTEXT_B_ALL_DATA_ACKED_SHIFT 31
  3841. };
  3842. /*
  3843. * TCP context region, shared in TOE, RDMA and ISCSI
  3844. */
  3845. struct tstorm_tcp_st_context_section {
  3846. u32 flags1;
  3847. #define TSTORM_TCP_ST_CONTEXT_SECTION_RTT_SRTT (0xFFFFFF<<0)
  3848. #define TSTORM_TCP_ST_CONTEXT_SECTION_RTT_SRTT_SHIFT 0
  3849. #define TSTORM_TCP_ST_CONTEXT_SECTION_PAWS_INVALID (0x1<<24)
  3850. #define TSTORM_TCP_ST_CONTEXT_SECTION_PAWS_INVALID_SHIFT 24
  3851. #define TSTORM_TCP_ST_CONTEXT_SECTION_TIMESTAMP_EXISTS (0x1<<25)
  3852. #define TSTORM_TCP_ST_CONTEXT_SECTION_TIMESTAMP_EXISTS_SHIFT 25
  3853. #define TSTORM_TCP_ST_CONTEXT_SECTION_RESERVED0 (0x1<<26)
  3854. #define TSTORM_TCP_ST_CONTEXT_SECTION_RESERVED0_SHIFT 26
  3855. #define TSTORM_TCP_ST_CONTEXT_SECTION_STOP_RX_PAYLOAD (0x1<<27)
  3856. #define TSTORM_TCP_ST_CONTEXT_SECTION_STOP_RX_PAYLOAD_SHIFT 27
  3857. #define TSTORM_TCP_ST_CONTEXT_SECTION_KA_ENABLED (0x1<<28)
  3858. #define TSTORM_TCP_ST_CONTEXT_SECTION_KA_ENABLED_SHIFT 28
  3859. #define TSTORM_TCP_ST_CONTEXT_SECTION_FIRST_RTO_ESTIMATE (0x1<<29)
  3860. #define TSTORM_TCP_ST_CONTEXT_SECTION_FIRST_RTO_ESTIMATE_SHIFT 29
  3861. #define TSTORM_TCP_ST_CONTEXT_SECTION_MAX_SEG_RETRANSMIT_EN (0x1<<30)
  3862. #define TSTORM_TCP_ST_CONTEXT_SECTION_MAX_SEG_RETRANSMIT_EN_SHIFT 30
  3863. #define TSTORM_TCP_ST_CONTEXT_SECTION_LAST_ISLE_HAS_FIN (0x1<<31)
  3864. #define TSTORM_TCP_ST_CONTEXT_SECTION_LAST_ISLE_HAS_FIN_SHIFT 31
  3865. u32 flags2;
  3866. #define TSTORM_TCP_ST_CONTEXT_SECTION_RTT_VARIATION (0xFFFFFF<<0)
  3867. #define TSTORM_TCP_ST_CONTEXT_SECTION_RTT_VARIATION_SHIFT 0
  3868. #define TSTORM_TCP_ST_CONTEXT_SECTION_DA_EN (0x1<<24)
  3869. #define TSTORM_TCP_ST_CONTEXT_SECTION_DA_EN_SHIFT 24
  3870. #define TSTORM_TCP_ST_CONTEXT_SECTION_DA_COUNTER_EN (0x1<<25)
  3871. #define TSTORM_TCP_ST_CONTEXT_SECTION_DA_COUNTER_EN_SHIFT 25
  3872. #define __TSTORM_TCP_ST_CONTEXT_SECTION_KA_PROBE_SENT (0x1<<26)
  3873. #define __TSTORM_TCP_ST_CONTEXT_SECTION_KA_PROBE_SENT_SHIFT 26
  3874. #define __TSTORM_TCP_ST_CONTEXT_SECTION_PERSIST_PROBE_SENT (0x1<<27)
  3875. #define __TSTORM_TCP_ST_CONTEXT_SECTION_PERSIST_PROBE_SENT_SHIFT 27
  3876. #define TSTORM_TCP_ST_CONTEXT_SECTION_UPDATE_L2_STATSTICS (0x1<<28)
  3877. #define TSTORM_TCP_ST_CONTEXT_SECTION_UPDATE_L2_STATSTICS_SHIFT 28
  3878. #define TSTORM_TCP_ST_CONTEXT_SECTION_UPDATE_L4_STATSTICS (0x1<<29)
  3879. #define TSTORM_TCP_ST_CONTEXT_SECTION_UPDATE_L4_STATSTICS_SHIFT 29
  3880. #define __TSTORM_TCP_ST_CONTEXT_SECTION_IN_WINDOW_RST_ATTACK (0x1<<30)
  3881. #define __TSTORM_TCP_ST_CONTEXT_SECTION_IN_WINDOW_RST_ATTACK_SHIFT 30
  3882. #define __TSTORM_TCP_ST_CONTEXT_SECTION_IN_WINDOW_SYN_ATTACK (0x1<<31)
  3883. #define __TSTORM_TCP_ST_CONTEXT_SECTION_IN_WINDOW_SYN_ATTACK_SHIFT 31
  3884. #if defined(__BIG_ENDIAN)
  3885. u16 mss;
  3886. u8 tcp_sm_state;
  3887. u8 rto_exp;
  3888. #elif defined(__LITTLE_ENDIAN)
  3889. u8 rto_exp;
  3890. u8 tcp_sm_state;
  3891. u16 mss;
  3892. #endif
  3893. u32 rcv_nxt;
  3894. u32 timestamp_recent;
  3895. u32 timestamp_recent_time;
  3896. u32 cwnd;
  3897. u32 ss_thresh;
  3898. u32 cwnd_accum;
  3899. u32 prev_seg_seq;
  3900. u32 expected_rel_seq;
  3901. u32 recover;
  3902. #if defined(__BIG_ENDIAN)
  3903. u8 retransmit_count;
  3904. u8 ka_max_probe_count;
  3905. u8 persist_probe_count;
  3906. u8 ka_probe_count;
  3907. #elif defined(__LITTLE_ENDIAN)
  3908. u8 ka_probe_count;
  3909. u8 persist_probe_count;
  3910. u8 ka_max_probe_count;
  3911. u8 retransmit_count;
  3912. #endif
  3913. #if defined(__BIG_ENDIAN)
  3914. u8 statistics_counter_id;
  3915. u8 ooo_support_mode;
  3916. u8 snd_wnd_scale;
  3917. u8 dup_ack_count;
  3918. #elif defined(__LITTLE_ENDIAN)
  3919. u8 dup_ack_count;
  3920. u8 snd_wnd_scale;
  3921. u8 ooo_support_mode;
  3922. u8 statistics_counter_id;
  3923. #endif
  3924. u32 retransmit_start_time;
  3925. u32 ka_timeout;
  3926. u32 ka_interval;
  3927. u32 isle_start_seq;
  3928. u32 isle_end_seq;
  3929. #if defined(__BIG_ENDIAN)
  3930. u16 second_isle_address;
  3931. u16 recent_seg_wnd;
  3932. #elif defined(__LITTLE_ENDIAN)
  3933. u16 recent_seg_wnd;
  3934. u16 second_isle_address;
  3935. #endif
  3936. #if defined(__BIG_ENDIAN)
  3937. u8 max_isles_ever_happened;
  3938. u8 isles_number;
  3939. u16 last_isle_address;
  3940. #elif defined(__LITTLE_ENDIAN)
  3941. u16 last_isle_address;
  3942. u8 isles_number;
  3943. u8 max_isles_ever_happened;
  3944. #endif
  3945. u32 max_rt_time;
  3946. #if defined(__BIG_ENDIAN)
  3947. u16 lsb_mac_address;
  3948. u16 vlan_id;
  3949. #elif defined(__LITTLE_ENDIAN)
  3950. u16 vlan_id;
  3951. u16 lsb_mac_address;
  3952. #endif
  3953. #if defined(__BIG_ENDIAN)
  3954. u16 msb_mac_address;
  3955. u16 mid_mac_address;
  3956. #elif defined(__LITTLE_ENDIAN)
  3957. u16 mid_mac_address;
  3958. u16 msb_mac_address;
  3959. #endif
  3960. u32 rightmost_received_seq;
  3961. };
  3962. /*
  3963. * Termination variables
  3964. */
  3965. struct iscsi_term_vars {
  3966. u8 BitMap;
  3967. #define ISCSI_TERM_VARS_TCP_STATE (0xF<<0)
  3968. #define ISCSI_TERM_VARS_TCP_STATE_SHIFT 0
  3969. #define ISCSI_TERM_VARS_FIN_RECEIVED_SBIT (0x1<<4)
  3970. #define ISCSI_TERM_VARS_FIN_RECEIVED_SBIT_SHIFT 4
  3971. #define ISCSI_TERM_VARS_ACK_ON_FIN_RECEIVED_SBIT (0x1<<5)
  3972. #define ISCSI_TERM_VARS_ACK_ON_FIN_RECEIVED_SBIT_SHIFT 5
  3973. #define ISCSI_TERM_VARS_TERM_ON_CHIP (0x1<<6)
  3974. #define ISCSI_TERM_VARS_TERM_ON_CHIP_SHIFT 6
  3975. #define ISCSI_TERM_VARS_RSRV (0x1<<7)
  3976. #define ISCSI_TERM_VARS_RSRV_SHIFT 7
  3977. };
  3978. /*
  3979. * iSCSI context region, used only in iSCSI
  3980. */
  3981. struct tstorm_iscsi_st_context_section {
  3982. u32 nalPayload;
  3983. u32 b2nh;
  3984. #if defined(__BIG_ENDIAN)
  3985. u16 rq_cons;
  3986. u8 flags;
  3987. #define TSTORM_ISCSI_ST_CONTEXT_SECTION_B_HDR_DIGEST_EN (0x1<<0)
  3988. #define TSTORM_ISCSI_ST_CONTEXT_SECTION_B_HDR_DIGEST_EN_SHIFT 0
  3989. #define TSTORM_ISCSI_ST_CONTEXT_SECTION_B_DATA_DIGEST_EN (0x1<<1)
  3990. #define TSTORM_ISCSI_ST_CONTEXT_SECTION_B_DATA_DIGEST_EN_SHIFT 1
  3991. #define TSTORM_ISCSI_ST_CONTEXT_SECTION_B_PARTIAL_HEADER (0x1<<2)
  3992. #define TSTORM_ISCSI_ST_CONTEXT_SECTION_B_PARTIAL_HEADER_SHIFT 2
  3993. #define TSTORM_ISCSI_ST_CONTEXT_SECTION_B_FULL_FEATURE (0x1<<3)
  3994. #define TSTORM_ISCSI_ST_CONTEXT_SECTION_B_FULL_FEATURE_SHIFT 3
  3995. #define TSTORM_ISCSI_ST_CONTEXT_SECTION_B_DROP_ALL_PDUS (0x1<<4)
  3996. #define TSTORM_ISCSI_ST_CONTEXT_SECTION_B_DROP_ALL_PDUS_SHIFT 4
  3997. #define TSTORM_ISCSI_ST_CONTEXT_SECTION_NALLEN (0x3<<5)
  3998. #define TSTORM_ISCSI_ST_CONTEXT_SECTION_NALLEN_SHIFT 5
  3999. #define TSTORM_ISCSI_ST_CONTEXT_SECTION_RSRV0 (0x1<<7)
  4000. #define TSTORM_ISCSI_ST_CONTEXT_SECTION_RSRV0_SHIFT 7
  4001. u8 hdr_bytes_2_fetch;
  4002. #elif defined(__LITTLE_ENDIAN)
  4003. u8 hdr_bytes_2_fetch;
  4004. u8 flags;
  4005. #define TSTORM_ISCSI_ST_CONTEXT_SECTION_B_HDR_DIGEST_EN (0x1<<0)
  4006. #define TSTORM_ISCSI_ST_CONTEXT_SECTION_B_HDR_DIGEST_EN_SHIFT 0
  4007. #define TSTORM_ISCSI_ST_CONTEXT_SECTION_B_DATA_DIGEST_EN (0x1<<1)
  4008. #define TSTORM_ISCSI_ST_CONTEXT_SECTION_B_DATA_DIGEST_EN_SHIFT 1
  4009. #define TSTORM_ISCSI_ST_CONTEXT_SECTION_B_PARTIAL_HEADER (0x1<<2)
  4010. #define TSTORM_ISCSI_ST_CONTEXT_SECTION_B_PARTIAL_HEADER_SHIFT 2
  4011. #define TSTORM_ISCSI_ST_CONTEXT_SECTION_B_FULL_FEATURE (0x1<<3)
  4012. #define TSTORM_ISCSI_ST_CONTEXT_SECTION_B_FULL_FEATURE_SHIFT 3
  4013. #define TSTORM_ISCSI_ST_CONTEXT_SECTION_B_DROP_ALL_PDUS (0x1<<4)
  4014. #define TSTORM_ISCSI_ST_CONTEXT_SECTION_B_DROP_ALL_PDUS_SHIFT 4
  4015. #define TSTORM_ISCSI_ST_CONTEXT_SECTION_NALLEN (0x3<<5)
  4016. #define TSTORM_ISCSI_ST_CONTEXT_SECTION_NALLEN_SHIFT 5
  4017. #define TSTORM_ISCSI_ST_CONTEXT_SECTION_RSRV0 (0x1<<7)
  4018. #define TSTORM_ISCSI_ST_CONTEXT_SECTION_RSRV0_SHIFT 7
  4019. u16 rq_cons;
  4020. #endif
  4021. struct regpair rq_db_phy_addr;
  4022. #if defined(__BIG_ENDIAN)
  4023. struct iscsi_term_vars term_vars;
  4024. u8 rsrv1;
  4025. u16 iscsi_conn_id;
  4026. #elif defined(__LITTLE_ENDIAN)
  4027. u16 iscsi_conn_id;
  4028. u8 rsrv1;
  4029. struct iscsi_term_vars term_vars;
  4030. #endif
  4031. u32 process_nxt;
  4032. };
  4033. /*
  4034. * The iSCSI non-aggregative context of Tstorm
  4035. */
  4036. struct tstorm_iscsi_st_context {
  4037. struct tstorm_tcp_st_context_section tcp;
  4038. struct tstorm_iscsi_st_context_section iscsi;
  4039. };
  4040. /*
  4041. * Ethernet context section, shared in TOE, RDMA and ISCSI
  4042. */
  4043. struct xstorm_eth_context_section {
  4044. #if defined(__BIG_ENDIAN)
  4045. u8 remote_addr_4;
  4046. u8 remote_addr_5;
  4047. u8 local_addr_0;
  4048. u8 local_addr_1;
  4049. #elif defined(__LITTLE_ENDIAN)
  4050. u8 local_addr_1;
  4051. u8 local_addr_0;
  4052. u8 remote_addr_5;
  4053. u8 remote_addr_4;
  4054. #endif
  4055. #if defined(__BIG_ENDIAN)
  4056. u8 remote_addr_0;
  4057. u8 remote_addr_1;
  4058. u8 remote_addr_2;
  4059. u8 remote_addr_3;
  4060. #elif defined(__LITTLE_ENDIAN)
  4061. u8 remote_addr_3;
  4062. u8 remote_addr_2;
  4063. u8 remote_addr_1;
  4064. u8 remote_addr_0;
  4065. #endif
  4066. #if defined(__BIG_ENDIAN)
  4067. u16 reserved_vlan_type;
  4068. u16 vlan_params;
  4069. #define XSTORM_ETH_CONTEXT_SECTION_VLAN_ID (0xFFF<<0)
  4070. #define XSTORM_ETH_CONTEXT_SECTION_VLAN_ID_SHIFT 0
  4071. #define XSTORM_ETH_CONTEXT_SECTION_CFI (0x1<<12)
  4072. #define XSTORM_ETH_CONTEXT_SECTION_CFI_SHIFT 12
  4073. #define XSTORM_ETH_CONTEXT_SECTION_PRIORITY (0x7<<13)
  4074. #define XSTORM_ETH_CONTEXT_SECTION_PRIORITY_SHIFT 13
  4075. #elif defined(__LITTLE_ENDIAN)
  4076. u16 vlan_params;
  4077. #define XSTORM_ETH_CONTEXT_SECTION_VLAN_ID (0xFFF<<0)
  4078. #define XSTORM_ETH_CONTEXT_SECTION_VLAN_ID_SHIFT 0
  4079. #define XSTORM_ETH_CONTEXT_SECTION_CFI (0x1<<12)
  4080. #define XSTORM_ETH_CONTEXT_SECTION_CFI_SHIFT 12
  4081. #define XSTORM_ETH_CONTEXT_SECTION_PRIORITY (0x7<<13)
  4082. #define XSTORM_ETH_CONTEXT_SECTION_PRIORITY_SHIFT 13
  4083. u16 reserved_vlan_type;
  4084. #endif
  4085. #if defined(__BIG_ENDIAN)
  4086. u8 local_addr_2;
  4087. u8 local_addr_3;
  4088. u8 local_addr_4;
  4089. u8 local_addr_5;
  4090. #elif defined(__LITTLE_ENDIAN)
  4091. u8 local_addr_5;
  4092. u8 local_addr_4;
  4093. u8 local_addr_3;
  4094. u8 local_addr_2;
  4095. #endif
  4096. };
  4097. /*
  4098. * IpV4 context section, shared in TOE, RDMA and ISCSI
  4099. */
  4100. struct xstorm_ip_v4_context_section {
  4101. #if defined(__BIG_ENDIAN)
  4102. u16 __pbf_hdr_cmd_rsvd_id;
  4103. u16 __pbf_hdr_cmd_rsvd_flags_offset;
  4104. #elif defined(__LITTLE_ENDIAN)
  4105. u16 __pbf_hdr_cmd_rsvd_flags_offset;
  4106. u16 __pbf_hdr_cmd_rsvd_id;
  4107. #endif
  4108. #if defined(__BIG_ENDIAN)
  4109. u8 __pbf_hdr_cmd_rsvd_ver_ihl;
  4110. u8 tos;
  4111. u16 __pbf_hdr_cmd_rsvd_length;
  4112. #elif defined(__LITTLE_ENDIAN)
  4113. u16 __pbf_hdr_cmd_rsvd_length;
  4114. u8 tos;
  4115. u8 __pbf_hdr_cmd_rsvd_ver_ihl;
  4116. #endif
  4117. u32 ip_local_addr;
  4118. #if defined(__BIG_ENDIAN)
  4119. u8 ttl;
  4120. u8 __pbf_hdr_cmd_rsvd_protocol;
  4121. u16 __pbf_hdr_cmd_rsvd_csum;
  4122. #elif defined(__LITTLE_ENDIAN)
  4123. u16 __pbf_hdr_cmd_rsvd_csum;
  4124. u8 __pbf_hdr_cmd_rsvd_protocol;
  4125. u8 ttl;
  4126. #endif
  4127. u32 __pbf_hdr_cmd_rsvd_1;
  4128. u32 ip_remote_addr;
  4129. };
  4130. /*
  4131. * context section, shared in TOE, RDMA and ISCSI
  4132. */
  4133. struct xstorm_padded_ip_v4_context_section {
  4134. struct xstorm_ip_v4_context_section ip_v4;
  4135. u32 reserved1[4];
  4136. };
  4137. /*
  4138. * IpV6 context section, shared in TOE, RDMA and ISCSI
  4139. */
  4140. struct xstorm_ip_v6_context_section {
  4141. #if defined(__BIG_ENDIAN)
  4142. u16 pbf_hdr_cmd_rsvd_payload_len;
  4143. u8 pbf_hdr_cmd_rsvd_nxt_hdr;
  4144. u8 hop_limit;
  4145. #elif defined(__LITTLE_ENDIAN)
  4146. u8 hop_limit;
  4147. u8 pbf_hdr_cmd_rsvd_nxt_hdr;
  4148. u16 pbf_hdr_cmd_rsvd_payload_len;
  4149. #endif
  4150. u32 priority_flow_label;
  4151. #define XSTORM_IP_V6_CONTEXT_SECTION_FLOW_LABEL (0xFFFFF<<0)
  4152. #define XSTORM_IP_V6_CONTEXT_SECTION_FLOW_LABEL_SHIFT 0
  4153. #define XSTORM_IP_V6_CONTEXT_SECTION_TRAFFIC_CLASS (0xFF<<20)
  4154. #define XSTORM_IP_V6_CONTEXT_SECTION_TRAFFIC_CLASS_SHIFT 20
  4155. #define XSTORM_IP_V6_CONTEXT_SECTION_PBF_HDR_CMD_RSVD_VER (0xF<<28)
  4156. #define XSTORM_IP_V6_CONTEXT_SECTION_PBF_HDR_CMD_RSVD_VER_SHIFT 28
  4157. u32 ip_local_addr_lo_hi;
  4158. u32 ip_local_addr_lo_lo;
  4159. u32 ip_local_addr_hi_hi;
  4160. u32 ip_local_addr_hi_lo;
  4161. u32 ip_remote_addr_lo_hi;
  4162. u32 ip_remote_addr_lo_lo;
  4163. u32 ip_remote_addr_hi_hi;
  4164. u32 ip_remote_addr_hi_lo;
  4165. };
  4166. union xstorm_ip_context_section_types {
  4167. struct xstorm_padded_ip_v4_context_section padded_ip_v4;
  4168. struct xstorm_ip_v6_context_section ip_v6;
  4169. };
  4170. /*
  4171. * TCP context section, shared in TOE, RDMA and ISCSI
  4172. */
  4173. struct xstorm_tcp_context_section {
  4174. u32 snd_max;
  4175. #if defined(__BIG_ENDIAN)
  4176. u16 remote_port;
  4177. u16 local_port;
  4178. #elif defined(__LITTLE_ENDIAN)
  4179. u16 local_port;
  4180. u16 remote_port;
  4181. #endif
  4182. #if defined(__BIG_ENDIAN)
  4183. u8 original_nagle_1b;
  4184. u8 ts_enabled;
  4185. u16 tcp_params;
  4186. #define XSTORM_TCP_CONTEXT_SECTION_TOTAL_HEADER_SIZE (0xFF<<0)
  4187. #define XSTORM_TCP_CONTEXT_SECTION_TOTAL_HEADER_SIZE_SHIFT 0
  4188. #define __XSTORM_TCP_CONTEXT_SECTION_ECT_BIT (0x1<<8)
  4189. #define __XSTORM_TCP_CONTEXT_SECTION_ECT_BIT_SHIFT 8
  4190. #define __XSTORM_TCP_CONTEXT_SECTION_ECN_ENABLED (0x1<<9)
  4191. #define __XSTORM_TCP_CONTEXT_SECTION_ECN_ENABLED_SHIFT 9
  4192. #define XSTORM_TCP_CONTEXT_SECTION_SACK_ENABLED (0x1<<10)
  4193. #define XSTORM_TCP_CONTEXT_SECTION_SACK_ENABLED_SHIFT 10
  4194. #define XSTORM_TCP_CONTEXT_SECTION_SMALL_WIN_ADV (0x1<<11)
  4195. #define XSTORM_TCP_CONTEXT_SECTION_SMALL_WIN_ADV_SHIFT 11
  4196. #define XSTORM_TCP_CONTEXT_SECTION_FIN_SENT_FLAG (0x1<<12)
  4197. #define XSTORM_TCP_CONTEXT_SECTION_FIN_SENT_FLAG_SHIFT 12
  4198. #define XSTORM_TCP_CONTEXT_SECTION_WINDOW_SATURATED (0x1<<13)
  4199. #define XSTORM_TCP_CONTEXT_SECTION_WINDOW_SATURATED_SHIFT 13
  4200. #define XSTORM_TCP_CONTEXT_SECTION_SLOWPATH_QUEUES_FLUSH_COUNTER (0x3<<14)
  4201. #define XSTORM_TCP_CONTEXT_SECTION_SLOWPATH_QUEUES_FLUSH_COUNTER_SHIFT 14
  4202. #elif defined(__LITTLE_ENDIAN)
  4203. u16 tcp_params;
  4204. #define XSTORM_TCP_CONTEXT_SECTION_TOTAL_HEADER_SIZE (0xFF<<0)
  4205. #define XSTORM_TCP_CONTEXT_SECTION_TOTAL_HEADER_SIZE_SHIFT 0
  4206. #define __XSTORM_TCP_CONTEXT_SECTION_ECT_BIT (0x1<<8)
  4207. #define __XSTORM_TCP_CONTEXT_SECTION_ECT_BIT_SHIFT 8
  4208. #define __XSTORM_TCP_CONTEXT_SECTION_ECN_ENABLED (0x1<<9)
  4209. #define __XSTORM_TCP_CONTEXT_SECTION_ECN_ENABLED_SHIFT 9
  4210. #define XSTORM_TCP_CONTEXT_SECTION_SACK_ENABLED (0x1<<10)
  4211. #define XSTORM_TCP_CONTEXT_SECTION_SACK_ENABLED_SHIFT 10
  4212. #define XSTORM_TCP_CONTEXT_SECTION_SMALL_WIN_ADV (0x1<<11)
  4213. #define XSTORM_TCP_CONTEXT_SECTION_SMALL_WIN_ADV_SHIFT 11
  4214. #define XSTORM_TCP_CONTEXT_SECTION_FIN_SENT_FLAG (0x1<<12)
  4215. #define XSTORM_TCP_CONTEXT_SECTION_FIN_SENT_FLAG_SHIFT 12
  4216. #define XSTORM_TCP_CONTEXT_SECTION_WINDOW_SATURATED (0x1<<13)
  4217. #define XSTORM_TCP_CONTEXT_SECTION_WINDOW_SATURATED_SHIFT 13
  4218. #define XSTORM_TCP_CONTEXT_SECTION_SLOWPATH_QUEUES_FLUSH_COUNTER (0x3<<14)
  4219. #define XSTORM_TCP_CONTEXT_SECTION_SLOWPATH_QUEUES_FLUSH_COUNTER_SHIFT 14
  4220. u8 ts_enabled;
  4221. u8 original_nagle_1b;
  4222. #endif
  4223. #if defined(__BIG_ENDIAN)
  4224. u16 pseudo_csum;
  4225. u16 window_scaling_factor;
  4226. #elif defined(__LITTLE_ENDIAN)
  4227. u16 window_scaling_factor;
  4228. u16 pseudo_csum;
  4229. #endif
  4230. #if defined(__BIG_ENDIAN)
  4231. u16 reserved2;
  4232. u8 statistics_counter_id;
  4233. u8 statistics_params;
  4234. #define XSTORM_TCP_CONTEXT_SECTION_UPDATE_L2_STATSTICS (0x1<<0)
  4235. #define XSTORM_TCP_CONTEXT_SECTION_UPDATE_L2_STATSTICS_SHIFT 0
  4236. #define XSTORM_TCP_CONTEXT_SECTION_UPDATE_L4_STATSTICS (0x1<<1)
  4237. #define XSTORM_TCP_CONTEXT_SECTION_UPDATE_L4_STATSTICS_SHIFT 1
  4238. #define XSTORM_TCP_CONTEXT_SECTION_RESERVED (0x3F<<2)
  4239. #define XSTORM_TCP_CONTEXT_SECTION_RESERVED_SHIFT 2
  4240. #elif defined(__LITTLE_ENDIAN)
  4241. u8 statistics_params;
  4242. #define XSTORM_TCP_CONTEXT_SECTION_UPDATE_L2_STATSTICS (0x1<<0)
  4243. #define XSTORM_TCP_CONTEXT_SECTION_UPDATE_L2_STATSTICS_SHIFT 0
  4244. #define XSTORM_TCP_CONTEXT_SECTION_UPDATE_L4_STATSTICS (0x1<<1)
  4245. #define XSTORM_TCP_CONTEXT_SECTION_UPDATE_L4_STATSTICS_SHIFT 1
  4246. #define XSTORM_TCP_CONTEXT_SECTION_RESERVED (0x3F<<2)
  4247. #define XSTORM_TCP_CONTEXT_SECTION_RESERVED_SHIFT 2
  4248. u8 statistics_counter_id;
  4249. u16 reserved2;
  4250. #endif
  4251. u32 ts_time_diff;
  4252. u32 __next_timer_expir;
  4253. };
  4254. /*
  4255. * Common context section, shared in TOE, RDMA and ISCSI
  4256. */
  4257. struct xstorm_common_context_section {
  4258. struct xstorm_eth_context_section ethernet;
  4259. union xstorm_ip_context_section_types ip_union;
  4260. struct xstorm_tcp_context_section tcp;
  4261. #if defined(__BIG_ENDIAN)
  4262. u8 __dcb_val;
  4263. u8 flags;
  4264. #define XSTORM_COMMON_CONTEXT_SECTION_PHYSQ_INITIALIZED (0x1<<0)
  4265. #define XSTORM_COMMON_CONTEXT_SECTION_PHYSQ_INITIALIZED_SHIFT 0
  4266. #define XSTORM_COMMON_CONTEXT_SECTION_PBF_PORT (0x7<<1)
  4267. #define XSTORM_COMMON_CONTEXT_SECTION_PBF_PORT_SHIFT 1
  4268. #define XSTORM_COMMON_CONTEXT_SECTION_VLAN_MODE (0x1<<4)
  4269. #define XSTORM_COMMON_CONTEXT_SECTION_VLAN_MODE_SHIFT 4
  4270. #define XSTORM_COMMON_CONTEXT_SECTION_ORIGINAL_PRIORITY (0x7<<5)
  4271. #define XSTORM_COMMON_CONTEXT_SECTION_ORIGINAL_PRIORITY_SHIFT 5
  4272. u8 reserved;
  4273. u8 ip_version_1b;
  4274. #elif defined(__LITTLE_ENDIAN)
  4275. u8 ip_version_1b;
  4276. u8 reserved;
  4277. u8 flags;
  4278. #define XSTORM_COMMON_CONTEXT_SECTION_PHYSQ_INITIALIZED (0x1<<0)
  4279. #define XSTORM_COMMON_CONTEXT_SECTION_PHYSQ_INITIALIZED_SHIFT 0
  4280. #define XSTORM_COMMON_CONTEXT_SECTION_PBF_PORT (0x7<<1)
  4281. #define XSTORM_COMMON_CONTEXT_SECTION_PBF_PORT_SHIFT 1
  4282. #define XSTORM_COMMON_CONTEXT_SECTION_VLAN_MODE (0x1<<4)
  4283. #define XSTORM_COMMON_CONTEXT_SECTION_VLAN_MODE_SHIFT 4
  4284. #define XSTORM_COMMON_CONTEXT_SECTION_ORIGINAL_PRIORITY (0x7<<5)
  4285. #define XSTORM_COMMON_CONTEXT_SECTION_ORIGINAL_PRIORITY_SHIFT 5
  4286. u8 __dcb_val;
  4287. #endif
  4288. };
  4289. /*
  4290. * Flags used in ISCSI context section
  4291. */
  4292. struct xstorm_iscsi_context_flags {
  4293. u8 flags;
  4294. #define XSTORM_ISCSI_CONTEXT_FLAGS_B_IMMEDIATE_DATA (0x1<<0)
  4295. #define XSTORM_ISCSI_CONTEXT_FLAGS_B_IMMEDIATE_DATA_SHIFT 0
  4296. #define XSTORM_ISCSI_CONTEXT_FLAGS_B_INITIAL_R2T (0x1<<1)
  4297. #define XSTORM_ISCSI_CONTEXT_FLAGS_B_INITIAL_R2T_SHIFT 1
  4298. #define XSTORM_ISCSI_CONTEXT_FLAGS_B_EN_HEADER_DIGEST (0x1<<2)
  4299. #define XSTORM_ISCSI_CONTEXT_FLAGS_B_EN_HEADER_DIGEST_SHIFT 2
  4300. #define XSTORM_ISCSI_CONTEXT_FLAGS_B_EN_DATA_DIGEST (0x1<<3)
  4301. #define XSTORM_ISCSI_CONTEXT_FLAGS_B_EN_DATA_DIGEST_SHIFT 3
  4302. #define XSTORM_ISCSI_CONTEXT_FLAGS_B_HQ_BD_WRITTEN (0x1<<4)
  4303. #define XSTORM_ISCSI_CONTEXT_FLAGS_B_HQ_BD_WRITTEN_SHIFT 4
  4304. #define XSTORM_ISCSI_CONTEXT_FLAGS_B_LAST_OP_SQ (0x1<<5)
  4305. #define XSTORM_ISCSI_CONTEXT_FLAGS_B_LAST_OP_SQ_SHIFT 5
  4306. #define XSTORM_ISCSI_CONTEXT_FLAGS_B_UPDATE_SND_NXT (0x1<<6)
  4307. #define XSTORM_ISCSI_CONTEXT_FLAGS_B_UPDATE_SND_NXT_SHIFT 6
  4308. #define XSTORM_ISCSI_CONTEXT_FLAGS_RESERVED4 (0x1<<7)
  4309. #define XSTORM_ISCSI_CONTEXT_FLAGS_RESERVED4_SHIFT 7
  4310. };
  4311. struct iscsi_task_context_entry_x {
  4312. u32 data_out_buffer_offset;
  4313. u32 itt;
  4314. u32 data_sn;
  4315. };
  4316. struct iscsi_task_context_entry_xuc_x_write_only {
  4317. u32 tx_r2t_sn;
  4318. };
  4319. struct iscsi_task_context_entry_xuc_xu_write_both {
  4320. u32 sgl_base_lo;
  4321. u32 sgl_base_hi;
  4322. #if defined(__BIG_ENDIAN)
  4323. u8 sgl_size;
  4324. u8 sge_index;
  4325. u16 sge_offset;
  4326. #elif defined(__LITTLE_ENDIAN)
  4327. u16 sge_offset;
  4328. u8 sge_index;
  4329. u8 sgl_size;
  4330. #endif
  4331. };
  4332. /*
  4333. * iSCSI context section
  4334. */
  4335. struct xstorm_iscsi_context_section {
  4336. u32 first_burst_length;
  4337. u32 max_send_pdu_length;
  4338. struct regpair sq_pbl_base;
  4339. struct regpair sq_curr_pbe;
  4340. struct regpair hq_pbl_base;
  4341. struct regpair hq_curr_pbe_base;
  4342. struct regpair r2tq_pbl_base;
  4343. struct regpair r2tq_curr_pbe_base;
  4344. struct regpair task_pbl_base;
  4345. #if defined(__BIG_ENDIAN)
  4346. u16 data_out_count;
  4347. struct xstorm_iscsi_context_flags flags;
  4348. u8 task_pbl_cache_idx;
  4349. #elif defined(__LITTLE_ENDIAN)
  4350. u8 task_pbl_cache_idx;
  4351. struct xstorm_iscsi_context_flags flags;
  4352. u16 data_out_count;
  4353. #endif
  4354. u32 seq_more_2_send;
  4355. u32 pdu_more_2_send;
  4356. struct iscsi_task_context_entry_x temp_tce_x;
  4357. struct iscsi_task_context_entry_xuc_x_write_only temp_tce_x_wr;
  4358. struct iscsi_task_context_entry_xuc_xu_write_both temp_tce_xu_wr;
  4359. struct regpair lun;
  4360. u32 exp_data_transfer_len_ttt;
  4361. u32 pdu_data_2_rxmit;
  4362. u32 rxmit_bytes_2_dr;
  4363. #if defined(__BIG_ENDIAN)
  4364. u16 rxmit_sge_offset;
  4365. u16 hq_rxmit_cons;
  4366. #elif defined(__LITTLE_ENDIAN)
  4367. u16 hq_rxmit_cons;
  4368. u16 rxmit_sge_offset;
  4369. #endif
  4370. #if defined(__BIG_ENDIAN)
  4371. u16 r2tq_cons;
  4372. u8 rxmit_flags;
  4373. #define XSTORM_ISCSI_CONTEXT_SECTION_B_NEW_HQ_BD (0x1<<0)
  4374. #define XSTORM_ISCSI_CONTEXT_SECTION_B_NEW_HQ_BD_SHIFT 0
  4375. #define XSTORM_ISCSI_CONTEXT_SECTION_B_RXMIT_PDU_HDR (0x1<<1)
  4376. #define XSTORM_ISCSI_CONTEXT_SECTION_B_RXMIT_PDU_HDR_SHIFT 1
  4377. #define XSTORM_ISCSI_CONTEXT_SECTION_B_RXMIT_END_PDU (0x1<<2)
  4378. #define XSTORM_ISCSI_CONTEXT_SECTION_B_RXMIT_END_PDU_SHIFT 2
  4379. #define XSTORM_ISCSI_CONTEXT_SECTION_B_RXMIT_DR (0x1<<3)
  4380. #define XSTORM_ISCSI_CONTEXT_SECTION_B_RXMIT_DR_SHIFT 3
  4381. #define XSTORM_ISCSI_CONTEXT_SECTION_B_RXMIT_START_DR (0x1<<4)
  4382. #define XSTORM_ISCSI_CONTEXT_SECTION_B_RXMIT_START_DR_SHIFT 4
  4383. #define XSTORM_ISCSI_CONTEXT_SECTION_B_RXMIT_PADDING (0x3<<5)
  4384. #define XSTORM_ISCSI_CONTEXT_SECTION_B_RXMIT_PADDING_SHIFT 5
  4385. #define XSTORM_ISCSI_CONTEXT_SECTION_B_ISCSI_CONT_FAST_RXMIT (0x1<<7)
  4386. #define XSTORM_ISCSI_CONTEXT_SECTION_B_ISCSI_CONT_FAST_RXMIT_SHIFT 7
  4387. u8 rxmit_sge_idx;
  4388. #elif defined(__LITTLE_ENDIAN)
  4389. u8 rxmit_sge_idx;
  4390. u8 rxmit_flags;
  4391. #define XSTORM_ISCSI_CONTEXT_SECTION_B_NEW_HQ_BD (0x1<<0)
  4392. #define XSTORM_ISCSI_CONTEXT_SECTION_B_NEW_HQ_BD_SHIFT 0
  4393. #define XSTORM_ISCSI_CONTEXT_SECTION_B_RXMIT_PDU_HDR (0x1<<1)
  4394. #define XSTORM_ISCSI_CONTEXT_SECTION_B_RXMIT_PDU_HDR_SHIFT 1
  4395. #define XSTORM_ISCSI_CONTEXT_SECTION_B_RXMIT_END_PDU (0x1<<2)
  4396. #define XSTORM_ISCSI_CONTEXT_SECTION_B_RXMIT_END_PDU_SHIFT 2
  4397. #define XSTORM_ISCSI_CONTEXT_SECTION_B_RXMIT_DR (0x1<<3)
  4398. #define XSTORM_ISCSI_CONTEXT_SECTION_B_RXMIT_DR_SHIFT 3
  4399. #define XSTORM_ISCSI_CONTEXT_SECTION_B_RXMIT_START_DR (0x1<<4)
  4400. #define XSTORM_ISCSI_CONTEXT_SECTION_B_RXMIT_START_DR_SHIFT 4
  4401. #define XSTORM_ISCSI_CONTEXT_SECTION_B_RXMIT_PADDING (0x3<<5)
  4402. #define XSTORM_ISCSI_CONTEXT_SECTION_B_RXMIT_PADDING_SHIFT 5
  4403. #define XSTORM_ISCSI_CONTEXT_SECTION_B_ISCSI_CONT_FAST_RXMIT (0x1<<7)
  4404. #define XSTORM_ISCSI_CONTEXT_SECTION_B_ISCSI_CONT_FAST_RXMIT_SHIFT 7
  4405. u16 r2tq_cons;
  4406. #endif
  4407. u32 hq_rxmit_tcp_seq;
  4408. };
  4409. /*
  4410. * Xstorm iSCSI Storm Context
  4411. */
  4412. struct xstorm_iscsi_st_context {
  4413. struct xstorm_common_context_section common;
  4414. struct xstorm_iscsi_context_section iscsi;
  4415. };
  4416. /*
  4417. * Iscsi connection context
  4418. */
  4419. struct iscsi_context {
  4420. struct ustorm_iscsi_st_context ustorm_st_context;
  4421. struct tstorm_iscsi_st_context tstorm_st_context;
  4422. struct xstorm_iscsi_ag_context xstorm_ag_context;
  4423. struct tstorm_iscsi_ag_context tstorm_ag_context;
  4424. struct cstorm_iscsi_ag_context cstorm_ag_context;
  4425. struct ustorm_iscsi_ag_context ustorm_ag_context;
  4426. struct timers_block_context timers_context;
  4427. struct regpair upb_context;
  4428. struct xstorm_iscsi_st_context xstorm_st_context;
  4429. struct regpair xpb_context;
  4430. struct cstorm_iscsi_st_context cstorm_st_context;
  4431. };
  4432. /*
  4433. * PDU header of an iSCSI DATA-OUT
  4434. */
  4435. struct iscsi_data_pdu_hdr_little_endian {
  4436. #if defined(__BIG_ENDIAN)
  4437. u8 opcode;
  4438. u8 op_attr;
  4439. #define ISCSI_DATA_PDU_HDR_LITTLE_ENDIAN_RSRV1 (0x7F<<0)
  4440. #define ISCSI_DATA_PDU_HDR_LITTLE_ENDIAN_RSRV1_SHIFT 0
  4441. #define ISCSI_DATA_PDU_HDR_LITTLE_ENDIAN_FINAL_FLAG (0x1<<7)
  4442. #define ISCSI_DATA_PDU_HDR_LITTLE_ENDIAN_FINAL_FLAG_SHIFT 7
  4443. u16 rsrv0;
  4444. #elif defined(__LITTLE_ENDIAN)
  4445. u16 rsrv0;
  4446. u8 op_attr;
  4447. #define ISCSI_DATA_PDU_HDR_LITTLE_ENDIAN_RSRV1 (0x7F<<0)
  4448. #define ISCSI_DATA_PDU_HDR_LITTLE_ENDIAN_RSRV1_SHIFT 0
  4449. #define ISCSI_DATA_PDU_HDR_LITTLE_ENDIAN_FINAL_FLAG (0x1<<7)
  4450. #define ISCSI_DATA_PDU_HDR_LITTLE_ENDIAN_FINAL_FLAG_SHIFT 7
  4451. u8 opcode;
  4452. #endif
  4453. u32 data_fields;
  4454. #define ISCSI_DATA_PDU_HDR_LITTLE_ENDIAN_DATA_SEGMENT_LENGTH (0xFFFFFF<<0)
  4455. #define ISCSI_DATA_PDU_HDR_LITTLE_ENDIAN_DATA_SEGMENT_LENGTH_SHIFT 0
  4456. #define ISCSI_DATA_PDU_HDR_LITTLE_ENDIAN_TOTAL_AHS_LENGTH (0xFF<<24)
  4457. #define ISCSI_DATA_PDU_HDR_LITTLE_ENDIAN_TOTAL_AHS_LENGTH_SHIFT 24
  4458. struct regpair lun;
  4459. u32 itt;
  4460. u32 ttt;
  4461. u32 rsrv2;
  4462. u32 exp_stat_sn;
  4463. u32 rsrv3;
  4464. u32 data_sn;
  4465. u32 buffer_offset;
  4466. u32 rsrv4;
  4467. };
  4468. /*
  4469. * PDU header of an iSCSI login request
  4470. */
  4471. struct iscsi_login_req_hdr_little_endian {
  4472. #if defined(__BIG_ENDIAN)
  4473. u8 opcode;
  4474. u8 op_attr;
  4475. #define ISCSI_LOGIN_REQ_HDR_LITTLE_ENDIAN_NSG (0x3<<0)
  4476. #define ISCSI_LOGIN_REQ_HDR_LITTLE_ENDIAN_NSG_SHIFT 0
  4477. #define ISCSI_LOGIN_REQ_HDR_LITTLE_ENDIAN_CSG (0x3<<2)
  4478. #define ISCSI_LOGIN_REQ_HDR_LITTLE_ENDIAN_CSG_SHIFT 2
  4479. #define ISCSI_LOGIN_REQ_HDR_LITTLE_ENDIAN_RSRV0 (0x3<<4)
  4480. #define ISCSI_LOGIN_REQ_HDR_LITTLE_ENDIAN_RSRV0_SHIFT 4
  4481. #define ISCSI_LOGIN_REQ_HDR_LITTLE_ENDIAN_CONTINUE_FLG (0x1<<6)
  4482. #define ISCSI_LOGIN_REQ_HDR_LITTLE_ENDIAN_CONTINUE_FLG_SHIFT 6
  4483. #define ISCSI_LOGIN_REQ_HDR_LITTLE_ENDIAN_TRANSIT (0x1<<7)
  4484. #define ISCSI_LOGIN_REQ_HDR_LITTLE_ENDIAN_TRANSIT_SHIFT 7
  4485. u8 version_max;
  4486. u8 version_min;
  4487. #elif defined(__LITTLE_ENDIAN)
  4488. u8 version_min;
  4489. u8 version_max;
  4490. u8 op_attr;
  4491. #define ISCSI_LOGIN_REQ_HDR_LITTLE_ENDIAN_NSG (0x3<<0)
  4492. #define ISCSI_LOGIN_REQ_HDR_LITTLE_ENDIAN_NSG_SHIFT 0
  4493. #define ISCSI_LOGIN_REQ_HDR_LITTLE_ENDIAN_CSG (0x3<<2)
  4494. #define ISCSI_LOGIN_REQ_HDR_LITTLE_ENDIAN_CSG_SHIFT 2
  4495. #define ISCSI_LOGIN_REQ_HDR_LITTLE_ENDIAN_RSRV0 (0x3<<4)
  4496. #define ISCSI_LOGIN_REQ_HDR_LITTLE_ENDIAN_RSRV0_SHIFT 4
  4497. #define ISCSI_LOGIN_REQ_HDR_LITTLE_ENDIAN_CONTINUE_FLG (0x1<<6)
  4498. #define ISCSI_LOGIN_REQ_HDR_LITTLE_ENDIAN_CONTINUE_FLG_SHIFT 6
  4499. #define ISCSI_LOGIN_REQ_HDR_LITTLE_ENDIAN_TRANSIT (0x1<<7)
  4500. #define ISCSI_LOGIN_REQ_HDR_LITTLE_ENDIAN_TRANSIT_SHIFT 7
  4501. u8 opcode;
  4502. #endif
  4503. u32 data_fields;
  4504. #define ISCSI_LOGIN_REQ_HDR_LITTLE_ENDIAN_DATA_SEGMENT_LENGTH (0xFFFFFF<<0)
  4505. #define ISCSI_LOGIN_REQ_HDR_LITTLE_ENDIAN_DATA_SEGMENT_LENGTH_SHIFT 0
  4506. #define ISCSI_LOGIN_REQ_HDR_LITTLE_ENDIAN_TOTAL_AHS_LENGTH (0xFF<<24)
  4507. #define ISCSI_LOGIN_REQ_HDR_LITTLE_ENDIAN_TOTAL_AHS_LENGTH_SHIFT 24
  4508. u32 isid_lo;
  4509. #if defined(__BIG_ENDIAN)
  4510. u16 isid_hi;
  4511. u16 tsih;
  4512. #elif defined(__LITTLE_ENDIAN)
  4513. u16 tsih;
  4514. u16 isid_hi;
  4515. #endif
  4516. u32 itt;
  4517. #if defined(__BIG_ENDIAN)
  4518. u16 cid;
  4519. u16 rsrv1;
  4520. #elif defined(__LITTLE_ENDIAN)
  4521. u16 rsrv1;
  4522. u16 cid;
  4523. #endif
  4524. u32 cmd_sn;
  4525. u32 exp_stat_sn;
  4526. u32 rsrv2[4];
  4527. };
  4528. /*
  4529. * PDU header of an iSCSI logout request
  4530. */
  4531. struct iscsi_logout_req_hdr_little_endian {
  4532. #if defined(__BIG_ENDIAN)
  4533. u8 opcode;
  4534. u8 op_attr;
  4535. #define ISCSI_LOGOUT_REQ_HDR_LITTLE_ENDIAN_REASON_CODE (0x7F<<0)
  4536. #define ISCSI_LOGOUT_REQ_HDR_LITTLE_ENDIAN_REASON_CODE_SHIFT 0
  4537. #define ISCSI_LOGOUT_REQ_HDR_LITTLE_ENDIAN_RSRV1_1 (0x1<<7)
  4538. #define ISCSI_LOGOUT_REQ_HDR_LITTLE_ENDIAN_RSRV1_1_SHIFT 7
  4539. u16 rsrv0;
  4540. #elif defined(__LITTLE_ENDIAN)
  4541. u16 rsrv0;
  4542. u8 op_attr;
  4543. #define ISCSI_LOGOUT_REQ_HDR_LITTLE_ENDIAN_REASON_CODE (0x7F<<0)
  4544. #define ISCSI_LOGOUT_REQ_HDR_LITTLE_ENDIAN_REASON_CODE_SHIFT 0
  4545. #define ISCSI_LOGOUT_REQ_HDR_LITTLE_ENDIAN_RSRV1_1 (0x1<<7)
  4546. #define ISCSI_LOGOUT_REQ_HDR_LITTLE_ENDIAN_RSRV1_1_SHIFT 7
  4547. u8 opcode;
  4548. #endif
  4549. u32 data_fields;
  4550. #define ISCSI_LOGOUT_REQ_HDR_LITTLE_ENDIAN_DATA_SEGMENT_LENGTH (0xFFFFFF<<0)
  4551. #define ISCSI_LOGOUT_REQ_HDR_LITTLE_ENDIAN_DATA_SEGMENT_LENGTH_SHIFT 0
  4552. #define ISCSI_LOGOUT_REQ_HDR_LITTLE_ENDIAN_TOTAL_AHS_LENGTH (0xFF<<24)
  4553. #define ISCSI_LOGOUT_REQ_HDR_LITTLE_ENDIAN_TOTAL_AHS_LENGTH_SHIFT 24
  4554. u32 rsrv2[2];
  4555. u32 itt;
  4556. #if defined(__BIG_ENDIAN)
  4557. u16 cid;
  4558. u16 rsrv1;
  4559. #elif defined(__LITTLE_ENDIAN)
  4560. u16 rsrv1;
  4561. u16 cid;
  4562. #endif
  4563. u32 cmd_sn;
  4564. u32 exp_stat_sn;
  4565. u32 rsrv3[4];
  4566. };
  4567. /*
  4568. * PDU header of an iSCSI TMF request
  4569. */
  4570. struct iscsi_tmf_req_hdr_little_endian {
  4571. #if defined(__BIG_ENDIAN)
  4572. u8 opcode;
  4573. u8 op_attr;
  4574. #define ISCSI_TMF_REQ_HDR_LITTLE_ENDIAN_FUNCTION (0x7F<<0)
  4575. #define ISCSI_TMF_REQ_HDR_LITTLE_ENDIAN_FUNCTION_SHIFT 0
  4576. #define ISCSI_TMF_REQ_HDR_LITTLE_ENDIAN_RSRV1_1 (0x1<<7)
  4577. #define ISCSI_TMF_REQ_HDR_LITTLE_ENDIAN_RSRV1_1_SHIFT 7
  4578. u16 rsrv0;
  4579. #elif defined(__LITTLE_ENDIAN)
  4580. u16 rsrv0;
  4581. u8 op_attr;
  4582. #define ISCSI_TMF_REQ_HDR_LITTLE_ENDIAN_FUNCTION (0x7F<<0)
  4583. #define ISCSI_TMF_REQ_HDR_LITTLE_ENDIAN_FUNCTION_SHIFT 0
  4584. #define ISCSI_TMF_REQ_HDR_LITTLE_ENDIAN_RSRV1_1 (0x1<<7)
  4585. #define ISCSI_TMF_REQ_HDR_LITTLE_ENDIAN_RSRV1_1_SHIFT 7
  4586. u8 opcode;
  4587. #endif
  4588. u32 data_fields;
  4589. #define ISCSI_TMF_REQ_HDR_LITTLE_ENDIAN_DATA_SEGMENT_LENGTH (0xFFFFFF<<0)
  4590. #define ISCSI_TMF_REQ_HDR_LITTLE_ENDIAN_DATA_SEGMENT_LENGTH_SHIFT 0
  4591. #define ISCSI_TMF_REQ_HDR_LITTLE_ENDIAN_TOTAL_AHS_LENGTH (0xFF<<24)
  4592. #define ISCSI_TMF_REQ_HDR_LITTLE_ENDIAN_TOTAL_AHS_LENGTH_SHIFT 24
  4593. struct regpair lun;
  4594. u32 itt;
  4595. u32 referenced_task_tag;
  4596. u32 cmd_sn;
  4597. u32 exp_stat_sn;
  4598. u32 ref_cmd_sn;
  4599. u32 exp_data_sn;
  4600. u32 rsrv2[2];
  4601. };
  4602. /*
  4603. * PDU header of an iSCSI Text request
  4604. */
  4605. struct iscsi_text_req_hdr_little_endian {
  4606. #if defined(__BIG_ENDIAN)
  4607. u8 opcode;
  4608. u8 op_attr;
  4609. #define ISCSI_TEXT_REQ_HDR_LITTLE_ENDIAN_RSRV1 (0x3F<<0)
  4610. #define ISCSI_TEXT_REQ_HDR_LITTLE_ENDIAN_RSRV1_SHIFT 0
  4611. #define ISCSI_TEXT_REQ_HDR_LITTLE_ENDIAN_CONTINUE_FLG (0x1<<6)
  4612. #define ISCSI_TEXT_REQ_HDR_LITTLE_ENDIAN_CONTINUE_FLG_SHIFT 6
  4613. #define ISCSI_TEXT_REQ_HDR_LITTLE_ENDIAN_FINAL (0x1<<7)
  4614. #define ISCSI_TEXT_REQ_HDR_LITTLE_ENDIAN_FINAL_SHIFT 7
  4615. u16 rsrv0;
  4616. #elif defined(__LITTLE_ENDIAN)
  4617. u16 rsrv0;
  4618. u8 op_attr;
  4619. #define ISCSI_TEXT_REQ_HDR_LITTLE_ENDIAN_RSRV1 (0x3F<<0)
  4620. #define ISCSI_TEXT_REQ_HDR_LITTLE_ENDIAN_RSRV1_SHIFT 0
  4621. #define ISCSI_TEXT_REQ_HDR_LITTLE_ENDIAN_CONTINUE_FLG (0x1<<6)
  4622. #define ISCSI_TEXT_REQ_HDR_LITTLE_ENDIAN_CONTINUE_FLG_SHIFT 6
  4623. #define ISCSI_TEXT_REQ_HDR_LITTLE_ENDIAN_FINAL (0x1<<7)
  4624. #define ISCSI_TEXT_REQ_HDR_LITTLE_ENDIAN_FINAL_SHIFT 7
  4625. u8 opcode;
  4626. #endif
  4627. u32 data_fields;
  4628. #define ISCSI_TEXT_REQ_HDR_LITTLE_ENDIAN_DATA_SEGMENT_LENGTH (0xFFFFFF<<0)
  4629. #define ISCSI_TEXT_REQ_HDR_LITTLE_ENDIAN_DATA_SEGMENT_LENGTH_SHIFT 0
  4630. #define ISCSI_TEXT_REQ_HDR_LITTLE_ENDIAN_TOTAL_AHS_LENGTH (0xFF<<24)
  4631. #define ISCSI_TEXT_REQ_HDR_LITTLE_ENDIAN_TOTAL_AHS_LENGTH_SHIFT 24
  4632. struct regpair lun;
  4633. u32 itt;
  4634. u32 ttt;
  4635. u32 cmd_sn;
  4636. u32 exp_stat_sn;
  4637. u32 rsrv3[4];
  4638. };
  4639. /*
  4640. * PDU header of an iSCSI Nop-Out
  4641. */
  4642. struct iscsi_nop_out_hdr_little_endian {
  4643. #if defined(__BIG_ENDIAN)
  4644. u8 opcode;
  4645. u8 op_attr;
  4646. #define ISCSI_NOP_OUT_HDR_LITTLE_ENDIAN_RSRV1 (0x7F<<0)
  4647. #define ISCSI_NOP_OUT_HDR_LITTLE_ENDIAN_RSRV1_SHIFT 0
  4648. #define ISCSI_NOP_OUT_HDR_LITTLE_ENDIAN_RSRV2_1 (0x1<<7)
  4649. #define ISCSI_NOP_OUT_HDR_LITTLE_ENDIAN_RSRV2_1_SHIFT 7
  4650. u16 rsrv0;
  4651. #elif defined(__LITTLE_ENDIAN)
  4652. u16 rsrv0;
  4653. u8 op_attr;
  4654. #define ISCSI_NOP_OUT_HDR_LITTLE_ENDIAN_RSRV1 (0x7F<<0)
  4655. #define ISCSI_NOP_OUT_HDR_LITTLE_ENDIAN_RSRV1_SHIFT 0
  4656. #define ISCSI_NOP_OUT_HDR_LITTLE_ENDIAN_RSRV2_1 (0x1<<7)
  4657. #define ISCSI_NOP_OUT_HDR_LITTLE_ENDIAN_RSRV2_1_SHIFT 7
  4658. u8 opcode;
  4659. #endif
  4660. u32 data_fields;
  4661. #define ISCSI_NOP_OUT_HDR_LITTLE_ENDIAN_DATA_SEGMENT_LENGTH (0xFFFFFF<<0)
  4662. #define ISCSI_NOP_OUT_HDR_LITTLE_ENDIAN_DATA_SEGMENT_LENGTH_SHIFT 0
  4663. #define ISCSI_NOP_OUT_HDR_LITTLE_ENDIAN_TOTAL_AHS_LENGTH (0xFF<<24)
  4664. #define ISCSI_NOP_OUT_HDR_LITTLE_ENDIAN_TOTAL_AHS_LENGTH_SHIFT 24
  4665. struct regpair lun;
  4666. u32 itt;
  4667. u32 ttt;
  4668. u32 cmd_sn;
  4669. u32 exp_stat_sn;
  4670. u32 rsrv3[4];
  4671. };
  4672. /*
  4673. * iscsi pdu headers in little endian form.
  4674. */
  4675. union iscsi_pdu_headers_little_endian {
  4676. u32 fullHeaderSize[12];
  4677. struct iscsi_cmd_pdu_hdr_little_endian command_pdu_hdr;
  4678. struct iscsi_data_pdu_hdr_little_endian data_out_pdu_hdr;
  4679. struct iscsi_login_req_hdr_little_endian login_req_pdu_hdr;
  4680. struct iscsi_logout_req_hdr_little_endian logout_req_pdu_hdr;
  4681. struct iscsi_tmf_req_hdr_little_endian tmf_req_pdu_hdr;
  4682. struct iscsi_text_req_hdr_little_endian text_req_pdu_hdr;
  4683. struct iscsi_nop_out_hdr_little_endian nop_out_pdu_hdr;
  4684. };
  4685. struct iscsi_hq_bd {
  4686. union iscsi_pdu_headers_little_endian pdu_header;
  4687. #if defined(__BIG_ENDIAN)
  4688. u16 reserved1;
  4689. u16 lcl_cmp_flg;
  4690. #elif defined(__LITTLE_ENDIAN)
  4691. u16 lcl_cmp_flg;
  4692. u16 reserved1;
  4693. #endif
  4694. u32 sgl_base_lo;
  4695. u32 sgl_base_hi;
  4696. #if defined(__BIG_ENDIAN)
  4697. u8 sgl_size;
  4698. u8 sge_index;
  4699. u16 sge_offset;
  4700. #elif defined(__LITTLE_ENDIAN)
  4701. u16 sge_offset;
  4702. u8 sge_index;
  4703. u8 sgl_size;
  4704. #endif
  4705. };
  4706. /*
  4707. * CQE data for L2 OOO connection $$KEEP_ENDIANNESS$$
  4708. */
  4709. struct iscsi_l2_ooo_data {
  4710. __le32 iscsi_cid;
  4711. u8 drop_isle;
  4712. u8 drop_size;
  4713. u8 ooo_opcode;
  4714. u8 ooo_isle;
  4715. u8 reserved[8];
  4716. };
  4717. struct iscsi_task_context_entry_xuc_c_write_only {
  4718. u32 total_data_acked;
  4719. };
  4720. struct iscsi_task_context_r2t_table_entry {
  4721. u32 ttt;
  4722. u32 desired_data_len;
  4723. };
  4724. struct iscsi_task_context_entry_xuc_u_write_only {
  4725. u32 exp_r2t_sn;
  4726. struct iscsi_task_context_r2t_table_entry r2t_table[4];
  4727. #if defined(__BIG_ENDIAN)
  4728. u16 data_in_count;
  4729. u8 cq_id;
  4730. u8 valid_1b;
  4731. #elif defined(__LITTLE_ENDIAN)
  4732. u8 valid_1b;
  4733. u8 cq_id;
  4734. u16 data_in_count;
  4735. #endif
  4736. };
  4737. struct iscsi_task_context_entry_xuc {
  4738. struct iscsi_task_context_entry_xuc_c_write_only write_c;
  4739. u32 exp_data_transfer_len;
  4740. struct iscsi_task_context_entry_xuc_x_write_only write_x;
  4741. u32 lun_lo;
  4742. struct iscsi_task_context_entry_xuc_xu_write_both write_xu;
  4743. u32 lun_hi;
  4744. struct iscsi_task_context_entry_xuc_u_write_only write_u;
  4745. };
  4746. struct iscsi_task_context_entry_u {
  4747. u32 exp_r2t_buff_offset;
  4748. u32 rem_rcv_len;
  4749. u32 exp_data_sn;
  4750. };
  4751. struct iscsi_task_context_entry {
  4752. struct iscsi_task_context_entry_x tce_x;
  4753. #if defined(__BIG_ENDIAN)
  4754. u16 data_out_count;
  4755. u16 rsrv0;
  4756. #elif defined(__LITTLE_ENDIAN)
  4757. u16 rsrv0;
  4758. u16 data_out_count;
  4759. #endif
  4760. struct iscsi_task_context_entry_xuc tce_xuc;
  4761. struct iscsi_task_context_entry_u tce_u;
  4762. u32 rsrv1[7];
  4763. };
  4764. struct iscsi_task_context_entry_xuc_x_init_only {
  4765. struct regpair lun;
  4766. u32 exp_data_transfer_len;
  4767. };
  4768. /*
  4769. * ipv6 structure
  4770. */
  4771. struct ip_v6_addr {
  4772. u32 ip_addr_lo_lo;
  4773. u32 ip_addr_lo_hi;
  4774. u32 ip_addr_hi_lo;
  4775. u32 ip_addr_hi_hi;
  4776. };
  4777. /*
  4778. * l5cm- connection identification params
  4779. */
  4780. struct l5cm_conn_addr_params {
  4781. u32 pmtu;
  4782. #if defined(__BIG_ENDIAN)
  4783. u8 remote_addr_3;
  4784. u8 remote_addr_2;
  4785. u8 remote_addr_1;
  4786. u8 remote_addr_0;
  4787. #elif defined(__LITTLE_ENDIAN)
  4788. u8 remote_addr_0;
  4789. u8 remote_addr_1;
  4790. u8 remote_addr_2;
  4791. u8 remote_addr_3;
  4792. #endif
  4793. #if defined(__BIG_ENDIAN)
  4794. u16 params;
  4795. #define L5CM_CONN_ADDR_PARAMS_IP_VERSION (0x1<<0)
  4796. #define L5CM_CONN_ADDR_PARAMS_IP_VERSION_SHIFT 0
  4797. #define L5CM_CONN_ADDR_PARAMS_RSRV (0x7FFF<<1)
  4798. #define L5CM_CONN_ADDR_PARAMS_RSRV_SHIFT 1
  4799. u8 remote_addr_5;
  4800. u8 remote_addr_4;
  4801. #elif defined(__LITTLE_ENDIAN)
  4802. u8 remote_addr_4;
  4803. u8 remote_addr_5;
  4804. u16 params;
  4805. #define L5CM_CONN_ADDR_PARAMS_IP_VERSION (0x1<<0)
  4806. #define L5CM_CONN_ADDR_PARAMS_IP_VERSION_SHIFT 0
  4807. #define L5CM_CONN_ADDR_PARAMS_RSRV (0x7FFF<<1)
  4808. #define L5CM_CONN_ADDR_PARAMS_RSRV_SHIFT 1
  4809. #endif
  4810. struct ip_v6_addr local_ip_addr;
  4811. struct ip_v6_addr remote_ip_addr;
  4812. u32 ipv6_flow_label_20b;
  4813. u32 reserved1;
  4814. #if defined(__BIG_ENDIAN)
  4815. u16 remote_tcp_port;
  4816. u16 local_tcp_port;
  4817. #elif defined(__LITTLE_ENDIAN)
  4818. u16 local_tcp_port;
  4819. u16 remote_tcp_port;
  4820. #endif
  4821. };
  4822. /*
  4823. * l5cm-xstorm connection buffer
  4824. */
  4825. struct l5cm_xstorm_conn_buffer {
  4826. #if defined(__BIG_ENDIAN)
  4827. u16 rsrv1;
  4828. u16 params;
  4829. #define L5CM_XSTORM_CONN_BUFFER_NAGLE_ENABLE (0x1<<0)
  4830. #define L5CM_XSTORM_CONN_BUFFER_NAGLE_ENABLE_SHIFT 0
  4831. #define L5CM_XSTORM_CONN_BUFFER_RSRV (0x7FFF<<1)
  4832. #define L5CM_XSTORM_CONN_BUFFER_RSRV_SHIFT 1
  4833. #elif defined(__LITTLE_ENDIAN)
  4834. u16 params;
  4835. #define L5CM_XSTORM_CONN_BUFFER_NAGLE_ENABLE (0x1<<0)
  4836. #define L5CM_XSTORM_CONN_BUFFER_NAGLE_ENABLE_SHIFT 0
  4837. #define L5CM_XSTORM_CONN_BUFFER_RSRV (0x7FFF<<1)
  4838. #define L5CM_XSTORM_CONN_BUFFER_RSRV_SHIFT 1
  4839. u16 rsrv1;
  4840. #endif
  4841. #if defined(__BIG_ENDIAN)
  4842. u16 mss;
  4843. u16 pseudo_header_checksum;
  4844. #elif defined(__LITTLE_ENDIAN)
  4845. u16 pseudo_header_checksum;
  4846. u16 mss;
  4847. #endif
  4848. u32 rcv_buf;
  4849. u32 rsrv2;
  4850. struct regpair context_addr;
  4851. };
  4852. /*
  4853. * l5cm-tstorm connection buffer
  4854. */
  4855. struct l5cm_tstorm_conn_buffer {
  4856. u32 rsrv1[2];
  4857. #if defined(__BIG_ENDIAN)
  4858. u16 params;
  4859. #define L5CM_TSTORM_CONN_BUFFER_DELAYED_ACK_ENABLE (0x1<<0)
  4860. #define L5CM_TSTORM_CONN_BUFFER_DELAYED_ACK_ENABLE_SHIFT 0
  4861. #define L5CM_TSTORM_CONN_BUFFER_RSRV (0x7FFF<<1)
  4862. #define L5CM_TSTORM_CONN_BUFFER_RSRV_SHIFT 1
  4863. u8 ka_max_probe_count;
  4864. u8 ka_enable;
  4865. #elif defined(__LITTLE_ENDIAN)
  4866. u8 ka_enable;
  4867. u8 ka_max_probe_count;
  4868. u16 params;
  4869. #define L5CM_TSTORM_CONN_BUFFER_DELAYED_ACK_ENABLE (0x1<<0)
  4870. #define L5CM_TSTORM_CONN_BUFFER_DELAYED_ACK_ENABLE_SHIFT 0
  4871. #define L5CM_TSTORM_CONN_BUFFER_RSRV (0x7FFF<<1)
  4872. #define L5CM_TSTORM_CONN_BUFFER_RSRV_SHIFT 1
  4873. #endif
  4874. u32 ka_timeout;
  4875. u32 ka_interval;
  4876. u32 max_rt_time;
  4877. };
  4878. /*
  4879. * l5cm connection buffer for active side
  4880. */
  4881. struct l5cm_active_conn_buffer {
  4882. struct l5cm_conn_addr_params conn_addr_buf;
  4883. struct l5cm_xstorm_conn_buffer xstorm_conn_buffer;
  4884. struct l5cm_tstorm_conn_buffer tstorm_conn_buffer;
  4885. };
  4886. /*
  4887. * The l5cm opaque buffer passed in add new connection ramrod passive side
  4888. */
  4889. struct l5cm_hash_input_string {
  4890. u32 __opaque1;
  4891. #if defined(__BIG_ENDIAN)
  4892. u16 __opaque3;
  4893. u16 __opaque2;
  4894. #elif defined(__LITTLE_ENDIAN)
  4895. u16 __opaque2;
  4896. u16 __opaque3;
  4897. #endif
  4898. struct ip_v6_addr __opaque4;
  4899. struct ip_v6_addr __opaque5;
  4900. u32 __opaque6;
  4901. u32 __opaque7[5];
  4902. };
  4903. /*
  4904. * syn cookie component
  4905. */
  4906. struct l5cm_syn_cookie_comp {
  4907. u32 __opaque;
  4908. };
  4909. /*
  4910. * data related to listeners of a TCP port
  4911. */
  4912. struct l5cm_port_listener_data {
  4913. u8 params;
  4914. #define L5CM_PORT_LISTENER_DATA_ENABLE (0x1<<0)
  4915. #define L5CM_PORT_LISTENER_DATA_ENABLE_SHIFT 0
  4916. #define L5CM_PORT_LISTENER_DATA_IP_INDEX (0xF<<1)
  4917. #define L5CM_PORT_LISTENER_DATA_IP_INDEX_SHIFT 1
  4918. #define L5CM_PORT_LISTENER_DATA_NET_FILTER (0x1<<5)
  4919. #define L5CM_PORT_LISTENER_DATA_NET_FILTER_SHIFT 5
  4920. #define L5CM_PORT_LISTENER_DATA_DEFFERED_MODE (0x1<<6)
  4921. #define L5CM_PORT_LISTENER_DATA_DEFFERED_MODE_SHIFT 6
  4922. #define L5CM_PORT_LISTENER_DATA_MPA_MODE (0x1<<7)
  4923. #define L5CM_PORT_LISTENER_DATA_MPA_MODE_SHIFT 7
  4924. };
  4925. /*
  4926. * Opaque structure passed from U to X when final ack arrives
  4927. */
  4928. struct l5cm_opaque_buf {
  4929. u32 __opaque1;
  4930. u32 __opaque2;
  4931. u32 __opaque3;
  4932. u32 __opaque4;
  4933. struct l5cm_syn_cookie_comp __opaque5;
  4934. #if defined(__BIG_ENDIAN)
  4935. u16 rsrv2;
  4936. u8 rsrv;
  4937. struct l5cm_port_listener_data __opaque6;
  4938. #elif defined(__LITTLE_ENDIAN)
  4939. struct l5cm_port_listener_data __opaque6;
  4940. u8 rsrv;
  4941. u16 rsrv2;
  4942. #endif
  4943. };
  4944. /*
  4945. * l5cm slow path element
  4946. */
  4947. struct l5cm_packet_size {
  4948. u32 size;
  4949. u32 rsrv;
  4950. };
  4951. /*
  4952. * The final-ack union structure in PCS entry after final ack arrived
  4953. */
  4954. struct l5cm_pcse_ack {
  4955. struct l5cm_xstorm_conn_buffer tx_socket_params;
  4956. struct l5cm_opaque_buf opaque_buf;
  4957. struct l5cm_tstorm_conn_buffer rx_socket_params;
  4958. };
  4959. /*
  4960. * The syn union structure in PCS entry after syn arrived
  4961. */
  4962. struct l5cm_pcse_syn {
  4963. struct l5cm_opaque_buf opaque_buf;
  4964. u32 rsrv[12];
  4965. };
  4966. /*
  4967. * pcs entry data for passive connections
  4968. */
  4969. struct l5cm_pcs_attributes {
  4970. #if defined(__BIG_ENDIAN)
  4971. u16 pcs_id;
  4972. u8 status;
  4973. u8 flags;
  4974. #define L5CM_PCS_ATTRIBUTES_NET_FILTER (0x1<<0)
  4975. #define L5CM_PCS_ATTRIBUTES_NET_FILTER_SHIFT 0
  4976. #define L5CM_PCS_ATTRIBUTES_CALCULATE_HASH (0x1<<1)
  4977. #define L5CM_PCS_ATTRIBUTES_CALCULATE_HASH_SHIFT 1
  4978. #define L5CM_PCS_ATTRIBUTES_COMPARE_HASH_RESULT (0x1<<2)
  4979. #define L5CM_PCS_ATTRIBUTES_COMPARE_HASH_RESULT_SHIFT 2
  4980. #define L5CM_PCS_ATTRIBUTES_QUERY_ULP_ACCEPT (0x1<<3)
  4981. #define L5CM_PCS_ATTRIBUTES_QUERY_ULP_ACCEPT_SHIFT 3
  4982. #define L5CM_PCS_ATTRIBUTES_FIND_DEST_MAC (0x1<<4)
  4983. #define L5CM_PCS_ATTRIBUTES_FIND_DEST_MAC_SHIFT 4
  4984. #define L5CM_PCS_ATTRIBUTES_L4_OFFLOAD (0x1<<5)
  4985. #define L5CM_PCS_ATTRIBUTES_L4_OFFLOAD_SHIFT 5
  4986. #define L5CM_PCS_ATTRIBUTES_FORWARD_PACKET (0x1<<6)
  4987. #define L5CM_PCS_ATTRIBUTES_FORWARD_PACKET_SHIFT 6
  4988. #define L5CM_PCS_ATTRIBUTES_RSRV (0x1<<7)
  4989. #define L5CM_PCS_ATTRIBUTES_RSRV_SHIFT 7
  4990. #elif defined(__LITTLE_ENDIAN)
  4991. u8 flags;
  4992. #define L5CM_PCS_ATTRIBUTES_NET_FILTER (0x1<<0)
  4993. #define L5CM_PCS_ATTRIBUTES_NET_FILTER_SHIFT 0
  4994. #define L5CM_PCS_ATTRIBUTES_CALCULATE_HASH (0x1<<1)
  4995. #define L5CM_PCS_ATTRIBUTES_CALCULATE_HASH_SHIFT 1
  4996. #define L5CM_PCS_ATTRIBUTES_COMPARE_HASH_RESULT (0x1<<2)
  4997. #define L5CM_PCS_ATTRIBUTES_COMPARE_HASH_RESULT_SHIFT 2
  4998. #define L5CM_PCS_ATTRIBUTES_QUERY_ULP_ACCEPT (0x1<<3)
  4999. #define L5CM_PCS_ATTRIBUTES_QUERY_ULP_ACCEPT_SHIFT 3
  5000. #define L5CM_PCS_ATTRIBUTES_FIND_DEST_MAC (0x1<<4)
  5001. #define L5CM_PCS_ATTRIBUTES_FIND_DEST_MAC_SHIFT 4
  5002. #define L5CM_PCS_ATTRIBUTES_L4_OFFLOAD (0x1<<5)
  5003. #define L5CM_PCS_ATTRIBUTES_L4_OFFLOAD_SHIFT 5
  5004. #define L5CM_PCS_ATTRIBUTES_FORWARD_PACKET (0x1<<6)
  5005. #define L5CM_PCS_ATTRIBUTES_FORWARD_PACKET_SHIFT 6
  5006. #define L5CM_PCS_ATTRIBUTES_RSRV (0x1<<7)
  5007. #define L5CM_PCS_ATTRIBUTES_RSRV_SHIFT 7
  5008. u8 status;
  5009. u16 pcs_id;
  5010. #endif
  5011. };
  5012. union l5cm_seg_params {
  5013. struct l5cm_pcse_syn syn_seg_params;
  5014. struct l5cm_pcse_ack ack_seg_params;
  5015. };
  5016. /*
  5017. * pcs entry data for passive connections
  5018. */
  5019. struct l5cm_pcs_hdr {
  5020. struct l5cm_hash_input_string hash_input_string;
  5021. struct l5cm_conn_addr_params conn_addr_buf;
  5022. u32 cid;
  5023. u32 hash_result;
  5024. union l5cm_seg_params seg_params;
  5025. struct l5cm_pcs_attributes att;
  5026. #if defined(__BIG_ENDIAN)
  5027. u16 rsrv;
  5028. u16 rx_seg_size;
  5029. #elif defined(__LITTLE_ENDIAN)
  5030. u16 rx_seg_size;
  5031. u16 rsrv;
  5032. #endif
  5033. };
  5034. /*
  5035. * pcs entry for passive connections
  5036. */
  5037. struct l5cm_pcs_entry {
  5038. struct l5cm_pcs_hdr hdr;
  5039. u8 rx_segment[1516];
  5040. };
  5041. /*
  5042. * l5cm connection parameters
  5043. */
  5044. union l5cm_reduce_param_union {
  5045. u32 opaque1;
  5046. u32 opaque2;
  5047. };
  5048. /*
  5049. * l5cm connection parameters
  5050. */
  5051. struct l5cm_reduce_conn {
  5052. union l5cm_reduce_param_union opaque1;
  5053. u32 opaque2;
  5054. };
  5055. /*
  5056. * l5cm slow path element
  5057. */
  5058. union l5cm_specific_data {
  5059. u8 protocol_data[8];
  5060. struct regpair phy_address;
  5061. struct l5cm_packet_size packet_size;
  5062. struct l5cm_reduce_conn reduced_conn;
  5063. };
  5064. /*
  5065. * l5 slow path element
  5066. */
  5067. struct l5cm_spe {
  5068. struct spe_hdr hdr;
  5069. union l5cm_specific_data data;
  5070. };
  5071. /*
  5072. * Termination variables
  5073. */
  5074. struct l5cm_term_vars {
  5075. u8 BitMap;
  5076. #define L5CM_TERM_VARS_TCP_STATE (0xF<<0)
  5077. #define L5CM_TERM_VARS_TCP_STATE_SHIFT 0
  5078. #define L5CM_TERM_VARS_FIN_RECEIVED_SBIT (0x1<<4)
  5079. #define L5CM_TERM_VARS_FIN_RECEIVED_SBIT_SHIFT 4
  5080. #define L5CM_TERM_VARS_ACK_ON_FIN_RECEIVED_SBIT (0x1<<5)
  5081. #define L5CM_TERM_VARS_ACK_ON_FIN_RECEIVED_SBIT_SHIFT 5
  5082. #define L5CM_TERM_VARS_TERM_ON_CHIP (0x1<<6)
  5083. #define L5CM_TERM_VARS_TERM_ON_CHIP_SHIFT 6
  5084. #define L5CM_TERM_VARS_RSRV (0x1<<7)
  5085. #define L5CM_TERM_VARS_RSRV_SHIFT 7
  5086. };
  5087. /*
  5088. * Tstorm Tcp flags
  5089. */
  5090. struct tstorm_l5cm_tcp_flags {
  5091. u16 flags;
  5092. #define TSTORM_L5CM_TCP_FLAGS_VLAN_ID (0xFFF<<0)
  5093. #define TSTORM_L5CM_TCP_FLAGS_VLAN_ID_SHIFT 0
  5094. #define TSTORM_L5CM_TCP_FLAGS_DELAYED_ACK_EN (0x1<<12)
  5095. #define TSTORM_L5CM_TCP_FLAGS_DELAYED_ACK_SHIFT 12
  5096. #define TSTORM_L5CM_TCP_FLAGS_TS_ENABLED (0x1<<13)
  5097. #define TSTORM_L5CM_TCP_FLAGS_TS_ENABLED_SHIFT 13
  5098. #define TSTORM_L5CM_TCP_FLAGS_RSRV1 (0x3<<14)
  5099. #define TSTORM_L5CM_TCP_FLAGS_RSRV1_SHIFT 14
  5100. };
  5101. /*
  5102. * Xstorm Tcp flags
  5103. */
  5104. struct xstorm_l5cm_tcp_flags {
  5105. u8 flags;
  5106. #define XSTORM_L5CM_TCP_FLAGS_ENC_ENABLED (0x1<<0)
  5107. #define XSTORM_L5CM_TCP_FLAGS_ENC_ENABLED_SHIFT 0
  5108. #define XSTORM_L5CM_TCP_FLAGS_TS_ENABLED (0x1<<1)
  5109. #define XSTORM_L5CM_TCP_FLAGS_TS_ENABLED_SHIFT 1
  5110. #define XSTORM_L5CM_TCP_FLAGS_WND_SCL_EN (0x1<<2)
  5111. #define XSTORM_L5CM_TCP_FLAGS_WND_SCL_EN_SHIFT 2
  5112. #define XSTORM_L5CM_TCP_FLAGS_RSRV (0x1F<<3)
  5113. #define XSTORM_L5CM_TCP_FLAGS_RSRV_SHIFT 3
  5114. };
  5115. /*
  5116. * Out-of-order states
  5117. */
  5118. enum tcp_ooo_event {
  5119. TCP_EVENT_ADD_PEN = 0,
  5120. TCP_EVENT_ADD_NEW_ISLE = 1,
  5121. TCP_EVENT_ADD_ISLE_RIGHT = 2,
  5122. TCP_EVENT_ADD_ISLE_LEFT = 3,
  5123. TCP_EVENT_JOIN = 4,
  5124. TCP_EVENT_NOP = 5,
  5125. MAX_TCP_OOO_EVENT
  5126. };
  5127. /*
  5128. * OOO support modes
  5129. */
  5130. enum tcp_tstorm_ooo {
  5131. TCP_TSTORM_OOO_DROP_AND_PROC_ACK = 0,
  5132. TCP_TSTORM_OOO_SEND_PURE_ACK = 1,
  5133. TCP_TSTORM_OOO_SUPPORTED = 2,
  5134. MAX_TCP_TSTORM_OOO
  5135. };
  5136. #endif /* __5710_HSI_CNIC_LE__ */