mcdi_pcol.h 335 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334
  1. /****************************************************************************
  2. * Driver for Solarflare network controllers and boards
  3. * Copyright 2009-2013 Solarflare Communications Inc.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of the GNU General Public License version 2 as published
  7. * by the Free Software Foundation, incorporated herein by reference.
  8. */
  9. #ifndef MCDI_PCOL_H
  10. #define MCDI_PCOL_H
  11. /* Values to be written into FMCR_CZ_RESET_STATE_REG to control boot. */
  12. /* Power-on reset state */
  13. #define MC_FW_STATE_POR (1)
  14. /* If this is set in MC_RESET_STATE_REG then it should be
  15. * possible to jump into IMEM without loading code from flash. */
  16. #define MC_FW_WARM_BOOT_OK (2)
  17. /* The MC main image has started to boot. */
  18. #define MC_FW_STATE_BOOTING (4)
  19. /* The Scheduler has started. */
  20. #define MC_FW_STATE_SCHED (8)
  21. /* If this is set in MC_RESET_STATE_REG then it should be
  22. * possible to jump into IMEM without loading code from flash.
  23. * Unlike a warm boot, assume DMEM has been reloaded, so that
  24. * the MC persistent data must be reinitialised. */
  25. #define MC_FW_TEPID_BOOT_OK (16)
  26. /* BIST state has been initialized */
  27. #define MC_FW_BIST_INIT_OK (128)
  28. /* Siena MC shared memmory offsets */
  29. /* The 'doorbell' addresses are hard-wired to alert the MC when written */
  30. #define MC_SMEM_P0_DOORBELL_OFST 0x000
  31. #define MC_SMEM_P1_DOORBELL_OFST 0x004
  32. /* The rest of these are firmware-defined */
  33. #define MC_SMEM_P0_PDU_OFST 0x008
  34. #define MC_SMEM_P1_PDU_OFST 0x108
  35. #define MC_SMEM_PDU_LEN 0x100
  36. #define MC_SMEM_P0_PTP_TIME_OFST 0x7f0
  37. #define MC_SMEM_P0_STATUS_OFST 0x7f8
  38. #define MC_SMEM_P1_STATUS_OFST 0x7fc
  39. /* Values to be written to the per-port status dword in shared
  40. * memory on reboot and assert */
  41. #define MC_STATUS_DWORD_REBOOT (0xb007b007)
  42. #define MC_STATUS_DWORD_ASSERT (0xdeaddead)
  43. /* Check whether an mcfw version (in host order) belongs to a bootloader */
  44. #define MC_FW_VERSION_IS_BOOTLOADER(_v) (((_v) >> 16) == 0xb007)
  45. /* The current version of the MCDI protocol.
  46. *
  47. * Note that the ROM burnt into the card only talks V0, so at the very
  48. * least every driver must support version 0 and MCDI_PCOL_VERSION
  49. */
  50. #define MCDI_PCOL_VERSION 2
  51. /* Unused commands: 0x23, 0x27, 0x30, 0x31 */
  52. /* MCDI version 1
  53. *
  54. * Each MCDI request starts with an MCDI_HEADER, which is a 32bit
  55. * structure, filled in by the client.
  56. *
  57. * 0 7 8 16 20 22 23 24 31
  58. * | CODE | R | LEN | SEQ | Rsvd | E | R | XFLAGS |
  59. * | | |
  60. * | | \--- Response
  61. * | \------- Error
  62. * \------------------------------ Resync (always set)
  63. *
  64. * The client writes it's request into MC shared memory, and rings the
  65. * doorbell. Each request is completed by either by the MC writting
  66. * back into shared memory, or by writting out an event.
  67. *
  68. * All MCDI commands support completion by shared memory response. Each
  69. * request may also contain additional data (accounted for by HEADER.LEN),
  70. * and some response's may also contain additional data (again, accounted
  71. * for by HEADER.LEN).
  72. *
  73. * Some MCDI commands support completion by event, in which any associated
  74. * response data is included in the event.
  75. *
  76. * The protocol requires one response to be delivered for every request, a
  77. * request should not be sent unless the response for the previous request
  78. * has been received (either by polling shared memory, or by receiving
  79. * an event).
  80. */
  81. /** Request/Response structure */
  82. #define MCDI_HEADER_OFST 0
  83. #define MCDI_HEADER_CODE_LBN 0
  84. #define MCDI_HEADER_CODE_WIDTH 7
  85. #define MCDI_HEADER_RESYNC_LBN 7
  86. #define MCDI_HEADER_RESYNC_WIDTH 1
  87. #define MCDI_HEADER_DATALEN_LBN 8
  88. #define MCDI_HEADER_DATALEN_WIDTH 8
  89. #define MCDI_HEADER_SEQ_LBN 16
  90. #define MCDI_HEADER_SEQ_WIDTH 4
  91. #define MCDI_HEADER_RSVD_LBN 20
  92. #define MCDI_HEADER_RSVD_WIDTH 1
  93. #define MCDI_HEADER_NOT_EPOCH_LBN 21
  94. #define MCDI_HEADER_NOT_EPOCH_WIDTH 1
  95. #define MCDI_HEADER_ERROR_LBN 22
  96. #define MCDI_HEADER_ERROR_WIDTH 1
  97. #define MCDI_HEADER_RESPONSE_LBN 23
  98. #define MCDI_HEADER_RESPONSE_WIDTH 1
  99. #define MCDI_HEADER_XFLAGS_LBN 24
  100. #define MCDI_HEADER_XFLAGS_WIDTH 8
  101. /* Request response using event */
  102. #define MCDI_HEADER_XFLAGS_EVREQ 0x01
  103. /* Maximum number of payload bytes */
  104. #define MCDI_CTL_SDU_LEN_MAX_V1 0xfc
  105. #define MCDI_CTL_SDU_LEN_MAX_V2 0x400
  106. #define MCDI_CTL_SDU_LEN_MAX MCDI_CTL_SDU_LEN_MAX_V2
  107. /* The MC can generate events for two reasons:
  108. * - To complete a shared memory request if XFLAGS_EVREQ was set
  109. * - As a notification (link state, i2c event), controlled
  110. * via MC_CMD_LOG_CTRL
  111. *
  112. * Both events share a common structure:
  113. *
  114. * 0 32 33 36 44 52 60
  115. * | Data | Cont | Level | Src | Code | Rsvd |
  116. * |
  117. * \ There is another event pending in this notification
  118. *
  119. * If Code==CMDDONE, then the fields are further interpreted as:
  120. *
  121. * - LEVEL==INFO Command succeeded
  122. * - LEVEL==ERR Command failed
  123. *
  124. * 0 8 16 24 32
  125. * | Seq | Datalen | Errno | Rsvd |
  126. *
  127. * These fields are taken directly out of the standard MCDI header, i.e.,
  128. * LEVEL==ERR, Datalen == 0 => Reboot
  129. *
  130. * Events can be squirted out of the UART (using LOG_CTRL) without a
  131. * MCDI header. An event can be distinguished from a MCDI response by
  132. * examining the first byte which is 0xc0. This corresponds to the
  133. * non-existent MCDI command MC_CMD_DEBUG_LOG.
  134. *
  135. * 0 7 8
  136. * | command | Resync | = 0xc0
  137. *
  138. * Since the event is written in big-endian byte order, this works
  139. * providing bits 56-63 of the event are 0xc0.
  140. *
  141. * 56 60 63
  142. * | Rsvd | Code | = 0xc0
  143. *
  144. * Which means for convenience the event code is 0xc for all MC
  145. * generated events.
  146. */
  147. #define FSE_AZ_EV_CODE_MCDI_EVRESPONSE 0xc
  148. /* Operation not permitted. */
  149. #define MC_CMD_ERR_EPERM 1
  150. /* Non-existent command target */
  151. #define MC_CMD_ERR_ENOENT 2
  152. /* assert() has killed the MC */
  153. #define MC_CMD_ERR_EINTR 4
  154. /* I/O failure */
  155. #define MC_CMD_ERR_EIO 5
  156. /* Try again */
  157. #define MC_CMD_ERR_EAGAIN 11
  158. /* Out of memory */
  159. #define MC_CMD_ERR_ENOMEM 12
  160. /* Caller does not hold required locks */
  161. #define MC_CMD_ERR_EACCES 13
  162. /* Resource is currently unavailable (e.g. lock contention) */
  163. #define MC_CMD_ERR_EBUSY 16
  164. /* No such device */
  165. #define MC_CMD_ERR_ENODEV 19
  166. /* Invalid argument to target */
  167. #define MC_CMD_ERR_EINVAL 22
  168. /* Out of range */
  169. #define MC_CMD_ERR_ERANGE 34
  170. /* Non-recursive resource is already acquired */
  171. #define MC_CMD_ERR_EDEADLK 35
  172. /* Operation not implemented */
  173. #define MC_CMD_ERR_ENOSYS 38
  174. /* Operation timed out */
  175. #define MC_CMD_ERR_ETIME 62
  176. /* Link has been severed */
  177. #define MC_CMD_ERR_ENOLINK 67
  178. /* Protocol error */
  179. #define MC_CMD_ERR_EPROTO 71
  180. /* Operation not supported */
  181. #define MC_CMD_ERR_ENOTSUP 95
  182. /* Address not available */
  183. #define MC_CMD_ERR_EADDRNOTAVAIL 99
  184. /* Not connected */
  185. #define MC_CMD_ERR_ENOTCONN 107
  186. /* Operation already in progress */
  187. #define MC_CMD_ERR_EALREADY 114
  188. /* Resource allocation failed. */
  189. #define MC_CMD_ERR_ALLOC_FAIL 0x1000
  190. /* V-adaptor not found. */
  191. #define MC_CMD_ERR_NO_VADAPTOR 0x1001
  192. /* EVB port not found. */
  193. #define MC_CMD_ERR_NO_EVB_PORT 0x1002
  194. /* V-switch not found. */
  195. #define MC_CMD_ERR_NO_VSWITCH 0x1003
  196. /* Too many VLAN tags. */
  197. #define MC_CMD_ERR_VLAN_LIMIT 0x1004
  198. /* Bad PCI function number. */
  199. #define MC_CMD_ERR_BAD_PCI_FUNC 0x1005
  200. /* Invalid VLAN mode. */
  201. #define MC_CMD_ERR_BAD_VLAN_MODE 0x1006
  202. /* Invalid v-switch type. */
  203. #define MC_CMD_ERR_BAD_VSWITCH_TYPE 0x1007
  204. /* Invalid v-port type. */
  205. #define MC_CMD_ERR_BAD_VPORT_TYPE 0x1008
  206. /* MAC address exists. */
  207. #define MC_CMD_ERR_MAC_EXIST 0x1009
  208. /* Slave core not present */
  209. #define MC_CMD_ERR_SLAVE_NOT_PRESENT 0x100a
  210. /* The datapath is disabled. */
  211. #define MC_CMD_ERR_DATAPATH_DISABLED 0x100b
  212. #define MC_CMD_ERR_CODE_OFST 0
  213. /* We define 8 "escape" commands to allow
  214. for command number space extension */
  215. #define MC_CMD_CMD_SPACE_ESCAPE_0 0x78
  216. #define MC_CMD_CMD_SPACE_ESCAPE_1 0x79
  217. #define MC_CMD_CMD_SPACE_ESCAPE_2 0x7A
  218. #define MC_CMD_CMD_SPACE_ESCAPE_3 0x7B
  219. #define MC_CMD_CMD_SPACE_ESCAPE_4 0x7C
  220. #define MC_CMD_CMD_SPACE_ESCAPE_5 0x7D
  221. #define MC_CMD_CMD_SPACE_ESCAPE_6 0x7E
  222. #define MC_CMD_CMD_SPACE_ESCAPE_7 0x7F
  223. /* Vectors in the boot ROM */
  224. /* Point to the copycode entry point. */
  225. #define SIENA_MC_BOOTROM_COPYCODE_VEC (0x800 - 3 * 0x4)
  226. #define HUNT_MC_BOOTROM_COPYCODE_VEC (0x8000 - 3 * 0x4)
  227. /* Points to the recovery mode entry point. */
  228. #define SIENA_MC_BOOTROM_NOFLASH_VEC (0x800 - 2 * 0x4)
  229. #define HUNT_MC_BOOTROM_NOFLASH_VEC (0x8000 - 2 * 0x4)
  230. /* The command set exported by the boot ROM (MCDI v0) */
  231. #define MC_CMD_GET_VERSION_V0_SUPPORTED_FUNCS { \
  232. (1 << MC_CMD_READ32) | \
  233. (1 << MC_CMD_WRITE32) | \
  234. (1 << MC_CMD_COPYCODE) | \
  235. (1 << MC_CMD_GET_VERSION), \
  236. 0, 0, 0 }
  237. #define MC_CMD_SENSOR_INFO_OUT_OFFSET_OFST(_x) \
  238. (MC_CMD_SENSOR_ENTRY_OFST + (_x))
  239. #define MC_CMD_DBI_WRITE_IN_ADDRESS_OFST(n) \
  240. (MC_CMD_DBI_WRITE_IN_DBIWROP_OFST + \
  241. MC_CMD_DBIWROP_TYPEDEF_ADDRESS_OFST + \
  242. (n) * MC_CMD_DBIWROP_TYPEDEF_LEN)
  243. #define MC_CMD_DBI_WRITE_IN_BYTE_MASK_OFST(n) \
  244. (MC_CMD_DBI_WRITE_IN_DBIWROP_OFST + \
  245. MC_CMD_DBIWROP_TYPEDEF_BYTE_MASK_OFST + \
  246. (n) * MC_CMD_DBIWROP_TYPEDEF_LEN)
  247. #define MC_CMD_DBI_WRITE_IN_VALUE_OFST(n) \
  248. (MC_CMD_DBI_WRITE_IN_DBIWROP_OFST + \
  249. MC_CMD_DBIWROP_TYPEDEF_VALUE_OFST + \
  250. (n) * MC_CMD_DBIWROP_TYPEDEF_LEN)
  251. /* Version 2 adds an optional argument to error returns: the errno value
  252. * may be followed by the (0-based) number of the first argument that
  253. * could not be processed.
  254. */
  255. #define MC_CMD_ERR_ARG_OFST 4
  256. /* No space */
  257. #define MC_CMD_ERR_ENOSPC 28
  258. /* MCDI_EVENT structuredef */
  259. #define MCDI_EVENT_LEN 8
  260. #define MCDI_EVENT_CONT_LBN 32
  261. #define MCDI_EVENT_CONT_WIDTH 1
  262. #define MCDI_EVENT_LEVEL_LBN 33
  263. #define MCDI_EVENT_LEVEL_WIDTH 3
  264. /* enum: Info. */
  265. #define MCDI_EVENT_LEVEL_INFO 0x0
  266. /* enum: Warning. */
  267. #define MCDI_EVENT_LEVEL_WARN 0x1
  268. /* enum: Error. */
  269. #define MCDI_EVENT_LEVEL_ERR 0x2
  270. /* enum: Fatal. */
  271. #define MCDI_EVENT_LEVEL_FATAL 0x3
  272. #define MCDI_EVENT_DATA_OFST 0
  273. #define MCDI_EVENT_CMDDONE_SEQ_LBN 0
  274. #define MCDI_EVENT_CMDDONE_SEQ_WIDTH 8
  275. #define MCDI_EVENT_CMDDONE_DATALEN_LBN 8
  276. #define MCDI_EVENT_CMDDONE_DATALEN_WIDTH 8
  277. #define MCDI_EVENT_CMDDONE_ERRNO_LBN 16
  278. #define MCDI_EVENT_CMDDONE_ERRNO_WIDTH 8
  279. #define MCDI_EVENT_LINKCHANGE_LP_CAP_LBN 0
  280. #define MCDI_EVENT_LINKCHANGE_LP_CAP_WIDTH 16
  281. #define MCDI_EVENT_LINKCHANGE_SPEED_LBN 16
  282. #define MCDI_EVENT_LINKCHANGE_SPEED_WIDTH 4
  283. /* enum: 100Mbs */
  284. #define MCDI_EVENT_LINKCHANGE_SPEED_100M 0x1
  285. /* enum: 1Gbs */
  286. #define MCDI_EVENT_LINKCHANGE_SPEED_1G 0x2
  287. /* enum: 10Gbs */
  288. #define MCDI_EVENT_LINKCHANGE_SPEED_10G 0x3
  289. /* enum: 40Gbs */
  290. #define MCDI_EVENT_LINKCHANGE_SPEED_40G 0x4
  291. #define MCDI_EVENT_LINKCHANGE_FCNTL_LBN 20
  292. #define MCDI_EVENT_LINKCHANGE_FCNTL_WIDTH 4
  293. #define MCDI_EVENT_LINKCHANGE_LINK_FLAGS_LBN 24
  294. #define MCDI_EVENT_LINKCHANGE_LINK_FLAGS_WIDTH 8
  295. #define MCDI_EVENT_SENSOREVT_MONITOR_LBN 0
  296. #define MCDI_EVENT_SENSOREVT_MONITOR_WIDTH 8
  297. #define MCDI_EVENT_SENSOREVT_STATE_LBN 8
  298. #define MCDI_EVENT_SENSOREVT_STATE_WIDTH 8
  299. #define MCDI_EVENT_SENSOREVT_VALUE_LBN 16
  300. #define MCDI_EVENT_SENSOREVT_VALUE_WIDTH 16
  301. #define MCDI_EVENT_FWALERT_DATA_LBN 8
  302. #define MCDI_EVENT_FWALERT_DATA_WIDTH 24
  303. #define MCDI_EVENT_FWALERT_REASON_LBN 0
  304. #define MCDI_EVENT_FWALERT_REASON_WIDTH 8
  305. /* enum: SRAM Access. */
  306. #define MCDI_EVENT_FWALERT_REASON_SRAM_ACCESS 0x1
  307. #define MCDI_EVENT_FLR_VF_LBN 0
  308. #define MCDI_EVENT_FLR_VF_WIDTH 8
  309. #define MCDI_EVENT_TX_ERR_TXQ_LBN 0
  310. #define MCDI_EVENT_TX_ERR_TXQ_WIDTH 12
  311. #define MCDI_EVENT_TX_ERR_TYPE_LBN 12
  312. #define MCDI_EVENT_TX_ERR_TYPE_WIDTH 4
  313. /* enum: Descriptor loader reported failure */
  314. #define MCDI_EVENT_TX_ERR_DL_FAIL 0x1
  315. /* enum: Descriptor ring empty and no EOP seen for packet */
  316. #define MCDI_EVENT_TX_ERR_NO_EOP 0x2
  317. /* enum: Overlength packet */
  318. #define MCDI_EVENT_TX_ERR_2BIG 0x3
  319. /* enum: Malformed option descriptor */
  320. #define MCDI_EVENT_TX_BAD_OPTDESC 0x5
  321. /* enum: Option descriptor part way through a packet */
  322. #define MCDI_EVENT_TX_OPT_IN_PKT 0x8
  323. /* enum: DMA or PIO data access error */
  324. #define MCDI_EVENT_TX_ERR_BAD_DMA_OR_PIO 0x9
  325. #define MCDI_EVENT_TX_ERR_INFO_LBN 16
  326. #define MCDI_EVENT_TX_ERR_INFO_WIDTH 16
  327. #define MCDI_EVENT_TX_FLUSH_TO_DRIVER_LBN 12
  328. #define MCDI_EVENT_TX_FLUSH_TO_DRIVER_WIDTH 1
  329. #define MCDI_EVENT_TX_FLUSH_TXQ_LBN 0
  330. #define MCDI_EVENT_TX_FLUSH_TXQ_WIDTH 12
  331. #define MCDI_EVENT_PTP_ERR_TYPE_LBN 0
  332. #define MCDI_EVENT_PTP_ERR_TYPE_WIDTH 8
  333. /* enum: PLL lost lock */
  334. #define MCDI_EVENT_PTP_ERR_PLL_LOST 0x1
  335. /* enum: Filter overflow (PDMA) */
  336. #define MCDI_EVENT_PTP_ERR_FILTER 0x2
  337. /* enum: FIFO overflow (FPGA) */
  338. #define MCDI_EVENT_PTP_ERR_FIFO 0x3
  339. /* enum: Merge queue overflow */
  340. #define MCDI_EVENT_PTP_ERR_QUEUE 0x4
  341. #define MCDI_EVENT_AOE_ERR_TYPE_LBN 0
  342. #define MCDI_EVENT_AOE_ERR_TYPE_WIDTH 8
  343. /* enum: AOE failed to load - no valid image? */
  344. #define MCDI_EVENT_AOE_NO_LOAD 0x1
  345. /* enum: AOE FC reported an exception */
  346. #define MCDI_EVENT_AOE_FC_ASSERT 0x2
  347. /* enum: AOE FC watchdogged */
  348. #define MCDI_EVENT_AOE_FC_WATCHDOG 0x3
  349. /* enum: AOE FC failed to start */
  350. #define MCDI_EVENT_AOE_FC_NO_START 0x4
  351. /* enum: Generic AOE fault - likely to have been reported via other means too
  352. * but intended for use by aoex driver.
  353. */
  354. #define MCDI_EVENT_AOE_FAULT 0x5
  355. /* enum: Results of reprogramming the CPLD (status in AOE_ERR_DATA) */
  356. #define MCDI_EVENT_AOE_CPLD_REPROGRAMMED 0x6
  357. /* enum: AOE loaded successfully */
  358. #define MCDI_EVENT_AOE_LOAD 0x7
  359. /* enum: AOE DMA operation completed (LSB of HOST_HANDLE in AOE_ERR_DATA) */
  360. #define MCDI_EVENT_AOE_DMA 0x8
  361. /* enum: AOE byteblaster connected/disconnected (Connection status in
  362. * AOE_ERR_DATA)
  363. */
  364. #define MCDI_EVENT_AOE_BYTEBLASTER 0x9
  365. /* enum: DDR ECC status update */
  366. #define MCDI_EVENT_AOE_DDR_ECC_STATUS 0xa
  367. #define MCDI_EVENT_AOE_ERR_DATA_LBN 8
  368. #define MCDI_EVENT_AOE_ERR_DATA_WIDTH 8
  369. #define MCDI_EVENT_RX_ERR_RXQ_LBN 0
  370. #define MCDI_EVENT_RX_ERR_RXQ_WIDTH 12
  371. #define MCDI_EVENT_RX_ERR_TYPE_LBN 12
  372. #define MCDI_EVENT_RX_ERR_TYPE_WIDTH 4
  373. #define MCDI_EVENT_RX_ERR_INFO_LBN 16
  374. #define MCDI_EVENT_RX_ERR_INFO_WIDTH 16
  375. #define MCDI_EVENT_RX_FLUSH_TO_DRIVER_LBN 12
  376. #define MCDI_EVENT_RX_FLUSH_TO_DRIVER_WIDTH 1
  377. #define MCDI_EVENT_RX_FLUSH_RXQ_LBN 0
  378. #define MCDI_EVENT_RX_FLUSH_RXQ_WIDTH 12
  379. #define MCDI_EVENT_MC_REBOOT_COUNT_LBN 0
  380. #define MCDI_EVENT_MC_REBOOT_COUNT_WIDTH 16
  381. #define MCDI_EVENT_DATA_LBN 0
  382. #define MCDI_EVENT_DATA_WIDTH 32
  383. #define MCDI_EVENT_SRC_LBN 36
  384. #define MCDI_EVENT_SRC_WIDTH 8
  385. #define MCDI_EVENT_EV_CODE_LBN 60
  386. #define MCDI_EVENT_EV_CODE_WIDTH 4
  387. #define MCDI_EVENT_CODE_LBN 44
  388. #define MCDI_EVENT_CODE_WIDTH 8
  389. /* enum: Bad assert. */
  390. #define MCDI_EVENT_CODE_BADSSERT 0x1
  391. /* enum: PM Notice. */
  392. #define MCDI_EVENT_CODE_PMNOTICE 0x2
  393. /* enum: Command done. */
  394. #define MCDI_EVENT_CODE_CMDDONE 0x3
  395. /* enum: Link change. */
  396. #define MCDI_EVENT_CODE_LINKCHANGE 0x4
  397. /* enum: Sensor Event. */
  398. #define MCDI_EVENT_CODE_SENSOREVT 0x5
  399. /* enum: Schedule error. */
  400. #define MCDI_EVENT_CODE_SCHEDERR 0x6
  401. /* enum: Reboot. */
  402. #define MCDI_EVENT_CODE_REBOOT 0x7
  403. /* enum: Mac stats DMA. */
  404. #define MCDI_EVENT_CODE_MAC_STATS_DMA 0x8
  405. /* enum: Firmware alert. */
  406. #define MCDI_EVENT_CODE_FWALERT 0x9
  407. /* enum: Function level reset. */
  408. #define MCDI_EVENT_CODE_FLR 0xa
  409. /* enum: Transmit error */
  410. #define MCDI_EVENT_CODE_TX_ERR 0xb
  411. /* enum: Tx flush has completed */
  412. #define MCDI_EVENT_CODE_TX_FLUSH 0xc
  413. /* enum: PTP packet received timestamp */
  414. #define MCDI_EVENT_CODE_PTP_RX 0xd
  415. /* enum: PTP NIC failure */
  416. #define MCDI_EVENT_CODE_PTP_FAULT 0xe
  417. /* enum: PTP PPS event */
  418. #define MCDI_EVENT_CODE_PTP_PPS 0xf
  419. /* enum: Rx flush has completed */
  420. #define MCDI_EVENT_CODE_RX_FLUSH 0x10
  421. /* enum: Receive error */
  422. #define MCDI_EVENT_CODE_RX_ERR 0x11
  423. /* enum: AOE fault */
  424. #define MCDI_EVENT_CODE_AOE 0x12
  425. /* enum: Network port calibration failed (VCAL). */
  426. #define MCDI_EVENT_CODE_VCAL_FAIL 0x13
  427. /* enum: HW PPS event */
  428. #define MCDI_EVENT_CODE_HW_PPS 0x14
  429. /* enum: The MC has rebooted (huntington and later, siena uses CODE_REBOOT and
  430. * a different format)
  431. */
  432. #define MCDI_EVENT_CODE_MC_REBOOT 0x15
  433. /* enum: the MC has detected a parity error */
  434. #define MCDI_EVENT_CODE_PAR_ERR 0x16
  435. /* enum: the MC has detected a correctable error */
  436. #define MCDI_EVENT_CODE_ECC_CORR_ERR 0x17
  437. /* enum: the MC has detected an uncorrectable error */
  438. #define MCDI_EVENT_CODE_ECC_FATAL_ERR 0x18
  439. /* enum: The MC has entered offline BIST mode */
  440. #define MCDI_EVENT_CODE_MC_BIST 0x19
  441. /* enum: PTP tick event providing current NIC time */
  442. #define MCDI_EVENT_CODE_PTP_TIME 0x1a
  443. /* enum: Artificial event generated by host and posted via MC for test
  444. * purposes.
  445. */
  446. #define MCDI_EVENT_CODE_TESTGEN 0xfa
  447. #define MCDI_EVENT_CMDDONE_DATA_OFST 0
  448. #define MCDI_EVENT_CMDDONE_DATA_LBN 0
  449. #define MCDI_EVENT_CMDDONE_DATA_WIDTH 32
  450. #define MCDI_EVENT_LINKCHANGE_DATA_OFST 0
  451. #define MCDI_EVENT_LINKCHANGE_DATA_LBN 0
  452. #define MCDI_EVENT_LINKCHANGE_DATA_WIDTH 32
  453. #define MCDI_EVENT_SENSOREVT_DATA_OFST 0
  454. #define MCDI_EVENT_SENSOREVT_DATA_LBN 0
  455. #define MCDI_EVENT_SENSOREVT_DATA_WIDTH 32
  456. #define MCDI_EVENT_MAC_STATS_DMA_GENERATION_OFST 0
  457. #define MCDI_EVENT_MAC_STATS_DMA_GENERATION_LBN 0
  458. #define MCDI_EVENT_MAC_STATS_DMA_GENERATION_WIDTH 32
  459. #define MCDI_EVENT_TX_ERR_DATA_OFST 0
  460. #define MCDI_EVENT_TX_ERR_DATA_LBN 0
  461. #define MCDI_EVENT_TX_ERR_DATA_WIDTH 32
  462. /* For CODE_PTP_RX, CODE_PTP_PPS and CODE_HW_PPS events the seconds field of
  463. * timestamp
  464. */
  465. #define MCDI_EVENT_PTP_SECONDS_OFST 0
  466. #define MCDI_EVENT_PTP_SECONDS_LBN 0
  467. #define MCDI_EVENT_PTP_SECONDS_WIDTH 32
  468. /* For CODE_PTP_RX, CODE_PTP_PPS and CODE_HW_PPS events the major field of
  469. * timestamp
  470. */
  471. #define MCDI_EVENT_PTP_MAJOR_OFST 0
  472. #define MCDI_EVENT_PTP_MAJOR_LBN 0
  473. #define MCDI_EVENT_PTP_MAJOR_WIDTH 32
  474. /* For CODE_PTP_RX, CODE_PTP_PPS and CODE_HW_PPS events the nanoseconds field
  475. * of timestamp
  476. */
  477. #define MCDI_EVENT_PTP_NANOSECONDS_OFST 0
  478. #define MCDI_EVENT_PTP_NANOSECONDS_LBN 0
  479. #define MCDI_EVENT_PTP_NANOSECONDS_WIDTH 32
  480. /* For CODE_PTP_RX, CODE_PTP_PPS and CODE_HW_PPS events the minor field of
  481. * timestamp
  482. */
  483. #define MCDI_EVENT_PTP_MINOR_OFST 0
  484. #define MCDI_EVENT_PTP_MINOR_LBN 0
  485. #define MCDI_EVENT_PTP_MINOR_WIDTH 32
  486. /* For CODE_PTP_RX events, the lowest four bytes of sourceUUID from PTP packet
  487. */
  488. #define MCDI_EVENT_PTP_UUID_OFST 0
  489. #define MCDI_EVENT_PTP_UUID_LBN 0
  490. #define MCDI_EVENT_PTP_UUID_WIDTH 32
  491. #define MCDI_EVENT_RX_ERR_DATA_OFST 0
  492. #define MCDI_EVENT_RX_ERR_DATA_LBN 0
  493. #define MCDI_EVENT_RX_ERR_DATA_WIDTH 32
  494. #define MCDI_EVENT_PAR_ERR_DATA_OFST 0
  495. #define MCDI_EVENT_PAR_ERR_DATA_LBN 0
  496. #define MCDI_EVENT_PAR_ERR_DATA_WIDTH 32
  497. #define MCDI_EVENT_ECC_CORR_ERR_DATA_OFST 0
  498. #define MCDI_EVENT_ECC_CORR_ERR_DATA_LBN 0
  499. #define MCDI_EVENT_ECC_CORR_ERR_DATA_WIDTH 32
  500. #define MCDI_EVENT_ECC_FATAL_ERR_DATA_OFST 0
  501. #define MCDI_EVENT_ECC_FATAL_ERR_DATA_LBN 0
  502. #define MCDI_EVENT_ECC_FATAL_ERR_DATA_WIDTH 32
  503. /* For CODE_PTP_TIME events, the major value of the PTP clock */
  504. #define MCDI_EVENT_PTP_TIME_MAJOR_OFST 0
  505. #define MCDI_EVENT_PTP_TIME_MAJOR_LBN 0
  506. #define MCDI_EVENT_PTP_TIME_MAJOR_WIDTH 32
  507. /* For CODE_PTP_TIME events, bits 19-26 of the minor value of the PTP clock */
  508. #define MCDI_EVENT_PTP_TIME_MINOR_26_19_LBN 36
  509. #define MCDI_EVENT_PTP_TIME_MINOR_26_19_WIDTH 8
  510. /* FCDI_EVENT structuredef */
  511. #define FCDI_EVENT_LEN 8
  512. #define FCDI_EVENT_CONT_LBN 32
  513. #define FCDI_EVENT_CONT_WIDTH 1
  514. #define FCDI_EVENT_LEVEL_LBN 33
  515. #define FCDI_EVENT_LEVEL_WIDTH 3
  516. /* enum: Info. */
  517. #define FCDI_EVENT_LEVEL_INFO 0x0
  518. /* enum: Warning. */
  519. #define FCDI_EVENT_LEVEL_WARN 0x1
  520. /* enum: Error. */
  521. #define FCDI_EVENT_LEVEL_ERR 0x2
  522. /* enum: Fatal. */
  523. #define FCDI_EVENT_LEVEL_FATAL 0x3
  524. #define FCDI_EVENT_DATA_OFST 0
  525. #define FCDI_EVENT_LINK_STATE_STATUS_LBN 0
  526. #define FCDI_EVENT_LINK_STATE_STATUS_WIDTH 1
  527. #define FCDI_EVENT_LINK_DOWN 0x0 /* enum */
  528. #define FCDI_EVENT_LINK_UP 0x1 /* enum */
  529. #define FCDI_EVENT_DATA_LBN 0
  530. #define FCDI_EVENT_DATA_WIDTH 32
  531. #define FCDI_EVENT_SRC_LBN 36
  532. #define FCDI_EVENT_SRC_WIDTH 8
  533. #define FCDI_EVENT_EV_CODE_LBN 60
  534. #define FCDI_EVENT_EV_CODE_WIDTH 4
  535. #define FCDI_EVENT_CODE_LBN 44
  536. #define FCDI_EVENT_CODE_WIDTH 8
  537. /* enum: The FC was rebooted. */
  538. #define FCDI_EVENT_CODE_REBOOT 0x1
  539. /* enum: Bad assert. */
  540. #define FCDI_EVENT_CODE_ASSERT 0x2
  541. /* enum: DDR3 test result. */
  542. #define FCDI_EVENT_CODE_DDR_TEST_RESULT 0x3
  543. /* enum: Link status. */
  544. #define FCDI_EVENT_CODE_LINK_STATE 0x4
  545. /* enum: A timed read is ready to be serviced. */
  546. #define FCDI_EVENT_CODE_TIMED_READ 0x5
  547. /* enum: One or more PPS IN events */
  548. #define FCDI_EVENT_CODE_PPS_IN 0x6
  549. /* enum: Tick event from PTP clock */
  550. #define FCDI_EVENT_CODE_PTP_TICK 0x7
  551. /* enum: ECC error counters */
  552. #define FCDI_EVENT_CODE_DDR_ECC_STATUS 0x8
  553. #define FCDI_EVENT_ASSERT_INSTR_ADDRESS_OFST 0
  554. #define FCDI_EVENT_ASSERT_INSTR_ADDRESS_LBN 0
  555. #define FCDI_EVENT_ASSERT_INSTR_ADDRESS_WIDTH 32
  556. #define FCDI_EVENT_ASSERT_TYPE_LBN 36
  557. #define FCDI_EVENT_ASSERT_TYPE_WIDTH 8
  558. #define FCDI_EVENT_DDR_TEST_RESULT_STATUS_CODE_LBN 36
  559. #define FCDI_EVENT_DDR_TEST_RESULT_STATUS_CODE_WIDTH 8
  560. #define FCDI_EVENT_DDR_TEST_RESULT_RESULT_OFST 0
  561. #define FCDI_EVENT_DDR_TEST_RESULT_RESULT_LBN 0
  562. #define FCDI_EVENT_DDR_TEST_RESULT_RESULT_WIDTH 32
  563. #define FCDI_EVENT_LINK_STATE_DATA_OFST 0
  564. #define FCDI_EVENT_LINK_STATE_DATA_LBN 0
  565. #define FCDI_EVENT_LINK_STATE_DATA_WIDTH 32
  566. #define FCDI_EVENT_DDR_ECC_STATUS_BANK_ID_LBN 36
  567. #define FCDI_EVENT_DDR_ECC_STATUS_BANK_ID_WIDTH 8
  568. #define FCDI_EVENT_DDR_ECC_STATUS_STATUS_OFST 0
  569. #define FCDI_EVENT_DDR_ECC_STATUS_STATUS_LBN 0
  570. #define FCDI_EVENT_DDR_ECC_STATUS_STATUS_WIDTH 32
  571. /* FCDI_EXTENDED_EVENT_PPS structuredef: Extended FCDI event to send PPS events
  572. * to the MC. Note that this structure | is overlayed over a normal FCDI event
  573. * such that bits 32-63 containing | event code, level, source etc remain the
  574. * same. In this case the data | field of the header is defined to be the
  575. * number of timestamps
  576. */
  577. #define FCDI_EXTENDED_EVENT_PPS_LENMIN 16
  578. #define FCDI_EXTENDED_EVENT_PPS_LENMAX 248
  579. #define FCDI_EXTENDED_EVENT_PPS_LEN(num) (8+8*(num))
  580. /* Number of timestamps following */
  581. #define FCDI_EXTENDED_EVENT_PPS_COUNT_OFST 0
  582. #define FCDI_EXTENDED_EVENT_PPS_COUNT_LBN 0
  583. #define FCDI_EXTENDED_EVENT_PPS_COUNT_WIDTH 32
  584. /* Seconds field of a timestamp record */
  585. #define FCDI_EXTENDED_EVENT_PPS_SECONDS_OFST 8
  586. #define FCDI_EXTENDED_EVENT_PPS_SECONDS_LBN 64
  587. #define FCDI_EXTENDED_EVENT_PPS_SECONDS_WIDTH 32
  588. /* Nanoseconds field of a timestamp record */
  589. #define FCDI_EXTENDED_EVENT_PPS_NANOSECONDS_OFST 12
  590. #define FCDI_EXTENDED_EVENT_PPS_NANOSECONDS_LBN 96
  591. #define FCDI_EXTENDED_EVENT_PPS_NANOSECONDS_WIDTH 32
  592. /* Timestamp records comprising the event */
  593. #define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_OFST 8
  594. #define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_LEN 8
  595. #define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_LO_OFST 8
  596. #define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_HI_OFST 12
  597. #define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_MINNUM 1
  598. #define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_MAXNUM 30
  599. #define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_LBN 64
  600. #define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_WIDTH 64
  601. /***********************************/
  602. /* MC_CMD_READ32
  603. * Read multiple 32byte words from MC memory.
  604. */
  605. #define MC_CMD_READ32 0x1
  606. #define MC_CMD_0x1_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  607. /* MC_CMD_READ32_IN msgrequest */
  608. #define MC_CMD_READ32_IN_LEN 8
  609. #define MC_CMD_READ32_IN_ADDR_OFST 0
  610. #define MC_CMD_READ32_IN_NUMWORDS_OFST 4
  611. /* MC_CMD_READ32_OUT msgresponse */
  612. #define MC_CMD_READ32_OUT_LENMIN 4
  613. #define MC_CMD_READ32_OUT_LENMAX 252
  614. #define MC_CMD_READ32_OUT_LEN(num) (0+4*(num))
  615. #define MC_CMD_READ32_OUT_BUFFER_OFST 0
  616. #define MC_CMD_READ32_OUT_BUFFER_LEN 4
  617. #define MC_CMD_READ32_OUT_BUFFER_MINNUM 1
  618. #define MC_CMD_READ32_OUT_BUFFER_MAXNUM 63
  619. /***********************************/
  620. /* MC_CMD_WRITE32
  621. * Write multiple 32byte words to MC memory.
  622. */
  623. #define MC_CMD_WRITE32 0x2
  624. #define MC_CMD_0x2_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  625. /* MC_CMD_WRITE32_IN msgrequest */
  626. #define MC_CMD_WRITE32_IN_LENMIN 8
  627. #define MC_CMD_WRITE32_IN_LENMAX 252
  628. #define MC_CMD_WRITE32_IN_LEN(num) (4+4*(num))
  629. #define MC_CMD_WRITE32_IN_ADDR_OFST 0
  630. #define MC_CMD_WRITE32_IN_BUFFER_OFST 4
  631. #define MC_CMD_WRITE32_IN_BUFFER_LEN 4
  632. #define MC_CMD_WRITE32_IN_BUFFER_MINNUM 1
  633. #define MC_CMD_WRITE32_IN_BUFFER_MAXNUM 62
  634. /* MC_CMD_WRITE32_OUT msgresponse */
  635. #define MC_CMD_WRITE32_OUT_LEN 0
  636. /***********************************/
  637. /* MC_CMD_COPYCODE
  638. * Copy MC code between two locations and jump.
  639. */
  640. #define MC_CMD_COPYCODE 0x3
  641. #define MC_CMD_0x3_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  642. /* MC_CMD_COPYCODE_IN msgrequest */
  643. #define MC_CMD_COPYCODE_IN_LEN 16
  644. /* Source address */
  645. #define MC_CMD_COPYCODE_IN_SRC_ADDR_OFST 0
  646. /* enum: The main image should be entered via a copy of a single word from and
  647. * to this address when none of the other magic behaviours are required.
  648. */
  649. #define MC_CMD_COPYCODE_HUNT_NO_MAGIC_ADDR 0x10000
  650. /* enum: Entering the main image via a copy of a single word from and to this
  651. * address indicates that it should not attempt to start the datapath CPUs.
  652. * This is useful for certain soft rebooting scenarios. (Huntington only)
  653. */
  654. #define MC_CMD_COPYCODE_HUNT_NO_DATAPATH_MAGIC_ADDR 0x1d0d0
  655. /* enum: Entering the main image via a copy of a single word from and to this
  656. * address indicates that it should not attempt to parse any configuration from
  657. * flash. (In addition, the datapath CPUs will not be started, as for
  658. * MC_CMD_COPYCODE_HUNT_NO_DATAPATH_MAGIC_ADDR above.) This is useful for
  659. * certain soft rebooting scenarios. (Huntington only)
  660. */
  661. #define MC_CMD_COPYCODE_HUNT_IGNORE_CONFIG_MAGIC_ADDR 0x1badc
  662. /* Destination address */
  663. #define MC_CMD_COPYCODE_IN_DEST_ADDR_OFST 4
  664. #define MC_CMD_COPYCODE_IN_NUMWORDS_OFST 8
  665. /* Address of where to jump after copy. */
  666. #define MC_CMD_COPYCODE_IN_JUMP_OFST 12
  667. /* enum: Control should return to the caller rather than jumping */
  668. #define MC_CMD_COPYCODE_JUMP_NONE 0x1
  669. /* MC_CMD_COPYCODE_OUT msgresponse */
  670. #define MC_CMD_COPYCODE_OUT_LEN 0
  671. /***********************************/
  672. /* MC_CMD_SET_FUNC
  673. * Select function for function-specific commands.
  674. */
  675. #define MC_CMD_SET_FUNC 0x4
  676. #define MC_CMD_0x4_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  677. /* MC_CMD_SET_FUNC_IN msgrequest */
  678. #define MC_CMD_SET_FUNC_IN_LEN 4
  679. /* Set function */
  680. #define MC_CMD_SET_FUNC_IN_FUNC_OFST 0
  681. /* MC_CMD_SET_FUNC_OUT msgresponse */
  682. #define MC_CMD_SET_FUNC_OUT_LEN 0
  683. /***********************************/
  684. /* MC_CMD_GET_BOOT_STATUS
  685. * Get the instruction address from which the MC booted.
  686. */
  687. #define MC_CMD_GET_BOOT_STATUS 0x5
  688. #define MC_CMD_0x5_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  689. /* MC_CMD_GET_BOOT_STATUS_IN msgrequest */
  690. #define MC_CMD_GET_BOOT_STATUS_IN_LEN 0
  691. /* MC_CMD_GET_BOOT_STATUS_OUT msgresponse */
  692. #define MC_CMD_GET_BOOT_STATUS_OUT_LEN 8
  693. /* ?? */
  694. #define MC_CMD_GET_BOOT_STATUS_OUT_BOOT_OFFSET_OFST 0
  695. /* enum: indicates that the MC wasn't flash booted */
  696. #define MC_CMD_GET_BOOT_STATUS_OUT_BOOT_OFFSET_NULL 0xdeadbeef
  697. #define MC_CMD_GET_BOOT_STATUS_OUT_FLAGS_OFST 4
  698. #define MC_CMD_GET_BOOT_STATUS_OUT_FLAGS_WATCHDOG_LBN 0
  699. #define MC_CMD_GET_BOOT_STATUS_OUT_FLAGS_WATCHDOG_WIDTH 1
  700. #define MC_CMD_GET_BOOT_STATUS_OUT_FLAGS_PRIMARY_LBN 1
  701. #define MC_CMD_GET_BOOT_STATUS_OUT_FLAGS_PRIMARY_WIDTH 1
  702. #define MC_CMD_GET_BOOT_STATUS_OUT_FLAGS_BACKUP_LBN 2
  703. #define MC_CMD_GET_BOOT_STATUS_OUT_FLAGS_BACKUP_WIDTH 1
  704. /***********************************/
  705. /* MC_CMD_GET_ASSERTS
  706. * Get (and optionally clear) the current assertion status. Only
  707. * OUT.GLOBAL_FLAGS is guaranteed to exist in the completion payload. The other
  708. * fields will only be present if OUT.GLOBAL_FLAGS != NO_FAILS
  709. */
  710. #define MC_CMD_GET_ASSERTS 0x6
  711. #define MC_CMD_0x6_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  712. /* MC_CMD_GET_ASSERTS_IN msgrequest */
  713. #define MC_CMD_GET_ASSERTS_IN_LEN 4
  714. /* Set to clear assertion */
  715. #define MC_CMD_GET_ASSERTS_IN_CLEAR_OFST 0
  716. /* MC_CMD_GET_ASSERTS_OUT msgresponse */
  717. #define MC_CMD_GET_ASSERTS_OUT_LEN 140
  718. /* Assertion status flag. */
  719. #define MC_CMD_GET_ASSERTS_OUT_GLOBAL_FLAGS_OFST 0
  720. /* enum: No assertions have failed. */
  721. #define MC_CMD_GET_ASSERTS_FLAGS_NO_FAILS 0x1
  722. /* enum: A system-level assertion has failed. */
  723. #define MC_CMD_GET_ASSERTS_FLAGS_SYS_FAIL 0x2
  724. /* enum: A thread-level assertion has failed. */
  725. #define MC_CMD_GET_ASSERTS_FLAGS_THR_FAIL 0x3
  726. /* enum: The system was reset by the watchdog. */
  727. #define MC_CMD_GET_ASSERTS_FLAGS_WDOG_FIRED 0x4
  728. /* enum: An illegal address trap stopped the system (huntington and later) */
  729. #define MC_CMD_GET_ASSERTS_FLAGS_ADDR_TRAP 0x5
  730. /* Failing PC value */
  731. #define MC_CMD_GET_ASSERTS_OUT_SAVED_PC_OFFS_OFST 4
  732. /* Saved GP regs */
  733. #define MC_CMD_GET_ASSERTS_OUT_GP_REGS_OFFS_OFST 8
  734. #define MC_CMD_GET_ASSERTS_OUT_GP_REGS_OFFS_LEN 4
  735. #define MC_CMD_GET_ASSERTS_OUT_GP_REGS_OFFS_NUM 31
  736. /* Failing thread address */
  737. #define MC_CMD_GET_ASSERTS_OUT_THREAD_OFFS_OFST 132
  738. #define MC_CMD_GET_ASSERTS_OUT_RESERVED_OFST 136
  739. /***********************************/
  740. /* MC_CMD_LOG_CTRL
  741. * Configure the output stream for various events and messages.
  742. */
  743. #define MC_CMD_LOG_CTRL 0x7
  744. #define MC_CMD_0x7_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  745. /* MC_CMD_LOG_CTRL_IN msgrequest */
  746. #define MC_CMD_LOG_CTRL_IN_LEN 8
  747. /* Log destination */
  748. #define MC_CMD_LOG_CTRL_IN_LOG_DEST_OFST 0
  749. /* enum: UART. */
  750. #define MC_CMD_LOG_CTRL_IN_LOG_DEST_UART 0x1
  751. /* enum: Event queue. */
  752. #define MC_CMD_LOG_CTRL_IN_LOG_DEST_EVQ 0x2
  753. #define MC_CMD_LOG_CTRL_IN_LOG_DEST_EVQ_OFST 4
  754. /* MC_CMD_LOG_CTRL_OUT msgresponse */
  755. #define MC_CMD_LOG_CTRL_OUT_LEN 0
  756. /***********************************/
  757. /* MC_CMD_GET_VERSION
  758. * Get version information about the MC firmware.
  759. */
  760. #define MC_CMD_GET_VERSION 0x8
  761. #define MC_CMD_0x8_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  762. /* MC_CMD_GET_VERSION_IN msgrequest */
  763. #define MC_CMD_GET_VERSION_IN_LEN 0
  764. /* MC_CMD_GET_VERSION_EXT_IN msgrequest: Asks for the extended version */
  765. #define MC_CMD_GET_VERSION_EXT_IN_LEN 4
  766. /* placeholder, set to 0 */
  767. #define MC_CMD_GET_VERSION_EXT_IN_EXT_FLAGS_OFST 0
  768. /* MC_CMD_GET_VERSION_V0_OUT msgresponse: deprecated version format */
  769. #define MC_CMD_GET_VERSION_V0_OUT_LEN 4
  770. #define MC_CMD_GET_VERSION_OUT_FIRMWARE_OFST 0
  771. /* enum: Reserved version number to indicate "any" version. */
  772. #define MC_CMD_GET_VERSION_OUT_FIRMWARE_ANY 0xffffffff
  773. /* enum: Bootrom version value for Siena. */
  774. #define MC_CMD_GET_VERSION_OUT_FIRMWARE_SIENA_BOOTROM 0xb0070000
  775. /* enum: Bootrom version value for Huntington. */
  776. #define MC_CMD_GET_VERSION_OUT_FIRMWARE_HUNT_BOOTROM 0xb0070001
  777. /* MC_CMD_GET_VERSION_OUT msgresponse */
  778. #define MC_CMD_GET_VERSION_OUT_LEN 32
  779. /* MC_CMD_GET_VERSION_OUT_FIRMWARE_OFST 0 */
  780. /* Enum values, see field(s): */
  781. /* MC_CMD_GET_VERSION_V0_OUT/MC_CMD_GET_VERSION_OUT_FIRMWARE */
  782. #define MC_CMD_GET_VERSION_OUT_PCOL_OFST 4
  783. /* 128bit mask of functions supported by the current firmware */
  784. #define MC_CMD_GET_VERSION_OUT_SUPPORTED_FUNCS_OFST 8
  785. #define MC_CMD_GET_VERSION_OUT_SUPPORTED_FUNCS_LEN 16
  786. #define MC_CMD_GET_VERSION_OUT_VERSION_OFST 24
  787. #define MC_CMD_GET_VERSION_OUT_VERSION_LEN 8
  788. #define MC_CMD_GET_VERSION_OUT_VERSION_LO_OFST 24
  789. #define MC_CMD_GET_VERSION_OUT_VERSION_HI_OFST 28
  790. /* MC_CMD_GET_VERSION_EXT_OUT msgresponse */
  791. #define MC_CMD_GET_VERSION_EXT_OUT_LEN 48
  792. /* MC_CMD_GET_VERSION_OUT_FIRMWARE_OFST 0 */
  793. /* Enum values, see field(s): */
  794. /* MC_CMD_GET_VERSION_V0_OUT/MC_CMD_GET_VERSION_OUT_FIRMWARE */
  795. #define MC_CMD_GET_VERSION_EXT_OUT_PCOL_OFST 4
  796. /* 128bit mask of functions supported by the current firmware */
  797. #define MC_CMD_GET_VERSION_EXT_OUT_SUPPORTED_FUNCS_OFST 8
  798. #define MC_CMD_GET_VERSION_EXT_OUT_SUPPORTED_FUNCS_LEN 16
  799. #define MC_CMD_GET_VERSION_EXT_OUT_VERSION_OFST 24
  800. #define MC_CMD_GET_VERSION_EXT_OUT_VERSION_LEN 8
  801. #define MC_CMD_GET_VERSION_EXT_OUT_VERSION_LO_OFST 24
  802. #define MC_CMD_GET_VERSION_EXT_OUT_VERSION_HI_OFST 28
  803. /* extra info */
  804. #define MC_CMD_GET_VERSION_EXT_OUT_EXTRA_OFST 32
  805. #define MC_CMD_GET_VERSION_EXT_OUT_EXTRA_LEN 16
  806. /***********************************/
  807. /* MC_CMD_PTP
  808. * Perform PTP operation
  809. */
  810. #define MC_CMD_PTP 0xb
  811. #define MC_CMD_0xb_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  812. /* MC_CMD_PTP_IN msgrequest */
  813. #define MC_CMD_PTP_IN_LEN 1
  814. /* PTP operation code */
  815. #define MC_CMD_PTP_IN_OP_OFST 0
  816. #define MC_CMD_PTP_IN_OP_LEN 1
  817. /* enum: Enable PTP packet timestamping operation. */
  818. #define MC_CMD_PTP_OP_ENABLE 0x1
  819. /* enum: Disable PTP packet timestamping operation. */
  820. #define MC_CMD_PTP_OP_DISABLE 0x2
  821. /* enum: Send a PTP packet. */
  822. #define MC_CMD_PTP_OP_TRANSMIT 0x3
  823. /* enum: Read the current NIC time. */
  824. #define MC_CMD_PTP_OP_READ_NIC_TIME 0x4
  825. /* enum: Get the current PTP status. */
  826. #define MC_CMD_PTP_OP_STATUS 0x5
  827. /* enum: Adjust the PTP NIC's time. */
  828. #define MC_CMD_PTP_OP_ADJUST 0x6
  829. /* enum: Synchronize host and NIC time. */
  830. #define MC_CMD_PTP_OP_SYNCHRONIZE 0x7
  831. /* enum: Basic manufacturing tests. */
  832. #define MC_CMD_PTP_OP_MANFTEST_BASIC 0x8
  833. /* enum: Packet based manufacturing tests. */
  834. #define MC_CMD_PTP_OP_MANFTEST_PACKET 0x9
  835. /* enum: Reset some of the PTP related statistics */
  836. #define MC_CMD_PTP_OP_RESET_STATS 0xa
  837. /* enum: Debug operations to MC. */
  838. #define MC_CMD_PTP_OP_DEBUG 0xb
  839. /* enum: Read an FPGA register */
  840. #define MC_CMD_PTP_OP_FPGAREAD 0xc
  841. /* enum: Write an FPGA register */
  842. #define MC_CMD_PTP_OP_FPGAWRITE 0xd
  843. /* enum: Apply an offset to the NIC clock */
  844. #define MC_CMD_PTP_OP_CLOCK_OFFSET_ADJUST 0xe
  845. /* enum: Change Apply an offset to the NIC clock */
  846. #define MC_CMD_PTP_OP_CLOCK_FREQ_ADJUST 0xf
  847. /* enum: Set the MC packet filter VLAN tags for received PTP packets */
  848. #define MC_CMD_PTP_OP_RX_SET_VLAN_FILTER 0x10
  849. /* enum: Set the MC packet filter UUID for received PTP packets */
  850. #define MC_CMD_PTP_OP_RX_SET_UUID_FILTER 0x11
  851. /* enum: Set the MC packet filter Domain for received PTP packets */
  852. #define MC_CMD_PTP_OP_RX_SET_DOMAIN_FILTER 0x12
  853. /* enum: Set the clock source */
  854. #define MC_CMD_PTP_OP_SET_CLK_SRC 0x13
  855. /* enum: Reset value of Timer Reg. */
  856. #define MC_CMD_PTP_OP_RST_CLK 0x14
  857. /* enum: Enable the forwarding of PPS events to the host */
  858. #define MC_CMD_PTP_OP_PPS_ENABLE 0x15
  859. /* enum: Get the time format used by this NIC for PTP operations */
  860. #define MC_CMD_PTP_OP_GET_TIME_FORMAT 0x16
  861. /* enum: Get the clock attributes. NOTE- extended version of
  862. * MC_CMD_PTP_OP_GET_TIME_FORMAT
  863. */
  864. #define MC_CMD_PTP_OP_GET_ATTRIBUTES 0x16
  865. /* enum: Get corrections that should be applied to the various different
  866. * timestamps
  867. */
  868. #define MC_CMD_PTP_OP_GET_TIMESTAMP_CORRECTIONS 0x17
  869. /* enum: Subscribe to receive periodic time events indicating the current NIC
  870. * time
  871. */
  872. #define MC_CMD_PTP_OP_TIME_EVENT_SUBSCRIBE 0x18
  873. /* enum: Unsubscribe to stop receiving time events */
  874. #define MC_CMD_PTP_OP_TIME_EVENT_UNSUBSCRIBE 0x19
  875. /* enum: PPS based manfacturing tests. Requires PPS output to be looped to PPS
  876. * input on the same NIC.
  877. */
  878. #define MC_CMD_PTP_OP_MANFTEST_PPS 0x1a
  879. /* enum: Above this for future use. */
  880. #define MC_CMD_PTP_OP_MAX 0x1b
  881. /* MC_CMD_PTP_IN_ENABLE msgrequest */
  882. #define MC_CMD_PTP_IN_ENABLE_LEN 16
  883. #define MC_CMD_PTP_IN_CMD_OFST 0
  884. #define MC_CMD_PTP_IN_PERIPH_ID_OFST 4
  885. /* Event queue for PTP events */
  886. #define MC_CMD_PTP_IN_ENABLE_QUEUE_OFST 8
  887. /* PTP timestamping mode */
  888. #define MC_CMD_PTP_IN_ENABLE_MODE_OFST 12
  889. /* enum: PTP, version 1 */
  890. #define MC_CMD_PTP_MODE_V1 0x0
  891. /* enum: PTP, version 1, with VLAN headers - deprecated */
  892. #define MC_CMD_PTP_MODE_V1_VLAN 0x1
  893. /* enum: PTP, version 2 */
  894. #define MC_CMD_PTP_MODE_V2 0x2
  895. /* enum: PTP, version 2, with VLAN headers - deprecated */
  896. #define MC_CMD_PTP_MODE_V2_VLAN 0x3
  897. /* enum: PTP, version 2, with improved UUID filtering */
  898. #define MC_CMD_PTP_MODE_V2_ENHANCED 0x4
  899. /* enum: FCoE (seconds and microseconds) */
  900. #define MC_CMD_PTP_MODE_FCOE 0x5
  901. /* MC_CMD_PTP_IN_DISABLE msgrequest */
  902. #define MC_CMD_PTP_IN_DISABLE_LEN 8
  903. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  904. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  905. /* MC_CMD_PTP_IN_TRANSMIT msgrequest */
  906. #define MC_CMD_PTP_IN_TRANSMIT_LENMIN 13
  907. #define MC_CMD_PTP_IN_TRANSMIT_LENMAX 252
  908. #define MC_CMD_PTP_IN_TRANSMIT_LEN(num) (12+1*(num))
  909. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  910. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  911. /* Transmit packet length */
  912. #define MC_CMD_PTP_IN_TRANSMIT_LENGTH_OFST 8
  913. /* Transmit packet data */
  914. #define MC_CMD_PTP_IN_TRANSMIT_PACKET_OFST 12
  915. #define MC_CMD_PTP_IN_TRANSMIT_PACKET_LEN 1
  916. #define MC_CMD_PTP_IN_TRANSMIT_PACKET_MINNUM 1
  917. #define MC_CMD_PTP_IN_TRANSMIT_PACKET_MAXNUM 240
  918. /* MC_CMD_PTP_IN_READ_NIC_TIME msgrequest */
  919. #define MC_CMD_PTP_IN_READ_NIC_TIME_LEN 8
  920. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  921. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  922. /* MC_CMD_PTP_IN_STATUS msgrequest */
  923. #define MC_CMD_PTP_IN_STATUS_LEN 8
  924. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  925. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  926. /* MC_CMD_PTP_IN_ADJUST msgrequest */
  927. #define MC_CMD_PTP_IN_ADJUST_LEN 24
  928. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  929. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  930. /* Frequency adjustment 40 bit fixed point ns */
  931. #define MC_CMD_PTP_IN_ADJUST_FREQ_OFST 8
  932. #define MC_CMD_PTP_IN_ADJUST_FREQ_LEN 8
  933. #define MC_CMD_PTP_IN_ADJUST_FREQ_LO_OFST 8
  934. #define MC_CMD_PTP_IN_ADJUST_FREQ_HI_OFST 12
  935. /* enum: Number of fractional bits in frequency adjustment */
  936. #define MC_CMD_PTP_IN_ADJUST_BITS 0x28
  937. /* Time adjustment in seconds */
  938. #define MC_CMD_PTP_IN_ADJUST_SECONDS_OFST 16
  939. /* Time adjustment major value */
  940. #define MC_CMD_PTP_IN_ADJUST_MAJOR_OFST 16
  941. /* Time adjustment in nanoseconds */
  942. #define MC_CMD_PTP_IN_ADJUST_NANOSECONDS_OFST 20
  943. /* Time adjustment minor value */
  944. #define MC_CMD_PTP_IN_ADJUST_MINOR_OFST 20
  945. /* MC_CMD_PTP_IN_SYNCHRONIZE msgrequest */
  946. #define MC_CMD_PTP_IN_SYNCHRONIZE_LEN 20
  947. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  948. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  949. /* Number of time readings to capture */
  950. #define MC_CMD_PTP_IN_SYNCHRONIZE_NUMTIMESETS_OFST 8
  951. /* Host address in which to write "synchronization started" indication (64
  952. * bits)
  953. */
  954. #define MC_CMD_PTP_IN_SYNCHRONIZE_START_ADDR_OFST 12
  955. #define MC_CMD_PTP_IN_SYNCHRONIZE_START_ADDR_LEN 8
  956. #define MC_CMD_PTP_IN_SYNCHRONIZE_START_ADDR_LO_OFST 12
  957. #define MC_CMD_PTP_IN_SYNCHRONIZE_START_ADDR_HI_OFST 16
  958. /* MC_CMD_PTP_IN_MANFTEST_BASIC msgrequest */
  959. #define MC_CMD_PTP_IN_MANFTEST_BASIC_LEN 8
  960. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  961. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  962. /* MC_CMD_PTP_IN_MANFTEST_PACKET msgrequest */
  963. #define MC_CMD_PTP_IN_MANFTEST_PACKET_LEN 12
  964. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  965. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  966. /* Enable or disable packet testing */
  967. #define MC_CMD_PTP_IN_MANFTEST_PACKET_TEST_ENABLE_OFST 8
  968. /* MC_CMD_PTP_IN_RESET_STATS msgrequest */
  969. #define MC_CMD_PTP_IN_RESET_STATS_LEN 8
  970. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  971. /* Reset PTP statistics */
  972. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  973. /* MC_CMD_PTP_IN_DEBUG msgrequest */
  974. #define MC_CMD_PTP_IN_DEBUG_LEN 12
  975. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  976. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  977. /* Debug operations */
  978. #define MC_CMD_PTP_IN_DEBUG_DEBUG_PARAM_OFST 8
  979. /* MC_CMD_PTP_IN_FPGAREAD msgrequest */
  980. #define MC_CMD_PTP_IN_FPGAREAD_LEN 16
  981. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  982. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  983. #define MC_CMD_PTP_IN_FPGAREAD_ADDR_OFST 8
  984. #define MC_CMD_PTP_IN_FPGAREAD_NUMBYTES_OFST 12
  985. /* MC_CMD_PTP_IN_FPGAWRITE msgrequest */
  986. #define MC_CMD_PTP_IN_FPGAWRITE_LENMIN 13
  987. #define MC_CMD_PTP_IN_FPGAWRITE_LENMAX 252
  988. #define MC_CMD_PTP_IN_FPGAWRITE_LEN(num) (12+1*(num))
  989. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  990. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  991. #define MC_CMD_PTP_IN_FPGAWRITE_ADDR_OFST 8
  992. #define MC_CMD_PTP_IN_FPGAWRITE_BUFFER_OFST 12
  993. #define MC_CMD_PTP_IN_FPGAWRITE_BUFFER_LEN 1
  994. #define MC_CMD_PTP_IN_FPGAWRITE_BUFFER_MINNUM 1
  995. #define MC_CMD_PTP_IN_FPGAWRITE_BUFFER_MAXNUM 240
  996. /* MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST msgrequest */
  997. #define MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_LEN 16
  998. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  999. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1000. /* Time adjustment in seconds */
  1001. #define MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_SECONDS_OFST 8
  1002. /* Time adjustment major value */
  1003. #define MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_MAJOR_OFST 8
  1004. /* Time adjustment in nanoseconds */
  1005. #define MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_NANOSECONDS_OFST 12
  1006. /* Time adjustment minor value */
  1007. #define MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_MINOR_OFST 12
  1008. /* MC_CMD_PTP_IN_CLOCK_FREQ_ADJUST msgrequest */
  1009. #define MC_CMD_PTP_IN_CLOCK_FREQ_ADJUST_LEN 16
  1010. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1011. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1012. /* Frequency adjustment 40 bit fixed point ns */
  1013. #define MC_CMD_PTP_IN_CLOCK_FREQ_ADJUST_FREQ_OFST 8
  1014. #define MC_CMD_PTP_IN_CLOCK_FREQ_ADJUST_FREQ_LEN 8
  1015. #define MC_CMD_PTP_IN_CLOCK_FREQ_ADJUST_FREQ_LO_OFST 8
  1016. #define MC_CMD_PTP_IN_CLOCK_FREQ_ADJUST_FREQ_HI_OFST 12
  1017. /* enum: Number of fractional bits in frequency adjustment */
  1018. /* MC_CMD_PTP_IN_ADJUST_BITS 0x28 */
  1019. /* MC_CMD_PTP_IN_RX_SET_VLAN_FILTER msgrequest */
  1020. #define MC_CMD_PTP_IN_RX_SET_VLAN_FILTER_LEN 24
  1021. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1022. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1023. /* Number of VLAN tags, 0 if not VLAN */
  1024. #define MC_CMD_PTP_IN_RX_SET_VLAN_FILTER_NUM_VLAN_TAGS_OFST 8
  1025. /* Set of VLAN tags to filter against */
  1026. #define MC_CMD_PTP_IN_RX_SET_VLAN_FILTER_VLAN_TAG_OFST 12
  1027. #define MC_CMD_PTP_IN_RX_SET_VLAN_FILTER_VLAN_TAG_LEN 4
  1028. #define MC_CMD_PTP_IN_RX_SET_VLAN_FILTER_VLAN_TAG_NUM 3
  1029. /* MC_CMD_PTP_IN_RX_SET_UUID_FILTER msgrequest */
  1030. #define MC_CMD_PTP_IN_RX_SET_UUID_FILTER_LEN 20
  1031. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1032. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1033. /* 1 to enable UUID filtering, 0 to disable */
  1034. #define MC_CMD_PTP_IN_RX_SET_UUID_FILTER_ENABLE_OFST 8
  1035. /* UUID to filter against */
  1036. #define MC_CMD_PTP_IN_RX_SET_UUID_FILTER_UUID_OFST 12
  1037. #define MC_CMD_PTP_IN_RX_SET_UUID_FILTER_UUID_LEN 8
  1038. #define MC_CMD_PTP_IN_RX_SET_UUID_FILTER_UUID_LO_OFST 12
  1039. #define MC_CMD_PTP_IN_RX_SET_UUID_FILTER_UUID_HI_OFST 16
  1040. /* MC_CMD_PTP_IN_RX_SET_DOMAIN_FILTER msgrequest */
  1041. #define MC_CMD_PTP_IN_RX_SET_DOMAIN_FILTER_LEN 16
  1042. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1043. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1044. /* 1 to enable Domain filtering, 0 to disable */
  1045. #define MC_CMD_PTP_IN_RX_SET_DOMAIN_FILTER_ENABLE_OFST 8
  1046. /* Domain number to filter against */
  1047. #define MC_CMD_PTP_IN_RX_SET_DOMAIN_FILTER_DOMAIN_OFST 12
  1048. /* MC_CMD_PTP_IN_SET_CLK_SRC msgrequest */
  1049. #define MC_CMD_PTP_IN_SET_CLK_SRC_LEN 12
  1050. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1051. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1052. /* Set the clock source. */
  1053. #define MC_CMD_PTP_IN_SET_CLK_SRC_CLK_OFST 8
  1054. /* enum: Internal. */
  1055. #define MC_CMD_PTP_CLK_SRC_INTERNAL 0x0
  1056. /* enum: External. */
  1057. #define MC_CMD_PTP_CLK_SRC_EXTERNAL 0x1
  1058. /* MC_CMD_PTP_IN_RST_CLK msgrequest */
  1059. #define MC_CMD_PTP_IN_RST_CLK_LEN 8
  1060. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1061. /* Reset value of Timer Reg. */
  1062. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1063. /* MC_CMD_PTP_IN_PPS_ENABLE msgrequest */
  1064. #define MC_CMD_PTP_IN_PPS_ENABLE_LEN 12
  1065. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1066. /* Enable or disable */
  1067. #define MC_CMD_PTP_IN_PPS_ENABLE_OP_OFST 4
  1068. /* enum: Enable */
  1069. #define MC_CMD_PTP_ENABLE_PPS 0x0
  1070. /* enum: Disable */
  1071. #define MC_CMD_PTP_DISABLE_PPS 0x1
  1072. /* Queue id to send events back */
  1073. #define MC_CMD_PTP_IN_PPS_ENABLE_QUEUE_ID_OFST 8
  1074. /* MC_CMD_PTP_IN_GET_TIME_FORMAT msgrequest */
  1075. #define MC_CMD_PTP_IN_GET_TIME_FORMAT_LEN 8
  1076. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1077. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1078. /* MC_CMD_PTP_IN_GET_ATTRIBUTES msgrequest */
  1079. #define MC_CMD_PTP_IN_GET_ATTRIBUTES_LEN 8
  1080. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1081. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1082. /* MC_CMD_PTP_IN_GET_TIMESTAMP_CORRECTIONS msgrequest */
  1083. #define MC_CMD_PTP_IN_GET_TIMESTAMP_CORRECTIONS_LEN 8
  1084. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1085. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1086. /* MC_CMD_PTP_IN_TIME_EVENT_SUBSCRIBE msgrequest */
  1087. #define MC_CMD_PTP_IN_TIME_EVENT_SUBSCRIBE_LEN 12
  1088. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1089. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1090. /* Event queue to send PTP time events to */
  1091. #define MC_CMD_PTP_IN_TIME_EVENT_SUBSCRIBE_QUEUE_OFST 8
  1092. /* MC_CMD_PTP_IN_TIME_EVENT_UNSUBSCRIBE msgrequest */
  1093. #define MC_CMD_PTP_IN_TIME_EVENT_UNSUBSCRIBE_LEN 16
  1094. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1095. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1096. /* Unsubscribe options */
  1097. #define MC_CMD_PTP_IN_TIME_EVENT_UNSUBSCRIBE_CONTROL_OFST 8
  1098. /* enum: Unsubscribe a single queue */
  1099. #define MC_CMD_PTP_IN_TIME_EVENT_UNSUBSCRIBE_SINGLE 0x0
  1100. /* enum: Unsubscribe all queues */
  1101. #define MC_CMD_PTP_IN_TIME_EVENT_UNSUBSCRIBE_ALL 0x1
  1102. /* Event queue ID */
  1103. #define MC_CMD_PTP_IN_TIME_EVENT_UNSUBSCRIBE_QUEUE_OFST 12
  1104. /* MC_CMD_PTP_IN_MANFTEST_PPS msgrequest */
  1105. #define MC_CMD_PTP_IN_MANFTEST_PPS_LEN 12
  1106. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1107. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1108. /* 1 to enable PPS test mode, 0 to disable and return result. */
  1109. #define MC_CMD_PTP_IN_MANFTEST_PPS_TEST_ENABLE_OFST 8
  1110. /* MC_CMD_PTP_OUT msgresponse */
  1111. #define MC_CMD_PTP_OUT_LEN 0
  1112. /* MC_CMD_PTP_OUT_TRANSMIT msgresponse */
  1113. #define MC_CMD_PTP_OUT_TRANSMIT_LEN 8
  1114. /* Value of seconds timestamp */
  1115. #define MC_CMD_PTP_OUT_TRANSMIT_SECONDS_OFST 0
  1116. /* Timestamp major value */
  1117. #define MC_CMD_PTP_OUT_TRANSMIT_MAJOR_OFST 0
  1118. /* Value of nanoseconds timestamp */
  1119. #define MC_CMD_PTP_OUT_TRANSMIT_NANOSECONDS_OFST 4
  1120. /* Timestamp minor value */
  1121. #define MC_CMD_PTP_OUT_TRANSMIT_MINOR_OFST 4
  1122. /* MC_CMD_PTP_OUT_TIME_EVENT_SUBSCRIBE msgresponse */
  1123. #define MC_CMD_PTP_OUT_TIME_EVENT_SUBSCRIBE_LEN 0
  1124. /* MC_CMD_PTP_OUT_TIME_EVENT_UNSUBSCRIBE msgresponse */
  1125. #define MC_CMD_PTP_OUT_TIME_EVENT_UNSUBSCRIBE_LEN 0
  1126. /* MC_CMD_PTP_OUT_READ_NIC_TIME msgresponse */
  1127. #define MC_CMD_PTP_OUT_READ_NIC_TIME_LEN 8
  1128. /* Value of seconds timestamp */
  1129. #define MC_CMD_PTP_OUT_READ_NIC_TIME_SECONDS_OFST 0
  1130. /* Timestamp major value */
  1131. #define MC_CMD_PTP_OUT_READ_NIC_TIME_MAJOR_OFST 0
  1132. /* Value of nanoseconds timestamp */
  1133. #define MC_CMD_PTP_OUT_READ_NIC_TIME_NANOSECONDS_OFST 4
  1134. /* Timestamp minor value */
  1135. #define MC_CMD_PTP_OUT_READ_NIC_TIME_MINOR_OFST 4
  1136. /* MC_CMD_PTP_OUT_STATUS msgresponse */
  1137. #define MC_CMD_PTP_OUT_STATUS_LEN 64
  1138. /* Frequency of NIC's hardware clock */
  1139. #define MC_CMD_PTP_OUT_STATUS_CLOCK_FREQ_OFST 0
  1140. /* Number of packets transmitted and timestamped */
  1141. #define MC_CMD_PTP_OUT_STATUS_STATS_TX_OFST 4
  1142. /* Number of packets received and timestamped */
  1143. #define MC_CMD_PTP_OUT_STATUS_STATS_RX_OFST 8
  1144. /* Number of packets timestamped by the FPGA */
  1145. #define MC_CMD_PTP_OUT_STATUS_STATS_TS_OFST 12
  1146. /* Number of packets filter matched */
  1147. #define MC_CMD_PTP_OUT_STATUS_STATS_FM_OFST 16
  1148. /* Number of packets not filter matched */
  1149. #define MC_CMD_PTP_OUT_STATUS_STATS_NFM_OFST 20
  1150. /* Number of PPS overflows (noise on input?) */
  1151. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_OFLOW_OFST 24
  1152. /* Number of PPS bad periods */
  1153. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_BAD_OFST 28
  1154. /* Minimum period of PPS pulse in nanoseconds */
  1155. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_PER_MIN_OFST 32
  1156. /* Maximum period of PPS pulse in nanoseconds */
  1157. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_PER_MAX_OFST 36
  1158. /* Last period of PPS pulse in nanoseconds */
  1159. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_PER_LAST_OFST 40
  1160. /* Mean period of PPS pulse in nanoseconds */
  1161. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_PER_MEAN_OFST 44
  1162. /* Minimum offset of PPS pulse in nanoseconds (signed) */
  1163. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_OFF_MIN_OFST 48
  1164. /* Maximum offset of PPS pulse in nanoseconds (signed) */
  1165. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_OFF_MAX_OFST 52
  1166. /* Last offset of PPS pulse in nanoseconds (signed) */
  1167. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_OFF_LAST_OFST 56
  1168. /* Mean offset of PPS pulse in nanoseconds (signed) */
  1169. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_OFF_MEAN_OFST 60
  1170. /* MC_CMD_PTP_OUT_SYNCHRONIZE msgresponse */
  1171. #define MC_CMD_PTP_OUT_SYNCHRONIZE_LENMIN 20
  1172. #define MC_CMD_PTP_OUT_SYNCHRONIZE_LENMAX 240
  1173. #define MC_CMD_PTP_OUT_SYNCHRONIZE_LEN(num) (0+20*(num))
  1174. /* A set of host and NIC times */
  1175. #define MC_CMD_PTP_OUT_SYNCHRONIZE_TIMESET_OFST 0
  1176. #define MC_CMD_PTP_OUT_SYNCHRONIZE_TIMESET_LEN 20
  1177. #define MC_CMD_PTP_OUT_SYNCHRONIZE_TIMESET_MINNUM 1
  1178. #define MC_CMD_PTP_OUT_SYNCHRONIZE_TIMESET_MAXNUM 12
  1179. /* Host time immediately before NIC's hardware clock read */
  1180. #define MC_CMD_PTP_OUT_SYNCHRONIZE_HOSTSTART_OFST 0
  1181. /* Value of seconds timestamp */
  1182. #define MC_CMD_PTP_OUT_SYNCHRONIZE_SECONDS_OFST 4
  1183. /* Timestamp major value */
  1184. #define MC_CMD_PTP_OUT_SYNCHRONIZE_MAJOR_OFST 4
  1185. /* Value of nanoseconds timestamp */
  1186. #define MC_CMD_PTP_OUT_SYNCHRONIZE_NANOSECONDS_OFST 8
  1187. /* Timestamp minor value */
  1188. #define MC_CMD_PTP_OUT_SYNCHRONIZE_MINOR_OFST 8
  1189. /* Host time immediately after NIC's hardware clock read */
  1190. #define MC_CMD_PTP_OUT_SYNCHRONIZE_HOSTEND_OFST 12
  1191. /* Number of nanoseconds waited after reading NIC's hardware clock */
  1192. #define MC_CMD_PTP_OUT_SYNCHRONIZE_WAITNS_OFST 16
  1193. /* MC_CMD_PTP_OUT_MANFTEST_BASIC msgresponse */
  1194. #define MC_CMD_PTP_OUT_MANFTEST_BASIC_LEN 8
  1195. /* Results of testing */
  1196. #define MC_CMD_PTP_OUT_MANFTEST_BASIC_TEST_RESULT_OFST 0
  1197. /* enum: Successful test */
  1198. #define MC_CMD_PTP_MANF_SUCCESS 0x0
  1199. /* enum: FPGA load failed */
  1200. #define MC_CMD_PTP_MANF_FPGA_LOAD 0x1
  1201. /* enum: FPGA version invalid */
  1202. #define MC_CMD_PTP_MANF_FPGA_VERSION 0x2
  1203. /* enum: FPGA registers incorrect */
  1204. #define MC_CMD_PTP_MANF_FPGA_REGISTERS 0x3
  1205. /* enum: Oscillator possibly not working? */
  1206. #define MC_CMD_PTP_MANF_OSCILLATOR 0x4
  1207. /* enum: Timestamps not increasing */
  1208. #define MC_CMD_PTP_MANF_TIMESTAMPS 0x5
  1209. /* enum: Mismatched packet count */
  1210. #define MC_CMD_PTP_MANF_PACKET_COUNT 0x6
  1211. /* enum: Mismatched packet count (Siena filter and FPGA) */
  1212. #define MC_CMD_PTP_MANF_FILTER_COUNT 0x7
  1213. /* enum: Not enough packets to perform timestamp check */
  1214. #define MC_CMD_PTP_MANF_PACKET_ENOUGH 0x8
  1215. /* enum: Timestamp trigger GPIO not working */
  1216. #define MC_CMD_PTP_MANF_GPIO_TRIGGER 0x9
  1217. /* enum: Insufficient PPS events to perform checks */
  1218. #define MC_CMD_PTP_MANF_PPS_ENOUGH 0xa
  1219. /* enum: PPS time event period not sufficiently close to 1s. */
  1220. #define MC_CMD_PTP_MANF_PPS_PERIOD 0xb
  1221. /* enum: PPS time event nS reading not sufficiently close to zero. */
  1222. #define MC_CMD_PTP_MANF_PPS_NS 0xc
  1223. /* enum: PTP peripheral registers incorrect */
  1224. #define MC_CMD_PTP_MANF_REGISTERS 0xd
  1225. /* enum: Failed to read time from PTP peripheral */
  1226. #define MC_CMD_PTP_MANF_CLOCK_READ 0xe
  1227. /* Presence of external oscillator */
  1228. #define MC_CMD_PTP_OUT_MANFTEST_BASIC_TEST_EXTOSC_OFST 4
  1229. /* MC_CMD_PTP_OUT_MANFTEST_PACKET msgresponse */
  1230. #define MC_CMD_PTP_OUT_MANFTEST_PACKET_LEN 12
  1231. /* Results of testing */
  1232. #define MC_CMD_PTP_OUT_MANFTEST_PACKET_TEST_RESULT_OFST 0
  1233. /* Number of packets received by FPGA */
  1234. #define MC_CMD_PTP_OUT_MANFTEST_PACKET_TEST_FPGACOUNT_OFST 4
  1235. /* Number of packets received by Siena filters */
  1236. #define MC_CMD_PTP_OUT_MANFTEST_PACKET_TEST_FILTERCOUNT_OFST 8
  1237. /* MC_CMD_PTP_OUT_FPGAREAD msgresponse */
  1238. #define MC_CMD_PTP_OUT_FPGAREAD_LENMIN 1
  1239. #define MC_CMD_PTP_OUT_FPGAREAD_LENMAX 252
  1240. #define MC_CMD_PTP_OUT_FPGAREAD_LEN(num) (0+1*(num))
  1241. #define MC_CMD_PTP_OUT_FPGAREAD_BUFFER_OFST 0
  1242. #define MC_CMD_PTP_OUT_FPGAREAD_BUFFER_LEN 1
  1243. #define MC_CMD_PTP_OUT_FPGAREAD_BUFFER_MINNUM 1
  1244. #define MC_CMD_PTP_OUT_FPGAREAD_BUFFER_MAXNUM 252
  1245. /* MC_CMD_PTP_OUT_GET_TIME_FORMAT msgresponse */
  1246. #define MC_CMD_PTP_OUT_GET_TIME_FORMAT_LEN 4
  1247. /* Time format required/used by for this NIC. Applies to all PTP MCDI
  1248. * operations that pass times between the host and firmware. If this operation
  1249. * is not supported (older firmware) a format of seconds and nanoseconds should
  1250. * be assumed.
  1251. */
  1252. #define MC_CMD_PTP_OUT_GET_TIME_FORMAT_FORMAT_OFST 0
  1253. /* enum: Times are in seconds and nanoseconds */
  1254. #define MC_CMD_PTP_OUT_GET_TIME_FORMAT_SECONDS_NANOSECONDS 0x0
  1255. /* enum: Major register has units of 16 second per tick, minor 8 ns per tick */
  1256. #define MC_CMD_PTP_OUT_GET_TIME_FORMAT_16SECONDS_8NANOSECONDS 0x1
  1257. /* enum: Major register has units of seconds, minor 2^-27s per tick */
  1258. #define MC_CMD_PTP_OUT_GET_TIME_FORMAT_SECONDS_27FRACTION 0x2
  1259. /* MC_CMD_PTP_OUT_GET_ATTRIBUTES msgresponse */
  1260. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_LEN 8
  1261. /* Time format required/used by for this NIC. Applies to all PTP MCDI
  1262. * operations that pass times between the host and firmware. If this operation
  1263. * is not supported (older firmware) a format of seconds and nanoseconds should
  1264. * be assumed.
  1265. */
  1266. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_TIME_FORMAT_OFST 0
  1267. /* enum: Times are in seconds and nanoseconds */
  1268. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_SECONDS_NANOSECONDS 0x0
  1269. /* enum: Major register has units of 16 second per tick, minor 8 ns per tick */
  1270. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_16SECONDS_8NANOSECONDS 0x1
  1271. /* enum: Major register has units of seconds, minor 2^-27s per tick */
  1272. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_SECONDS_27FRACTION 0x2
  1273. /* Minimum acceptable value for a corrected synchronization timeset. When
  1274. * comparing host and NIC clock times, the MC returns a set of samples that
  1275. * contain the host start and end time, the MC time when the host start was
  1276. * detected and the time the MC waited between reading the time and detecting
  1277. * the host end. The corrected sync window is the difference between the host
  1278. * end and start times minus the time that the MC waited for host end.
  1279. */
  1280. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_SYNC_WINDOW_MIN_OFST 4
  1281. /* MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS msgresponse */
  1282. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_LEN 16
  1283. /* Uncorrected error on transmit timestamps in NIC clock format */
  1284. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_TRANSMIT_OFST 0
  1285. /* Uncorrected error on receive timestamps in NIC clock format */
  1286. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_RECEIVE_OFST 4
  1287. /* Uncorrected error on PPS output in NIC clock format */
  1288. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_PPS_OUT_OFST 8
  1289. /* Uncorrected error on PPS input in NIC clock format */
  1290. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_PPS_IN_OFST 12
  1291. /* MC_CMD_PTP_OUT_MANFTEST_PPS msgresponse */
  1292. #define MC_CMD_PTP_OUT_MANFTEST_PPS_LEN 4
  1293. /* Results of testing */
  1294. #define MC_CMD_PTP_OUT_MANFTEST_PPS_TEST_RESULT_OFST 0
  1295. /* Enum values, see field(s): */
  1296. /* MC_CMD_PTP_OUT_MANFTEST_BASIC/TEST_RESULT */
  1297. /***********************************/
  1298. /* MC_CMD_CSR_READ32
  1299. * Read 32bit words from the indirect memory map.
  1300. */
  1301. #define MC_CMD_CSR_READ32 0xc
  1302. #define MC_CMD_0xc_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  1303. /* MC_CMD_CSR_READ32_IN msgrequest */
  1304. #define MC_CMD_CSR_READ32_IN_LEN 12
  1305. /* Address */
  1306. #define MC_CMD_CSR_READ32_IN_ADDR_OFST 0
  1307. #define MC_CMD_CSR_READ32_IN_STEP_OFST 4
  1308. #define MC_CMD_CSR_READ32_IN_NUMWORDS_OFST 8
  1309. /* MC_CMD_CSR_READ32_OUT msgresponse */
  1310. #define MC_CMD_CSR_READ32_OUT_LENMIN 4
  1311. #define MC_CMD_CSR_READ32_OUT_LENMAX 252
  1312. #define MC_CMD_CSR_READ32_OUT_LEN(num) (0+4*(num))
  1313. /* The last dword is the status, not a value read */
  1314. #define MC_CMD_CSR_READ32_OUT_BUFFER_OFST 0
  1315. #define MC_CMD_CSR_READ32_OUT_BUFFER_LEN 4
  1316. #define MC_CMD_CSR_READ32_OUT_BUFFER_MINNUM 1
  1317. #define MC_CMD_CSR_READ32_OUT_BUFFER_MAXNUM 63
  1318. /***********************************/
  1319. /* MC_CMD_CSR_WRITE32
  1320. * Write 32bit dwords to the indirect memory map.
  1321. */
  1322. #define MC_CMD_CSR_WRITE32 0xd
  1323. #define MC_CMD_0xd_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  1324. /* MC_CMD_CSR_WRITE32_IN msgrequest */
  1325. #define MC_CMD_CSR_WRITE32_IN_LENMIN 12
  1326. #define MC_CMD_CSR_WRITE32_IN_LENMAX 252
  1327. #define MC_CMD_CSR_WRITE32_IN_LEN(num) (8+4*(num))
  1328. /* Address */
  1329. #define MC_CMD_CSR_WRITE32_IN_ADDR_OFST 0
  1330. #define MC_CMD_CSR_WRITE32_IN_STEP_OFST 4
  1331. #define MC_CMD_CSR_WRITE32_IN_BUFFER_OFST 8
  1332. #define MC_CMD_CSR_WRITE32_IN_BUFFER_LEN 4
  1333. #define MC_CMD_CSR_WRITE32_IN_BUFFER_MINNUM 1
  1334. #define MC_CMD_CSR_WRITE32_IN_BUFFER_MAXNUM 61
  1335. /* MC_CMD_CSR_WRITE32_OUT msgresponse */
  1336. #define MC_CMD_CSR_WRITE32_OUT_LEN 4
  1337. #define MC_CMD_CSR_WRITE32_OUT_STATUS_OFST 0
  1338. /***********************************/
  1339. /* MC_CMD_HP
  1340. * These commands are used for HP related features. They are grouped under one
  1341. * MCDI command to avoid creating too many MCDI commands.
  1342. */
  1343. #define MC_CMD_HP 0x54
  1344. #define MC_CMD_0x54_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  1345. /* MC_CMD_HP_IN msgrequest */
  1346. #define MC_CMD_HP_IN_LEN 16
  1347. /* HP OCSD sub-command. When address is not NULL, request activation of OCSD at
  1348. * the specified address with the specified interval.When address is NULL,
  1349. * INTERVAL is interpreted as a command: 0: stop OCSD / 1: Report OCSD current
  1350. * state / 2: (debug) Show temperature reported by one of the supported
  1351. * sensors.
  1352. */
  1353. #define MC_CMD_HP_IN_SUBCMD_OFST 0
  1354. /* enum: OCSD (Option Card Sensor Data) sub-command. */
  1355. #define MC_CMD_HP_IN_OCSD_SUBCMD 0x0
  1356. /* enum: Last known valid HP sub-command. */
  1357. #define MC_CMD_HP_IN_LAST_SUBCMD 0x0
  1358. /* The address to the array of sensor fields. (Or NULL to use a sub-command.)
  1359. */
  1360. #define MC_CMD_HP_IN_OCSD_ADDR_OFST 4
  1361. #define MC_CMD_HP_IN_OCSD_ADDR_LEN 8
  1362. #define MC_CMD_HP_IN_OCSD_ADDR_LO_OFST 4
  1363. #define MC_CMD_HP_IN_OCSD_ADDR_HI_OFST 8
  1364. /* The requested update interval, in seconds. (Or the sub-command if ADDR is
  1365. * NULL.)
  1366. */
  1367. #define MC_CMD_HP_IN_OCSD_INTERVAL_OFST 12
  1368. /* MC_CMD_HP_OUT msgresponse */
  1369. #define MC_CMD_HP_OUT_LEN 4
  1370. #define MC_CMD_HP_OUT_OCSD_STATUS_OFST 0
  1371. /* enum: OCSD stopped for this card. */
  1372. #define MC_CMD_HP_OUT_OCSD_STOPPED 0x1
  1373. /* enum: OCSD was successfully started with the address provided. */
  1374. #define MC_CMD_HP_OUT_OCSD_STARTED 0x2
  1375. /* enum: OCSD was already started for this card. */
  1376. #define MC_CMD_HP_OUT_OCSD_ALREADY_STARTED 0x3
  1377. /***********************************/
  1378. /* MC_CMD_STACKINFO
  1379. * Get stack information.
  1380. */
  1381. #define MC_CMD_STACKINFO 0xf
  1382. #define MC_CMD_0xf_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  1383. /* MC_CMD_STACKINFO_IN msgrequest */
  1384. #define MC_CMD_STACKINFO_IN_LEN 0
  1385. /* MC_CMD_STACKINFO_OUT msgresponse */
  1386. #define MC_CMD_STACKINFO_OUT_LENMIN 12
  1387. #define MC_CMD_STACKINFO_OUT_LENMAX 252
  1388. #define MC_CMD_STACKINFO_OUT_LEN(num) (0+12*(num))
  1389. /* (thread ptr, stack size, free space) for each thread in system */
  1390. #define MC_CMD_STACKINFO_OUT_THREAD_INFO_OFST 0
  1391. #define MC_CMD_STACKINFO_OUT_THREAD_INFO_LEN 12
  1392. #define MC_CMD_STACKINFO_OUT_THREAD_INFO_MINNUM 1
  1393. #define MC_CMD_STACKINFO_OUT_THREAD_INFO_MAXNUM 21
  1394. /***********************************/
  1395. /* MC_CMD_MDIO_READ
  1396. * MDIO register read.
  1397. */
  1398. #define MC_CMD_MDIO_READ 0x10
  1399. #define MC_CMD_0x10_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  1400. /* MC_CMD_MDIO_READ_IN msgrequest */
  1401. #define MC_CMD_MDIO_READ_IN_LEN 16
  1402. /* Bus number; there are two MDIO buses: one for the internal PHY, and one for
  1403. * external devices.
  1404. */
  1405. #define MC_CMD_MDIO_READ_IN_BUS_OFST 0
  1406. /* enum: Internal. */
  1407. #define MC_CMD_MDIO_BUS_INTERNAL 0x0
  1408. /* enum: External. */
  1409. #define MC_CMD_MDIO_BUS_EXTERNAL 0x1
  1410. /* Port address */
  1411. #define MC_CMD_MDIO_READ_IN_PRTAD_OFST 4
  1412. /* Device Address or clause 22. */
  1413. #define MC_CMD_MDIO_READ_IN_DEVAD_OFST 8
  1414. /* enum: By default all the MCDI MDIO operations perform clause45 mode. If you
  1415. * want to use clause22 then set DEVAD = MC_CMD_MDIO_CLAUSE22.
  1416. */
  1417. #define MC_CMD_MDIO_CLAUSE22 0x20
  1418. /* Address */
  1419. #define MC_CMD_MDIO_READ_IN_ADDR_OFST 12
  1420. /* MC_CMD_MDIO_READ_OUT msgresponse */
  1421. #define MC_CMD_MDIO_READ_OUT_LEN 8
  1422. /* Value */
  1423. #define MC_CMD_MDIO_READ_OUT_VALUE_OFST 0
  1424. /* Status the MDIO commands return the raw status bits from the MDIO block. A
  1425. * "good" transaction should have the DONE bit set and all other bits clear.
  1426. */
  1427. #define MC_CMD_MDIO_READ_OUT_STATUS_OFST 4
  1428. /* enum: Good. */
  1429. #define MC_CMD_MDIO_STATUS_GOOD 0x8
  1430. /***********************************/
  1431. /* MC_CMD_MDIO_WRITE
  1432. * MDIO register write.
  1433. */
  1434. #define MC_CMD_MDIO_WRITE 0x11
  1435. #define MC_CMD_0x11_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  1436. /* MC_CMD_MDIO_WRITE_IN msgrequest */
  1437. #define MC_CMD_MDIO_WRITE_IN_LEN 20
  1438. /* Bus number; there are two MDIO buses: one for the internal PHY, and one for
  1439. * external devices.
  1440. */
  1441. #define MC_CMD_MDIO_WRITE_IN_BUS_OFST 0
  1442. /* enum: Internal. */
  1443. /* MC_CMD_MDIO_BUS_INTERNAL 0x0 */
  1444. /* enum: External. */
  1445. /* MC_CMD_MDIO_BUS_EXTERNAL 0x1 */
  1446. /* Port address */
  1447. #define MC_CMD_MDIO_WRITE_IN_PRTAD_OFST 4
  1448. /* Device Address or clause 22. */
  1449. #define MC_CMD_MDIO_WRITE_IN_DEVAD_OFST 8
  1450. /* enum: By default all the MCDI MDIO operations perform clause45 mode. If you
  1451. * want to use clause22 then set DEVAD = MC_CMD_MDIO_CLAUSE22.
  1452. */
  1453. /* MC_CMD_MDIO_CLAUSE22 0x20 */
  1454. /* Address */
  1455. #define MC_CMD_MDIO_WRITE_IN_ADDR_OFST 12
  1456. /* Value */
  1457. #define MC_CMD_MDIO_WRITE_IN_VALUE_OFST 16
  1458. /* MC_CMD_MDIO_WRITE_OUT msgresponse */
  1459. #define MC_CMD_MDIO_WRITE_OUT_LEN 4
  1460. /* Status; the MDIO commands return the raw status bits from the MDIO block. A
  1461. * "good" transaction should have the DONE bit set and all other bits clear.
  1462. */
  1463. #define MC_CMD_MDIO_WRITE_OUT_STATUS_OFST 0
  1464. /* enum: Good. */
  1465. /* MC_CMD_MDIO_STATUS_GOOD 0x8 */
  1466. /***********************************/
  1467. /* MC_CMD_DBI_WRITE
  1468. * Write DBI register(s).
  1469. */
  1470. #define MC_CMD_DBI_WRITE 0x12
  1471. #define MC_CMD_0x12_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  1472. /* MC_CMD_DBI_WRITE_IN msgrequest */
  1473. #define MC_CMD_DBI_WRITE_IN_LENMIN 12
  1474. #define MC_CMD_DBI_WRITE_IN_LENMAX 252
  1475. #define MC_CMD_DBI_WRITE_IN_LEN(num) (0+12*(num))
  1476. /* Each write op consists of an address (offset 0), byte enable/VF/CS2 (offset
  1477. * 32) and value (offset 64). See MC_CMD_DBIWROP_TYPEDEF.
  1478. */
  1479. #define MC_CMD_DBI_WRITE_IN_DBIWROP_OFST 0
  1480. #define MC_CMD_DBI_WRITE_IN_DBIWROP_LEN 12
  1481. #define MC_CMD_DBI_WRITE_IN_DBIWROP_MINNUM 1
  1482. #define MC_CMD_DBI_WRITE_IN_DBIWROP_MAXNUM 21
  1483. /* MC_CMD_DBI_WRITE_OUT msgresponse */
  1484. #define MC_CMD_DBI_WRITE_OUT_LEN 0
  1485. /* MC_CMD_DBIWROP_TYPEDEF structuredef */
  1486. #define MC_CMD_DBIWROP_TYPEDEF_LEN 12
  1487. #define MC_CMD_DBIWROP_TYPEDEF_ADDRESS_OFST 0
  1488. #define MC_CMD_DBIWROP_TYPEDEF_ADDRESS_LBN 0
  1489. #define MC_CMD_DBIWROP_TYPEDEF_ADDRESS_WIDTH 32
  1490. #define MC_CMD_DBIWROP_TYPEDEF_PARMS_OFST 4
  1491. #define MC_CMD_DBIWROP_TYPEDEF_VF_NUM_LBN 16
  1492. #define MC_CMD_DBIWROP_TYPEDEF_VF_NUM_WIDTH 16
  1493. #define MC_CMD_DBIWROP_TYPEDEF_VF_ACTIVE_LBN 15
  1494. #define MC_CMD_DBIWROP_TYPEDEF_VF_ACTIVE_WIDTH 1
  1495. #define MC_CMD_DBIWROP_TYPEDEF_CS2_LBN 14
  1496. #define MC_CMD_DBIWROP_TYPEDEF_CS2_WIDTH 1
  1497. #define MC_CMD_DBIWROP_TYPEDEF_PARMS_LBN 32
  1498. #define MC_CMD_DBIWROP_TYPEDEF_PARMS_WIDTH 32
  1499. #define MC_CMD_DBIWROP_TYPEDEF_VALUE_OFST 8
  1500. #define MC_CMD_DBIWROP_TYPEDEF_VALUE_LBN 64
  1501. #define MC_CMD_DBIWROP_TYPEDEF_VALUE_WIDTH 32
  1502. /***********************************/
  1503. /* MC_CMD_PORT_READ32
  1504. * Read a 32-bit register from the indirect port register map. The port to
  1505. * access is implied by the Shared memory channel used.
  1506. */
  1507. #define MC_CMD_PORT_READ32 0x14
  1508. /* MC_CMD_PORT_READ32_IN msgrequest */
  1509. #define MC_CMD_PORT_READ32_IN_LEN 4
  1510. /* Address */
  1511. #define MC_CMD_PORT_READ32_IN_ADDR_OFST 0
  1512. /* MC_CMD_PORT_READ32_OUT msgresponse */
  1513. #define MC_CMD_PORT_READ32_OUT_LEN 8
  1514. /* Value */
  1515. #define MC_CMD_PORT_READ32_OUT_VALUE_OFST 0
  1516. /* Status */
  1517. #define MC_CMD_PORT_READ32_OUT_STATUS_OFST 4
  1518. /***********************************/
  1519. /* MC_CMD_PORT_WRITE32
  1520. * Write a 32-bit register to the indirect port register map. The port to
  1521. * access is implied by the Shared memory channel used.
  1522. */
  1523. #define MC_CMD_PORT_WRITE32 0x15
  1524. /* MC_CMD_PORT_WRITE32_IN msgrequest */
  1525. #define MC_CMD_PORT_WRITE32_IN_LEN 8
  1526. /* Address */
  1527. #define MC_CMD_PORT_WRITE32_IN_ADDR_OFST 0
  1528. /* Value */
  1529. #define MC_CMD_PORT_WRITE32_IN_VALUE_OFST 4
  1530. /* MC_CMD_PORT_WRITE32_OUT msgresponse */
  1531. #define MC_CMD_PORT_WRITE32_OUT_LEN 4
  1532. /* Status */
  1533. #define MC_CMD_PORT_WRITE32_OUT_STATUS_OFST 0
  1534. /***********************************/
  1535. /* MC_CMD_PORT_READ128
  1536. * Read a 128-bit register from the indirect port register map. The port to
  1537. * access is implied by the Shared memory channel used.
  1538. */
  1539. #define MC_CMD_PORT_READ128 0x16
  1540. /* MC_CMD_PORT_READ128_IN msgrequest */
  1541. #define MC_CMD_PORT_READ128_IN_LEN 4
  1542. /* Address */
  1543. #define MC_CMD_PORT_READ128_IN_ADDR_OFST 0
  1544. /* MC_CMD_PORT_READ128_OUT msgresponse */
  1545. #define MC_CMD_PORT_READ128_OUT_LEN 20
  1546. /* Value */
  1547. #define MC_CMD_PORT_READ128_OUT_VALUE_OFST 0
  1548. #define MC_CMD_PORT_READ128_OUT_VALUE_LEN 16
  1549. /* Status */
  1550. #define MC_CMD_PORT_READ128_OUT_STATUS_OFST 16
  1551. /***********************************/
  1552. /* MC_CMD_PORT_WRITE128
  1553. * Write a 128-bit register to the indirect port register map. The port to
  1554. * access is implied by the Shared memory channel used.
  1555. */
  1556. #define MC_CMD_PORT_WRITE128 0x17
  1557. /* MC_CMD_PORT_WRITE128_IN msgrequest */
  1558. #define MC_CMD_PORT_WRITE128_IN_LEN 20
  1559. /* Address */
  1560. #define MC_CMD_PORT_WRITE128_IN_ADDR_OFST 0
  1561. /* Value */
  1562. #define MC_CMD_PORT_WRITE128_IN_VALUE_OFST 4
  1563. #define MC_CMD_PORT_WRITE128_IN_VALUE_LEN 16
  1564. /* MC_CMD_PORT_WRITE128_OUT msgresponse */
  1565. #define MC_CMD_PORT_WRITE128_OUT_LEN 4
  1566. /* Status */
  1567. #define MC_CMD_PORT_WRITE128_OUT_STATUS_OFST 0
  1568. /* MC_CMD_CAPABILITIES structuredef */
  1569. #define MC_CMD_CAPABILITIES_LEN 4
  1570. /* Small buf table. */
  1571. #define MC_CMD_CAPABILITIES_SMALL_BUF_TBL_LBN 0
  1572. #define MC_CMD_CAPABILITIES_SMALL_BUF_TBL_WIDTH 1
  1573. /* Turbo mode (for Maranello). */
  1574. #define MC_CMD_CAPABILITIES_TURBO_LBN 1
  1575. #define MC_CMD_CAPABILITIES_TURBO_WIDTH 1
  1576. /* Turbo mode active (for Maranello). */
  1577. #define MC_CMD_CAPABILITIES_TURBO_ACTIVE_LBN 2
  1578. #define MC_CMD_CAPABILITIES_TURBO_ACTIVE_WIDTH 1
  1579. /* PTP offload. */
  1580. #define MC_CMD_CAPABILITIES_PTP_LBN 3
  1581. #define MC_CMD_CAPABILITIES_PTP_WIDTH 1
  1582. /* AOE mode. */
  1583. #define MC_CMD_CAPABILITIES_AOE_LBN 4
  1584. #define MC_CMD_CAPABILITIES_AOE_WIDTH 1
  1585. /* AOE mode active. */
  1586. #define MC_CMD_CAPABILITIES_AOE_ACTIVE_LBN 5
  1587. #define MC_CMD_CAPABILITIES_AOE_ACTIVE_WIDTH 1
  1588. /* AOE mode active. */
  1589. #define MC_CMD_CAPABILITIES_FC_ACTIVE_LBN 6
  1590. #define MC_CMD_CAPABILITIES_FC_ACTIVE_WIDTH 1
  1591. #define MC_CMD_CAPABILITIES_RESERVED_LBN 7
  1592. #define MC_CMD_CAPABILITIES_RESERVED_WIDTH 25
  1593. /***********************************/
  1594. /* MC_CMD_GET_BOARD_CFG
  1595. * Returns the MC firmware configuration structure.
  1596. */
  1597. #define MC_CMD_GET_BOARD_CFG 0x18
  1598. #define MC_CMD_0x18_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  1599. /* MC_CMD_GET_BOARD_CFG_IN msgrequest */
  1600. #define MC_CMD_GET_BOARD_CFG_IN_LEN 0
  1601. /* MC_CMD_GET_BOARD_CFG_OUT msgresponse */
  1602. #define MC_CMD_GET_BOARD_CFG_OUT_LENMIN 96
  1603. #define MC_CMD_GET_BOARD_CFG_OUT_LENMAX 136
  1604. #define MC_CMD_GET_BOARD_CFG_OUT_LEN(num) (72+2*(num))
  1605. #define MC_CMD_GET_BOARD_CFG_OUT_BOARD_TYPE_OFST 0
  1606. #define MC_CMD_GET_BOARD_CFG_OUT_BOARD_NAME_OFST 4
  1607. #define MC_CMD_GET_BOARD_CFG_OUT_BOARD_NAME_LEN 32
  1608. /* See MC_CMD_CAPABILITIES */
  1609. #define MC_CMD_GET_BOARD_CFG_OUT_CAPABILITIES_PORT0_OFST 36
  1610. /* See MC_CMD_CAPABILITIES */
  1611. #define MC_CMD_GET_BOARD_CFG_OUT_CAPABILITIES_PORT1_OFST 40
  1612. #define MC_CMD_GET_BOARD_CFG_OUT_MAC_ADDR_BASE_PORT0_OFST 44
  1613. #define MC_CMD_GET_BOARD_CFG_OUT_MAC_ADDR_BASE_PORT0_LEN 6
  1614. #define MC_CMD_GET_BOARD_CFG_OUT_MAC_ADDR_BASE_PORT1_OFST 50
  1615. #define MC_CMD_GET_BOARD_CFG_OUT_MAC_ADDR_BASE_PORT1_LEN 6
  1616. #define MC_CMD_GET_BOARD_CFG_OUT_MAC_COUNT_PORT0_OFST 56
  1617. #define MC_CMD_GET_BOARD_CFG_OUT_MAC_COUNT_PORT1_OFST 60
  1618. #define MC_CMD_GET_BOARD_CFG_OUT_MAC_STRIDE_PORT0_OFST 64
  1619. #define MC_CMD_GET_BOARD_CFG_OUT_MAC_STRIDE_PORT1_OFST 68
  1620. /* This field contains a 16-bit value for each of the types of NVRAM area. The
  1621. * values are defined in the firmware/mc/platform/.c file for a specific board
  1622. * type, but otherwise have no meaning to the MC; they are used by the driver
  1623. * to manage selection of appropriate firmware updates.
  1624. */
  1625. #define MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_OFST 72
  1626. #define MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_LEN 2
  1627. #define MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_MINNUM 12
  1628. #define MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_MAXNUM 32
  1629. /***********************************/
  1630. /* MC_CMD_DBI_READX
  1631. * Read DBI register(s) -- extended functionality
  1632. */
  1633. #define MC_CMD_DBI_READX 0x19
  1634. #define MC_CMD_0x19_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  1635. /* MC_CMD_DBI_READX_IN msgrequest */
  1636. #define MC_CMD_DBI_READX_IN_LENMIN 8
  1637. #define MC_CMD_DBI_READX_IN_LENMAX 248
  1638. #define MC_CMD_DBI_READX_IN_LEN(num) (0+8*(num))
  1639. /* Each Read op consists of an address (offset 0), VF/CS2) */
  1640. #define MC_CMD_DBI_READX_IN_DBIRDOP_OFST 0
  1641. #define MC_CMD_DBI_READX_IN_DBIRDOP_LEN 8
  1642. #define MC_CMD_DBI_READX_IN_DBIRDOP_LO_OFST 0
  1643. #define MC_CMD_DBI_READX_IN_DBIRDOP_HI_OFST 4
  1644. #define MC_CMD_DBI_READX_IN_DBIRDOP_MINNUM 1
  1645. #define MC_CMD_DBI_READX_IN_DBIRDOP_MAXNUM 31
  1646. /* MC_CMD_DBI_READX_OUT msgresponse */
  1647. #define MC_CMD_DBI_READX_OUT_LENMIN 4
  1648. #define MC_CMD_DBI_READX_OUT_LENMAX 252
  1649. #define MC_CMD_DBI_READX_OUT_LEN(num) (0+4*(num))
  1650. /* Value */
  1651. #define MC_CMD_DBI_READX_OUT_VALUE_OFST 0
  1652. #define MC_CMD_DBI_READX_OUT_VALUE_LEN 4
  1653. #define MC_CMD_DBI_READX_OUT_VALUE_MINNUM 1
  1654. #define MC_CMD_DBI_READX_OUT_VALUE_MAXNUM 63
  1655. /* MC_CMD_DBIRDOP_TYPEDEF structuredef */
  1656. #define MC_CMD_DBIRDOP_TYPEDEF_LEN 8
  1657. #define MC_CMD_DBIRDOP_TYPEDEF_ADDRESS_OFST 0
  1658. #define MC_CMD_DBIRDOP_TYPEDEF_ADDRESS_LBN 0
  1659. #define MC_CMD_DBIRDOP_TYPEDEF_ADDRESS_WIDTH 32
  1660. #define MC_CMD_DBIRDOP_TYPEDEF_PARMS_OFST 4
  1661. #define MC_CMD_DBIRDOP_TYPEDEF_VF_NUM_LBN 16
  1662. #define MC_CMD_DBIRDOP_TYPEDEF_VF_NUM_WIDTH 16
  1663. #define MC_CMD_DBIRDOP_TYPEDEF_VF_ACTIVE_LBN 15
  1664. #define MC_CMD_DBIRDOP_TYPEDEF_VF_ACTIVE_WIDTH 1
  1665. #define MC_CMD_DBIRDOP_TYPEDEF_CS2_LBN 14
  1666. #define MC_CMD_DBIRDOP_TYPEDEF_CS2_WIDTH 1
  1667. #define MC_CMD_DBIRDOP_TYPEDEF_PARMS_LBN 32
  1668. #define MC_CMD_DBIRDOP_TYPEDEF_PARMS_WIDTH 32
  1669. /***********************************/
  1670. /* MC_CMD_SET_RAND_SEED
  1671. * Set the 16byte seed for the MC pseudo-random generator.
  1672. */
  1673. #define MC_CMD_SET_RAND_SEED 0x1a
  1674. #define MC_CMD_0x1a_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  1675. /* MC_CMD_SET_RAND_SEED_IN msgrequest */
  1676. #define MC_CMD_SET_RAND_SEED_IN_LEN 16
  1677. /* Seed value. */
  1678. #define MC_CMD_SET_RAND_SEED_IN_SEED_OFST 0
  1679. #define MC_CMD_SET_RAND_SEED_IN_SEED_LEN 16
  1680. /* MC_CMD_SET_RAND_SEED_OUT msgresponse */
  1681. #define MC_CMD_SET_RAND_SEED_OUT_LEN 0
  1682. /***********************************/
  1683. /* MC_CMD_LTSSM_HIST
  1684. * Retrieve the history of the LTSSM, if the build supports it.
  1685. */
  1686. #define MC_CMD_LTSSM_HIST 0x1b
  1687. /* MC_CMD_LTSSM_HIST_IN msgrequest */
  1688. #define MC_CMD_LTSSM_HIST_IN_LEN 0
  1689. /* MC_CMD_LTSSM_HIST_OUT msgresponse */
  1690. #define MC_CMD_LTSSM_HIST_OUT_LENMIN 0
  1691. #define MC_CMD_LTSSM_HIST_OUT_LENMAX 252
  1692. #define MC_CMD_LTSSM_HIST_OUT_LEN(num) (0+4*(num))
  1693. /* variable number of LTSSM values, as bytes. The history is read-to-clear. */
  1694. #define MC_CMD_LTSSM_HIST_OUT_DATA_OFST 0
  1695. #define MC_CMD_LTSSM_HIST_OUT_DATA_LEN 4
  1696. #define MC_CMD_LTSSM_HIST_OUT_DATA_MINNUM 0
  1697. #define MC_CMD_LTSSM_HIST_OUT_DATA_MAXNUM 63
  1698. /***********************************/
  1699. /* MC_CMD_DRV_ATTACH
  1700. * Inform MCPU that this port is managed on the host (i.e. driver active). For
  1701. * Huntington, also request the preferred datapath firmware to use if possible
  1702. * (it may not be possible for this request to be fulfilled; the driver must
  1703. * issue a subsequent MC_CMD_GET_CAPABILITIES command to determine which
  1704. * features are actually available). The FIRMWARE_ID field is ignored by older
  1705. * platforms.
  1706. */
  1707. #define MC_CMD_DRV_ATTACH 0x1c
  1708. #define MC_CMD_0x1c_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  1709. /* MC_CMD_DRV_ATTACH_IN msgrequest */
  1710. #define MC_CMD_DRV_ATTACH_IN_LEN 12
  1711. /* new state (0=detached, 1=attached) to set if UPDATE=1 */
  1712. #define MC_CMD_DRV_ATTACH_IN_NEW_STATE_OFST 0
  1713. /* 1 to set new state, or 0 to just report the existing state */
  1714. #define MC_CMD_DRV_ATTACH_IN_UPDATE_OFST 4
  1715. /* preferred datapath firmware (for Huntington; ignored for Siena) */
  1716. #define MC_CMD_DRV_ATTACH_IN_FIRMWARE_ID_OFST 8
  1717. /* enum: Prefer to use full featured firmware */
  1718. #define MC_CMD_FW_FULL_FEATURED 0x0
  1719. /* enum: Prefer to use firmware with fewer features but lower latency */
  1720. #define MC_CMD_FW_LOW_LATENCY 0x1
  1721. /* enum: Only this option is allowed for non-admin functions */
  1722. #define MC_CMD_FW_DONT_CARE 0xffffffff
  1723. /* MC_CMD_DRV_ATTACH_OUT msgresponse */
  1724. #define MC_CMD_DRV_ATTACH_OUT_LEN 4
  1725. /* previous or existing state (0=detached, 1=attached) */
  1726. #define MC_CMD_DRV_ATTACH_OUT_OLD_STATE_OFST 0
  1727. /* MC_CMD_DRV_ATTACH_EXT_OUT msgresponse */
  1728. #define MC_CMD_DRV_ATTACH_EXT_OUT_LEN 8
  1729. /* previous or existing state (0=detached, 1=attached) */
  1730. #define MC_CMD_DRV_ATTACH_EXT_OUT_OLD_STATE_OFST 0
  1731. /* Flags associated with this function */
  1732. #define MC_CMD_DRV_ATTACH_EXT_OUT_FUNC_FLAGS_OFST 4
  1733. /* enum: Labels the lowest-numbered function visible to the OS */
  1734. #define MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_PRIMARY 0x0
  1735. /* enum: The function can control the link state of the physical port it is
  1736. * bound to.
  1737. */
  1738. #define MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_LINKCTRL 0x1
  1739. /* enum: The function can perform privileged operations */
  1740. #define MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_TRUSTED 0x2
  1741. /***********************************/
  1742. /* MC_CMD_SHMUART
  1743. * Route UART output to circular buffer in shared memory instead.
  1744. */
  1745. #define MC_CMD_SHMUART 0x1f
  1746. /* MC_CMD_SHMUART_IN msgrequest */
  1747. #define MC_CMD_SHMUART_IN_LEN 4
  1748. /* ??? */
  1749. #define MC_CMD_SHMUART_IN_FLAG_OFST 0
  1750. /* MC_CMD_SHMUART_OUT msgresponse */
  1751. #define MC_CMD_SHMUART_OUT_LEN 0
  1752. /***********************************/
  1753. /* MC_CMD_PORT_RESET
  1754. * Generic per-port reset. There is no equivalent for per-board reset. Locks
  1755. * required: None; Return code: 0, ETIME. NOTE: This command is deprecated -
  1756. * use MC_CMD_ENTITY_RESET instead.
  1757. */
  1758. #define MC_CMD_PORT_RESET 0x20
  1759. #define MC_CMD_0x20_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  1760. /* MC_CMD_PORT_RESET_IN msgrequest */
  1761. #define MC_CMD_PORT_RESET_IN_LEN 0
  1762. /* MC_CMD_PORT_RESET_OUT msgresponse */
  1763. #define MC_CMD_PORT_RESET_OUT_LEN 0
  1764. /***********************************/
  1765. /* MC_CMD_ENTITY_RESET
  1766. * Generic per-resource reset. There is no equivalent for per-board reset.
  1767. * Locks required: None; Return code: 0, ETIME. NOTE: This command is an
  1768. * extended version of the deprecated MC_CMD_PORT_RESET with added fields.
  1769. */
  1770. #define MC_CMD_ENTITY_RESET 0x20
  1771. /* MC_CMD_0x20_PRIVILEGE_CTG SRIOV_CTG_GENERAL */
  1772. /* MC_CMD_ENTITY_RESET_IN msgrequest */
  1773. #define MC_CMD_ENTITY_RESET_IN_LEN 4
  1774. /* Optional flags field. Omitting this will perform a "legacy" reset action
  1775. * (TBD).
  1776. */
  1777. #define MC_CMD_ENTITY_RESET_IN_FLAG_OFST 0
  1778. #define MC_CMD_ENTITY_RESET_IN_FUNCTION_RESOURCE_RESET_LBN 0
  1779. #define MC_CMD_ENTITY_RESET_IN_FUNCTION_RESOURCE_RESET_WIDTH 1
  1780. /* MC_CMD_ENTITY_RESET_OUT msgresponse */
  1781. #define MC_CMD_ENTITY_RESET_OUT_LEN 0
  1782. /***********************************/
  1783. /* MC_CMD_PCIE_CREDITS
  1784. * Read instantaneous and minimum flow control thresholds.
  1785. */
  1786. #define MC_CMD_PCIE_CREDITS 0x21
  1787. /* MC_CMD_PCIE_CREDITS_IN msgrequest */
  1788. #define MC_CMD_PCIE_CREDITS_IN_LEN 8
  1789. /* poll period. 0 is disabled */
  1790. #define MC_CMD_PCIE_CREDITS_IN_POLL_PERIOD_OFST 0
  1791. /* wipe statistics */
  1792. #define MC_CMD_PCIE_CREDITS_IN_WIPE_OFST 4
  1793. /* MC_CMD_PCIE_CREDITS_OUT msgresponse */
  1794. #define MC_CMD_PCIE_CREDITS_OUT_LEN 16
  1795. #define MC_CMD_PCIE_CREDITS_OUT_CURRENT_P_HDR_OFST 0
  1796. #define MC_CMD_PCIE_CREDITS_OUT_CURRENT_P_HDR_LEN 2
  1797. #define MC_CMD_PCIE_CREDITS_OUT_CURRENT_P_DATA_OFST 2
  1798. #define MC_CMD_PCIE_CREDITS_OUT_CURRENT_P_DATA_LEN 2
  1799. #define MC_CMD_PCIE_CREDITS_OUT_CURRENT_NP_HDR_OFST 4
  1800. #define MC_CMD_PCIE_CREDITS_OUT_CURRENT_NP_HDR_LEN 2
  1801. #define MC_CMD_PCIE_CREDITS_OUT_CURRENT_NP_DATA_OFST 6
  1802. #define MC_CMD_PCIE_CREDITS_OUT_CURRENT_NP_DATA_LEN 2
  1803. #define MC_CMD_PCIE_CREDITS_OUT_MINIMUM_P_HDR_OFST 8
  1804. #define MC_CMD_PCIE_CREDITS_OUT_MINIMUM_P_HDR_LEN 2
  1805. #define MC_CMD_PCIE_CREDITS_OUT_MINIMUM_P_DATA_OFST 10
  1806. #define MC_CMD_PCIE_CREDITS_OUT_MINIMUM_P_DATA_LEN 2
  1807. #define MC_CMD_PCIE_CREDITS_OUT_MINIMUM_NP_HDR_OFST 12
  1808. #define MC_CMD_PCIE_CREDITS_OUT_MINIMUM_NP_HDR_LEN 2
  1809. #define MC_CMD_PCIE_CREDITS_OUT_MINIMUM_NP_DATA_OFST 14
  1810. #define MC_CMD_PCIE_CREDITS_OUT_MINIMUM_NP_DATA_LEN 2
  1811. /***********************************/
  1812. /* MC_CMD_RXD_MONITOR
  1813. * Get histogram of RX queue fill level.
  1814. */
  1815. #define MC_CMD_RXD_MONITOR 0x22
  1816. /* MC_CMD_RXD_MONITOR_IN msgrequest */
  1817. #define MC_CMD_RXD_MONITOR_IN_LEN 12
  1818. #define MC_CMD_RXD_MONITOR_IN_QID_OFST 0
  1819. #define MC_CMD_RXD_MONITOR_IN_POLL_PERIOD_OFST 4
  1820. #define MC_CMD_RXD_MONITOR_IN_WIPE_OFST 8
  1821. /* MC_CMD_RXD_MONITOR_OUT msgresponse */
  1822. #define MC_CMD_RXD_MONITOR_OUT_LEN 80
  1823. #define MC_CMD_RXD_MONITOR_OUT_QID_OFST 0
  1824. #define MC_CMD_RXD_MONITOR_OUT_RING_FILL_OFST 4
  1825. #define MC_CMD_RXD_MONITOR_OUT_CACHE_FILL_OFST 8
  1826. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_1_OFST 12
  1827. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_2_OFST 16
  1828. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_4_OFST 20
  1829. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_8_OFST 24
  1830. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_16_OFST 28
  1831. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_32_OFST 32
  1832. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_64_OFST 36
  1833. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_128_OFST 40
  1834. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_256_OFST 44
  1835. #define MC_CMD_RXD_MONITOR_OUT_RING_GE_256_OFST 48
  1836. #define MC_CMD_RXD_MONITOR_OUT_CACHE_LT_1_OFST 52
  1837. #define MC_CMD_RXD_MONITOR_OUT_CACHE_LT_2_OFST 56
  1838. #define MC_CMD_RXD_MONITOR_OUT_CACHE_LT_4_OFST 60
  1839. #define MC_CMD_RXD_MONITOR_OUT_CACHE_LT_8_OFST 64
  1840. #define MC_CMD_RXD_MONITOR_OUT_CACHE_LT_16_OFST 68
  1841. #define MC_CMD_RXD_MONITOR_OUT_CACHE_LT_32_OFST 72
  1842. #define MC_CMD_RXD_MONITOR_OUT_CACHE_GE_32_OFST 76
  1843. /***********************************/
  1844. /* MC_CMD_PUTS
  1845. * Copy the given ASCII string out onto UART and/or out of the network port.
  1846. */
  1847. #define MC_CMD_PUTS 0x23
  1848. #define MC_CMD_0x23_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  1849. /* MC_CMD_PUTS_IN msgrequest */
  1850. #define MC_CMD_PUTS_IN_LENMIN 13
  1851. #define MC_CMD_PUTS_IN_LENMAX 252
  1852. #define MC_CMD_PUTS_IN_LEN(num) (12+1*(num))
  1853. #define MC_CMD_PUTS_IN_DEST_OFST 0
  1854. #define MC_CMD_PUTS_IN_UART_LBN 0
  1855. #define MC_CMD_PUTS_IN_UART_WIDTH 1
  1856. #define MC_CMD_PUTS_IN_PORT_LBN 1
  1857. #define MC_CMD_PUTS_IN_PORT_WIDTH 1
  1858. #define MC_CMD_PUTS_IN_DHOST_OFST 4
  1859. #define MC_CMD_PUTS_IN_DHOST_LEN 6
  1860. #define MC_CMD_PUTS_IN_STRING_OFST 12
  1861. #define MC_CMD_PUTS_IN_STRING_LEN 1
  1862. #define MC_CMD_PUTS_IN_STRING_MINNUM 1
  1863. #define MC_CMD_PUTS_IN_STRING_MAXNUM 240
  1864. /* MC_CMD_PUTS_OUT msgresponse */
  1865. #define MC_CMD_PUTS_OUT_LEN 0
  1866. /***********************************/
  1867. /* MC_CMD_GET_PHY_CFG
  1868. * Report PHY configuration. This guarantees to succeed even if the PHY is in a
  1869. * 'zombie' state. Locks required: None
  1870. */
  1871. #define MC_CMD_GET_PHY_CFG 0x24
  1872. #define MC_CMD_0x24_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  1873. /* MC_CMD_GET_PHY_CFG_IN msgrequest */
  1874. #define MC_CMD_GET_PHY_CFG_IN_LEN 0
  1875. /* MC_CMD_GET_PHY_CFG_OUT msgresponse */
  1876. #define MC_CMD_GET_PHY_CFG_OUT_LEN 72
  1877. /* flags */
  1878. #define MC_CMD_GET_PHY_CFG_OUT_FLAGS_OFST 0
  1879. #define MC_CMD_GET_PHY_CFG_OUT_PRESENT_LBN 0
  1880. #define MC_CMD_GET_PHY_CFG_OUT_PRESENT_WIDTH 1
  1881. #define MC_CMD_GET_PHY_CFG_OUT_BIST_CABLE_SHORT_LBN 1
  1882. #define MC_CMD_GET_PHY_CFG_OUT_BIST_CABLE_SHORT_WIDTH 1
  1883. #define MC_CMD_GET_PHY_CFG_OUT_BIST_CABLE_LONG_LBN 2
  1884. #define MC_CMD_GET_PHY_CFG_OUT_BIST_CABLE_LONG_WIDTH 1
  1885. #define MC_CMD_GET_PHY_CFG_OUT_LOWPOWER_LBN 3
  1886. #define MC_CMD_GET_PHY_CFG_OUT_LOWPOWER_WIDTH 1
  1887. #define MC_CMD_GET_PHY_CFG_OUT_POWEROFF_LBN 4
  1888. #define MC_CMD_GET_PHY_CFG_OUT_POWEROFF_WIDTH 1
  1889. #define MC_CMD_GET_PHY_CFG_OUT_TXDIS_LBN 5
  1890. #define MC_CMD_GET_PHY_CFG_OUT_TXDIS_WIDTH 1
  1891. #define MC_CMD_GET_PHY_CFG_OUT_BIST_LBN 6
  1892. #define MC_CMD_GET_PHY_CFG_OUT_BIST_WIDTH 1
  1893. /* ?? */
  1894. #define MC_CMD_GET_PHY_CFG_OUT_TYPE_OFST 4
  1895. /* Bitmask of supported capabilities */
  1896. #define MC_CMD_GET_PHY_CFG_OUT_SUPPORTED_CAP_OFST 8
  1897. #define MC_CMD_PHY_CAP_10HDX_LBN 1
  1898. #define MC_CMD_PHY_CAP_10HDX_WIDTH 1
  1899. #define MC_CMD_PHY_CAP_10FDX_LBN 2
  1900. #define MC_CMD_PHY_CAP_10FDX_WIDTH 1
  1901. #define MC_CMD_PHY_CAP_100HDX_LBN 3
  1902. #define MC_CMD_PHY_CAP_100HDX_WIDTH 1
  1903. #define MC_CMD_PHY_CAP_100FDX_LBN 4
  1904. #define MC_CMD_PHY_CAP_100FDX_WIDTH 1
  1905. #define MC_CMD_PHY_CAP_1000HDX_LBN 5
  1906. #define MC_CMD_PHY_CAP_1000HDX_WIDTH 1
  1907. #define MC_CMD_PHY_CAP_1000FDX_LBN 6
  1908. #define MC_CMD_PHY_CAP_1000FDX_WIDTH 1
  1909. #define MC_CMD_PHY_CAP_10000FDX_LBN 7
  1910. #define MC_CMD_PHY_CAP_10000FDX_WIDTH 1
  1911. #define MC_CMD_PHY_CAP_PAUSE_LBN 8
  1912. #define MC_CMD_PHY_CAP_PAUSE_WIDTH 1
  1913. #define MC_CMD_PHY_CAP_ASYM_LBN 9
  1914. #define MC_CMD_PHY_CAP_ASYM_WIDTH 1
  1915. #define MC_CMD_PHY_CAP_AN_LBN 10
  1916. #define MC_CMD_PHY_CAP_AN_WIDTH 1
  1917. #define MC_CMD_PHY_CAP_40000FDX_LBN 11
  1918. #define MC_CMD_PHY_CAP_40000FDX_WIDTH 1
  1919. #define MC_CMD_PHY_CAP_DDM_LBN 12
  1920. #define MC_CMD_PHY_CAP_DDM_WIDTH 1
  1921. /* ?? */
  1922. #define MC_CMD_GET_PHY_CFG_OUT_CHANNEL_OFST 12
  1923. /* ?? */
  1924. #define MC_CMD_GET_PHY_CFG_OUT_PRT_OFST 16
  1925. /* ?? */
  1926. #define MC_CMD_GET_PHY_CFG_OUT_STATS_MASK_OFST 20
  1927. /* ?? */
  1928. #define MC_CMD_GET_PHY_CFG_OUT_NAME_OFST 24
  1929. #define MC_CMD_GET_PHY_CFG_OUT_NAME_LEN 20
  1930. /* ?? */
  1931. #define MC_CMD_GET_PHY_CFG_OUT_MEDIA_TYPE_OFST 44
  1932. /* enum: Xaui. */
  1933. #define MC_CMD_MEDIA_XAUI 0x1
  1934. /* enum: CX4. */
  1935. #define MC_CMD_MEDIA_CX4 0x2
  1936. /* enum: KX4. */
  1937. #define MC_CMD_MEDIA_KX4 0x3
  1938. /* enum: XFP Far. */
  1939. #define MC_CMD_MEDIA_XFP 0x4
  1940. /* enum: SFP+. */
  1941. #define MC_CMD_MEDIA_SFP_PLUS 0x5
  1942. /* enum: 10GBaseT. */
  1943. #define MC_CMD_MEDIA_BASE_T 0x6
  1944. /* enum: QSFP+. */
  1945. #define MC_CMD_MEDIA_QSFP_PLUS 0x7
  1946. #define MC_CMD_GET_PHY_CFG_OUT_MMD_MASK_OFST 48
  1947. /* enum: Native clause 22 */
  1948. #define MC_CMD_MMD_CLAUSE22 0x0
  1949. #define MC_CMD_MMD_CLAUSE45_PMAPMD 0x1 /* enum */
  1950. #define MC_CMD_MMD_CLAUSE45_WIS 0x2 /* enum */
  1951. #define MC_CMD_MMD_CLAUSE45_PCS 0x3 /* enum */
  1952. #define MC_CMD_MMD_CLAUSE45_PHYXS 0x4 /* enum */
  1953. #define MC_CMD_MMD_CLAUSE45_DTEXS 0x5 /* enum */
  1954. #define MC_CMD_MMD_CLAUSE45_TC 0x6 /* enum */
  1955. #define MC_CMD_MMD_CLAUSE45_AN 0x7 /* enum */
  1956. /* enum: Clause22 proxied over clause45 by PHY. */
  1957. #define MC_CMD_MMD_CLAUSE45_C22EXT 0x1d
  1958. #define MC_CMD_MMD_CLAUSE45_VEND1 0x1e /* enum */
  1959. #define MC_CMD_MMD_CLAUSE45_VEND2 0x1f /* enum */
  1960. #define MC_CMD_GET_PHY_CFG_OUT_REVISION_OFST 52
  1961. #define MC_CMD_GET_PHY_CFG_OUT_REVISION_LEN 20
  1962. /***********************************/
  1963. /* MC_CMD_START_BIST
  1964. * Start a BIST test on the PHY. Locks required: PHY_LOCK if doing a PHY BIST
  1965. * Return code: 0, EINVAL, EACCES (if PHY_LOCK is not held)
  1966. */
  1967. #define MC_CMD_START_BIST 0x25
  1968. #define MC_CMD_0x25_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  1969. /* MC_CMD_START_BIST_IN msgrequest */
  1970. #define MC_CMD_START_BIST_IN_LEN 4
  1971. /* Type of test. */
  1972. #define MC_CMD_START_BIST_IN_TYPE_OFST 0
  1973. /* enum: Run the PHY's short cable BIST. */
  1974. #define MC_CMD_PHY_BIST_CABLE_SHORT 0x1
  1975. /* enum: Run the PHY's long cable BIST. */
  1976. #define MC_CMD_PHY_BIST_CABLE_LONG 0x2
  1977. /* enum: Run BIST on the currently selected BPX Serdes (XAUI or XFI) . */
  1978. #define MC_CMD_BPX_SERDES_BIST 0x3
  1979. /* enum: Run the MC loopback tests. */
  1980. #define MC_CMD_MC_LOOPBACK_BIST 0x4
  1981. /* enum: Run the PHY's standard BIST. */
  1982. #define MC_CMD_PHY_BIST 0x5
  1983. /* enum: Run MC RAM test. */
  1984. #define MC_CMD_MC_MEM_BIST 0x6
  1985. /* enum: Run Port RAM test. */
  1986. #define MC_CMD_PORT_MEM_BIST 0x7
  1987. /* enum: Run register test. */
  1988. #define MC_CMD_REG_BIST 0x8
  1989. /* MC_CMD_START_BIST_OUT msgresponse */
  1990. #define MC_CMD_START_BIST_OUT_LEN 0
  1991. /***********************************/
  1992. /* MC_CMD_POLL_BIST
  1993. * Poll for BIST completion. Returns a single status code, and optionally some
  1994. * PHY specific bist output. The driver should only consume the BIST output
  1995. * after validating OUTLEN and MC_CMD_GET_PHY_CFG.TYPE. If a driver can't
  1996. * successfully parse the BIST output, it should still respect the pass/Fail in
  1997. * OUT.RESULT. Locks required: PHY_LOCK if doing a PHY BIST. Return code: 0,
  1998. * EACCES (if PHY_LOCK is not held).
  1999. */
  2000. #define MC_CMD_POLL_BIST 0x26
  2001. #define MC_CMD_0x26_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  2002. /* MC_CMD_POLL_BIST_IN msgrequest */
  2003. #define MC_CMD_POLL_BIST_IN_LEN 0
  2004. /* MC_CMD_POLL_BIST_OUT msgresponse */
  2005. #define MC_CMD_POLL_BIST_OUT_LEN 8
  2006. /* result */
  2007. #define MC_CMD_POLL_BIST_OUT_RESULT_OFST 0
  2008. /* enum: Running. */
  2009. #define MC_CMD_POLL_BIST_RUNNING 0x1
  2010. /* enum: Passed. */
  2011. #define MC_CMD_POLL_BIST_PASSED 0x2
  2012. /* enum: Failed. */
  2013. #define MC_CMD_POLL_BIST_FAILED 0x3
  2014. /* enum: Timed-out. */
  2015. #define MC_CMD_POLL_BIST_TIMEOUT 0x4
  2016. #define MC_CMD_POLL_BIST_OUT_PRIVATE_OFST 4
  2017. /* MC_CMD_POLL_BIST_OUT_SFT9001 msgresponse */
  2018. #define MC_CMD_POLL_BIST_OUT_SFT9001_LEN 36
  2019. /* result */
  2020. /* MC_CMD_POLL_BIST_OUT_RESULT_OFST 0 */
  2021. /* Enum values, see field(s): */
  2022. /* MC_CMD_POLL_BIST_OUT/MC_CMD_POLL_BIST_OUT_RESULT */
  2023. #define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_LENGTH_A_OFST 4
  2024. #define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_LENGTH_B_OFST 8
  2025. #define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_LENGTH_C_OFST 12
  2026. #define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_LENGTH_D_OFST 16
  2027. /* Status of each channel A */
  2028. #define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_STATUS_A_OFST 20
  2029. /* enum: Ok. */
  2030. #define MC_CMD_POLL_BIST_SFT9001_PAIR_OK 0x1
  2031. /* enum: Open. */
  2032. #define MC_CMD_POLL_BIST_SFT9001_PAIR_OPEN 0x2
  2033. /* enum: Intra-pair short. */
  2034. #define MC_CMD_POLL_BIST_SFT9001_INTRA_PAIR_SHORT 0x3
  2035. /* enum: Inter-pair short. */
  2036. #define MC_CMD_POLL_BIST_SFT9001_INTER_PAIR_SHORT 0x4
  2037. /* enum: Busy. */
  2038. #define MC_CMD_POLL_BIST_SFT9001_PAIR_BUSY 0x9
  2039. /* Status of each channel B */
  2040. #define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_STATUS_B_OFST 24
  2041. /* Enum values, see field(s): */
  2042. /* CABLE_STATUS_A */
  2043. /* Status of each channel C */
  2044. #define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_STATUS_C_OFST 28
  2045. /* Enum values, see field(s): */
  2046. /* CABLE_STATUS_A */
  2047. /* Status of each channel D */
  2048. #define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_STATUS_D_OFST 32
  2049. /* Enum values, see field(s): */
  2050. /* CABLE_STATUS_A */
  2051. /* MC_CMD_POLL_BIST_OUT_MRSFP msgresponse */
  2052. #define MC_CMD_POLL_BIST_OUT_MRSFP_LEN 8
  2053. /* result */
  2054. /* MC_CMD_POLL_BIST_OUT_RESULT_OFST 0 */
  2055. /* Enum values, see field(s): */
  2056. /* MC_CMD_POLL_BIST_OUT/MC_CMD_POLL_BIST_OUT_RESULT */
  2057. #define MC_CMD_POLL_BIST_OUT_MRSFP_TEST_OFST 4
  2058. /* enum: Complete. */
  2059. #define MC_CMD_POLL_BIST_MRSFP_TEST_COMPLETE 0x0
  2060. /* enum: Bus switch off I2C write. */
  2061. #define MC_CMD_POLL_BIST_MRSFP_TEST_BUS_SWITCH_OFF_I2C_WRITE 0x1
  2062. /* enum: Bus switch off I2C no access IO exp. */
  2063. #define MC_CMD_POLL_BIST_MRSFP_TEST_BUS_SWITCH_OFF_I2C_NO_ACCESS_IO_EXP 0x2
  2064. /* enum: Bus switch off I2C no access module. */
  2065. #define MC_CMD_POLL_BIST_MRSFP_TEST_BUS_SWITCH_OFF_I2C_NO_ACCESS_MODULE 0x3
  2066. /* enum: IO exp I2C configure. */
  2067. #define MC_CMD_POLL_BIST_MRSFP_TEST_IO_EXP_I2C_CONFIGURE 0x4
  2068. /* enum: Bus switch I2C no cross talk. */
  2069. #define MC_CMD_POLL_BIST_MRSFP_TEST_BUS_SWITCH_I2C_NO_CROSSTALK 0x5
  2070. /* enum: Module presence. */
  2071. #define MC_CMD_POLL_BIST_MRSFP_TEST_MODULE_PRESENCE 0x6
  2072. /* enum: Module ID I2C access. */
  2073. #define MC_CMD_POLL_BIST_MRSFP_TEST_MODULE_ID_I2C_ACCESS 0x7
  2074. /* enum: Module ID sane value. */
  2075. #define MC_CMD_POLL_BIST_MRSFP_TEST_MODULE_ID_SANE_VALUE 0x8
  2076. /* MC_CMD_POLL_BIST_OUT_MEM msgresponse */
  2077. #define MC_CMD_POLL_BIST_OUT_MEM_LEN 36
  2078. /* result */
  2079. /* MC_CMD_POLL_BIST_OUT_RESULT_OFST 0 */
  2080. /* Enum values, see field(s): */
  2081. /* MC_CMD_POLL_BIST_OUT/MC_CMD_POLL_BIST_OUT_RESULT */
  2082. #define MC_CMD_POLL_BIST_OUT_MEM_TEST_OFST 4
  2083. /* enum: Test has completed. */
  2084. #define MC_CMD_POLL_BIST_MEM_COMPLETE 0x0
  2085. /* enum: RAM test - walk ones. */
  2086. #define MC_CMD_POLL_BIST_MEM_MEM_WALK_ONES 0x1
  2087. /* enum: RAM test - walk zeros. */
  2088. #define MC_CMD_POLL_BIST_MEM_MEM_WALK_ZEROS 0x2
  2089. /* enum: RAM test - walking inversions zeros/ones. */
  2090. #define MC_CMD_POLL_BIST_MEM_MEM_INV_ZERO_ONE 0x3
  2091. /* enum: RAM test - walking inversions checkerboard. */
  2092. #define MC_CMD_POLL_BIST_MEM_MEM_INV_CHKBOARD 0x4
  2093. /* enum: Register test - set / clear individual bits. */
  2094. #define MC_CMD_POLL_BIST_MEM_REG 0x5
  2095. /* enum: ECC error detected. */
  2096. #define MC_CMD_POLL_BIST_MEM_ECC 0x6
  2097. /* Failure address, only valid if result is POLL_BIST_FAILED */
  2098. #define MC_CMD_POLL_BIST_OUT_MEM_ADDR_OFST 8
  2099. /* Bus or address space to which the failure address corresponds */
  2100. #define MC_CMD_POLL_BIST_OUT_MEM_BUS_OFST 12
  2101. /* enum: MC MIPS bus. */
  2102. #define MC_CMD_POLL_BIST_MEM_BUS_MC 0x0
  2103. /* enum: CSR IREG bus. */
  2104. #define MC_CMD_POLL_BIST_MEM_BUS_CSR 0x1
  2105. /* enum: RX DPCPU bus. */
  2106. #define MC_CMD_POLL_BIST_MEM_BUS_DPCPU_RX 0x2
  2107. /* enum: TX0 DPCPU bus. */
  2108. #define MC_CMD_POLL_BIST_MEM_BUS_DPCPU_TX0 0x3
  2109. /* enum: TX1 DPCPU bus. */
  2110. #define MC_CMD_POLL_BIST_MEM_BUS_DPCPU_TX1 0x4
  2111. /* enum: RX DICPU bus. */
  2112. #define MC_CMD_POLL_BIST_MEM_BUS_DICPU_RX 0x5
  2113. /* enum: TX DICPU bus. */
  2114. #define MC_CMD_POLL_BIST_MEM_BUS_DICPU_TX 0x6
  2115. /* Pattern written to RAM / register */
  2116. #define MC_CMD_POLL_BIST_OUT_MEM_EXPECT_OFST 16
  2117. /* Actual value read from RAM / register */
  2118. #define MC_CMD_POLL_BIST_OUT_MEM_ACTUAL_OFST 20
  2119. /* ECC error mask */
  2120. #define MC_CMD_POLL_BIST_OUT_MEM_ECC_OFST 24
  2121. /* ECC parity error mask */
  2122. #define MC_CMD_POLL_BIST_OUT_MEM_ECC_PARITY_OFST 28
  2123. /* ECC fatal error mask */
  2124. #define MC_CMD_POLL_BIST_OUT_MEM_ECC_FATAL_OFST 32
  2125. /***********************************/
  2126. /* MC_CMD_FLUSH_RX_QUEUES
  2127. * Flush receive queue(s). If SRIOV is enabled (via MC_CMD_SRIOV), then RXQ
  2128. * flushes should be initiated via this MCDI operation, rather than via
  2129. * directly writing FLUSH_CMD.
  2130. *
  2131. * The flush is completed (either done/fail) asynchronously (after this command
  2132. * returns). The driver must still wait for flush done/failure events as usual.
  2133. */
  2134. #define MC_CMD_FLUSH_RX_QUEUES 0x27
  2135. /* MC_CMD_FLUSH_RX_QUEUES_IN msgrequest */
  2136. #define MC_CMD_FLUSH_RX_QUEUES_IN_LENMIN 4
  2137. #define MC_CMD_FLUSH_RX_QUEUES_IN_LENMAX 252
  2138. #define MC_CMD_FLUSH_RX_QUEUES_IN_LEN(num) (0+4*(num))
  2139. #define MC_CMD_FLUSH_RX_QUEUES_IN_QID_OFST_OFST 0
  2140. #define MC_CMD_FLUSH_RX_QUEUES_IN_QID_OFST_LEN 4
  2141. #define MC_CMD_FLUSH_RX_QUEUES_IN_QID_OFST_MINNUM 1
  2142. #define MC_CMD_FLUSH_RX_QUEUES_IN_QID_OFST_MAXNUM 63
  2143. /* MC_CMD_FLUSH_RX_QUEUES_OUT msgresponse */
  2144. #define MC_CMD_FLUSH_RX_QUEUES_OUT_LEN 0
  2145. /***********************************/
  2146. /* MC_CMD_GET_LOOPBACK_MODES
  2147. * Returns a bitmask of loopback modes available at each speed.
  2148. */
  2149. #define MC_CMD_GET_LOOPBACK_MODES 0x28
  2150. #define MC_CMD_0x28_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  2151. /* MC_CMD_GET_LOOPBACK_MODES_IN msgrequest */
  2152. #define MC_CMD_GET_LOOPBACK_MODES_IN_LEN 0
  2153. /* MC_CMD_GET_LOOPBACK_MODES_OUT msgresponse */
  2154. #define MC_CMD_GET_LOOPBACK_MODES_OUT_LEN 40
  2155. /* Supported loopbacks. */
  2156. #define MC_CMD_GET_LOOPBACK_MODES_OUT_100M_OFST 0
  2157. #define MC_CMD_GET_LOOPBACK_MODES_OUT_100M_LEN 8
  2158. #define MC_CMD_GET_LOOPBACK_MODES_OUT_100M_LO_OFST 0
  2159. #define MC_CMD_GET_LOOPBACK_MODES_OUT_100M_HI_OFST 4
  2160. /* enum: None. */
  2161. #define MC_CMD_LOOPBACK_NONE 0x0
  2162. /* enum: Data. */
  2163. #define MC_CMD_LOOPBACK_DATA 0x1
  2164. /* enum: GMAC. */
  2165. #define MC_CMD_LOOPBACK_GMAC 0x2
  2166. /* enum: XGMII. */
  2167. #define MC_CMD_LOOPBACK_XGMII 0x3
  2168. /* enum: XGXS. */
  2169. #define MC_CMD_LOOPBACK_XGXS 0x4
  2170. /* enum: XAUI. */
  2171. #define MC_CMD_LOOPBACK_XAUI 0x5
  2172. /* enum: GMII. */
  2173. #define MC_CMD_LOOPBACK_GMII 0x6
  2174. /* enum: SGMII. */
  2175. #define MC_CMD_LOOPBACK_SGMII 0x7
  2176. /* enum: XGBR. */
  2177. #define MC_CMD_LOOPBACK_XGBR 0x8
  2178. /* enum: XFI. */
  2179. #define MC_CMD_LOOPBACK_XFI 0x9
  2180. /* enum: XAUI Far. */
  2181. #define MC_CMD_LOOPBACK_XAUI_FAR 0xa
  2182. /* enum: GMII Far. */
  2183. #define MC_CMD_LOOPBACK_GMII_FAR 0xb
  2184. /* enum: SGMII Far. */
  2185. #define MC_CMD_LOOPBACK_SGMII_FAR 0xc
  2186. /* enum: XFI Far. */
  2187. #define MC_CMD_LOOPBACK_XFI_FAR 0xd
  2188. /* enum: GPhy. */
  2189. #define MC_CMD_LOOPBACK_GPHY 0xe
  2190. /* enum: PhyXS. */
  2191. #define MC_CMD_LOOPBACK_PHYXS 0xf
  2192. /* enum: PCS. */
  2193. #define MC_CMD_LOOPBACK_PCS 0x10
  2194. /* enum: PMA-PMD. */
  2195. #define MC_CMD_LOOPBACK_PMAPMD 0x11
  2196. /* enum: Cross-Port. */
  2197. #define MC_CMD_LOOPBACK_XPORT 0x12
  2198. /* enum: XGMII-Wireside. */
  2199. #define MC_CMD_LOOPBACK_XGMII_WS 0x13
  2200. /* enum: XAUI Wireside. */
  2201. #define MC_CMD_LOOPBACK_XAUI_WS 0x14
  2202. /* enum: XAUI Wireside Far. */
  2203. #define MC_CMD_LOOPBACK_XAUI_WS_FAR 0x15
  2204. /* enum: XAUI Wireside near. */
  2205. #define MC_CMD_LOOPBACK_XAUI_WS_NEAR 0x16
  2206. /* enum: GMII Wireside. */
  2207. #define MC_CMD_LOOPBACK_GMII_WS 0x17
  2208. /* enum: XFI Wireside. */
  2209. #define MC_CMD_LOOPBACK_XFI_WS 0x18
  2210. /* enum: XFI Wireside Far. */
  2211. #define MC_CMD_LOOPBACK_XFI_WS_FAR 0x19
  2212. /* enum: PhyXS Wireside. */
  2213. #define MC_CMD_LOOPBACK_PHYXS_WS 0x1a
  2214. /* enum: PMA lanes MAC-Serdes. */
  2215. #define MC_CMD_LOOPBACK_PMA_INT 0x1b
  2216. /* enum: KR Serdes Parallel (Encoder). */
  2217. #define MC_CMD_LOOPBACK_SD_NEAR 0x1c
  2218. /* enum: KR Serdes Serial. */
  2219. #define MC_CMD_LOOPBACK_SD_FAR 0x1d
  2220. /* enum: PMA lanes MAC-Serdes Wireside. */
  2221. #define MC_CMD_LOOPBACK_PMA_INT_WS 0x1e
  2222. /* enum: KR Serdes Parallel Wireside (Full PCS). */
  2223. #define MC_CMD_LOOPBACK_SD_FEP2_WS 0x1f
  2224. /* enum: KR Serdes Parallel Wireside (Sym Aligner to TX). */
  2225. #define MC_CMD_LOOPBACK_SD_FEP1_5_WS 0x20
  2226. /* enum: KR Serdes Parallel Wireside (Deserializer to Serializer). */
  2227. #define MC_CMD_LOOPBACK_SD_FEP_WS 0x21
  2228. /* enum: KR Serdes Serial Wireside. */
  2229. #define MC_CMD_LOOPBACK_SD_FES_WS 0x22
  2230. /* enum: Near side of AOE Siena side port */
  2231. #define MC_CMD_LOOPBACK_AOE_INT_NEAR 0x23
  2232. /* Supported loopbacks. */
  2233. #define MC_CMD_GET_LOOPBACK_MODES_OUT_1G_OFST 8
  2234. #define MC_CMD_GET_LOOPBACK_MODES_OUT_1G_LEN 8
  2235. #define MC_CMD_GET_LOOPBACK_MODES_OUT_1G_LO_OFST 8
  2236. #define MC_CMD_GET_LOOPBACK_MODES_OUT_1G_HI_OFST 12
  2237. /* Enum values, see field(s): */
  2238. /* 100M */
  2239. /* Supported loopbacks. */
  2240. #define MC_CMD_GET_LOOPBACK_MODES_OUT_10G_OFST 16
  2241. #define MC_CMD_GET_LOOPBACK_MODES_OUT_10G_LEN 8
  2242. #define MC_CMD_GET_LOOPBACK_MODES_OUT_10G_LO_OFST 16
  2243. #define MC_CMD_GET_LOOPBACK_MODES_OUT_10G_HI_OFST 20
  2244. /* Enum values, see field(s): */
  2245. /* 100M */
  2246. /* Supported loopbacks. */
  2247. #define MC_CMD_GET_LOOPBACK_MODES_OUT_SUGGESTED_OFST 24
  2248. #define MC_CMD_GET_LOOPBACK_MODES_OUT_SUGGESTED_LEN 8
  2249. #define MC_CMD_GET_LOOPBACK_MODES_OUT_SUGGESTED_LO_OFST 24
  2250. #define MC_CMD_GET_LOOPBACK_MODES_OUT_SUGGESTED_HI_OFST 28
  2251. /* Enum values, see field(s): */
  2252. /* 100M */
  2253. /* Supported loopbacks. */
  2254. #define MC_CMD_GET_LOOPBACK_MODES_OUT_40G_OFST 32
  2255. #define MC_CMD_GET_LOOPBACK_MODES_OUT_40G_LEN 8
  2256. #define MC_CMD_GET_LOOPBACK_MODES_OUT_40G_LO_OFST 32
  2257. #define MC_CMD_GET_LOOPBACK_MODES_OUT_40G_HI_OFST 36
  2258. /* Enum values, see field(s): */
  2259. /* 100M */
  2260. /***********************************/
  2261. /* MC_CMD_GET_LINK
  2262. * Read the unified MAC/PHY link state. Locks required: None Return code: 0,
  2263. * ETIME.
  2264. */
  2265. #define MC_CMD_GET_LINK 0x29
  2266. #define MC_CMD_0x29_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  2267. /* MC_CMD_GET_LINK_IN msgrequest */
  2268. #define MC_CMD_GET_LINK_IN_LEN 0
  2269. /* MC_CMD_GET_LINK_OUT msgresponse */
  2270. #define MC_CMD_GET_LINK_OUT_LEN 28
  2271. /* near-side advertised capabilities */
  2272. #define MC_CMD_GET_LINK_OUT_CAP_OFST 0
  2273. /* link-partner advertised capabilities */
  2274. #define MC_CMD_GET_LINK_OUT_LP_CAP_OFST 4
  2275. /* Autonegotiated speed in mbit/s. The link may still be down even if this
  2276. * reads non-zero.
  2277. */
  2278. #define MC_CMD_GET_LINK_OUT_LINK_SPEED_OFST 8
  2279. /* Current loopback setting. */
  2280. #define MC_CMD_GET_LINK_OUT_LOOPBACK_MODE_OFST 12
  2281. /* Enum values, see field(s): */
  2282. /* MC_CMD_GET_LOOPBACK_MODES/MC_CMD_GET_LOOPBACK_MODES_OUT/100M */
  2283. #define MC_CMD_GET_LINK_OUT_FLAGS_OFST 16
  2284. #define MC_CMD_GET_LINK_OUT_LINK_UP_LBN 0
  2285. #define MC_CMD_GET_LINK_OUT_LINK_UP_WIDTH 1
  2286. #define MC_CMD_GET_LINK_OUT_FULL_DUPLEX_LBN 1
  2287. #define MC_CMD_GET_LINK_OUT_FULL_DUPLEX_WIDTH 1
  2288. #define MC_CMD_GET_LINK_OUT_BPX_LINK_LBN 2
  2289. #define MC_CMD_GET_LINK_OUT_BPX_LINK_WIDTH 1
  2290. #define MC_CMD_GET_LINK_OUT_PHY_LINK_LBN 3
  2291. #define MC_CMD_GET_LINK_OUT_PHY_LINK_WIDTH 1
  2292. #define MC_CMD_GET_LINK_OUT_LINK_FAULT_RX_LBN 6
  2293. #define MC_CMD_GET_LINK_OUT_LINK_FAULT_RX_WIDTH 1
  2294. #define MC_CMD_GET_LINK_OUT_LINK_FAULT_TX_LBN 7
  2295. #define MC_CMD_GET_LINK_OUT_LINK_FAULT_TX_WIDTH 1
  2296. /* This returns the negotiated flow control value. */
  2297. #define MC_CMD_GET_LINK_OUT_FCNTL_OFST 20
  2298. /* enum: Flow control is off. */
  2299. #define MC_CMD_FCNTL_OFF 0x0
  2300. /* enum: Respond to flow control. */
  2301. #define MC_CMD_FCNTL_RESPOND 0x1
  2302. /* enum: Respond to and Issue flow control. */
  2303. #define MC_CMD_FCNTL_BIDIR 0x2
  2304. #define MC_CMD_GET_LINK_OUT_MAC_FAULT_OFST 24
  2305. #define MC_CMD_MAC_FAULT_XGMII_LOCAL_LBN 0
  2306. #define MC_CMD_MAC_FAULT_XGMII_LOCAL_WIDTH 1
  2307. #define MC_CMD_MAC_FAULT_XGMII_REMOTE_LBN 1
  2308. #define MC_CMD_MAC_FAULT_XGMII_REMOTE_WIDTH 1
  2309. #define MC_CMD_MAC_FAULT_SGMII_REMOTE_LBN 2
  2310. #define MC_CMD_MAC_FAULT_SGMII_REMOTE_WIDTH 1
  2311. #define MC_CMD_MAC_FAULT_PENDING_RECONFIG_LBN 3
  2312. #define MC_CMD_MAC_FAULT_PENDING_RECONFIG_WIDTH 1
  2313. /***********************************/
  2314. /* MC_CMD_SET_LINK
  2315. * Write the unified MAC/PHY link configuration. Locks required: None. Return
  2316. * code: 0, EINVAL, ETIME
  2317. */
  2318. #define MC_CMD_SET_LINK 0x2a
  2319. #define MC_CMD_0x2a_PRIVILEGE_CTG SRIOV_CTG_LINK
  2320. /* MC_CMD_SET_LINK_IN msgrequest */
  2321. #define MC_CMD_SET_LINK_IN_LEN 16
  2322. /* ??? */
  2323. #define MC_CMD_SET_LINK_IN_CAP_OFST 0
  2324. /* Flags */
  2325. #define MC_CMD_SET_LINK_IN_FLAGS_OFST 4
  2326. #define MC_CMD_SET_LINK_IN_LOWPOWER_LBN 0
  2327. #define MC_CMD_SET_LINK_IN_LOWPOWER_WIDTH 1
  2328. #define MC_CMD_SET_LINK_IN_POWEROFF_LBN 1
  2329. #define MC_CMD_SET_LINK_IN_POWEROFF_WIDTH 1
  2330. #define MC_CMD_SET_LINK_IN_TXDIS_LBN 2
  2331. #define MC_CMD_SET_LINK_IN_TXDIS_WIDTH 1
  2332. /* Loopback mode. */
  2333. #define MC_CMD_SET_LINK_IN_LOOPBACK_MODE_OFST 8
  2334. /* Enum values, see field(s): */
  2335. /* MC_CMD_GET_LOOPBACK_MODES/MC_CMD_GET_LOOPBACK_MODES_OUT/100M */
  2336. /* A loopback speed of "0" is supported, and means (choose any available
  2337. * speed).
  2338. */
  2339. #define MC_CMD_SET_LINK_IN_LOOPBACK_SPEED_OFST 12
  2340. /* MC_CMD_SET_LINK_OUT msgresponse */
  2341. #define MC_CMD_SET_LINK_OUT_LEN 0
  2342. /***********************************/
  2343. /* MC_CMD_SET_ID_LED
  2344. * Set identification LED state. Locks required: None. Return code: 0, EINVAL
  2345. */
  2346. #define MC_CMD_SET_ID_LED 0x2b
  2347. #define MC_CMD_0x2b_PRIVILEGE_CTG SRIOV_CTG_LINK
  2348. /* MC_CMD_SET_ID_LED_IN msgrequest */
  2349. #define MC_CMD_SET_ID_LED_IN_LEN 4
  2350. /* Set LED state. */
  2351. #define MC_CMD_SET_ID_LED_IN_STATE_OFST 0
  2352. #define MC_CMD_LED_OFF 0x0 /* enum */
  2353. #define MC_CMD_LED_ON 0x1 /* enum */
  2354. #define MC_CMD_LED_DEFAULT 0x2 /* enum */
  2355. /* MC_CMD_SET_ID_LED_OUT msgresponse */
  2356. #define MC_CMD_SET_ID_LED_OUT_LEN 0
  2357. /***********************************/
  2358. /* MC_CMD_SET_MAC
  2359. * Set MAC configuration. Locks required: None. Return code: 0, EINVAL
  2360. */
  2361. #define MC_CMD_SET_MAC 0x2c
  2362. #define MC_CMD_0x2c_PRIVILEGE_CTG SRIOV_CTG_LINK
  2363. /* MC_CMD_SET_MAC_IN msgrequest */
  2364. #define MC_CMD_SET_MAC_IN_LEN 24
  2365. /* The MTU is the MTU programmed directly into the XMAC/GMAC (inclusive of
  2366. * EtherII, VLAN, bug16011 padding).
  2367. */
  2368. #define MC_CMD_SET_MAC_IN_MTU_OFST 0
  2369. #define MC_CMD_SET_MAC_IN_DRAIN_OFST 4
  2370. #define MC_CMD_SET_MAC_IN_ADDR_OFST 8
  2371. #define MC_CMD_SET_MAC_IN_ADDR_LEN 8
  2372. #define MC_CMD_SET_MAC_IN_ADDR_LO_OFST 8
  2373. #define MC_CMD_SET_MAC_IN_ADDR_HI_OFST 12
  2374. #define MC_CMD_SET_MAC_IN_REJECT_OFST 16
  2375. #define MC_CMD_SET_MAC_IN_REJECT_UNCST_LBN 0
  2376. #define MC_CMD_SET_MAC_IN_REJECT_UNCST_WIDTH 1
  2377. #define MC_CMD_SET_MAC_IN_REJECT_BRDCST_LBN 1
  2378. #define MC_CMD_SET_MAC_IN_REJECT_BRDCST_WIDTH 1
  2379. #define MC_CMD_SET_MAC_IN_FCNTL_OFST 20
  2380. /* enum: Flow control is off. */
  2381. /* MC_CMD_FCNTL_OFF 0x0 */
  2382. /* enum: Respond to flow control. */
  2383. /* MC_CMD_FCNTL_RESPOND 0x1 */
  2384. /* enum: Respond to and Issue flow control. */
  2385. /* MC_CMD_FCNTL_BIDIR 0x2 */
  2386. /* enum: Auto neg flow control. */
  2387. #define MC_CMD_FCNTL_AUTO 0x3
  2388. /* MC_CMD_SET_MAC_OUT msgresponse */
  2389. #define MC_CMD_SET_MAC_OUT_LEN 0
  2390. /***********************************/
  2391. /* MC_CMD_PHY_STATS
  2392. * Get generic PHY statistics. This call returns the statistics for a generic
  2393. * PHY in a sparse array (indexed by the enumerate). Each value is represented
  2394. * by a 32bit number. If the DMA_ADDR is 0, then no DMA is performed, and the
  2395. * statistics may be read from the message response. If DMA_ADDR != 0, then the
  2396. * statistics are dmad to that (page-aligned location). Locks required: None.
  2397. * Returns: 0, ETIME
  2398. */
  2399. #define MC_CMD_PHY_STATS 0x2d
  2400. #define MC_CMD_0x2d_PRIVILEGE_CTG SRIOV_CTG_LINK
  2401. /* MC_CMD_PHY_STATS_IN msgrequest */
  2402. #define MC_CMD_PHY_STATS_IN_LEN 8
  2403. /* ??? */
  2404. #define MC_CMD_PHY_STATS_IN_DMA_ADDR_OFST 0
  2405. #define MC_CMD_PHY_STATS_IN_DMA_ADDR_LEN 8
  2406. #define MC_CMD_PHY_STATS_IN_DMA_ADDR_LO_OFST 0
  2407. #define MC_CMD_PHY_STATS_IN_DMA_ADDR_HI_OFST 4
  2408. /* MC_CMD_PHY_STATS_OUT_DMA msgresponse */
  2409. #define MC_CMD_PHY_STATS_OUT_DMA_LEN 0
  2410. /* MC_CMD_PHY_STATS_OUT_NO_DMA msgresponse */
  2411. #define MC_CMD_PHY_STATS_OUT_NO_DMA_LEN (((MC_CMD_PHY_NSTATS*32))>>3)
  2412. #define MC_CMD_PHY_STATS_OUT_NO_DMA_STATISTICS_OFST 0
  2413. #define MC_CMD_PHY_STATS_OUT_NO_DMA_STATISTICS_LEN 4
  2414. #define MC_CMD_PHY_STATS_OUT_NO_DMA_STATISTICS_NUM MC_CMD_PHY_NSTATS
  2415. /* enum: OUI. */
  2416. #define MC_CMD_OUI 0x0
  2417. /* enum: PMA-PMD Link Up. */
  2418. #define MC_CMD_PMA_PMD_LINK_UP 0x1
  2419. /* enum: PMA-PMD RX Fault. */
  2420. #define MC_CMD_PMA_PMD_RX_FAULT 0x2
  2421. /* enum: PMA-PMD TX Fault. */
  2422. #define MC_CMD_PMA_PMD_TX_FAULT 0x3
  2423. /* enum: PMA-PMD Signal */
  2424. #define MC_CMD_PMA_PMD_SIGNAL 0x4
  2425. /* enum: PMA-PMD SNR A. */
  2426. #define MC_CMD_PMA_PMD_SNR_A 0x5
  2427. /* enum: PMA-PMD SNR B. */
  2428. #define MC_CMD_PMA_PMD_SNR_B 0x6
  2429. /* enum: PMA-PMD SNR C. */
  2430. #define MC_CMD_PMA_PMD_SNR_C 0x7
  2431. /* enum: PMA-PMD SNR D. */
  2432. #define MC_CMD_PMA_PMD_SNR_D 0x8
  2433. /* enum: PCS Link Up. */
  2434. #define MC_CMD_PCS_LINK_UP 0x9
  2435. /* enum: PCS RX Fault. */
  2436. #define MC_CMD_PCS_RX_FAULT 0xa
  2437. /* enum: PCS TX Fault. */
  2438. #define MC_CMD_PCS_TX_FAULT 0xb
  2439. /* enum: PCS BER. */
  2440. #define MC_CMD_PCS_BER 0xc
  2441. /* enum: PCS Block Errors. */
  2442. #define MC_CMD_PCS_BLOCK_ERRORS 0xd
  2443. /* enum: PhyXS Link Up. */
  2444. #define MC_CMD_PHYXS_LINK_UP 0xe
  2445. /* enum: PhyXS RX Fault. */
  2446. #define MC_CMD_PHYXS_RX_FAULT 0xf
  2447. /* enum: PhyXS TX Fault. */
  2448. #define MC_CMD_PHYXS_TX_FAULT 0x10
  2449. /* enum: PhyXS Align. */
  2450. #define MC_CMD_PHYXS_ALIGN 0x11
  2451. /* enum: PhyXS Sync. */
  2452. #define MC_CMD_PHYXS_SYNC 0x12
  2453. /* enum: AN link-up. */
  2454. #define MC_CMD_AN_LINK_UP 0x13
  2455. /* enum: AN Complete. */
  2456. #define MC_CMD_AN_COMPLETE 0x14
  2457. /* enum: AN 10GBaseT Status. */
  2458. #define MC_CMD_AN_10GBT_STATUS 0x15
  2459. /* enum: Clause 22 Link-Up. */
  2460. #define MC_CMD_CL22_LINK_UP 0x16
  2461. /* enum: (Last entry) */
  2462. #define MC_CMD_PHY_NSTATS 0x17
  2463. /***********************************/
  2464. /* MC_CMD_MAC_STATS
  2465. * Get generic MAC statistics. This call returns unified statistics maintained
  2466. * by the MC as it switches between the GMAC and XMAC. The MC will write out
  2467. * all supported stats. The driver should zero initialise the buffer to
  2468. * guarantee consistent results. If the DMA_ADDR is 0, then no DMA is
  2469. * performed, and the statistics may be read from the message response. If
  2470. * DMA_ADDR != 0, then the statistics are dmad to that (page-aligned location).
  2471. * Locks required: None. Returns: 0, ETIME
  2472. */
  2473. #define MC_CMD_MAC_STATS 0x2e
  2474. #define MC_CMD_0x2e_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  2475. /* MC_CMD_MAC_STATS_IN msgrequest */
  2476. #define MC_CMD_MAC_STATS_IN_LEN 20
  2477. /* ??? */
  2478. #define MC_CMD_MAC_STATS_IN_DMA_ADDR_OFST 0
  2479. #define MC_CMD_MAC_STATS_IN_DMA_ADDR_LEN 8
  2480. #define MC_CMD_MAC_STATS_IN_DMA_ADDR_LO_OFST 0
  2481. #define MC_CMD_MAC_STATS_IN_DMA_ADDR_HI_OFST 4
  2482. #define MC_CMD_MAC_STATS_IN_CMD_OFST 8
  2483. #define MC_CMD_MAC_STATS_IN_DMA_LBN 0
  2484. #define MC_CMD_MAC_STATS_IN_DMA_WIDTH 1
  2485. #define MC_CMD_MAC_STATS_IN_CLEAR_LBN 1
  2486. #define MC_CMD_MAC_STATS_IN_CLEAR_WIDTH 1
  2487. #define MC_CMD_MAC_STATS_IN_PERIODIC_CHANGE_LBN 2
  2488. #define MC_CMD_MAC_STATS_IN_PERIODIC_CHANGE_WIDTH 1
  2489. #define MC_CMD_MAC_STATS_IN_PERIODIC_ENABLE_LBN 3
  2490. #define MC_CMD_MAC_STATS_IN_PERIODIC_ENABLE_WIDTH 1
  2491. #define MC_CMD_MAC_STATS_IN_PERIODIC_CLEAR_LBN 4
  2492. #define MC_CMD_MAC_STATS_IN_PERIODIC_CLEAR_WIDTH 1
  2493. #define MC_CMD_MAC_STATS_IN_PERIODIC_NOEVENT_LBN 5
  2494. #define MC_CMD_MAC_STATS_IN_PERIODIC_NOEVENT_WIDTH 1
  2495. #define MC_CMD_MAC_STATS_IN_PERIOD_MS_LBN 16
  2496. #define MC_CMD_MAC_STATS_IN_PERIOD_MS_WIDTH 16
  2497. #define MC_CMD_MAC_STATS_IN_DMA_LEN_OFST 12
  2498. /* port id so vadapter stats can be provided */
  2499. #define MC_CMD_MAC_STATS_IN_PORT_ID_OFST 16
  2500. /* MC_CMD_MAC_STATS_OUT_DMA msgresponse */
  2501. #define MC_CMD_MAC_STATS_OUT_DMA_LEN 0
  2502. /* MC_CMD_MAC_STATS_OUT_NO_DMA msgresponse */
  2503. #define MC_CMD_MAC_STATS_OUT_NO_DMA_LEN (((MC_CMD_MAC_NSTATS*64))>>3)
  2504. #define MC_CMD_MAC_STATS_OUT_NO_DMA_STATISTICS_OFST 0
  2505. #define MC_CMD_MAC_STATS_OUT_NO_DMA_STATISTICS_LEN 8
  2506. #define MC_CMD_MAC_STATS_OUT_NO_DMA_STATISTICS_LO_OFST 0
  2507. #define MC_CMD_MAC_STATS_OUT_NO_DMA_STATISTICS_HI_OFST 4
  2508. #define MC_CMD_MAC_STATS_OUT_NO_DMA_STATISTICS_NUM MC_CMD_MAC_NSTATS
  2509. #define MC_CMD_MAC_GENERATION_START 0x0 /* enum */
  2510. #define MC_CMD_MAC_TX_PKTS 0x1 /* enum */
  2511. #define MC_CMD_MAC_TX_PAUSE_PKTS 0x2 /* enum */
  2512. #define MC_CMD_MAC_TX_CONTROL_PKTS 0x3 /* enum */
  2513. #define MC_CMD_MAC_TX_UNICAST_PKTS 0x4 /* enum */
  2514. #define MC_CMD_MAC_TX_MULTICAST_PKTS 0x5 /* enum */
  2515. #define MC_CMD_MAC_TX_BROADCAST_PKTS 0x6 /* enum */
  2516. #define MC_CMD_MAC_TX_BYTES 0x7 /* enum */
  2517. #define MC_CMD_MAC_TX_BAD_BYTES 0x8 /* enum */
  2518. #define MC_CMD_MAC_TX_LT64_PKTS 0x9 /* enum */
  2519. #define MC_CMD_MAC_TX_64_PKTS 0xa /* enum */
  2520. #define MC_CMD_MAC_TX_65_TO_127_PKTS 0xb /* enum */
  2521. #define MC_CMD_MAC_TX_128_TO_255_PKTS 0xc /* enum */
  2522. #define MC_CMD_MAC_TX_256_TO_511_PKTS 0xd /* enum */
  2523. #define MC_CMD_MAC_TX_512_TO_1023_PKTS 0xe /* enum */
  2524. #define MC_CMD_MAC_TX_1024_TO_15XX_PKTS 0xf /* enum */
  2525. #define MC_CMD_MAC_TX_15XX_TO_JUMBO_PKTS 0x10 /* enum */
  2526. #define MC_CMD_MAC_TX_GTJUMBO_PKTS 0x11 /* enum */
  2527. #define MC_CMD_MAC_TX_BAD_FCS_PKTS 0x12 /* enum */
  2528. #define MC_CMD_MAC_TX_SINGLE_COLLISION_PKTS 0x13 /* enum */
  2529. #define MC_CMD_MAC_TX_MULTIPLE_COLLISION_PKTS 0x14 /* enum */
  2530. #define MC_CMD_MAC_TX_EXCESSIVE_COLLISION_PKTS 0x15 /* enum */
  2531. #define MC_CMD_MAC_TX_LATE_COLLISION_PKTS 0x16 /* enum */
  2532. #define MC_CMD_MAC_TX_DEFERRED_PKTS 0x17 /* enum */
  2533. #define MC_CMD_MAC_TX_EXCESSIVE_DEFERRED_PKTS 0x18 /* enum */
  2534. #define MC_CMD_MAC_TX_NON_TCPUDP_PKTS 0x19 /* enum */
  2535. #define MC_CMD_MAC_TX_MAC_SRC_ERR_PKTS 0x1a /* enum */
  2536. #define MC_CMD_MAC_TX_IP_SRC_ERR_PKTS 0x1b /* enum */
  2537. #define MC_CMD_MAC_RX_PKTS 0x1c /* enum */
  2538. #define MC_CMD_MAC_RX_PAUSE_PKTS 0x1d /* enum */
  2539. #define MC_CMD_MAC_RX_GOOD_PKTS 0x1e /* enum */
  2540. #define MC_CMD_MAC_RX_CONTROL_PKTS 0x1f /* enum */
  2541. #define MC_CMD_MAC_RX_UNICAST_PKTS 0x20 /* enum */
  2542. #define MC_CMD_MAC_RX_MULTICAST_PKTS 0x21 /* enum */
  2543. #define MC_CMD_MAC_RX_BROADCAST_PKTS 0x22 /* enum */
  2544. #define MC_CMD_MAC_RX_BYTES 0x23 /* enum */
  2545. #define MC_CMD_MAC_RX_BAD_BYTES 0x24 /* enum */
  2546. #define MC_CMD_MAC_RX_64_PKTS 0x25 /* enum */
  2547. #define MC_CMD_MAC_RX_65_TO_127_PKTS 0x26 /* enum */
  2548. #define MC_CMD_MAC_RX_128_TO_255_PKTS 0x27 /* enum */
  2549. #define MC_CMD_MAC_RX_256_TO_511_PKTS 0x28 /* enum */
  2550. #define MC_CMD_MAC_RX_512_TO_1023_PKTS 0x29 /* enum */
  2551. #define MC_CMD_MAC_RX_1024_TO_15XX_PKTS 0x2a /* enum */
  2552. #define MC_CMD_MAC_RX_15XX_TO_JUMBO_PKTS 0x2b /* enum */
  2553. #define MC_CMD_MAC_RX_GTJUMBO_PKTS 0x2c /* enum */
  2554. #define MC_CMD_MAC_RX_UNDERSIZE_PKTS 0x2d /* enum */
  2555. #define MC_CMD_MAC_RX_BAD_FCS_PKTS 0x2e /* enum */
  2556. #define MC_CMD_MAC_RX_OVERFLOW_PKTS 0x2f /* enum */
  2557. #define MC_CMD_MAC_RX_FALSE_CARRIER_PKTS 0x30 /* enum */
  2558. #define MC_CMD_MAC_RX_SYMBOL_ERROR_PKTS 0x31 /* enum */
  2559. #define MC_CMD_MAC_RX_ALIGN_ERROR_PKTS 0x32 /* enum */
  2560. #define MC_CMD_MAC_RX_LENGTH_ERROR_PKTS 0x33 /* enum */
  2561. #define MC_CMD_MAC_RX_INTERNAL_ERROR_PKTS 0x34 /* enum */
  2562. #define MC_CMD_MAC_RX_JABBER_PKTS 0x35 /* enum */
  2563. #define MC_CMD_MAC_RX_NODESC_DROPS 0x36 /* enum */
  2564. #define MC_CMD_MAC_RX_LANES01_CHAR_ERR 0x37 /* enum */
  2565. #define MC_CMD_MAC_RX_LANES23_CHAR_ERR 0x38 /* enum */
  2566. #define MC_CMD_MAC_RX_LANES01_DISP_ERR 0x39 /* enum */
  2567. #define MC_CMD_MAC_RX_LANES23_DISP_ERR 0x3a /* enum */
  2568. #define MC_CMD_MAC_RX_MATCH_FAULT 0x3b /* enum */
  2569. /* enum: PM trunc_bb_overflow counter. Valid for EF10 with PM_AND_RXDP_COUNTERS
  2570. * capability only.
  2571. */
  2572. #define MC_CMD_MAC_PM_TRUNC_BB_OVERFLOW 0x3c
  2573. /* enum: PM discard_bb_overflow counter. Valid for EF10 with
  2574. * PM_AND_RXDP_COUNTERS capability only.
  2575. */
  2576. #define MC_CMD_MAC_PM_DISCARD_BB_OVERFLOW 0x3d
  2577. /* enum: PM trunc_vfifo_full counter. Valid for EF10 with PM_AND_RXDP_COUNTERS
  2578. * capability only.
  2579. */
  2580. #define MC_CMD_MAC_PM_TRUNC_VFIFO_FULL 0x3e
  2581. /* enum: PM discard_vfifo_full counter. Valid for EF10 with
  2582. * PM_AND_RXDP_COUNTERS capability only.
  2583. */
  2584. #define MC_CMD_MAC_PM_DISCARD_VFIFO_FULL 0x3f
  2585. /* enum: PM trunc_qbb counter. Valid for EF10 with PM_AND_RXDP_COUNTERS
  2586. * capability only.
  2587. */
  2588. #define MC_CMD_MAC_PM_TRUNC_QBB 0x40
  2589. /* enum: PM discard_qbb counter. Valid for EF10 with PM_AND_RXDP_COUNTERS
  2590. * capability only.
  2591. */
  2592. #define MC_CMD_MAC_PM_DISCARD_QBB 0x41
  2593. /* enum: PM discard_mapping counter. Valid for EF10 with PM_AND_RXDP_COUNTERS
  2594. * capability only.
  2595. */
  2596. #define MC_CMD_MAC_PM_DISCARD_MAPPING 0x42
  2597. /* enum: RXDP counter: Number of packets dropped due to the queue being
  2598. * disabled. Valid for EF10 with PM_AND_RXDP_COUNTERS capability only.
  2599. */
  2600. #define MC_CMD_MAC_RXDP_Q_DISABLED_PKTS 0x43
  2601. /* enum: RXDP counter: Number of packets dropped by the DICPU. Valid for EF10
  2602. * with PM_AND_RXDP_COUNTERS capability only.
  2603. */
  2604. #define MC_CMD_MAC_RXDP_DI_DROPPED_PKTS 0x45
  2605. /* enum: RXDP counter: Number of non-host packets. Valid for EF10 with
  2606. * PM_AND_RXDP_COUNTERS capability only.
  2607. */
  2608. #define MC_CMD_MAC_RXDP_STREAMING_PKTS 0x46
  2609. /* enum: RXDP counter: Number of times an emergency descriptor fetch was
  2610. * performed. Valid for EF10 with PM_AND_RXDP_COUNTERS capability only.
  2611. */
  2612. #define MC_CMD_MAC_RXDP_HLB_FETCH_CONDITIONS 0x47
  2613. /* enum: RXDP counter: Number of times the DPCPU waited for an existing
  2614. * descriptor fetch. Valid for EF10 with PM_AND_RXDP_COUNTERS capability only.
  2615. */
  2616. #define MC_CMD_MAC_RXDP_HLB_WAIT_CONDITIONS 0x48
  2617. #define MC_CMD_MAC_VADAPTER_RX_DMABUF_START 0x4c /* enum */
  2618. #define MC_CMD_MAC_VADAPTER_RX_UNICAST_PACKETS 0x4c /* enum */
  2619. #define MC_CMD_MAC_VADAPTER_RX_UNICAST_BYTES 0x4d /* enum */
  2620. #define MC_CMD_MAC_VADAPTER_RX_MULTICAST_PACKETS 0x4e /* enum */
  2621. #define MC_CMD_MAC_VADAPTER_RX_MULTICAST_BYTES 0x4f /* enum */
  2622. #define MC_CMD_MAC_VADAPTER_RX_BROADCAST_PACKETS 0x50 /* enum */
  2623. #define MC_CMD_MAC_VADAPTER_RX_BROADCAST_BYTES 0x51 /* enum */
  2624. #define MC_CMD_MAC_VADAPTER_RX_BAD_PACKETS 0x52 /* enum */
  2625. #define MC_CMD_MAC_VADAPTER_RX_BAD_BYTES 0x53 /* enum */
  2626. #define MC_CMD_MAC_VADAPTER_RX_OVERFLOW 0x54 /* enum */
  2627. #define MC_CMD_MAC_VADAPTER_TX_DMABUF_START 0x57 /* enum */
  2628. #define MC_CMD_MAC_VADAPTER_TX_UNICAST_PACKETS 0x57 /* enum */
  2629. #define MC_CMD_MAC_VADAPTER_TX_UNICAST_BYTES 0x58 /* enum */
  2630. #define MC_CMD_MAC_VADAPTER_TX_MULTICAST_PACKETS 0x59 /* enum */
  2631. #define MC_CMD_MAC_VADAPTER_TX_MULTICAST_BYTES 0x5a /* enum */
  2632. #define MC_CMD_MAC_VADAPTER_TX_BROADCAST_PACKETS 0x5b /* enum */
  2633. #define MC_CMD_MAC_VADAPTER_TX_BROADCAST_BYTES 0x5c /* enum */
  2634. #define MC_CMD_MAC_VADAPTER_TX_BAD_PACKETS 0x5d /* enum */
  2635. #define MC_CMD_MAC_VADAPTER_TX_BAD_BYTES 0x5e /* enum */
  2636. #define MC_CMD_MAC_VADAPTER_TX_OVERFLOW 0x5f /* enum */
  2637. /* enum: Start of GMAC stats buffer space, for Siena only. */
  2638. #define MC_CMD_GMAC_DMABUF_START 0x40
  2639. /* enum: End of GMAC stats buffer space, for Siena only. */
  2640. #define MC_CMD_GMAC_DMABUF_END 0x5f
  2641. #define MC_CMD_MAC_GENERATION_END 0x60 /* enum */
  2642. #define MC_CMD_MAC_NSTATS 0x61 /* enum */
  2643. /***********************************/
  2644. /* MC_CMD_SRIOV
  2645. * to be documented
  2646. */
  2647. #define MC_CMD_SRIOV 0x30
  2648. /* MC_CMD_SRIOV_IN msgrequest */
  2649. #define MC_CMD_SRIOV_IN_LEN 12
  2650. #define MC_CMD_SRIOV_IN_ENABLE_OFST 0
  2651. #define MC_CMD_SRIOV_IN_VI_BASE_OFST 4
  2652. #define MC_CMD_SRIOV_IN_VF_COUNT_OFST 8
  2653. /* MC_CMD_SRIOV_OUT msgresponse */
  2654. #define MC_CMD_SRIOV_OUT_LEN 8
  2655. #define MC_CMD_SRIOV_OUT_VI_SCALE_OFST 0
  2656. #define MC_CMD_SRIOV_OUT_VF_TOTAL_OFST 4
  2657. /* MC_CMD_MEMCPY_RECORD_TYPEDEF structuredef */
  2658. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_LEN 32
  2659. /* this is only used for the first record */
  2660. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_NUM_RECORDS_OFST 0
  2661. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_NUM_RECORDS_LBN 0
  2662. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_NUM_RECORDS_WIDTH 32
  2663. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_TO_RID_OFST 4
  2664. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_TO_RID_LBN 32
  2665. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_TO_RID_WIDTH 32
  2666. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_TO_ADDR_OFST 8
  2667. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_TO_ADDR_LEN 8
  2668. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_TO_ADDR_LO_OFST 8
  2669. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_TO_ADDR_HI_OFST 12
  2670. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_TO_ADDR_LBN 64
  2671. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_TO_ADDR_WIDTH 64
  2672. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_FROM_RID_OFST 16
  2673. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_RID_INLINE 0x100 /* enum */
  2674. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_FROM_RID_LBN 128
  2675. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_FROM_RID_WIDTH 32
  2676. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_FROM_ADDR_OFST 20
  2677. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_FROM_ADDR_LEN 8
  2678. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_FROM_ADDR_LO_OFST 20
  2679. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_FROM_ADDR_HI_OFST 24
  2680. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_FROM_ADDR_LBN 160
  2681. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_FROM_ADDR_WIDTH 64
  2682. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_LENGTH_OFST 28
  2683. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_LENGTH_LBN 224
  2684. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_LENGTH_WIDTH 32
  2685. /***********************************/
  2686. /* MC_CMD_MEMCPY
  2687. * DMA write data into (Rid,Addr), either by dma reading (Rid,Addr), or by data
  2688. * embedded directly in the command.
  2689. *
  2690. * A common pattern is for a client to use generation counts to signal a dma
  2691. * update of a datastructure. To facilitate this, this MCDI operation can
  2692. * contain multiple requests which are executed in strict order. Requests take
  2693. * the form of duplicating the entire MCDI request continuously (including the
  2694. * requests record, which is ignored in all but the first structure)
  2695. *
  2696. * The source data can either come from a DMA from the host, or it can be
  2697. * embedded within the request directly, thereby eliminating a DMA read. To
  2698. * indicate this, the client sets FROM_RID=%RID_INLINE, ADDR_HI=0, and
  2699. * ADDR_LO=offset, and inserts the data at %offset from the start of the
  2700. * payload. It's the callers responsibility to ensure that the embedded data
  2701. * doesn't overlap the records.
  2702. *
  2703. * Returns: 0, EINVAL (invalid RID)
  2704. */
  2705. #define MC_CMD_MEMCPY 0x31
  2706. /* MC_CMD_MEMCPY_IN msgrequest */
  2707. #define MC_CMD_MEMCPY_IN_LENMIN 32
  2708. #define MC_CMD_MEMCPY_IN_LENMAX 224
  2709. #define MC_CMD_MEMCPY_IN_LEN(num) (0+32*(num))
  2710. /* see MC_CMD_MEMCPY_RECORD_TYPEDEF */
  2711. #define MC_CMD_MEMCPY_IN_RECORD_OFST 0
  2712. #define MC_CMD_MEMCPY_IN_RECORD_LEN 32
  2713. #define MC_CMD_MEMCPY_IN_RECORD_MINNUM 1
  2714. #define MC_CMD_MEMCPY_IN_RECORD_MAXNUM 7
  2715. /* MC_CMD_MEMCPY_OUT msgresponse */
  2716. #define MC_CMD_MEMCPY_OUT_LEN 0
  2717. /***********************************/
  2718. /* MC_CMD_WOL_FILTER_SET
  2719. * Set a WoL filter.
  2720. */
  2721. #define MC_CMD_WOL_FILTER_SET 0x32
  2722. #define MC_CMD_0x32_PRIVILEGE_CTG SRIOV_CTG_LINK
  2723. /* MC_CMD_WOL_FILTER_SET_IN msgrequest */
  2724. #define MC_CMD_WOL_FILTER_SET_IN_LEN 192
  2725. #define MC_CMD_WOL_FILTER_SET_IN_FILTER_MODE_OFST 0
  2726. #define MC_CMD_FILTER_MODE_SIMPLE 0x0 /* enum */
  2727. #define MC_CMD_FILTER_MODE_STRUCTURED 0xffffffff /* enum */
  2728. /* A type value of 1 is unused. */
  2729. #define MC_CMD_WOL_FILTER_SET_IN_WOL_TYPE_OFST 4
  2730. /* enum: Magic */
  2731. #define MC_CMD_WOL_TYPE_MAGIC 0x0
  2732. /* enum: MS Windows Magic */
  2733. #define MC_CMD_WOL_TYPE_WIN_MAGIC 0x2
  2734. /* enum: IPv4 Syn */
  2735. #define MC_CMD_WOL_TYPE_IPV4_SYN 0x3
  2736. /* enum: IPv6 Syn */
  2737. #define MC_CMD_WOL_TYPE_IPV6_SYN 0x4
  2738. /* enum: Bitmap */
  2739. #define MC_CMD_WOL_TYPE_BITMAP 0x5
  2740. /* enum: Link */
  2741. #define MC_CMD_WOL_TYPE_LINK 0x6
  2742. /* enum: (Above this for future use) */
  2743. #define MC_CMD_WOL_TYPE_MAX 0x7
  2744. #define MC_CMD_WOL_FILTER_SET_IN_DATA_OFST 8
  2745. #define MC_CMD_WOL_FILTER_SET_IN_DATA_LEN 4
  2746. #define MC_CMD_WOL_FILTER_SET_IN_DATA_NUM 46
  2747. /* MC_CMD_WOL_FILTER_SET_IN_MAGIC msgrequest */
  2748. #define MC_CMD_WOL_FILTER_SET_IN_MAGIC_LEN 16
  2749. /* MC_CMD_WOL_FILTER_SET_IN_FILTER_MODE_OFST 0 */
  2750. /* MC_CMD_WOL_FILTER_SET_IN_WOL_TYPE_OFST 4 */
  2751. #define MC_CMD_WOL_FILTER_SET_IN_MAGIC_MAC_OFST 8
  2752. #define MC_CMD_WOL_FILTER_SET_IN_MAGIC_MAC_LEN 8
  2753. #define MC_CMD_WOL_FILTER_SET_IN_MAGIC_MAC_LO_OFST 8
  2754. #define MC_CMD_WOL_FILTER_SET_IN_MAGIC_MAC_HI_OFST 12
  2755. /* MC_CMD_WOL_FILTER_SET_IN_IPV4_SYN msgrequest */
  2756. #define MC_CMD_WOL_FILTER_SET_IN_IPV4_SYN_LEN 20
  2757. /* MC_CMD_WOL_FILTER_SET_IN_FILTER_MODE_OFST 0 */
  2758. /* MC_CMD_WOL_FILTER_SET_IN_WOL_TYPE_OFST 4 */
  2759. #define MC_CMD_WOL_FILTER_SET_IN_IPV4_SYN_SRC_IP_OFST 8
  2760. #define MC_CMD_WOL_FILTER_SET_IN_IPV4_SYN_DST_IP_OFST 12
  2761. #define MC_CMD_WOL_FILTER_SET_IN_IPV4_SYN_SRC_PORT_OFST 16
  2762. #define MC_CMD_WOL_FILTER_SET_IN_IPV4_SYN_SRC_PORT_LEN 2
  2763. #define MC_CMD_WOL_FILTER_SET_IN_IPV4_SYN_DST_PORT_OFST 18
  2764. #define MC_CMD_WOL_FILTER_SET_IN_IPV4_SYN_DST_PORT_LEN 2
  2765. /* MC_CMD_WOL_FILTER_SET_IN_IPV6_SYN msgrequest */
  2766. #define MC_CMD_WOL_FILTER_SET_IN_IPV6_SYN_LEN 44
  2767. /* MC_CMD_WOL_FILTER_SET_IN_FILTER_MODE_OFST 0 */
  2768. /* MC_CMD_WOL_FILTER_SET_IN_WOL_TYPE_OFST 4 */
  2769. #define MC_CMD_WOL_FILTER_SET_IN_IPV6_SYN_SRC_IP_OFST 8
  2770. #define MC_CMD_WOL_FILTER_SET_IN_IPV6_SYN_SRC_IP_LEN 16
  2771. #define MC_CMD_WOL_FILTER_SET_IN_IPV6_SYN_DST_IP_OFST 24
  2772. #define MC_CMD_WOL_FILTER_SET_IN_IPV6_SYN_DST_IP_LEN 16
  2773. #define MC_CMD_WOL_FILTER_SET_IN_IPV6_SYN_SRC_PORT_OFST 40
  2774. #define MC_CMD_WOL_FILTER_SET_IN_IPV6_SYN_SRC_PORT_LEN 2
  2775. #define MC_CMD_WOL_FILTER_SET_IN_IPV6_SYN_DST_PORT_OFST 42
  2776. #define MC_CMD_WOL_FILTER_SET_IN_IPV6_SYN_DST_PORT_LEN 2
  2777. /* MC_CMD_WOL_FILTER_SET_IN_BITMAP msgrequest */
  2778. #define MC_CMD_WOL_FILTER_SET_IN_BITMAP_LEN 187
  2779. /* MC_CMD_WOL_FILTER_SET_IN_FILTER_MODE_OFST 0 */
  2780. /* MC_CMD_WOL_FILTER_SET_IN_WOL_TYPE_OFST 4 */
  2781. #define MC_CMD_WOL_FILTER_SET_IN_BITMAP_MASK_OFST 8
  2782. #define MC_CMD_WOL_FILTER_SET_IN_BITMAP_MASK_LEN 48
  2783. #define MC_CMD_WOL_FILTER_SET_IN_BITMAP_BITMAP_OFST 56
  2784. #define MC_CMD_WOL_FILTER_SET_IN_BITMAP_BITMAP_LEN 128
  2785. #define MC_CMD_WOL_FILTER_SET_IN_BITMAP_LEN_OFST 184
  2786. #define MC_CMD_WOL_FILTER_SET_IN_BITMAP_LEN_LEN 1
  2787. #define MC_CMD_WOL_FILTER_SET_IN_BITMAP_LAYER3_OFST 185
  2788. #define MC_CMD_WOL_FILTER_SET_IN_BITMAP_LAYER3_LEN 1
  2789. #define MC_CMD_WOL_FILTER_SET_IN_BITMAP_LAYER4_OFST 186
  2790. #define MC_CMD_WOL_FILTER_SET_IN_BITMAP_LAYER4_LEN 1
  2791. /* MC_CMD_WOL_FILTER_SET_IN_LINK msgrequest */
  2792. #define MC_CMD_WOL_FILTER_SET_IN_LINK_LEN 12
  2793. /* MC_CMD_WOL_FILTER_SET_IN_FILTER_MODE_OFST 0 */
  2794. /* MC_CMD_WOL_FILTER_SET_IN_WOL_TYPE_OFST 4 */
  2795. #define MC_CMD_WOL_FILTER_SET_IN_LINK_MASK_OFST 8
  2796. #define MC_CMD_WOL_FILTER_SET_IN_LINK_UP_LBN 0
  2797. #define MC_CMD_WOL_FILTER_SET_IN_LINK_UP_WIDTH 1
  2798. #define MC_CMD_WOL_FILTER_SET_IN_LINK_DOWN_LBN 1
  2799. #define MC_CMD_WOL_FILTER_SET_IN_LINK_DOWN_WIDTH 1
  2800. /* MC_CMD_WOL_FILTER_SET_OUT msgresponse */
  2801. #define MC_CMD_WOL_FILTER_SET_OUT_LEN 4
  2802. #define MC_CMD_WOL_FILTER_SET_OUT_FILTER_ID_OFST 0
  2803. /***********************************/
  2804. /* MC_CMD_WOL_FILTER_REMOVE
  2805. * Remove a WoL filter. Locks required: None. Returns: 0, EINVAL, ENOSYS
  2806. */
  2807. #define MC_CMD_WOL_FILTER_REMOVE 0x33
  2808. #define MC_CMD_0x33_PRIVILEGE_CTG SRIOV_CTG_LINK
  2809. /* MC_CMD_WOL_FILTER_REMOVE_IN msgrequest */
  2810. #define MC_CMD_WOL_FILTER_REMOVE_IN_LEN 4
  2811. #define MC_CMD_WOL_FILTER_REMOVE_IN_FILTER_ID_OFST 0
  2812. /* MC_CMD_WOL_FILTER_REMOVE_OUT msgresponse */
  2813. #define MC_CMD_WOL_FILTER_REMOVE_OUT_LEN 0
  2814. /***********************************/
  2815. /* MC_CMD_WOL_FILTER_RESET
  2816. * Reset (i.e. remove all) WoL filters. Locks required: None. Returns: 0,
  2817. * ENOSYS
  2818. */
  2819. #define MC_CMD_WOL_FILTER_RESET 0x34
  2820. #define MC_CMD_0x34_PRIVILEGE_CTG SRIOV_CTG_LINK
  2821. /* MC_CMD_WOL_FILTER_RESET_IN msgrequest */
  2822. #define MC_CMD_WOL_FILTER_RESET_IN_LEN 4
  2823. #define MC_CMD_WOL_FILTER_RESET_IN_MASK_OFST 0
  2824. #define MC_CMD_WOL_FILTER_RESET_IN_WAKE_FILTERS 0x1 /* enum */
  2825. #define MC_CMD_WOL_FILTER_RESET_IN_LIGHTSOUT_OFFLOADS 0x2 /* enum */
  2826. /* MC_CMD_WOL_FILTER_RESET_OUT msgresponse */
  2827. #define MC_CMD_WOL_FILTER_RESET_OUT_LEN 0
  2828. /***********************************/
  2829. /* MC_CMD_SET_MCAST_HASH
  2830. * Set the MCAST hash value without otherwise reconfiguring the MAC
  2831. */
  2832. #define MC_CMD_SET_MCAST_HASH 0x35
  2833. /* MC_CMD_SET_MCAST_HASH_IN msgrequest */
  2834. #define MC_CMD_SET_MCAST_HASH_IN_LEN 32
  2835. #define MC_CMD_SET_MCAST_HASH_IN_HASH0_OFST 0
  2836. #define MC_CMD_SET_MCAST_HASH_IN_HASH0_LEN 16
  2837. #define MC_CMD_SET_MCAST_HASH_IN_HASH1_OFST 16
  2838. #define MC_CMD_SET_MCAST_HASH_IN_HASH1_LEN 16
  2839. /* MC_CMD_SET_MCAST_HASH_OUT msgresponse */
  2840. #define MC_CMD_SET_MCAST_HASH_OUT_LEN 0
  2841. /***********************************/
  2842. /* MC_CMD_NVRAM_TYPES
  2843. * Return bitfield indicating available types of virtual NVRAM partitions.
  2844. * Locks required: none. Returns: 0
  2845. */
  2846. #define MC_CMD_NVRAM_TYPES 0x36
  2847. #define MC_CMD_0x36_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  2848. /* MC_CMD_NVRAM_TYPES_IN msgrequest */
  2849. #define MC_CMD_NVRAM_TYPES_IN_LEN 0
  2850. /* MC_CMD_NVRAM_TYPES_OUT msgresponse */
  2851. #define MC_CMD_NVRAM_TYPES_OUT_LEN 4
  2852. /* Bit mask of supported types. */
  2853. #define MC_CMD_NVRAM_TYPES_OUT_TYPES_OFST 0
  2854. /* enum: Disabled callisto. */
  2855. #define MC_CMD_NVRAM_TYPE_DISABLED_CALLISTO 0x0
  2856. /* enum: MC firmware. */
  2857. #define MC_CMD_NVRAM_TYPE_MC_FW 0x1
  2858. /* enum: MC backup firmware. */
  2859. #define MC_CMD_NVRAM_TYPE_MC_FW_BACKUP 0x2
  2860. /* enum: Static configuration Port0. */
  2861. #define MC_CMD_NVRAM_TYPE_STATIC_CFG_PORT0 0x3
  2862. /* enum: Static configuration Port1. */
  2863. #define MC_CMD_NVRAM_TYPE_STATIC_CFG_PORT1 0x4
  2864. /* enum: Dynamic configuration Port0. */
  2865. #define MC_CMD_NVRAM_TYPE_DYNAMIC_CFG_PORT0 0x5
  2866. /* enum: Dynamic configuration Port1. */
  2867. #define MC_CMD_NVRAM_TYPE_DYNAMIC_CFG_PORT1 0x6
  2868. /* enum: Expansion Rom. */
  2869. #define MC_CMD_NVRAM_TYPE_EXP_ROM 0x7
  2870. /* enum: Expansion Rom Configuration Port0. */
  2871. #define MC_CMD_NVRAM_TYPE_EXP_ROM_CFG_PORT0 0x8
  2872. /* enum: Expansion Rom Configuration Port1. */
  2873. #define MC_CMD_NVRAM_TYPE_EXP_ROM_CFG_PORT1 0x9
  2874. /* enum: Phy Configuration Port0. */
  2875. #define MC_CMD_NVRAM_TYPE_PHY_PORT0 0xa
  2876. /* enum: Phy Configuration Port1. */
  2877. #define MC_CMD_NVRAM_TYPE_PHY_PORT1 0xb
  2878. /* enum: Log. */
  2879. #define MC_CMD_NVRAM_TYPE_LOG 0xc
  2880. /* enum: FPGA image. */
  2881. #define MC_CMD_NVRAM_TYPE_FPGA 0xd
  2882. /* enum: FPGA backup image */
  2883. #define MC_CMD_NVRAM_TYPE_FPGA_BACKUP 0xe
  2884. /* enum: FC firmware. */
  2885. #define MC_CMD_NVRAM_TYPE_FC_FW 0xf
  2886. /* enum: FC backup firmware. */
  2887. #define MC_CMD_NVRAM_TYPE_FC_FW_BACKUP 0x10
  2888. /* enum: CPLD image. */
  2889. #define MC_CMD_NVRAM_TYPE_CPLD 0x11
  2890. /* enum: Licensing information. */
  2891. #define MC_CMD_NVRAM_TYPE_LICENSE 0x12
  2892. /* enum: FC Log. */
  2893. #define MC_CMD_NVRAM_TYPE_FC_LOG 0x13
  2894. /***********************************/
  2895. /* MC_CMD_NVRAM_INFO
  2896. * Read info about a virtual NVRAM partition. Locks required: none. Returns: 0,
  2897. * EINVAL (bad type).
  2898. */
  2899. #define MC_CMD_NVRAM_INFO 0x37
  2900. #define MC_CMD_0x37_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  2901. /* MC_CMD_NVRAM_INFO_IN msgrequest */
  2902. #define MC_CMD_NVRAM_INFO_IN_LEN 4
  2903. #define MC_CMD_NVRAM_INFO_IN_TYPE_OFST 0
  2904. /* Enum values, see field(s): */
  2905. /* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */
  2906. /* MC_CMD_NVRAM_INFO_OUT msgresponse */
  2907. #define MC_CMD_NVRAM_INFO_OUT_LEN 24
  2908. #define MC_CMD_NVRAM_INFO_OUT_TYPE_OFST 0
  2909. /* Enum values, see field(s): */
  2910. /* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */
  2911. #define MC_CMD_NVRAM_INFO_OUT_SIZE_OFST 4
  2912. #define MC_CMD_NVRAM_INFO_OUT_ERASESIZE_OFST 8
  2913. #define MC_CMD_NVRAM_INFO_OUT_FLAGS_OFST 12
  2914. #define MC_CMD_NVRAM_INFO_OUT_PROTECTED_LBN 0
  2915. #define MC_CMD_NVRAM_INFO_OUT_PROTECTED_WIDTH 1
  2916. #define MC_CMD_NVRAM_INFO_OUT_TLV_LBN 1
  2917. #define MC_CMD_NVRAM_INFO_OUT_TLV_WIDTH 1
  2918. #define MC_CMD_NVRAM_INFO_OUT_A_B_LBN 7
  2919. #define MC_CMD_NVRAM_INFO_OUT_A_B_WIDTH 1
  2920. #define MC_CMD_NVRAM_INFO_OUT_PHYSDEV_OFST 16
  2921. #define MC_CMD_NVRAM_INFO_OUT_PHYSADDR_OFST 20
  2922. /***********************************/
  2923. /* MC_CMD_NVRAM_UPDATE_START
  2924. * Start a group of update operations on a virtual NVRAM partition. Locks
  2925. * required: PHY_LOCK if type==*PHY*. Returns: 0, EINVAL (bad type), EACCES (if
  2926. * PHY_LOCK required and not held).
  2927. */
  2928. #define MC_CMD_NVRAM_UPDATE_START 0x38
  2929. #define MC_CMD_0x38_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  2930. /* MC_CMD_NVRAM_UPDATE_START_IN msgrequest */
  2931. #define MC_CMD_NVRAM_UPDATE_START_IN_LEN 4
  2932. #define MC_CMD_NVRAM_UPDATE_START_IN_TYPE_OFST 0
  2933. /* Enum values, see field(s): */
  2934. /* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */
  2935. /* MC_CMD_NVRAM_UPDATE_START_OUT msgresponse */
  2936. #define MC_CMD_NVRAM_UPDATE_START_OUT_LEN 0
  2937. /***********************************/
  2938. /* MC_CMD_NVRAM_READ
  2939. * Read data from a virtual NVRAM partition. Locks required: PHY_LOCK if
  2940. * type==*PHY*. Returns: 0, EINVAL (bad type/offset/length), EACCES (if
  2941. * PHY_LOCK required and not held)
  2942. */
  2943. #define MC_CMD_NVRAM_READ 0x39
  2944. #define MC_CMD_0x39_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  2945. /* MC_CMD_NVRAM_READ_IN msgrequest */
  2946. #define MC_CMD_NVRAM_READ_IN_LEN 12
  2947. #define MC_CMD_NVRAM_READ_IN_TYPE_OFST 0
  2948. /* Enum values, see field(s): */
  2949. /* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */
  2950. #define MC_CMD_NVRAM_READ_IN_OFFSET_OFST 4
  2951. /* amount to read in bytes */
  2952. #define MC_CMD_NVRAM_READ_IN_LENGTH_OFST 8
  2953. /* MC_CMD_NVRAM_READ_OUT msgresponse */
  2954. #define MC_CMD_NVRAM_READ_OUT_LENMIN 1
  2955. #define MC_CMD_NVRAM_READ_OUT_LENMAX 252
  2956. #define MC_CMD_NVRAM_READ_OUT_LEN(num) (0+1*(num))
  2957. #define MC_CMD_NVRAM_READ_OUT_READ_BUFFER_OFST 0
  2958. #define MC_CMD_NVRAM_READ_OUT_READ_BUFFER_LEN 1
  2959. #define MC_CMD_NVRAM_READ_OUT_READ_BUFFER_MINNUM 1
  2960. #define MC_CMD_NVRAM_READ_OUT_READ_BUFFER_MAXNUM 252
  2961. /***********************************/
  2962. /* MC_CMD_NVRAM_WRITE
  2963. * Write data to a virtual NVRAM partition. Locks required: PHY_LOCK if
  2964. * type==*PHY*. Returns: 0, EINVAL (bad type/offset/length), EACCES (if
  2965. * PHY_LOCK required and not held)
  2966. */
  2967. #define MC_CMD_NVRAM_WRITE 0x3a
  2968. #define MC_CMD_0x3a_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  2969. /* MC_CMD_NVRAM_WRITE_IN msgrequest */
  2970. #define MC_CMD_NVRAM_WRITE_IN_LENMIN 13
  2971. #define MC_CMD_NVRAM_WRITE_IN_LENMAX 252
  2972. #define MC_CMD_NVRAM_WRITE_IN_LEN(num) (12+1*(num))
  2973. #define MC_CMD_NVRAM_WRITE_IN_TYPE_OFST 0
  2974. /* Enum values, see field(s): */
  2975. /* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */
  2976. #define MC_CMD_NVRAM_WRITE_IN_OFFSET_OFST 4
  2977. #define MC_CMD_NVRAM_WRITE_IN_LENGTH_OFST 8
  2978. #define MC_CMD_NVRAM_WRITE_IN_WRITE_BUFFER_OFST 12
  2979. #define MC_CMD_NVRAM_WRITE_IN_WRITE_BUFFER_LEN 1
  2980. #define MC_CMD_NVRAM_WRITE_IN_WRITE_BUFFER_MINNUM 1
  2981. #define MC_CMD_NVRAM_WRITE_IN_WRITE_BUFFER_MAXNUM 240
  2982. /* MC_CMD_NVRAM_WRITE_OUT msgresponse */
  2983. #define MC_CMD_NVRAM_WRITE_OUT_LEN 0
  2984. /***********************************/
  2985. /* MC_CMD_NVRAM_ERASE
  2986. * Erase sector(s) from a virtual NVRAM partition. Locks required: PHY_LOCK if
  2987. * type==*PHY*. Returns: 0, EINVAL (bad type/offset/length), EACCES (if
  2988. * PHY_LOCK required and not held)
  2989. */
  2990. #define MC_CMD_NVRAM_ERASE 0x3b
  2991. #define MC_CMD_0x3b_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  2992. /* MC_CMD_NVRAM_ERASE_IN msgrequest */
  2993. #define MC_CMD_NVRAM_ERASE_IN_LEN 12
  2994. #define MC_CMD_NVRAM_ERASE_IN_TYPE_OFST 0
  2995. /* Enum values, see field(s): */
  2996. /* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */
  2997. #define MC_CMD_NVRAM_ERASE_IN_OFFSET_OFST 4
  2998. #define MC_CMD_NVRAM_ERASE_IN_LENGTH_OFST 8
  2999. /* MC_CMD_NVRAM_ERASE_OUT msgresponse */
  3000. #define MC_CMD_NVRAM_ERASE_OUT_LEN 0
  3001. /***********************************/
  3002. /* MC_CMD_NVRAM_UPDATE_FINISH
  3003. * Finish a group of update operations on a virtual NVRAM partition. Locks
  3004. * required: PHY_LOCK if type==*PHY*. Returns: 0, EINVAL (bad
  3005. * type/offset/length), EACCES (if PHY_LOCK required and not held)
  3006. */
  3007. #define MC_CMD_NVRAM_UPDATE_FINISH 0x3c
  3008. #define MC_CMD_0x3c_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  3009. /* MC_CMD_NVRAM_UPDATE_FINISH_IN msgrequest */
  3010. #define MC_CMD_NVRAM_UPDATE_FINISH_IN_LEN 8
  3011. #define MC_CMD_NVRAM_UPDATE_FINISH_IN_TYPE_OFST 0
  3012. /* Enum values, see field(s): */
  3013. /* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */
  3014. #define MC_CMD_NVRAM_UPDATE_FINISH_IN_REBOOT_OFST 4
  3015. /* MC_CMD_NVRAM_UPDATE_FINISH_OUT msgresponse */
  3016. #define MC_CMD_NVRAM_UPDATE_FINISH_OUT_LEN 0
  3017. /***********************************/
  3018. /* MC_CMD_REBOOT
  3019. * Reboot the MC.
  3020. *
  3021. * The AFTER_ASSERTION flag is intended to be used when the driver notices an
  3022. * assertion failure (at which point it is expected to perform a complete tear
  3023. * down and reinitialise), to allow both ports to reset the MC once in an
  3024. * atomic fashion.
  3025. *
  3026. * Production mc firmwares are generally compiled with REBOOT_ON_ASSERT=1,
  3027. * which means that they will automatically reboot out of the assertion
  3028. * handler, so this is in practise an optional operation. It is still
  3029. * recommended that drivers execute this to support custom firmwares with
  3030. * REBOOT_ON_ASSERT=0.
  3031. *
  3032. * Locks required: NONE Returns: Nothing. You get back a response with ERR=1,
  3033. * DATALEN=0
  3034. */
  3035. #define MC_CMD_REBOOT 0x3d
  3036. #define MC_CMD_0x3d_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  3037. /* MC_CMD_REBOOT_IN msgrequest */
  3038. #define MC_CMD_REBOOT_IN_LEN 4
  3039. #define MC_CMD_REBOOT_IN_FLAGS_OFST 0
  3040. #define MC_CMD_REBOOT_FLAGS_AFTER_ASSERTION 0x1 /* enum */
  3041. /* MC_CMD_REBOOT_OUT msgresponse */
  3042. #define MC_CMD_REBOOT_OUT_LEN 0
  3043. /***********************************/
  3044. /* MC_CMD_SCHEDINFO
  3045. * Request scheduler info. Locks required: NONE. Returns: An array of
  3046. * (timeslice,maximum overrun), one for each thread, in ascending order of
  3047. * thread address.
  3048. */
  3049. #define MC_CMD_SCHEDINFO 0x3e
  3050. /* MC_CMD_SCHEDINFO_IN msgrequest */
  3051. #define MC_CMD_SCHEDINFO_IN_LEN 0
  3052. /* MC_CMD_SCHEDINFO_OUT msgresponse */
  3053. #define MC_CMD_SCHEDINFO_OUT_LENMIN 4
  3054. #define MC_CMD_SCHEDINFO_OUT_LENMAX 252
  3055. #define MC_CMD_SCHEDINFO_OUT_LEN(num) (0+4*(num))
  3056. #define MC_CMD_SCHEDINFO_OUT_DATA_OFST 0
  3057. #define MC_CMD_SCHEDINFO_OUT_DATA_LEN 4
  3058. #define MC_CMD_SCHEDINFO_OUT_DATA_MINNUM 1
  3059. #define MC_CMD_SCHEDINFO_OUT_DATA_MAXNUM 63
  3060. /***********************************/
  3061. /* MC_CMD_REBOOT_MODE
  3062. * Set the mode for the next MC reboot. Locks required: NONE. Sets the reboot
  3063. * mode to the specified value. Returns the old mode.
  3064. */
  3065. #define MC_CMD_REBOOT_MODE 0x3f
  3066. #define MC_CMD_0x3f_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  3067. /* MC_CMD_REBOOT_MODE_IN msgrequest */
  3068. #define MC_CMD_REBOOT_MODE_IN_LEN 4
  3069. #define MC_CMD_REBOOT_MODE_IN_VALUE_OFST 0
  3070. /* enum: Normal. */
  3071. #define MC_CMD_REBOOT_MODE_NORMAL 0x0
  3072. /* enum: Power-on Reset. */
  3073. #define MC_CMD_REBOOT_MODE_POR 0x2
  3074. /* enum: Snapper. */
  3075. #define MC_CMD_REBOOT_MODE_SNAPPER 0x3
  3076. /* enum: snapper fake POR */
  3077. #define MC_CMD_REBOOT_MODE_SNAPPER_POR 0x4
  3078. #define MC_CMD_REBOOT_MODE_IN_FAKE_LBN 7
  3079. #define MC_CMD_REBOOT_MODE_IN_FAKE_WIDTH 1
  3080. /* MC_CMD_REBOOT_MODE_OUT msgresponse */
  3081. #define MC_CMD_REBOOT_MODE_OUT_LEN 4
  3082. #define MC_CMD_REBOOT_MODE_OUT_VALUE_OFST 0
  3083. /***********************************/
  3084. /* MC_CMD_SENSOR_INFO
  3085. * Returns information about every available sensor.
  3086. *
  3087. * Each sensor has a single (16bit) value, and a corresponding state. The
  3088. * mapping between value and state is nominally determined by the MC, but may
  3089. * be implemented using up to 2 ranges per sensor.
  3090. *
  3091. * This call returns a mask (32bit) of the sensors that are supported by this
  3092. * platform, then an array of sensor information structures, in order of sensor
  3093. * type (but without gaps for unimplemented sensors). Each structure defines
  3094. * the ranges for the corresponding sensor. An unused range is indicated by
  3095. * equal limit values. If one range is used, a value outside that range results
  3096. * in STATE_FATAL. If two ranges are used, a value outside the second range
  3097. * results in STATE_FATAL while a value outside the first and inside the second
  3098. * range results in STATE_WARNING.
  3099. *
  3100. * Sensor masks and sensor information arrays are organised into pages. For
  3101. * backward compatibility, older host software can only use sensors in page 0.
  3102. * Bit 32 in the sensor mask was previously unused, and is no reserved for use
  3103. * as the next page flag.
  3104. *
  3105. * If the request does not contain a PAGE value then firmware will only return
  3106. * page 0 of sensor information, with bit 31 in the sensor mask cleared.
  3107. *
  3108. * If the request contains a PAGE value then firmware responds with the sensor
  3109. * mask and sensor information array for that page of sensors. In this case bit
  3110. * 31 in the mask is set if another page exists.
  3111. *
  3112. * Locks required: None Returns: 0
  3113. */
  3114. #define MC_CMD_SENSOR_INFO 0x41
  3115. #define MC_CMD_0x41_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  3116. /* MC_CMD_SENSOR_INFO_IN msgrequest */
  3117. #define MC_CMD_SENSOR_INFO_IN_LEN 0
  3118. /* MC_CMD_SENSOR_INFO_EXT_IN msgrequest */
  3119. #define MC_CMD_SENSOR_INFO_EXT_IN_LEN 4
  3120. /* Which page of sensors to report.
  3121. *
  3122. * Page 0 contains sensors 0 to 30 (sensor 31 is the next page bit).
  3123. *
  3124. * Page 1 contains sensors 32 to 62 (sensor 63 is the next page bit). etc.
  3125. */
  3126. #define MC_CMD_SENSOR_INFO_EXT_IN_PAGE_OFST 0
  3127. /* MC_CMD_SENSOR_INFO_OUT msgresponse */
  3128. #define MC_CMD_SENSOR_INFO_OUT_LENMIN 4
  3129. #define MC_CMD_SENSOR_INFO_OUT_LENMAX 252
  3130. #define MC_CMD_SENSOR_INFO_OUT_LEN(num) (4+8*(num))
  3131. #define MC_CMD_SENSOR_INFO_OUT_MASK_OFST 0
  3132. /* enum: Controller temperature: degC */
  3133. #define MC_CMD_SENSOR_CONTROLLER_TEMP 0x0
  3134. /* enum: Phy common temperature: degC */
  3135. #define MC_CMD_SENSOR_PHY_COMMON_TEMP 0x1
  3136. /* enum: Controller cooling: bool */
  3137. #define MC_CMD_SENSOR_CONTROLLER_COOLING 0x2
  3138. /* enum: Phy 0 temperature: degC */
  3139. #define MC_CMD_SENSOR_PHY0_TEMP 0x3
  3140. /* enum: Phy 0 cooling: bool */
  3141. #define MC_CMD_SENSOR_PHY0_COOLING 0x4
  3142. /* enum: Phy 1 temperature: degC */
  3143. #define MC_CMD_SENSOR_PHY1_TEMP 0x5
  3144. /* enum: Phy 1 cooling: bool */
  3145. #define MC_CMD_SENSOR_PHY1_COOLING 0x6
  3146. /* enum: 1.0v power: mV */
  3147. #define MC_CMD_SENSOR_IN_1V0 0x7
  3148. /* enum: 1.2v power: mV */
  3149. #define MC_CMD_SENSOR_IN_1V2 0x8
  3150. /* enum: 1.8v power: mV */
  3151. #define MC_CMD_SENSOR_IN_1V8 0x9
  3152. /* enum: 2.5v power: mV */
  3153. #define MC_CMD_SENSOR_IN_2V5 0xa
  3154. /* enum: 3.3v power: mV */
  3155. #define MC_CMD_SENSOR_IN_3V3 0xb
  3156. /* enum: 12v power: mV */
  3157. #define MC_CMD_SENSOR_IN_12V0 0xc
  3158. /* enum: 1.2v analogue power: mV */
  3159. #define MC_CMD_SENSOR_IN_1V2A 0xd
  3160. /* enum: reference voltage: mV */
  3161. #define MC_CMD_SENSOR_IN_VREF 0xe
  3162. /* enum: AOE FPGA power: mV */
  3163. #define MC_CMD_SENSOR_OUT_VAOE 0xf
  3164. /* enum: AOE FPGA temperature: degC */
  3165. #define MC_CMD_SENSOR_AOE_TEMP 0x10
  3166. /* enum: AOE FPGA PSU temperature: degC */
  3167. #define MC_CMD_SENSOR_PSU_AOE_TEMP 0x11
  3168. /* enum: AOE PSU temperature: degC */
  3169. #define MC_CMD_SENSOR_PSU_TEMP 0x12
  3170. /* enum: Fan 0 speed: RPM */
  3171. #define MC_CMD_SENSOR_FAN_0 0x13
  3172. /* enum: Fan 1 speed: RPM */
  3173. #define MC_CMD_SENSOR_FAN_1 0x14
  3174. /* enum: Fan 2 speed: RPM */
  3175. #define MC_CMD_SENSOR_FAN_2 0x15
  3176. /* enum: Fan 3 speed: RPM */
  3177. #define MC_CMD_SENSOR_FAN_3 0x16
  3178. /* enum: Fan 4 speed: RPM */
  3179. #define MC_CMD_SENSOR_FAN_4 0x17
  3180. /* enum: AOE FPGA input power: mV */
  3181. #define MC_CMD_SENSOR_IN_VAOE 0x18
  3182. /* enum: AOE FPGA current: mA */
  3183. #define MC_CMD_SENSOR_OUT_IAOE 0x19
  3184. /* enum: AOE FPGA input current: mA */
  3185. #define MC_CMD_SENSOR_IN_IAOE 0x1a
  3186. /* enum: NIC power consumption: W */
  3187. #define MC_CMD_SENSOR_NIC_POWER 0x1b
  3188. /* enum: 0.9v power voltage: mV */
  3189. #define MC_CMD_SENSOR_IN_0V9 0x1c
  3190. /* enum: 0.9v power current: mA */
  3191. #define MC_CMD_SENSOR_IN_I0V9 0x1d
  3192. /* enum: 1.2v power current: mA */
  3193. #define MC_CMD_SENSOR_IN_I1V2 0x1e
  3194. /* enum: Not a sensor: reserved for the next page flag */
  3195. #define MC_CMD_SENSOR_PAGE0_NEXT 0x1f
  3196. /* enum: 0.9v power voltage (at ADC): mV */
  3197. #define MC_CMD_SENSOR_IN_0V9_ADC 0x20
  3198. /* enum: Controller temperature 2: degC */
  3199. #define MC_CMD_SENSOR_CONTROLLER_2_TEMP 0x21
  3200. /* enum: Voltage regulator internal temperature: degC */
  3201. #define MC_CMD_SENSOR_VREG_INTERNAL_TEMP 0x22
  3202. /* enum: 0.9V voltage regulator temperature: degC */
  3203. #define MC_CMD_SENSOR_VREG_0V9_TEMP 0x23
  3204. /* enum: 1.2V voltage regulator temperature: degC */
  3205. #define MC_CMD_SENSOR_VREG_1V2_TEMP 0x24
  3206. /* enum: controller internal temperature sensor voltage (internal ADC): mV */
  3207. #define MC_CMD_SENSOR_CONTROLLER_VPTAT 0x25
  3208. /* enum: controller internal temperature (internal ADC): degC */
  3209. #define MC_CMD_SENSOR_CONTROLLER_INTERNAL_TEMP 0x26
  3210. /* enum: controller internal temperature sensor voltage (external ADC): mV */
  3211. #define MC_CMD_SENSOR_CONTROLLER_VPTAT_EXTADC 0x27
  3212. /* enum: controller internal temperature (external ADC): degC */
  3213. #define MC_CMD_SENSOR_CONTROLLER_INTERNAL_TEMP_EXTADC 0x28
  3214. /* enum: ambient temperature: degC */
  3215. #define MC_CMD_SENSOR_AMBIENT_TEMP 0x29
  3216. /* enum: air flow: bool */
  3217. #define MC_CMD_SENSOR_AIRFLOW 0x2a
  3218. /* enum: voltage between VSS08D and VSS08D at CSR: mV */
  3219. #define MC_CMD_SENSOR_VDD08D_VSS08D_CSR 0x2b
  3220. /* enum: voltage between VSS08D and VSS08D at CSR (external ADC): mV */
  3221. #define MC_CMD_SENSOR_VDD08D_VSS08D_CSR_EXTADC 0x2c
  3222. /* enum: Hotpoint temperature: degC */
  3223. #define MC_CMD_SENSOR_HOTPOINT_TEMP 0x2d
  3224. /* MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF */
  3225. #define MC_CMD_SENSOR_ENTRY_OFST 4
  3226. #define MC_CMD_SENSOR_ENTRY_LEN 8
  3227. #define MC_CMD_SENSOR_ENTRY_LO_OFST 4
  3228. #define MC_CMD_SENSOR_ENTRY_HI_OFST 8
  3229. #define MC_CMD_SENSOR_ENTRY_MINNUM 0
  3230. #define MC_CMD_SENSOR_ENTRY_MAXNUM 31
  3231. /* MC_CMD_SENSOR_INFO_EXT_OUT msgresponse */
  3232. #define MC_CMD_SENSOR_INFO_EXT_OUT_LENMIN 4
  3233. #define MC_CMD_SENSOR_INFO_EXT_OUT_LENMAX 252
  3234. #define MC_CMD_SENSOR_INFO_EXT_OUT_LEN(num) (4+8*(num))
  3235. #define MC_CMD_SENSOR_INFO_EXT_OUT_MASK_OFST 0
  3236. /* Enum values, see field(s): */
  3237. /* MC_CMD_SENSOR_INFO_OUT */
  3238. #define MC_CMD_SENSOR_INFO_EXT_OUT_NEXT_PAGE_LBN 31
  3239. #define MC_CMD_SENSOR_INFO_EXT_OUT_NEXT_PAGE_WIDTH 1
  3240. /* MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF */
  3241. /* MC_CMD_SENSOR_ENTRY_OFST 4 */
  3242. /* MC_CMD_SENSOR_ENTRY_LEN 8 */
  3243. /* MC_CMD_SENSOR_ENTRY_LO_OFST 4 */
  3244. /* MC_CMD_SENSOR_ENTRY_HI_OFST 8 */
  3245. /* MC_CMD_SENSOR_ENTRY_MINNUM 0 */
  3246. /* MC_CMD_SENSOR_ENTRY_MAXNUM 31 */
  3247. /* MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF structuredef */
  3248. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_LEN 8
  3249. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MIN1_OFST 0
  3250. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MIN1_LEN 2
  3251. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MIN1_LBN 0
  3252. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MIN1_WIDTH 16
  3253. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MAX1_OFST 2
  3254. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MAX1_LEN 2
  3255. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MAX1_LBN 16
  3256. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MAX1_WIDTH 16
  3257. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MIN2_OFST 4
  3258. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MIN2_LEN 2
  3259. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MIN2_LBN 32
  3260. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MIN2_WIDTH 16
  3261. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MAX2_OFST 6
  3262. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MAX2_LEN 2
  3263. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MAX2_LBN 48
  3264. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MAX2_WIDTH 16
  3265. /***********************************/
  3266. /* MC_CMD_READ_SENSORS
  3267. * Returns the current reading from each sensor. DMAs an array of sensor
  3268. * readings, in order of sensor type (but without gaps for unimplemented
  3269. * sensors), into host memory. Each array element is a
  3270. * MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF dword.
  3271. *
  3272. * If the request does not contain the LENGTH field then only sensors 0 to 30
  3273. * are reported, to avoid DMA buffer overflow in older host software. If the
  3274. * sensor reading require more space than the LENGTH allows, then return
  3275. * EINVAL.
  3276. *
  3277. * The MC will send a SENSOREVT event every time any sensor changes state. The
  3278. * driver is responsible for ensuring that it doesn't miss any events. The
  3279. * board will function normally if all sensors are in STATE_OK or
  3280. * STATE_WARNING. Otherwise the board should not be expected to function.
  3281. */
  3282. #define MC_CMD_READ_SENSORS 0x42
  3283. #define MC_CMD_0x42_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  3284. /* MC_CMD_READ_SENSORS_IN msgrequest */
  3285. #define MC_CMD_READ_SENSORS_IN_LEN 8
  3286. /* DMA address of host buffer for sensor readings (must be 4Kbyte aligned). */
  3287. #define MC_CMD_READ_SENSORS_IN_DMA_ADDR_OFST 0
  3288. #define MC_CMD_READ_SENSORS_IN_DMA_ADDR_LEN 8
  3289. #define MC_CMD_READ_SENSORS_IN_DMA_ADDR_LO_OFST 0
  3290. #define MC_CMD_READ_SENSORS_IN_DMA_ADDR_HI_OFST 4
  3291. /* MC_CMD_READ_SENSORS_EXT_IN msgrequest */
  3292. #define MC_CMD_READ_SENSORS_EXT_IN_LEN 12
  3293. /* DMA address of host buffer for sensor readings */
  3294. #define MC_CMD_READ_SENSORS_EXT_IN_DMA_ADDR_OFST 0
  3295. #define MC_CMD_READ_SENSORS_EXT_IN_DMA_ADDR_LEN 8
  3296. #define MC_CMD_READ_SENSORS_EXT_IN_DMA_ADDR_LO_OFST 0
  3297. #define MC_CMD_READ_SENSORS_EXT_IN_DMA_ADDR_HI_OFST 4
  3298. /* Size in bytes of host buffer. */
  3299. #define MC_CMD_READ_SENSORS_EXT_IN_LENGTH_OFST 8
  3300. /* MC_CMD_READ_SENSORS_OUT msgresponse */
  3301. #define MC_CMD_READ_SENSORS_OUT_LEN 0
  3302. /* MC_CMD_READ_SENSORS_EXT_OUT msgresponse */
  3303. #define MC_CMD_READ_SENSORS_EXT_OUT_LEN 0
  3304. /* MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF structuredef */
  3305. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_LEN 4
  3306. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_VALUE_OFST 0
  3307. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_VALUE_LEN 2
  3308. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_VALUE_LBN 0
  3309. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_VALUE_WIDTH 16
  3310. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_STATE_OFST 2
  3311. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_STATE_LEN 1
  3312. /* enum: Ok. */
  3313. #define MC_CMD_SENSOR_STATE_OK 0x0
  3314. /* enum: Breached warning threshold. */
  3315. #define MC_CMD_SENSOR_STATE_WARNING 0x1
  3316. /* enum: Breached fatal threshold. */
  3317. #define MC_CMD_SENSOR_STATE_FATAL 0x2
  3318. /* enum: Fault with sensor. */
  3319. #define MC_CMD_SENSOR_STATE_BROKEN 0x3
  3320. /* enum: Sensor is working but does not currently have a reading. */
  3321. #define MC_CMD_SENSOR_STATE_NO_READING 0x4
  3322. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_STATE_LBN 16
  3323. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_STATE_WIDTH 8
  3324. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_TYPE_OFST 3
  3325. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_TYPE_LEN 1
  3326. /* Enum values, see field(s): */
  3327. /* MC_CMD_SENSOR_INFO/MC_CMD_SENSOR_INFO_OUT/MASK */
  3328. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_TYPE_LBN 24
  3329. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_TYPE_WIDTH 8
  3330. /***********************************/
  3331. /* MC_CMD_GET_PHY_STATE
  3332. * Report current state of PHY. A 'zombie' PHY is a PHY that has failed to boot
  3333. * (e.g. due to missing or corrupted firmware). Locks required: None. Return
  3334. * code: 0
  3335. */
  3336. #define MC_CMD_GET_PHY_STATE 0x43
  3337. #define MC_CMD_0x43_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  3338. /* MC_CMD_GET_PHY_STATE_IN msgrequest */
  3339. #define MC_CMD_GET_PHY_STATE_IN_LEN 0
  3340. /* MC_CMD_GET_PHY_STATE_OUT msgresponse */
  3341. #define MC_CMD_GET_PHY_STATE_OUT_LEN 4
  3342. #define MC_CMD_GET_PHY_STATE_OUT_STATE_OFST 0
  3343. /* enum: Ok. */
  3344. #define MC_CMD_PHY_STATE_OK 0x1
  3345. /* enum: Faulty. */
  3346. #define MC_CMD_PHY_STATE_ZOMBIE 0x2
  3347. /***********************************/
  3348. /* MC_CMD_SETUP_8021QBB
  3349. * 802.1Qbb control. 8 Tx queues that map to priorities 0 - 7. Use all 1s to
  3350. * disable 802.Qbb for a given priority.
  3351. */
  3352. #define MC_CMD_SETUP_8021QBB 0x44
  3353. /* MC_CMD_SETUP_8021QBB_IN msgrequest */
  3354. #define MC_CMD_SETUP_8021QBB_IN_LEN 32
  3355. #define MC_CMD_SETUP_8021QBB_IN_TXQS_OFST 0
  3356. #define MC_CMD_SETUP_8021QBB_IN_TXQS_LEN 32
  3357. /* MC_CMD_SETUP_8021QBB_OUT msgresponse */
  3358. #define MC_CMD_SETUP_8021QBB_OUT_LEN 0
  3359. /***********************************/
  3360. /* MC_CMD_WOL_FILTER_GET
  3361. * Retrieve ID of any WoL filters. Locks required: None. Returns: 0, ENOSYS
  3362. */
  3363. #define MC_CMD_WOL_FILTER_GET 0x45
  3364. #define MC_CMD_0x45_PRIVILEGE_CTG SRIOV_CTG_LINK
  3365. /* MC_CMD_WOL_FILTER_GET_IN msgrequest */
  3366. #define MC_CMD_WOL_FILTER_GET_IN_LEN 0
  3367. /* MC_CMD_WOL_FILTER_GET_OUT msgresponse */
  3368. #define MC_CMD_WOL_FILTER_GET_OUT_LEN 4
  3369. #define MC_CMD_WOL_FILTER_GET_OUT_FILTER_ID_OFST 0
  3370. /***********************************/
  3371. /* MC_CMD_ADD_LIGHTSOUT_OFFLOAD
  3372. * Add a protocol offload to NIC for lights-out state. Locks required: None.
  3373. * Returns: 0, ENOSYS
  3374. */
  3375. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD 0x46
  3376. #define MC_CMD_0x46_PRIVILEGE_CTG SRIOV_CTG_LINK
  3377. /* MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN msgrequest */
  3378. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_LENMIN 8
  3379. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_LENMAX 252
  3380. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_LEN(num) (4+4*(num))
  3381. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_PROTOCOL_OFST 0
  3382. #define MC_CMD_LIGHTSOUT_OFFLOAD_PROTOCOL_ARP 0x1 /* enum */
  3383. #define MC_CMD_LIGHTSOUT_OFFLOAD_PROTOCOL_NS 0x2 /* enum */
  3384. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_DATA_OFST 4
  3385. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_DATA_LEN 4
  3386. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_DATA_MINNUM 1
  3387. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_DATA_MAXNUM 62
  3388. /* MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_ARP msgrequest */
  3389. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_ARP_LEN 14
  3390. /* MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_PROTOCOL_OFST 0 */
  3391. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_ARP_MAC_OFST 4
  3392. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_ARP_MAC_LEN 6
  3393. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_ARP_IP_OFST 10
  3394. /* MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_NS msgrequest */
  3395. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_NS_LEN 42
  3396. /* MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_PROTOCOL_OFST 0 */
  3397. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_NS_MAC_OFST 4
  3398. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_NS_MAC_LEN 6
  3399. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_NS_SNIPV6_OFST 10
  3400. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_NS_SNIPV6_LEN 16
  3401. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_NS_IPV6_OFST 26
  3402. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_NS_IPV6_LEN 16
  3403. /* MC_CMD_ADD_LIGHTSOUT_OFFLOAD_OUT msgresponse */
  3404. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_OUT_LEN 4
  3405. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_OUT_FILTER_ID_OFST 0
  3406. /***********************************/
  3407. /* MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD
  3408. * Remove a protocol offload from NIC for lights-out state. Locks required:
  3409. * None. Returns: 0, ENOSYS
  3410. */
  3411. #define MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD 0x47
  3412. #define MC_CMD_0x47_PRIVILEGE_CTG SRIOV_CTG_LINK
  3413. /* MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD_IN msgrequest */
  3414. #define MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD_IN_LEN 8
  3415. #define MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD_IN_PROTOCOL_OFST 0
  3416. #define MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD_IN_FILTER_ID_OFST 4
  3417. /* MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD_OUT msgresponse */
  3418. #define MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD_OUT_LEN 0
  3419. /***********************************/
  3420. /* MC_CMD_MAC_RESET_RESTORE
  3421. * Restore MAC after block reset. Locks required: None. Returns: 0.
  3422. */
  3423. #define MC_CMD_MAC_RESET_RESTORE 0x48
  3424. /* MC_CMD_MAC_RESET_RESTORE_IN msgrequest */
  3425. #define MC_CMD_MAC_RESET_RESTORE_IN_LEN 0
  3426. /* MC_CMD_MAC_RESET_RESTORE_OUT msgresponse */
  3427. #define MC_CMD_MAC_RESET_RESTORE_OUT_LEN 0
  3428. /***********************************/
  3429. /* MC_CMD_TESTASSERT
  3430. * Deliberately trigger an assert-detonation in the firmware for testing
  3431. * purposes (i.e. to allow tests that the driver copes gracefully). Locks
  3432. * required: None Returns: 0
  3433. */
  3434. #define MC_CMD_TESTASSERT 0x49
  3435. #define MC_CMD_0x49_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  3436. /* MC_CMD_TESTASSERT_IN msgrequest */
  3437. #define MC_CMD_TESTASSERT_IN_LEN 0
  3438. /* MC_CMD_TESTASSERT_OUT msgresponse */
  3439. #define MC_CMD_TESTASSERT_OUT_LEN 0
  3440. /***********************************/
  3441. /* MC_CMD_WORKAROUND
  3442. * Enable/Disable a given workaround. The mcfw will return EINVAL if it doesn't
  3443. * understand the given workaround number - which should not be treated as a
  3444. * hard error by client code. This op does not imply any semantics about each
  3445. * workaround, that's between the driver and the mcfw on a per-workaround
  3446. * basis. Locks required: None. Returns: 0, EINVAL .
  3447. */
  3448. #define MC_CMD_WORKAROUND 0x4a
  3449. #define MC_CMD_0x4a_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  3450. /* MC_CMD_WORKAROUND_IN msgrequest */
  3451. #define MC_CMD_WORKAROUND_IN_LEN 8
  3452. #define MC_CMD_WORKAROUND_IN_TYPE_OFST 0
  3453. /* enum: Bug 17230 work around. */
  3454. #define MC_CMD_WORKAROUND_BUG17230 0x1
  3455. /* enum: Bug 35388 work around (unsafe EVQ writes). */
  3456. #define MC_CMD_WORKAROUND_BUG35388 0x2
  3457. /* enum: Bug35017 workaround (A64 tables must be identity map) */
  3458. #define MC_CMD_WORKAROUND_BUG35017 0x3
  3459. #define MC_CMD_WORKAROUND_IN_ENABLED_OFST 4
  3460. /* MC_CMD_WORKAROUND_OUT msgresponse */
  3461. #define MC_CMD_WORKAROUND_OUT_LEN 0
  3462. /***********************************/
  3463. /* MC_CMD_GET_PHY_MEDIA_INFO
  3464. * Read media-specific data from PHY (e.g. SFP/SFP+ module ID information for
  3465. * SFP+ PHYs). The 'media type' can be found via GET_PHY_CFG
  3466. * (GET_PHY_CFG_OUT_MEDIA_TYPE); the valid 'page number' input values, and the
  3467. * output data, are interpreted on a per-type basis. For SFP+: PAGE=0 or 1
  3468. * returns a 128-byte block read from module I2C address 0xA0 offset 0 or 0x80.
  3469. * Anything else: currently undefined. Locks required: None. Return code: 0.
  3470. */
  3471. #define MC_CMD_GET_PHY_MEDIA_INFO 0x4b
  3472. #define MC_CMD_0x4b_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  3473. /* MC_CMD_GET_PHY_MEDIA_INFO_IN msgrequest */
  3474. #define MC_CMD_GET_PHY_MEDIA_INFO_IN_LEN 4
  3475. #define MC_CMD_GET_PHY_MEDIA_INFO_IN_PAGE_OFST 0
  3476. /* MC_CMD_GET_PHY_MEDIA_INFO_OUT msgresponse */
  3477. #define MC_CMD_GET_PHY_MEDIA_INFO_OUT_LENMIN 5
  3478. #define MC_CMD_GET_PHY_MEDIA_INFO_OUT_LENMAX 252
  3479. #define MC_CMD_GET_PHY_MEDIA_INFO_OUT_LEN(num) (4+1*(num))
  3480. /* in bytes */
  3481. #define MC_CMD_GET_PHY_MEDIA_INFO_OUT_DATALEN_OFST 0
  3482. #define MC_CMD_GET_PHY_MEDIA_INFO_OUT_DATA_OFST 4
  3483. #define MC_CMD_GET_PHY_MEDIA_INFO_OUT_DATA_LEN 1
  3484. #define MC_CMD_GET_PHY_MEDIA_INFO_OUT_DATA_MINNUM 1
  3485. #define MC_CMD_GET_PHY_MEDIA_INFO_OUT_DATA_MAXNUM 248
  3486. /***********************************/
  3487. /* MC_CMD_NVRAM_TEST
  3488. * Test a particular NVRAM partition for valid contents (where "valid" depends
  3489. * on the type of partition).
  3490. */
  3491. #define MC_CMD_NVRAM_TEST 0x4c
  3492. #define MC_CMD_0x4c_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  3493. /* MC_CMD_NVRAM_TEST_IN msgrequest */
  3494. #define MC_CMD_NVRAM_TEST_IN_LEN 4
  3495. #define MC_CMD_NVRAM_TEST_IN_TYPE_OFST 0
  3496. /* Enum values, see field(s): */
  3497. /* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */
  3498. /* MC_CMD_NVRAM_TEST_OUT msgresponse */
  3499. #define MC_CMD_NVRAM_TEST_OUT_LEN 4
  3500. #define MC_CMD_NVRAM_TEST_OUT_RESULT_OFST 0
  3501. /* enum: Passed. */
  3502. #define MC_CMD_NVRAM_TEST_PASS 0x0
  3503. /* enum: Failed. */
  3504. #define MC_CMD_NVRAM_TEST_FAIL 0x1
  3505. /* enum: Not supported. */
  3506. #define MC_CMD_NVRAM_TEST_NOTSUPP 0x2
  3507. /***********************************/
  3508. /* MC_CMD_MRSFP_TWEAK
  3509. * Read status and/or set parameters for the 'mrsfp' driver in mr_rusty builds.
  3510. * I2C I/O expander bits are always read; if equaliser parameters are supplied,
  3511. * they are configured first. Locks required: None. Return code: 0, EINVAL.
  3512. */
  3513. #define MC_CMD_MRSFP_TWEAK 0x4d
  3514. /* MC_CMD_MRSFP_TWEAK_IN_EQ_CONFIG msgrequest */
  3515. #define MC_CMD_MRSFP_TWEAK_IN_EQ_CONFIG_LEN 16
  3516. /* 0-6 low->high de-emph. */
  3517. #define MC_CMD_MRSFP_TWEAK_IN_EQ_CONFIG_TXEQ_LEVEL_OFST 0
  3518. /* 0-8 low->high ref.V */
  3519. #define MC_CMD_MRSFP_TWEAK_IN_EQ_CONFIG_TXEQ_DT_CFG_OFST 4
  3520. /* 0-8 0-8 low->high boost */
  3521. #define MC_CMD_MRSFP_TWEAK_IN_EQ_CONFIG_RXEQ_BOOST_OFST 8
  3522. /* 0-8 low->high ref.V */
  3523. #define MC_CMD_MRSFP_TWEAK_IN_EQ_CONFIG_RXEQ_DT_CFG_OFST 12
  3524. /* MC_CMD_MRSFP_TWEAK_IN_READ_ONLY msgrequest */
  3525. #define MC_CMD_MRSFP_TWEAK_IN_READ_ONLY_LEN 0
  3526. /* MC_CMD_MRSFP_TWEAK_OUT msgresponse */
  3527. #define MC_CMD_MRSFP_TWEAK_OUT_LEN 12
  3528. /* input bits */
  3529. #define MC_CMD_MRSFP_TWEAK_OUT_IOEXP_INPUTS_OFST 0
  3530. /* output bits */
  3531. #define MC_CMD_MRSFP_TWEAK_OUT_IOEXP_OUTPUTS_OFST 4
  3532. /* direction */
  3533. #define MC_CMD_MRSFP_TWEAK_OUT_IOEXP_DIRECTION_OFST 8
  3534. /* enum: Out. */
  3535. #define MC_CMD_MRSFP_TWEAK_OUT_IOEXP_DIRECTION_OUT 0x0
  3536. /* enum: In. */
  3537. #define MC_CMD_MRSFP_TWEAK_OUT_IOEXP_DIRECTION_IN 0x1
  3538. /***********************************/
  3539. /* MC_CMD_SENSOR_SET_LIMS
  3540. * Adjusts the sensor limits. This is a warranty-voiding operation. Returns:
  3541. * ENOENT if the sensor specified does not exist, EINVAL if the limits are out
  3542. * of range.
  3543. */
  3544. #define MC_CMD_SENSOR_SET_LIMS 0x4e
  3545. #define MC_CMD_0x4e_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  3546. /* MC_CMD_SENSOR_SET_LIMS_IN msgrequest */
  3547. #define MC_CMD_SENSOR_SET_LIMS_IN_LEN 20
  3548. #define MC_CMD_SENSOR_SET_LIMS_IN_SENSOR_OFST 0
  3549. /* Enum values, see field(s): */
  3550. /* MC_CMD_SENSOR_INFO/MC_CMD_SENSOR_INFO_OUT/MASK */
  3551. /* interpretation is is sensor-specific. */
  3552. #define MC_CMD_SENSOR_SET_LIMS_IN_LOW0_OFST 4
  3553. /* interpretation is is sensor-specific. */
  3554. #define MC_CMD_SENSOR_SET_LIMS_IN_HI0_OFST 8
  3555. /* interpretation is is sensor-specific. */
  3556. #define MC_CMD_SENSOR_SET_LIMS_IN_LOW1_OFST 12
  3557. /* interpretation is is sensor-specific. */
  3558. #define MC_CMD_SENSOR_SET_LIMS_IN_HI1_OFST 16
  3559. /* MC_CMD_SENSOR_SET_LIMS_OUT msgresponse */
  3560. #define MC_CMD_SENSOR_SET_LIMS_OUT_LEN 0
  3561. /***********************************/
  3562. /* MC_CMD_GET_RESOURCE_LIMITS
  3563. */
  3564. #define MC_CMD_GET_RESOURCE_LIMITS 0x4f
  3565. /* MC_CMD_GET_RESOURCE_LIMITS_IN msgrequest */
  3566. #define MC_CMD_GET_RESOURCE_LIMITS_IN_LEN 0
  3567. /* MC_CMD_GET_RESOURCE_LIMITS_OUT msgresponse */
  3568. #define MC_CMD_GET_RESOURCE_LIMITS_OUT_LEN 16
  3569. #define MC_CMD_GET_RESOURCE_LIMITS_OUT_BUFTBL_OFST 0
  3570. #define MC_CMD_GET_RESOURCE_LIMITS_OUT_EVQ_OFST 4
  3571. #define MC_CMD_GET_RESOURCE_LIMITS_OUT_RXQ_OFST 8
  3572. #define MC_CMD_GET_RESOURCE_LIMITS_OUT_TXQ_OFST 12
  3573. /***********************************/
  3574. /* MC_CMD_NVRAM_PARTITIONS
  3575. * Reads the list of available virtual NVRAM partition types. Locks required:
  3576. * none. Returns: 0, EINVAL (bad type).
  3577. */
  3578. #define MC_CMD_NVRAM_PARTITIONS 0x51
  3579. #define MC_CMD_0x51_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  3580. /* MC_CMD_NVRAM_PARTITIONS_IN msgrequest */
  3581. #define MC_CMD_NVRAM_PARTITIONS_IN_LEN 0
  3582. /* MC_CMD_NVRAM_PARTITIONS_OUT msgresponse */
  3583. #define MC_CMD_NVRAM_PARTITIONS_OUT_LENMIN 4
  3584. #define MC_CMD_NVRAM_PARTITIONS_OUT_LENMAX 252
  3585. #define MC_CMD_NVRAM_PARTITIONS_OUT_LEN(num) (4+4*(num))
  3586. /* total number of partitions */
  3587. #define MC_CMD_NVRAM_PARTITIONS_OUT_NUM_PARTITIONS_OFST 0
  3588. /* type ID code for each of NUM_PARTITIONS partitions */
  3589. #define MC_CMD_NVRAM_PARTITIONS_OUT_TYPE_ID_OFST 4
  3590. #define MC_CMD_NVRAM_PARTITIONS_OUT_TYPE_ID_LEN 4
  3591. #define MC_CMD_NVRAM_PARTITIONS_OUT_TYPE_ID_MINNUM 0
  3592. #define MC_CMD_NVRAM_PARTITIONS_OUT_TYPE_ID_MAXNUM 62
  3593. /***********************************/
  3594. /* MC_CMD_NVRAM_METADATA
  3595. * Reads soft metadata for a virtual NVRAM partition type. Locks required:
  3596. * none. Returns: 0, EINVAL (bad type).
  3597. */
  3598. #define MC_CMD_NVRAM_METADATA 0x52
  3599. #define MC_CMD_0x52_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  3600. /* MC_CMD_NVRAM_METADATA_IN msgrequest */
  3601. #define MC_CMD_NVRAM_METADATA_IN_LEN 4
  3602. /* Partition type ID code */
  3603. #define MC_CMD_NVRAM_METADATA_IN_TYPE_OFST 0
  3604. /* MC_CMD_NVRAM_METADATA_OUT msgresponse */
  3605. #define MC_CMD_NVRAM_METADATA_OUT_LENMIN 20
  3606. #define MC_CMD_NVRAM_METADATA_OUT_LENMAX 252
  3607. #define MC_CMD_NVRAM_METADATA_OUT_LEN(num) (20+1*(num))
  3608. /* Partition type ID code */
  3609. #define MC_CMD_NVRAM_METADATA_OUT_TYPE_OFST 0
  3610. #define MC_CMD_NVRAM_METADATA_OUT_FLAGS_OFST 4
  3611. #define MC_CMD_NVRAM_METADATA_OUT_SUBTYPE_VALID_LBN 0
  3612. #define MC_CMD_NVRAM_METADATA_OUT_SUBTYPE_VALID_WIDTH 1
  3613. #define MC_CMD_NVRAM_METADATA_OUT_VERSION_VALID_LBN 1
  3614. #define MC_CMD_NVRAM_METADATA_OUT_VERSION_VALID_WIDTH 1
  3615. #define MC_CMD_NVRAM_METADATA_OUT_DESCRIPTION_VALID_LBN 2
  3616. #define MC_CMD_NVRAM_METADATA_OUT_DESCRIPTION_VALID_WIDTH 1
  3617. /* Subtype ID code for content of this partition */
  3618. #define MC_CMD_NVRAM_METADATA_OUT_SUBTYPE_OFST 8
  3619. /* 1st component of W.X.Y.Z version number for content of this partition */
  3620. #define MC_CMD_NVRAM_METADATA_OUT_VERSION_W_OFST 12
  3621. #define MC_CMD_NVRAM_METADATA_OUT_VERSION_W_LEN 2
  3622. /* 2nd component of W.X.Y.Z version number for content of this partition */
  3623. #define MC_CMD_NVRAM_METADATA_OUT_VERSION_X_OFST 14
  3624. #define MC_CMD_NVRAM_METADATA_OUT_VERSION_X_LEN 2
  3625. /* 3rd component of W.X.Y.Z version number for content of this partition */
  3626. #define MC_CMD_NVRAM_METADATA_OUT_VERSION_Y_OFST 16
  3627. #define MC_CMD_NVRAM_METADATA_OUT_VERSION_Y_LEN 2
  3628. /* 4th component of W.X.Y.Z version number for content of this partition */
  3629. #define MC_CMD_NVRAM_METADATA_OUT_VERSION_Z_OFST 18
  3630. #define MC_CMD_NVRAM_METADATA_OUT_VERSION_Z_LEN 2
  3631. /* Zero-terminated string describing the content of this partition */
  3632. #define MC_CMD_NVRAM_METADATA_OUT_DESCRIPTION_OFST 20
  3633. #define MC_CMD_NVRAM_METADATA_OUT_DESCRIPTION_LEN 1
  3634. #define MC_CMD_NVRAM_METADATA_OUT_DESCRIPTION_MINNUM 0
  3635. #define MC_CMD_NVRAM_METADATA_OUT_DESCRIPTION_MAXNUM 232
  3636. /***********************************/
  3637. /* MC_CMD_GET_MAC_ADDRESSES
  3638. * Returns the base MAC, count and stride for the requestiong function
  3639. */
  3640. #define MC_CMD_GET_MAC_ADDRESSES 0x55
  3641. #define MC_CMD_0x55_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  3642. /* MC_CMD_GET_MAC_ADDRESSES_IN msgrequest */
  3643. #define MC_CMD_GET_MAC_ADDRESSES_IN_LEN 0
  3644. /* MC_CMD_GET_MAC_ADDRESSES_OUT msgresponse */
  3645. #define MC_CMD_GET_MAC_ADDRESSES_OUT_LEN 16
  3646. /* Base MAC address */
  3647. #define MC_CMD_GET_MAC_ADDRESSES_OUT_MAC_ADDR_BASE_OFST 0
  3648. #define MC_CMD_GET_MAC_ADDRESSES_OUT_MAC_ADDR_BASE_LEN 6
  3649. /* Padding */
  3650. #define MC_CMD_GET_MAC_ADDRESSES_OUT_RESERVED_OFST 6
  3651. #define MC_CMD_GET_MAC_ADDRESSES_OUT_RESERVED_LEN 2
  3652. /* Number of allocated MAC addresses */
  3653. #define MC_CMD_GET_MAC_ADDRESSES_OUT_MAC_COUNT_OFST 8
  3654. /* Spacing of allocated MAC addresses */
  3655. #define MC_CMD_GET_MAC_ADDRESSES_OUT_MAC_STRIDE_OFST 12
  3656. /* MC_CMD_RESOURCE_SPECIFIER enum */
  3657. /* enum: Any */
  3658. #define MC_CMD_RESOURCE_INSTANCE_ANY 0xffffffff
  3659. /* enum: None */
  3660. #define MC_CMD_RESOURCE_INSTANCE_NONE 0xfffffffe
  3661. /* EVB_PORT_ID structuredef */
  3662. #define EVB_PORT_ID_LEN 4
  3663. #define EVB_PORT_ID_PORT_ID_OFST 0
  3664. /* enum: An invalid port handle. */
  3665. #define EVB_PORT_ID_NULL 0x0
  3666. /* enum: The port assigned to this function.. */
  3667. #define EVB_PORT_ID_ASSIGNED 0x1000000
  3668. /* enum: External network port 0 */
  3669. #define EVB_PORT_ID_MAC0 0x2000000
  3670. /* enum: External network port 1 */
  3671. #define EVB_PORT_ID_MAC1 0x2000001
  3672. /* enum: External network port 2 */
  3673. #define EVB_PORT_ID_MAC2 0x2000002
  3674. /* enum: External network port 3 */
  3675. #define EVB_PORT_ID_MAC3 0x2000003
  3676. #define EVB_PORT_ID_PORT_ID_LBN 0
  3677. #define EVB_PORT_ID_PORT_ID_WIDTH 32
  3678. /* EVB_VLAN_TAG structuredef */
  3679. #define EVB_VLAN_TAG_LEN 2
  3680. /* The VLAN tag value */
  3681. #define EVB_VLAN_TAG_VLAN_ID_LBN 0
  3682. #define EVB_VLAN_TAG_VLAN_ID_WIDTH 12
  3683. #define EVB_VLAN_TAG_MODE_LBN 12
  3684. #define EVB_VLAN_TAG_MODE_WIDTH 4
  3685. /* enum: Insert the VLAN. */
  3686. #define EVB_VLAN_TAG_INSERT 0x0
  3687. /* enum: Replace the VLAN if already present. */
  3688. #define EVB_VLAN_TAG_REPLACE 0x1
  3689. /* BUFTBL_ENTRY structuredef */
  3690. #define BUFTBL_ENTRY_LEN 12
  3691. /* the owner ID */
  3692. #define BUFTBL_ENTRY_OID_OFST 0
  3693. #define BUFTBL_ENTRY_OID_LEN 2
  3694. #define BUFTBL_ENTRY_OID_LBN 0
  3695. #define BUFTBL_ENTRY_OID_WIDTH 16
  3696. /* the page parameter as one of ESE_DZ_SMC_PAGE_SIZE_ */
  3697. #define BUFTBL_ENTRY_PGSZ_OFST 2
  3698. #define BUFTBL_ENTRY_PGSZ_LEN 2
  3699. #define BUFTBL_ENTRY_PGSZ_LBN 16
  3700. #define BUFTBL_ENTRY_PGSZ_WIDTH 16
  3701. /* the raw 64-bit address field from the SMC, not adjusted for page size */
  3702. #define BUFTBL_ENTRY_RAWADDR_OFST 4
  3703. #define BUFTBL_ENTRY_RAWADDR_LEN 8
  3704. #define BUFTBL_ENTRY_RAWADDR_LO_OFST 4
  3705. #define BUFTBL_ENTRY_RAWADDR_HI_OFST 8
  3706. #define BUFTBL_ENTRY_RAWADDR_LBN 32
  3707. #define BUFTBL_ENTRY_RAWADDR_WIDTH 64
  3708. /* NVRAM_PARTITION_TYPE structuredef */
  3709. #define NVRAM_PARTITION_TYPE_LEN 2
  3710. #define NVRAM_PARTITION_TYPE_ID_OFST 0
  3711. #define NVRAM_PARTITION_TYPE_ID_LEN 2
  3712. /* enum: Primary MC firmware partition */
  3713. #define NVRAM_PARTITION_TYPE_MC_FIRMWARE 0x100
  3714. /* enum: Secondary MC firmware partition */
  3715. #define NVRAM_PARTITION_TYPE_MC_FIRMWARE_BACKUP 0x200
  3716. /* enum: Expansion ROM partition */
  3717. #define NVRAM_PARTITION_TYPE_EXPANSION_ROM 0x300
  3718. /* enum: Static configuration TLV partition */
  3719. #define NVRAM_PARTITION_TYPE_STATIC_CONFIG 0x400
  3720. /* enum: Dynamic configuration TLV partition */
  3721. #define NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG 0x500
  3722. /* enum: Expansion ROM configuration data for port 0 */
  3723. #define NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT0 0x600
  3724. /* enum: Expansion ROM configuration data for port 1 */
  3725. #define NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT1 0x601
  3726. /* enum: Expansion ROM configuration data for port 2 */
  3727. #define NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT2 0x602
  3728. /* enum: Expansion ROM configuration data for port 3 */
  3729. #define NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT3 0x603
  3730. /* enum: Non-volatile log output partition */
  3731. #define NVRAM_PARTITION_TYPE_LOG 0x700
  3732. /* enum: Device state dump output partition */
  3733. #define NVRAM_PARTITION_TYPE_DUMP 0x800
  3734. /* enum: Application license key storage partition */
  3735. #define NVRAM_PARTITION_TYPE_LICENSE 0x900
  3736. /* enum: Start of range used for PHY partitions (low 8 bits are the PHY ID) */
  3737. #define NVRAM_PARTITION_TYPE_PHY_MIN 0xa00
  3738. /* enum: End of range used for PHY partitions (low 8 bits are the PHY ID) */
  3739. #define NVRAM_PARTITION_TYPE_PHY_MAX 0xaff
  3740. /* enum: Start of reserved value range (firmware may use for any purpose) */
  3741. #define NVRAM_PARTITION_TYPE_RESERVED_VALUES_MIN 0xff00
  3742. /* enum: End of reserved value range (firmware may use for any purpose) */
  3743. #define NVRAM_PARTITION_TYPE_RESERVED_VALUES_MAX 0xfffd
  3744. /* enum: Recovery partition map (provided if real map is missing or corrupt) */
  3745. #define NVRAM_PARTITION_TYPE_RECOVERY_MAP 0xfffe
  3746. /* enum: Partition map (real map as stored in flash) */
  3747. #define NVRAM_PARTITION_TYPE_PARTITION_MAP 0xffff
  3748. #define NVRAM_PARTITION_TYPE_ID_LBN 0
  3749. #define NVRAM_PARTITION_TYPE_ID_WIDTH 16
  3750. /* LICENSED_APP_ID structuredef */
  3751. #define LICENSED_APP_ID_LEN 4
  3752. #define LICENSED_APP_ID_ID_OFST 0
  3753. /* enum: OpenOnload */
  3754. #define LICENSED_APP_ID_ONLOAD 0x1
  3755. /* enum: PTP timestamping */
  3756. #define LICENSED_APP_ID_PTP 0x2
  3757. /* enum: SolarCapture Pro */
  3758. #define LICENSED_APP_ID_SOLARCAPTURE_PRO 0x4
  3759. #define LICENSED_APP_ID_ID_LBN 0
  3760. #define LICENSED_APP_ID_ID_WIDTH 32
  3761. /***********************************/
  3762. /* MC_CMD_GET_WORKAROUNDS
  3763. * Read the list of all implemented and all currently enabled workarounds. The
  3764. * enums here must correspond with those in MC_CMD_WORKAROUND.
  3765. */
  3766. #define MC_CMD_GET_WORKAROUNDS 0x59
  3767. /* MC_CMD_GET_WORKAROUNDS_OUT msgresponse */
  3768. #define MC_CMD_GET_WORKAROUNDS_OUT_LEN 8
  3769. /* Each workaround is represented by a single bit according to the enums below.
  3770. */
  3771. #define MC_CMD_GET_WORKAROUNDS_OUT_IMPLEMENTED_OFST 0
  3772. #define MC_CMD_GET_WORKAROUNDS_OUT_ENABLED_OFST 4
  3773. /* enum: Bug 17230 work around. */
  3774. #define MC_CMD_GET_WORKAROUNDS_OUT_BUG17230 0x2
  3775. /* enum: Bug 35388 work around (unsafe EVQ writes). */
  3776. #define MC_CMD_GET_WORKAROUNDS_OUT_BUG35388 0x4
  3777. /* enum: Bug35017 workaround (A64 tables must be identity map) */
  3778. #define MC_CMD_GET_WORKAROUNDS_OUT_BUG35017 0x8
  3779. /***********************************/
  3780. /* MC_CMD_LINK_STATE_MODE
  3781. * Read/set link state mode of a VF
  3782. */
  3783. #define MC_CMD_LINK_STATE_MODE 0x5c
  3784. #define MC_CMD_0x5c_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  3785. /* MC_CMD_LINK_STATE_MODE_IN msgrequest */
  3786. #define MC_CMD_LINK_STATE_MODE_IN_LEN 8
  3787. /* The target function to have its link state mode read or set, must be a VF
  3788. * e.g. VF 1,3 = 0x00030001
  3789. */
  3790. #define MC_CMD_LINK_STATE_MODE_IN_FUNCTION_OFST 0
  3791. #define MC_CMD_LINK_STATE_MODE_IN_FUNCTION_PF_LBN 0
  3792. #define MC_CMD_LINK_STATE_MODE_IN_FUNCTION_PF_WIDTH 16
  3793. #define MC_CMD_LINK_STATE_MODE_IN_FUNCTION_VF_LBN 16
  3794. #define MC_CMD_LINK_STATE_MODE_IN_FUNCTION_VF_WIDTH 16
  3795. /* New link state mode to be set */
  3796. #define MC_CMD_LINK_STATE_MODE_IN_NEW_MODE_OFST 4
  3797. #define MC_CMD_LINK_STATE_MODE_IN_LINK_STATE_AUTO 0x0 /* enum */
  3798. #define MC_CMD_LINK_STATE_MODE_IN_LINK_STATE_UP 0x1 /* enum */
  3799. #define MC_CMD_LINK_STATE_MODE_IN_LINK_STATE_DOWN 0x2 /* enum */
  3800. /* enum: Use this value to just read the existing setting without modifying it.
  3801. */
  3802. #define MC_CMD_LINK_STATE_MODE_IN_DO_NOT_CHANGE 0xffffffff
  3803. /* MC_CMD_LINK_STATE_MODE_OUT msgresponse */
  3804. #define MC_CMD_LINK_STATE_MODE_OUT_LEN 4
  3805. #define MC_CMD_LINK_STATE_MODE_OUT_OLD_MODE_OFST 0
  3806. /***********************************/
  3807. /* MC_CMD_READ_REGS
  3808. * Get a dump of the MCPU registers
  3809. */
  3810. #define MC_CMD_READ_REGS 0x50
  3811. #define MC_CMD_0x50_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  3812. /* MC_CMD_READ_REGS_IN msgrequest */
  3813. #define MC_CMD_READ_REGS_IN_LEN 0
  3814. /* MC_CMD_READ_REGS_OUT msgresponse */
  3815. #define MC_CMD_READ_REGS_OUT_LEN 308
  3816. /* Whether the corresponding register entry contains a valid value */
  3817. #define MC_CMD_READ_REGS_OUT_MASK_OFST 0
  3818. #define MC_CMD_READ_REGS_OUT_MASK_LEN 16
  3819. /* Same order as MIPS GDB (r0-r31, sr, lo, hi, bad, cause, 32 x float, fsr,
  3820. * fir, fp)
  3821. */
  3822. #define MC_CMD_READ_REGS_OUT_REGS_OFST 16
  3823. #define MC_CMD_READ_REGS_OUT_REGS_LEN 4
  3824. #define MC_CMD_READ_REGS_OUT_REGS_NUM 73
  3825. /***********************************/
  3826. /* MC_CMD_INIT_EVQ
  3827. * Set up an event queue according to the supplied parameters. The IN arguments
  3828. * end with an address for each 4k of host memory required to back the EVQ.
  3829. */
  3830. #define MC_CMD_INIT_EVQ 0x80
  3831. #define MC_CMD_0x80_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  3832. /* MC_CMD_INIT_EVQ_IN msgrequest */
  3833. #define MC_CMD_INIT_EVQ_IN_LENMIN 44
  3834. #define MC_CMD_INIT_EVQ_IN_LENMAX 548
  3835. #define MC_CMD_INIT_EVQ_IN_LEN(num) (36+8*(num))
  3836. /* Size, in entries */
  3837. #define MC_CMD_INIT_EVQ_IN_SIZE_OFST 0
  3838. /* Desired instance. Must be set to a specific instance, which is a function
  3839. * local queue index.
  3840. */
  3841. #define MC_CMD_INIT_EVQ_IN_INSTANCE_OFST 4
  3842. /* The initial timer value. The load value is ignored if the timer mode is DIS.
  3843. */
  3844. #define MC_CMD_INIT_EVQ_IN_TMR_LOAD_OFST 8
  3845. /* The reload value is ignored in one-shot modes */
  3846. #define MC_CMD_INIT_EVQ_IN_TMR_RELOAD_OFST 12
  3847. /* tbd */
  3848. #define MC_CMD_INIT_EVQ_IN_FLAGS_OFST 16
  3849. #define MC_CMD_INIT_EVQ_IN_FLAG_INTERRUPTING_LBN 0
  3850. #define MC_CMD_INIT_EVQ_IN_FLAG_INTERRUPTING_WIDTH 1
  3851. #define MC_CMD_INIT_EVQ_IN_FLAG_RPTR_DOS_LBN 1
  3852. #define MC_CMD_INIT_EVQ_IN_FLAG_RPTR_DOS_WIDTH 1
  3853. #define MC_CMD_INIT_EVQ_IN_FLAG_INT_ARMD_LBN 2
  3854. #define MC_CMD_INIT_EVQ_IN_FLAG_INT_ARMD_WIDTH 1
  3855. #define MC_CMD_INIT_EVQ_IN_FLAG_CUT_THRU_LBN 3
  3856. #define MC_CMD_INIT_EVQ_IN_FLAG_CUT_THRU_WIDTH 1
  3857. #define MC_CMD_INIT_EVQ_IN_FLAG_RX_MERGE_LBN 4
  3858. #define MC_CMD_INIT_EVQ_IN_FLAG_RX_MERGE_WIDTH 1
  3859. #define MC_CMD_INIT_EVQ_IN_FLAG_TX_MERGE_LBN 5
  3860. #define MC_CMD_INIT_EVQ_IN_FLAG_TX_MERGE_WIDTH 1
  3861. #define MC_CMD_INIT_EVQ_IN_TMR_MODE_OFST 20
  3862. /* enum: Disabled */
  3863. #define MC_CMD_INIT_EVQ_IN_TMR_MODE_DIS 0x0
  3864. /* enum: Immediate */
  3865. #define MC_CMD_INIT_EVQ_IN_TMR_IMMED_START 0x1
  3866. /* enum: Triggered */
  3867. #define MC_CMD_INIT_EVQ_IN_TMR_TRIG_START 0x2
  3868. /* enum: Hold-off */
  3869. #define MC_CMD_INIT_EVQ_IN_TMR_INT_HLDOFF 0x3
  3870. /* Target EVQ for wakeups if in wakeup mode. */
  3871. #define MC_CMD_INIT_EVQ_IN_TARGET_EVQ_OFST 24
  3872. /* Target interrupt if in interrupting mode (note union with target EVQ). Use
  3873. * MC_CMD_RESOURCE_INSTANCE_ANY unless a specific one required for test
  3874. * purposes.
  3875. */
  3876. #define MC_CMD_INIT_EVQ_IN_IRQ_NUM_OFST 24
  3877. /* Event Counter Mode. */
  3878. #define MC_CMD_INIT_EVQ_IN_COUNT_MODE_OFST 28
  3879. /* enum: Disabled */
  3880. #define MC_CMD_INIT_EVQ_IN_COUNT_MODE_DIS 0x0
  3881. /* enum: Disabled */
  3882. #define MC_CMD_INIT_EVQ_IN_COUNT_MODE_RX 0x1
  3883. /* enum: Disabled */
  3884. #define MC_CMD_INIT_EVQ_IN_COUNT_MODE_TX 0x2
  3885. /* enum: Disabled */
  3886. #define MC_CMD_INIT_EVQ_IN_COUNT_MODE_RXTX 0x3
  3887. /* Event queue packet count threshold. */
  3888. #define MC_CMD_INIT_EVQ_IN_COUNT_THRSHLD_OFST 32
  3889. /* 64-bit address of 4k of 4k-aligned host memory buffer */
  3890. #define MC_CMD_INIT_EVQ_IN_DMA_ADDR_OFST 36
  3891. #define MC_CMD_INIT_EVQ_IN_DMA_ADDR_LEN 8
  3892. #define MC_CMD_INIT_EVQ_IN_DMA_ADDR_LO_OFST 36
  3893. #define MC_CMD_INIT_EVQ_IN_DMA_ADDR_HI_OFST 40
  3894. #define MC_CMD_INIT_EVQ_IN_DMA_ADDR_MINNUM 1
  3895. #define MC_CMD_INIT_EVQ_IN_DMA_ADDR_MAXNUM 64
  3896. /* MC_CMD_INIT_EVQ_OUT msgresponse */
  3897. #define MC_CMD_INIT_EVQ_OUT_LEN 4
  3898. /* Only valid if INTRFLAG was true */
  3899. #define MC_CMD_INIT_EVQ_OUT_IRQ_OFST 0
  3900. /* QUEUE_CRC_MODE structuredef */
  3901. #define QUEUE_CRC_MODE_LEN 1
  3902. #define QUEUE_CRC_MODE_MODE_LBN 0
  3903. #define QUEUE_CRC_MODE_MODE_WIDTH 4
  3904. /* enum: No CRC. */
  3905. #define QUEUE_CRC_MODE_NONE 0x0
  3906. /* enum: CRC Fiber channel over ethernet. */
  3907. #define QUEUE_CRC_MODE_FCOE 0x1
  3908. /* enum: CRC (digest) iSCSI header only. */
  3909. #define QUEUE_CRC_MODE_ISCSI_HDR 0x2
  3910. /* enum: CRC (digest) iSCSI header and payload. */
  3911. #define QUEUE_CRC_MODE_ISCSI 0x3
  3912. /* enum: CRC Fiber channel over IP over ethernet. */
  3913. #define QUEUE_CRC_MODE_FCOIPOE 0x4
  3914. /* enum: CRC MPA. */
  3915. #define QUEUE_CRC_MODE_MPA 0x5
  3916. #define QUEUE_CRC_MODE_SPARE_LBN 4
  3917. #define QUEUE_CRC_MODE_SPARE_WIDTH 4
  3918. /***********************************/
  3919. /* MC_CMD_INIT_RXQ
  3920. * set up a receive queue according to the supplied parameters. The IN
  3921. * arguments end with an address for each 4k of host memory required to back
  3922. * the RXQ.
  3923. */
  3924. #define MC_CMD_INIT_RXQ 0x81
  3925. #define MC_CMD_0x81_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  3926. /* MC_CMD_INIT_RXQ_IN msgrequest */
  3927. #define MC_CMD_INIT_RXQ_IN_LENMIN 36
  3928. #define MC_CMD_INIT_RXQ_IN_LENMAX 252
  3929. #define MC_CMD_INIT_RXQ_IN_LEN(num) (28+8*(num))
  3930. /* Size, in entries */
  3931. #define MC_CMD_INIT_RXQ_IN_SIZE_OFST 0
  3932. /* The EVQ to send events to. This is an index originally specified to INIT_EVQ
  3933. */
  3934. #define MC_CMD_INIT_RXQ_IN_TARGET_EVQ_OFST 4
  3935. /* The value to put in the event data. Check hardware spec. for valid range. */
  3936. #define MC_CMD_INIT_RXQ_IN_LABEL_OFST 8
  3937. /* Desired instance. Must be set to a specific instance, which is a function
  3938. * local queue index.
  3939. */
  3940. #define MC_CMD_INIT_RXQ_IN_INSTANCE_OFST 12
  3941. /* There will be more flags here. */
  3942. #define MC_CMD_INIT_RXQ_IN_FLAGS_OFST 16
  3943. #define MC_CMD_INIT_RXQ_IN_FLAG_BUFF_MODE_LBN 0
  3944. #define MC_CMD_INIT_RXQ_IN_FLAG_BUFF_MODE_WIDTH 1
  3945. #define MC_CMD_INIT_RXQ_IN_FLAG_HDR_SPLIT_LBN 1
  3946. #define MC_CMD_INIT_RXQ_IN_FLAG_HDR_SPLIT_WIDTH 1
  3947. #define MC_CMD_INIT_RXQ_IN_FLAG_TIMESTAMP_LBN 2
  3948. #define MC_CMD_INIT_RXQ_IN_FLAG_TIMESTAMP_WIDTH 1
  3949. #define MC_CMD_INIT_RXQ_IN_CRC_MODE_LBN 3
  3950. #define MC_CMD_INIT_RXQ_IN_CRC_MODE_WIDTH 4
  3951. #define MC_CMD_INIT_RXQ_IN_FLAG_CHAIN_LBN 7
  3952. #define MC_CMD_INIT_RXQ_IN_FLAG_CHAIN_WIDTH 1
  3953. #define MC_CMD_INIT_RXQ_IN_FLAG_PREFIX_LBN 8
  3954. #define MC_CMD_INIT_RXQ_IN_FLAG_PREFIX_WIDTH 1
  3955. #define MC_CMD_INIT_RXQ_IN_FLAG_DISABLE_SCATTER_LBN 9
  3956. #define MC_CMD_INIT_RXQ_IN_FLAG_DISABLE_SCATTER_WIDTH 1
  3957. /* Owner ID to use if in buffer mode (zero if physical) */
  3958. #define MC_CMD_INIT_RXQ_IN_OWNER_ID_OFST 20
  3959. /* The port ID associated with the v-adaptor which should contain this DMAQ. */
  3960. #define MC_CMD_INIT_RXQ_IN_PORT_ID_OFST 24
  3961. /* 64-bit address of 4k of 4k-aligned host memory buffer */
  3962. #define MC_CMD_INIT_RXQ_IN_DMA_ADDR_OFST 28
  3963. #define MC_CMD_INIT_RXQ_IN_DMA_ADDR_LEN 8
  3964. #define MC_CMD_INIT_RXQ_IN_DMA_ADDR_LO_OFST 28
  3965. #define MC_CMD_INIT_RXQ_IN_DMA_ADDR_HI_OFST 32
  3966. #define MC_CMD_INIT_RXQ_IN_DMA_ADDR_MINNUM 1
  3967. #define MC_CMD_INIT_RXQ_IN_DMA_ADDR_MAXNUM 28
  3968. /* MC_CMD_INIT_RXQ_OUT msgresponse */
  3969. #define MC_CMD_INIT_RXQ_OUT_LEN 0
  3970. /***********************************/
  3971. /* MC_CMD_INIT_TXQ
  3972. */
  3973. #define MC_CMD_INIT_TXQ 0x82
  3974. #define MC_CMD_0x82_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  3975. /* MC_CMD_INIT_TXQ_IN msgrequest */
  3976. #define MC_CMD_INIT_TXQ_IN_LENMIN 36
  3977. #define MC_CMD_INIT_TXQ_IN_LENMAX 252
  3978. #define MC_CMD_INIT_TXQ_IN_LEN(num) (28+8*(num))
  3979. /* Size, in entries */
  3980. #define MC_CMD_INIT_TXQ_IN_SIZE_OFST 0
  3981. /* The EVQ to send events to. This is an index originally specified to
  3982. * INIT_EVQ.
  3983. */
  3984. #define MC_CMD_INIT_TXQ_IN_TARGET_EVQ_OFST 4
  3985. /* The value to put in the event data. Check hardware spec. for valid range. */
  3986. #define MC_CMD_INIT_TXQ_IN_LABEL_OFST 8
  3987. /* Desired instance. Must be set to a specific instance, which is a function
  3988. * local queue index.
  3989. */
  3990. #define MC_CMD_INIT_TXQ_IN_INSTANCE_OFST 12
  3991. /* There will be more flags here. */
  3992. #define MC_CMD_INIT_TXQ_IN_FLAGS_OFST 16
  3993. #define MC_CMD_INIT_TXQ_IN_FLAG_BUFF_MODE_LBN 0
  3994. #define MC_CMD_INIT_TXQ_IN_FLAG_BUFF_MODE_WIDTH 1
  3995. #define MC_CMD_INIT_TXQ_IN_FLAG_IP_CSUM_DIS_LBN 1
  3996. #define MC_CMD_INIT_TXQ_IN_FLAG_IP_CSUM_DIS_WIDTH 1
  3997. #define MC_CMD_INIT_TXQ_IN_FLAG_TCP_CSUM_DIS_LBN 2
  3998. #define MC_CMD_INIT_TXQ_IN_FLAG_TCP_CSUM_DIS_WIDTH 1
  3999. #define MC_CMD_INIT_TXQ_IN_FLAG_TCP_UDP_ONLY_LBN 3
  4000. #define MC_CMD_INIT_TXQ_IN_FLAG_TCP_UDP_ONLY_WIDTH 1
  4001. #define MC_CMD_INIT_TXQ_IN_CRC_MODE_LBN 4
  4002. #define MC_CMD_INIT_TXQ_IN_CRC_MODE_WIDTH 4
  4003. #define MC_CMD_INIT_TXQ_IN_FLAG_TIMESTAMP_LBN 8
  4004. #define MC_CMD_INIT_TXQ_IN_FLAG_TIMESTAMP_WIDTH 1
  4005. #define MC_CMD_INIT_TXQ_IN_FLAG_PACER_BYPASS_LBN 9
  4006. #define MC_CMD_INIT_TXQ_IN_FLAG_PACER_BYPASS_WIDTH 1
  4007. /* Owner ID to use if in buffer mode (zero if physical) */
  4008. #define MC_CMD_INIT_TXQ_IN_OWNER_ID_OFST 20
  4009. /* The port ID associated with the v-adaptor which should contain this DMAQ. */
  4010. #define MC_CMD_INIT_TXQ_IN_PORT_ID_OFST 24
  4011. /* 64-bit address of 4k of 4k-aligned host memory buffer */
  4012. #define MC_CMD_INIT_TXQ_IN_DMA_ADDR_OFST 28
  4013. #define MC_CMD_INIT_TXQ_IN_DMA_ADDR_LEN 8
  4014. #define MC_CMD_INIT_TXQ_IN_DMA_ADDR_LO_OFST 28
  4015. #define MC_CMD_INIT_TXQ_IN_DMA_ADDR_HI_OFST 32
  4016. #define MC_CMD_INIT_TXQ_IN_DMA_ADDR_MINNUM 1
  4017. #define MC_CMD_INIT_TXQ_IN_DMA_ADDR_MAXNUM 28
  4018. /* MC_CMD_INIT_TXQ_OUT msgresponse */
  4019. #define MC_CMD_INIT_TXQ_OUT_LEN 0
  4020. /***********************************/
  4021. /* MC_CMD_FINI_EVQ
  4022. * Teardown an EVQ.
  4023. *
  4024. * All DMAQs or EVQs that point to the EVQ to tear down must be torn down first
  4025. * or the operation will fail with EBUSY
  4026. */
  4027. #define MC_CMD_FINI_EVQ 0x83
  4028. #define MC_CMD_0x83_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  4029. /* MC_CMD_FINI_EVQ_IN msgrequest */
  4030. #define MC_CMD_FINI_EVQ_IN_LEN 4
  4031. /* Instance of EVQ to destroy. Should be the same instance as that previously
  4032. * passed to INIT_EVQ
  4033. */
  4034. #define MC_CMD_FINI_EVQ_IN_INSTANCE_OFST 0
  4035. /* MC_CMD_FINI_EVQ_OUT msgresponse */
  4036. #define MC_CMD_FINI_EVQ_OUT_LEN 0
  4037. /***********************************/
  4038. /* MC_CMD_FINI_RXQ
  4039. * Teardown a RXQ.
  4040. */
  4041. #define MC_CMD_FINI_RXQ 0x84
  4042. #define MC_CMD_0x84_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  4043. /* MC_CMD_FINI_RXQ_IN msgrequest */
  4044. #define MC_CMD_FINI_RXQ_IN_LEN 4
  4045. /* Instance of RXQ to destroy */
  4046. #define MC_CMD_FINI_RXQ_IN_INSTANCE_OFST 0
  4047. /* MC_CMD_FINI_RXQ_OUT msgresponse */
  4048. #define MC_CMD_FINI_RXQ_OUT_LEN 0
  4049. /***********************************/
  4050. /* MC_CMD_FINI_TXQ
  4051. * Teardown a TXQ.
  4052. */
  4053. #define MC_CMD_FINI_TXQ 0x85
  4054. #define MC_CMD_0x85_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  4055. /* MC_CMD_FINI_TXQ_IN msgrequest */
  4056. #define MC_CMD_FINI_TXQ_IN_LEN 4
  4057. /* Instance of TXQ to destroy */
  4058. #define MC_CMD_FINI_TXQ_IN_INSTANCE_OFST 0
  4059. /* MC_CMD_FINI_TXQ_OUT msgresponse */
  4060. #define MC_CMD_FINI_TXQ_OUT_LEN 0
  4061. /***********************************/
  4062. /* MC_CMD_DRIVER_EVENT
  4063. * Generate an event on an EVQ belonging to the function issuing the command.
  4064. */
  4065. #define MC_CMD_DRIVER_EVENT 0x86
  4066. #define MC_CMD_0x86_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  4067. /* MC_CMD_DRIVER_EVENT_IN msgrequest */
  4068. #define MC_CMD_DRIVER_EVENT_IN_LEN 12
  4069. /* Handle of target EVQ */
  4070. #define MC_CMD_DRIVER_EVENT_IN_EVQ_OFST 0
  4071. /* Bits 0 - 63 of event */
  4072. #define MC_CMD_DRIVER_EVENT_IN_DATA_OFST 4
  4073. #define MC_CMD_DRIVER_EVENT_IN_DATA_LEN 8
  4074. #define MC_CMD_DRIVER_EVENT_IN_DATA_LO_OFST 4
  4075. #define MC_CMD_DRIVER_EVENT_IN_DATA_HI_OFST 8
  4076. /* MC_CMD_DRIVER_EVENT_OUT msgresponse */
  4077. #define MC_CMD_DRIVER_EVENT_OUT_LEN 0
  4078. /***********************************/
  4079. /* MC_CMD_PROXY_CMD
  4080. * Execute an arbitrary MCDI command on behalf of a different function, subject
  4081. * to security restrictions. The command to be proxied follows immediately
  4082. * afterward in the host buffer (or on the UART). This command supercedes
  4083. * MC_CMD_SET_FUNC, which remains available for Siena but now deprecated.
  4084. */
  4085. #define MC_CMD_PROXY_CMD 0x5b
  4086. #define MC_CMD_0x5b_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  4087. /* MC_CMD_PROXY_CMD_IN msgrequest */
  4088. #define MC_CMD_PROXY_CMD_IN_LEN 4
  4089. /* The handle of the target function. */
  4090. #define MC_CMD_PROXY_CMD_IN_TARGET_OFST 0
  4091. #define MC_CMD_PROXY_CMD_IN_TARGET_PF_LBN 0
  4092. #define MC_CMD_PROXY_CMD_IN_TARGET_PF_WIDTH 16
  4093. #define MC_CMD_PROXY_CMD_IN_TARGET_VF_LBN 16
  4094. #define MC_CMD_PROXY_CMD_IN_TARGET_VF_WIDTH 16
  4095. #define MC_CMD_PROXY_CMD_IN_VF_NULL 0xffff /* enum */
  4096. /* MC_CMD_PROXY_CMD_OUT msgresponse */
  4097. #define MC_CMD_PROXY_CMD_OUT_LEN 0
  4098. /***********************************/
  4099. /* MC_CMD_ALLOC_BUFTBL_CHUNK
  4100. * Allocate a set of buffer table entries using the specified owner ID. This
  4101. * operation allocates the required buffer table entries (and fails if it
  4102. * cannot do so). The buffer table entries will initially be zeroed.
  4103. */
  4104. #define MC_CMD_ALLOC_BUFTBL_CHUNK 0x87
  4105. #define MC_CMD_0x87_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
  4106. /* MC_CMD_ALLOC_BUFTBL_CHUNK_IN msgrequest */
  4107. #define MC_CMD_ALLOC_BUFTBL_CHUNK_IN_LEN 8
  4108. /* Owner ID to use */
  4109. #define MC_CMD_ALLOC_BUFTBL_CHUNK_IN_OWNER_OFST 0
  4110. /* Size of buffer table pages to use, in bytes (note that only a few values are
  4111. * legal on any specific hardware).
  4112. */
  4113. #define MC_CMD_ALLOC_BUFTBL_CHUNK_IN_PAGE_SIZE_OFST 4
  4114. /* MC_CMD_ALLOC_BUFTBL_CHUNK_OUT msgresponse */
  4115. #define MC_CMD_ALLOC_BUFTBL_CHUNK_OUT_LEN 12
  4116. #define MC_CMD_ALLOC_BUFTBL_CHUNK_OUT_HANDLE_OFST 0
  4117. #define MC_CMD_ALLOC_BUFTBL_CHUNK_OUT_NUMENTRIES_OFST 4
  4118. /* Buffer table IDs for use in DMA descriptors. */
  4119. #define MC_CMD_ALLOC_BUFTBL_CHUNK_OUT_ID_OFST 8
  4120. /***********************************/
  4121. /* MC_CMD_PROGRAM_BUFTBL_ENTRIES
  4122. * Reprogram a set of buffer table entries in the specified chunk.
  4123. */
  4124. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES 0x88
  4125. #define MC_CMD_0x88_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
  4126. /* MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN msgrequest */
  4127. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_LENMIN 20
  4128. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_LENMAX 268
  4129. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_LEN(num) (12+8*(num))
  4130. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_HANDLE_OFST 0
  4131. /* ID */
  4132. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_FIRSTID_OFST 4
  4133. /* Num entries */
  4134. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_NUMENTRIES_OFST 8
  4135. /* Buffer table entry address */
  4136. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_ENTRY_OFST 12
  4137. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_ENTRY_LEN 8
  4138. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_ENTRY_LO_OFST 12
  4139. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_ENTRY_HI_OFST 16
  4140. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_ENTRY_MINNUM 1
  4141. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_ENTRY_MAXNUM 32
  4142. /* MC_CMD_PROGRAM_BUFTBL_ENTRIES_OUT msgresponse */
  4143. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_OUT_LEN 0
  4144. /***********************************/
  4145. /* MC_CMD_FREE_BUFTBL_CHUNK
  4146. */
  4147. #define MC_CMD_FREE_BUFTBL_CHUNK 0x89
  4148. #define MC_CMD_0x89_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
  4149. /* MC_CMD_FREE_BUFTBL_CHUNK_IN msgrequest */
  4150. #define MC_CMD_FREE_BUFTBL_CHUNK_IN_LEN 4
  4151. #define MC_CMD_FREE_BUFTBL_CHUNK_IN_HANDLE_OFST 0
  4152. /* MC_CMD_FREE_BUFTBL_CHUNK_OUT msgresponse */
  4153. #define MC_CMD_FREE_BUFTBL_CHUNK_OUT_LEN 0
  4154. /***********************************/
  4155. /* MC_CMD_FILTER_OP
  4156. * Multiplexed MCDI call for filter operations
  4157. */
  4158. #define MC_CMD_FILTER_OP 0x8a
  4159. #define MC_CMD_0x8a_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  4160. /* MC_CMD_FILTER_OP_IN msgrequest */
  4161. #define MC_CMD_FILTER_OP_IN_LEN 108
  4162. /* identifies the type of operation requested */
  4163. #define MC_CMD_FILTER_OP_IN_OP_OFST 0
  4164. /* enum: single-recipient filter insert */
  4165. #define MC_CMD_FILTER_OP_IN_OP_INSERT 0x0
  4166. /* enum: single-recipient filter remove */
  4167. #define MC_CMD_FILTER_OP_IN_OP_REMOVE 0x1
  4168. /* enum: multi-recipient filter subscribe */
  4169. #define MC_CMD_FILTER_OP_IN_OP_SUBSCRIBE 0x2
  4170. /* enum: multi-recipient filter unsubscribe */
  4171. #define MC_CMD_FILTER_OP_IN_OP_UNSUBSCRIBE 0x3
  4172. /* enum: replace one recipient with another (warning - the filter handle may
  4173. * change)
  4174. */
  4175. #define MC_CMD_FILTER_OP_IN_OP_REPLACE 0x4
  4176. /* filter handle (for remove / unsubscribe operations) */
  4177. #define MC_CMD_FILTER_OP_IN_HANDLE_OFST 4
  4178. #define MC_CMD_FILTER_OP_IN_HANDLE_LEN 8
  4179. #define MC_CMD_FILTER_OP_IN_HANDLE_LO_OFST 4
  4180. #define MC_CMD_FILTER_OP_IN_HANDLE_HI_OFST 8
  4181. /* The port ID associated with the v-adaptor which should contain this filter.
  4182. */
  4183. #define MC_CMD_FILTER_OP_IN_PORT_ID_OFST 12
  4184. /* fields to include in match criteria */
  4185. #define MC_CMD_FILTER_OP_IN_MATCH_FIELDS_OFST 16
  4186. #define MC_CMD_FILTER_OP_IN_MATCH_SRC_IP_LBN 0
  4187. #define MC_CMD_FILTER_OP_IN_MATCH_SRC_IP_WIDTH 1
  4188. #define MC_CMD_FILTER_OP_IN_MATCH_DST_IP_LBN 1
  4189. #define MC_CMD_FILTER_OP_IN_MATCH_DST_IP_WIDTH 1
  4190. #define MC_CMD_FILTER_OP_IN_MATCH_SRC_MAC_LBN 2
  4191. #define MC_CMD_FILTER_OP_IN_MATCH_SRC_MAC_WIDTH 1
  4192. #define MC_CMD_FILTER_OP_IN_MATCH_SRC_PORT_LBN 3
  4193. #define MC_CMD_FILTER_OP_IN_MATCH_SRC_PORT_WIDTH 1
  4194. #define MC_CMD_FILTER_OP_IN_MATCH_DST_MAC_LBN 4
  4195. #define MC_CMD_FILTER_OP_IN_MATCH_DST_MAC_WIDTH 1
  4196. #define MC_CMD_FILTER_OP_IN_MATCH_DST_PORT_LBN 5
  4197. #define MC_CMD_FILTER_OP_IN_MATCH_DST_PORT_WIDTH 1
  4198. #define MC_CMD_FILTER_OP_IN_MATCH_ETHER_TYPE_LBN 6
  4199. #define MC_CMD_FILTER_OP_IN_MATCH_ETHER_TYPE_WIDTH 1
  4200. #define MC_CMD_FILTER_OP_IN_MATCH_INNER_VLAN_LBN 7
  4201. #define MC_CMD_FILTER_OP_IN_MATCH_INNER_VLAN_WIDTH 1
  4202. #define MC_CMD_FILTER_OP_IN_MATCH_OUTER_VLAN_LBN 8
  4203. #define MC_CMD_FILTER_OP_IN_MATCH_OUTER_VLAN_WIDTH 1
  4204. #define MC_CMD_FILTER_OP_IN_MATCH_IP_PROTO_LBN 9
  4205. #define MC_CMD_FILTER_OP_IN_MATCH_IP_PROTO_WIDTH 1
  4206. #define MC_CMD_FILTER_OP_IN_MATCH_FWDEF0_LBN 10
  4207. #define MC_CMD_FILTER_OP_IN_MATCH_FWDEF0_WIDTH 1
  4208. #define MC_CMD_FILTER_OP_IN_MATCH_FWDEF1_LBN 11
  4209. #define MC_CMD_FILTER_OP_IN_MATCH_FWDEF1_WIDTH 1
  4210. #define MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_MCAST_DST_LBN 30
  4211. #define MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_MCAST_DST_WIDTH 1
  4212. #define MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_UCAST_DST_LBN 31
  4213. #define MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_UCAST_DST_WIDTH 1
  4214. /* receive destination */
  4215. #define MC_CMD_FILTER_OP_IN_RX_DEST_OFST 20
  4216. /* enum: drop packets */
  4217. #define MC_CMD_FILTER_OP_IN_RX_DEST_DROP 0x0
  4218. /* enum: receive to host */
  4219. #define MC_CMD_FILTER_OP_IN_RX_DEST_HOST 0x1
  4220. /* enum: receive to MC */
  4221. #define MC_CMD_FILTER_OP_IN_RX_DEST_MC 0x2
  4222. /* enum: loop back to port 0 TX MAC */
  4223. #define MC_CMD_FILTER_OP_IN_RX_DEST_TX0 0x3
  4224. /* enum: loop back to port 1 TX MAC */
  4225. #define MC_CMD_FILTER_OP_IN_RX_DEST_TX1 0x4
  4226. /* receive queue handle (for multiple queue modes, this is the base queue) */
  4227. #define MC_CMD_FILTER_OP_IN_RX_QUEUE_OFST 24
  4228. /* receive mode */
  4229. #define MC_CMD_FILTER_OP_IN_RX_MODE_OFST 28
  4230. /* enum: receive to just the specified queue */
  4231. #define MC_CMD_FILTER_OP_IN_RX_MODE_SIMPLE 0x0
  4232. /* enum: receive to multiple queues using RSS context */
  4233. #define MC_CMD_FILTER_OP_IN_RX_MODE_RSS 0x1
  4234. /* enum: receive to multiple queues using .1p mapping */
  4235. #define MC_CMD_FILTER_OP_IN_RX_MODE_DOT1P_MAPPING 0x2
  4236. /* enum: install a filter entry that will never match; for test purposes only
  4237. */
  4238. #define MC_CMD_FILTER_OP_IN_RX_MODE_TEST_NEVER_MATCH 0x80000000
  4239. /* RSS context (for RX_MODE_RSS) or .1p mapping handle (for
  4240. * RX_MODE_DOT1P_MAPPING), as returned by MC_CMD_RSS_CONTEXT_ALLOC or
  4241. * MC_CMD_DOT1P_MAPPING_ALLOC. Note that these handles should be considered
  4242. * opaque to the host, although a value of 0xFFFFFFFF is guaranteed never to be
  4243. * a valid handle.
  4244. */
  4245. #define MC_CMD_FILTER_OP_IN_RX_CONTEXT_OFST 32
  4246. /* transmit domain (reserved; set to 0) */
  4247. #define MC_CMD_FILTER_OP_IN_TX_DOMAIN_OFST 36
  4248. /* transmit destination (either set the MAC and/or PM bits for explicit
  4249. * control, or set this field to TX_DEST_DEFAULT for sensible default
  4250. * behaviour)
  4251. */
  4252. #define MC_CMD_FILTER_OP_IN_TX_DEST_OFST 40
  4253. /* enum: request default behaviour (based on filter type) */
  4254. #define MC_CMD_FILTER_OP_IN_TX_DEST_DEFAULT 0xffffffff
  4255. #define MC_CMD_FILTER_OP_IN_TX_DEST_MAC_LBN 0
  4256. #define MC_CMD_FILTER_OP_IN_TX_DEST_MAC_WIDTH 1
  4257. #define MC_CMD_FILTER_OP_IN_TX_DEST_PM_LBN 1
  4258. #define MC_CMD_FILTER_OP_IN_TX_DEST_PM_WIDTH 1
  4259. /* source MAC address to match (as bytes in network order) */
  4260. #define MC_CMD_FILTER_OP_IN_SRC_MAC_OFST 44
  4261. #define MC_CMD_FILTER_OP_IN_SRC_MAC_LEN 6
  4262. /* source port to match (as bytes in network order) */
  4263. #define MC_CMD_FILTER_OP_IN_SRC_PORT_OFST 50
  4264. #define MC_CMD_FILTER_OP_IN_SRC_PORT_LEN 2
  4265. /* destination MAC address to match (as bytes in network order) */
  4266. #define MC_CMD_FILTER_OP_IN_DST_MAC_OFST 52
  4267. #define MC_CMD_FILTER_OP_IN_DST_MAC_LEN 6
  4268. /* destination port to match (as bytes in network order) */
  4269. #define MC_CMD_FILTER_OP_IN_DST_PORT_OFST 58
  4270. #define MC_CMD_FILTER_OP_IN_DST_PORT_LEN 2
  4271. /* Ethernet type to match (as bytes in network order) */
  4272. #define MC_CMD_FILTER_OP_IN_ETHER_TYPE_OFST 60
  4273. #define MC_CMD_FILTER_OP_IN_ETHER_TYPE_LEN 2
  4274. /* Inner VLAN tag to match (as bytes in network order) */
  4275. #define MC_CMD_FILTER_OP_IN_INNER_VLAN_OFST 62
  4276. #define MC_CMD_FILTER_OP_IN_INNER_VLAN_LEN 2
  4277. /* Outer VLAN tag to match (as bytes in network order) */
  4278. #define MC_CMD_FILTER_OP_IN_OUTER_VLAN_OFST 64
  4279. #define MC_CMD_FILTER_OP_IN_OUTER_VLAN_LEN 2
  4280. /* IP protocol to match (in low byte; set high byte to 0) */
  4281. #define MC_CMD_FILTER_OP_IN_IP_PROTO_OFST 66
  4282. #define MC_CMD_FILTER_OP_IN_IP_PROTO_LEN 2
  4283. /* Firmware defined register 0 to match (reserved; set to 0) */
  4284. #define MC_CMD_FILTER_OP_IN_FWDEF0_OFST 68
  4285. /* Firmware defined register 1 to match (reserved; set to 0) */
  4286. #define MC_CMD_FILTER_OP_IN_FWDEF1_OFST 72
  4287. /* source IP address to match (as bytes in network order; set last 12 bytes to
  4288. * 0 for IPv4 address)
  4289. */
  4290. #define MC_CMD_FILTER_OP_IN_SRC_IP_OFST 76
  4291. #define MC_CMD_FILTER_OP_IN_SRC_IP_LEN 16
  4292. /* destination IP address to match (as bytes in network order; set last 12
  4293. * bytes to 0 for IPv4 address)
  4294. */
  4295. #define MC_CMD_FILTER_OP_IN_DST_IP_OFST 92
  4296. #define MC_CMD_FILTER_OP_IN_DST_IP_LEN 16
  4297. /* MC_CMD_FILTER_OP_OUT msgresponse */
  4298. #define MC_CMD_FILTER_OP_OUT_LEN 12
  4299. /* identifies the type of operation requested */
  4300. #define MC_CMD_FILTER_OP_OUT_OP_OFST 0
  4301. /* Enum values, see field(s): */
  4302. /* MC_CMD_FILTER_OP_IN/OP */
  4303. /* Returned filter handle (for insert / subscribe operations). Note that these
  4304. * handles should be considered opaque to the host, although a value of
  4305. * 0xFFFFFFFF_FFFFFFFF is guaranteed never to be a valid handle.
  4306. */
  4307. #define MC_CMD_FILTER_OP_OUT_HANDLE_OFST 4
  4308. #define MC_CMD_FILTER_OP_OUT_HANDLE_LEN 8
  4309. #define MC_CMD_FILTER_OP_OUT_HANDLE_LO_OFST 4
  4310. #define MC_CMD_FILTER_OP_OUT_HANDLE_HI_OFST 8
  4311. /***********************************/
  4312. /* MC_CMD_GET_PARSER_DISP_INFO
  4313. * Get information related to the parser-dispatcher subsystem
  4314. */
  4315. #define MC_CMD_GET_PARSER_DISP_INFO 0xe4
  4316. #define MC_CMD_0xe4_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  4317. /* MC_CMD_GET_PARSER_DISP_INFO_IN msgrequest */
  4318. #define MC_CMD_GET_PARSER_DISP_INFO_IN_LEN 4
  4319. /* identifies the type of operation requested */
  4320. #define MC_CMD_GET_PARSER_DISP_INFO_IN_OP_OFST 0
  4321. /* enum: read the list of supported RX filter matches */
  4322. #define MC_CMD_GET_PARSER_DISP_INFO_IN_OP_GET_SUPPORTED_RX_MATCHES 0x1
  4323. /* MC_CMD_GET_PARSER_DISP_INFO_OUT msgresponse */
  4324. #define MC_CMD_GET_PARSER_DISP_INFO_OUT_LENMIN 8
  4325. #define MC_CMD_GET_PARSER_DISP_INFO_OUT_LENMAX 252
  4326. #define MC_CMD_GET_PARSER_DISP_INFO_OUT_LEN(num) (8+4*(num))
  4327. /* identifies the type of operation requested */
  4328. #define MC_CMD_GET_PARSER_DISP_INFO_OUT_OP_OFST 0
  4329. /* Enum values, see field(s): */
  4330. /* MC_CMD_GET_PARSER_DISP_INFO_IN/OP */
  4331. /* number of supported match types */
  4332. #define MC_CMD_GET_PARSER_DISP_INFO_OUT_NUM_SUPPORTED_MATCHES_OFST 4
  4333. /* array of supported match types (valid MATCH_FIELDS values for
  4334. * MC_CMD_FILTER_OP) sorted in decreasing priority order
  4335. */
  4336. #define MC_CMD_GET_PARSER_DISP_INFO_OUT_SUPPORTED_MATCHES_OFST 8
  4337. #define MC_CMD_GET_PARSER_DISP_INFO_OUT_SUPPORTED_MATCHES_LEN 4
  4338. #define MC_CMD_GET_PARSER_DISP_INFO_OUT_SUPPORTED_MATCHES_MINNUM 0
  4339. #define MC_CMD_GET_PARSER_DISP_INFO_OUT_SUPPORTED_MATCHES_MAXNUM 61
  4340. /***********************************/
  4341. /* MC_CMD_PARSER_DISP_RW
  4342. * Direct read/write of parser-dispatcher state (DICPUs and LUE) for debugging
  4343. */
  4344. #define MC_CMD_PARSER_DISP_RW 0xe5
  4345. #define MC_CMD_0xe5_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  4346. /* MC_CMD_PARSER_DISP_RW_IN msgrequest */
  4347. #define MC_CMD_PARSER_DISP_RW_IN_LEN 32
  4348. /* identifies the target of the operation */
  4349. #define MC_CMD_PARSER_DISP_RW_IN_TARGET_OFST 0
  4350. /* enum: RX dispatcher CPU */
  4351. #define MC_CMD_PARSER_DISP_RW_IN_RX_DICPU 0x0
  4352. /* enum: TX dispatcher CPU */
  4353. #define MC_CMD_PARSER_DISP_RW_IN_TX_DICPU 0x1
  4354. /* enum: Lookup engine */
  4355. #define MC_CMD_PARSER_DISP_RW_IN_LUE 0x2
  4356. /* identifies the type of operation requested */
  4357. #define MC_CMD_PARSER_DISP_RW_IN_OP_OFST 4
  4358. /* enum: read a word of DICPU DMEM or a LUE entry */
  4359. #define MC_CMD_PARSER_DISP_RW_IN_READ 0x0
  4360. /* enum: write a word of DICPU DMEM or a LUE entry */
  4361. #define MC_CMD_PARSER_DISP_RW_IN_WRITE 0x1
  4362. /* enum: read-modify-write a word of DICPU DMEM (not valid for LUE) */
  4363. #define MC_CMD_PARSER_DISP_RW_IN_RMW 0x2
  4364. /* data memory address or LUE index */
  4365. #define MC_CMD_PARSER_DISP_RW_IN_ADDRESS_OFST 8
  4366. /* value to write (for DMEM writes) */
  4367. #define MC_CMD_PARSER_DISP_RW_IN_DMEM_WRITE_VALUE_OFST 12
  4368. /* XOR value (for DMEM read-modify-writes: new = (old & mask) ^ value) */
  4369. #define MC_CMD_PARSER_DISP_RW_IN_DMEM_RMW_XOR_VALUE_OFST 12
  4370. /* AND mask (for DMEM read-modify-writes: new = (old & mask) ^ value) */
  4371. #define MC_CMD_PARSER_DISP_RW_IN_DMEM_RMW_AND_MASK_OFST 16
  4372. /* value to write (for LUE writes) */
  4373. #define MC_CMD_PARSER_DISP_RW_IN_LUE_WRITE_VALUE_OFST 12
  4374. #define MC_CMD_PARSER_DISP_RW_IN_LUE_WRITE_VALUE_LEN 20
  4375. /* MC_CMD_PARSER_DISP_RW_OUT msgresponse */
  4376. #define MC_CMD_PARSER_DISP_RW_OUT_LEN 52
  4377. /* value read (for DMEM reads) */
  4378. #define MC_CMD_PARSER_DISP_RW_OUT_DMEM_READ_VALUE_OFST 0
  4379. /* value read (for LUE reads) */
  4380. #define MC_CMD_PARSER_DISP_RW_OUT_LUE_READ_VALUE_OFST 0
  4381. #define MC_CMD_PARSER_DISP_RW_OUT_LUE_READ_VALUE_LEN 20
  4382. /* up to 8 32-bit words of additional soft state from the LUE manager (the
  4383. * exact content is firmware-dependent and intended only for debug use)
  4384. */
  4385. #define MC_CMD_PARSER_DISP_RW_OUT_LUE_MGR_STATE_OFST 20
  4386. #define MC_CMD_PARSER_DISP_RW_OUT_LUE_MGR_STATE_LEN 32
  4387. /***********************************/
  4388. /* MC_CMD_GET_PF_COUNT
  4389. * Get number of PFs on the device.
  4390. */
  4391. #define MC_CMD_GET_PF_COUNT 0xb6
  4392. #define MC_CMD_0xb6_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  4393. /* MC_CMD_GET_PF_COUNT_IN msgrequest */
  4394. #define MC_CMD_GET_PF_COUNT_IN_LEN 0
  4395. /* MC_CMD_GET_PF_COUNT_OUT msgresponse */
  4396. #define MC_CMD_GET_PF_COUNT_OUT_LEN 1
  4397. /* Identifies the number of PFs on the device. */
  4398. #define MC_CMD_GET_PF_COUNT_OUT_PF_COUNT_OFST 0
  4399. #define MC_CMD_GET_PF_COUNT_OUT_PF_COUNT_LEN 1
  4400. /***********************************/
  4401. /* MC_CMD_SET_PF_COUNT
  4402. * Set number of PFs on the device.
  4403. */
  4404. #define MC_CMD_SET_PF_COUNT 0xb7
  4405. /* MC_CMD_SET_PF_COUNT_IN msgrequest */
  4406. #define MC_CMD_SET_PF_COUNT_IN_LEN 4
  4407. /* New number of PFs on the device. */
  4408. #define MC_CMD_SET_PF_COUNT_IN_PF_COUNT_OFST 0
  4409. /* MC_CMD_SET_PF_COUNT_OUT msgresponse */
  4410. #define MC_CMD_SET_PF_COUNT_OUT_LEN 0
  4411. /***********************************/
  4412. /* MC_CMD_GET_PORT_ASSIGNMENT
  4413. * Get port assignment for current PCI function.
  4414. */
  4415. #define MC_CMD_GET_PORT_ASSIGNMENT 0xb8
  4416. #define MC_CMD_0xb8_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  4417. /* MC_CMD_GET_PORT_ASSIGNMENT_IN msgrequest */
  4418. #define MC_CMD_GET_PORT_ASSIGNMENT_IN_LEN 0
  4419. /* MC_CMD_GET_PORT_ASSIGNMENT_OUT msgresponse */
  4420. #define MC_CMD_GET_PORT_ASSIGNMENT_OUT_LEN 4
  4421. /* Identifies the port assignment for this function. */
  4422. #define MC_CMD_GET_PORT_ASSIGNMENT_OUT_PORT_OFST 0
  4423. /***********************************/
  4424. /* MC_CMD_SET_PORT_ASSIGNMENT
  4425. * Set port assignment for current PCI function.
  4426. */
  4427. #define MC_CMD_SET_PORT_ASSIGNMENT 0xb9
  4428. #define MC_CMD_0xb9_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  4429. /* MC_CMD_SET_PORT_ASSIGNMENT_IN msgrequest */
  4430. #define MC_CMD_SET_PORT_ASSIGNMENT_IN_LEN 4
  4431. /* Identifies the port assignment for this function. */
  4432. #define MC_CMD_SET_PORT_ASSIGNMENT_IN_PORT_OFST 0
  4433. /* MC_CMD_SET_PORT_ASSIGNMENT_OUT msgresponse */
  4434. #define MC_CMD_SET_PORT_ASSIGNMENT_OUT_LEN 0
  4435. /***********************************/
  4436. /* MC_CMD_ALLOC_VIS
  4437. * Allocate VIs for current PCI function.
  4438. */
  4439. #define MC_CMD_ALLOC_VIS 0x8b
  4440. #define MC_CMD_0x8b_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  4441. /* MC_CMD_ALLOC_VIS_IN msgrequest */
  4442. #define MC_CMD_ALLOC_VIS_IN_LEN 8
  4443. /* The minimum number of VIs that is acceptable */
  4444. #define MC_CMD_ALLOC_VIS_IN_MIN_VI_COUNT_OFST 0
  4445. /* The maximum number of VIs that would be useful */
  4446. #define MC_CMD_ALLOC_VIS_IN_MAX_VI_COUNT_OFST 4
  4447. /* MC_CMD_ALLOC_VIS_OUT msgresponse */
  4448. #define MC_CMD_ALLOC_VIS_OUT_LEN 8
  4449. /* The number of VIs allocated on this function */
  4450. #define MC_CMD_ALLOC_VIS_OUT_VI_COUNT_OFST 0
  4451. /* The base absolute VI number allocated to this function. Required to
  4452. * correctly interpret wakeup events.
  4453. */
  4454. #define MC_CMD_ALLOC_VIS_OUT_VI_BASE_OFST 4
  4455. /***********************************/
  4456. /* MC_CMD_FREE_VIS
  4457. * Free VIs for current PCI function. Any linked PIO buffers will be unlinked,
  4458. * but not freed.
  4459. */
  4460. #define MC_CMD_FREE_VIS 0x8c
  4461. #define MC_CMD_0x8c_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  4462. /* MC_CMD_FREE_VIS_IN msgrequest */
  4463. #define MC_CMD_FREE_VIS_IN_LEN 0
  4464. /* MC_CMD_FREE_VIS_OUT msgresponse */
  4465. #define MC_CMD_FREE_VIS_OUT_LEN 0
  4466. /***********************************/
  4467. /* MC_CMD_GET_SRIOV_CFG
  4468. * Get SRIOV config for this PF.
  4469. */
  4470. #define MC_CMD_GET_SRIOV_CFG 0xba
  4471. #define MC_CMD_0xba_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  4472. /* MC_CMD_GET_SRIOV_CFG_IN msgrequest */
  4473. #define MC_CMD_GET_SRIOV_CFG_IN_LEN 0
  4474. /* MC_CMD_GET_SRIOV_CFG_OUT msgresponse */
  4475. #define MC_CMD_GET_SRIOV_CFG_OUT_LEN 20
  4476. /* Number of VFs currently enabled. */
  4477. #define MC_CMD_GET_SRIOV_CFG_OUT_VF_CURRENT_OFST 0
  4478. /* Max number of VFs before sriov stride and offset may need to be changed. */
  4479. #define MC_CMD_GET_SRIOV_CFG_OUT_VF_MAX_OFST 4
  4480. #define MC_CMD_GET_SRIOV_CFG_OUT_FLAGS_OFST 8
  4481. #define MC_CMD_GET_SRIOV_CFG_OUT_VF_ENABLED_LBN 0
  4482. #define MC_CMD_GET_SRIOV_CFG_OUT_VF_ENABLED_WIDTH 1
  4483. /* RID offset of first VF from PF. */
  4484. #define MC_CMD_GET_SRIOV_CFG_OUT_VF_OFFSET_OFST 12
  4485. /* RID offset of each subsequent VF from the previous. */
  4486. #define MC_CMD_GET_SRIOV_CFG_OUT_VF_STRIDE_OFST 16
  4487. /***********************************/
  4488. /* MC_CMD_SET_SRIOV_CFG
  4489. * Set SRIOV config for this PF.
  4490. */
  4491. #define MC_CMD_SET_SRIOV_CFG 0xbb
  4492. #define MC_CMD_0xbb_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  4493. /* MC_CMD_SET_SRIOV_CFG_IN msgrequest */
  4494. #define MC_CMD_SET_SRIOV_CFG_IN_LEN 20
  4495. /* Number of VFs currently enabled. */
  4496. #define MC_CMD_SET_SRIOV_CFG_IN_VF_CURRENT_OFST 0
  4497. /* Max number of VFs before sriov stride and offset may need to be changed. */
  4498. #define MC_CMD_SET_SRIOV_CFG_IN_VF_MAX_OFST 4
  4499. #define MC_CMD_SET_SRIOV_CFG_IN_FLAGS_OFST 8
  4500. #define MC_CMD_SET_SRIOV_CFG_IN_VF_ENABLED_LBN 0
  4501. #define MC_CMD_SET_SRIOV_CFG_IN_VF_ENABLED_WIDTH 1
  4502. /* RID offset of first VF from PF, or 0 for no change, or
  4503. * MC_CMD_RESOURCE_INSTANCE_ANY to allow the system to allocate an offset.
  4504. */
  4505. #define MC_CMD_SET_SRIOV_CFG_IN_VF_OFFSET_OFST 12
  4506. /* RID offset of each subsequent VF from the previous, 0 for no change, or
  4507. * MC_CMD_RESOURCE_INSTANCE_ANY to allow the system to allocate a stride.
  4508. */
  4509. #define MC_CMD_SET_SRIOV_CFG_IN_VF_STRIDE_OFST 16
  4510. /* MC_CMD_SET_SRIOV_CFG_OUT msgresponse */
  4511. #define MC_CMD_SET_SRIOV_CFG_OUT_LEN 0
  4512. /***********************************/
  4513. /* MC_CMD_GET_VI_ALLOC_INFO
  4514. * Get information about number of VI's and base VI number allocated to this
  4515. * function.
  4516. */
  4517. #define MC_CMD_GET_VI_ALLOC_INFO 0x8d
  4518. #define MC_CMD_0x8d_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  4519. /* MC_CMD_GET_VI_ALLOC_INFO_IN msgrequest */
  4520. #define MC_CMD_GET_VI_ALLOC_INFO_IN_LEN 0
  4521. /* MC_CMD_GET_VI_ALLOC_INFO_OUT msgresponse */
  4522. #define MC_CMD_GET_VI_ALLOC_INFO_OUT_LEN 8
  4523. /* The number of VIs allocated on this function */
  4524. #define MC_CMD_GET_VI_ALLOC_INFO_OUT_VI_COUNT_OFST 0
  4525. /* The base absolute VI number allocated to this function. Required to
  4526. * correctly interpret wakeup events.
  4527. */
  4528. #define MC_CMD_GET_VI_ALLOC_INFO_OUT_VI_BASE_OFST 4
  4529. /***********************************/
  4530. /* MC_CMD_DUMP_VI_STATE
  4531. * For CmdClient use. Dump pertinent information on a specific absolute VI.
  4532. */
  4533. #define MC_CMD_DUMP_VI_STATE 0x8e
  4534. #define MC_CMD_0x8e_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  4535. /* MC_CMD_DUMP_VI_STATE_IN msgrequest */
  4536. #define MC_CMD_DUMP_VI_STATE_IN_LEN 4
  4537. /* The VI number to query. */
  4538. #define MC_CMD_DUMP_VI_STATE_IN_VI_NUMBER_OFST 0
  4539. /* MC_CMD_DUMP_VI_STATE_OUT msgresponse */
  4540. #define MC_CMD_DUMP_VI_STATE_OUT_LEN 96
  4541. /* The PF part of the function owning this VI. */
  4542. #define MC_CMD_DUMP_VI_STATE_OUT_OWNER_PF_OFST 0
  4543. #define MC_CMD_DUMP_VI_STATE_OUT_OWNER_PF_LEN 2
  4544. /* The VF part of the function owning this VI. */
  4545. #define MC_CMD_DUMP_VI_STATE_OUT_OWNER_VF_OFST 2
  4546. #define MC_CMD_DUMP_VI_STATE_OUT_OWNER_VF_LEN 2
  4547. /* Base of VIs allocated to this function. */
  4548. #define MC_CMD_DUMP_VI_STATE_OUT_FUNC_VI_BASE_OFST 4
  4549. #define MC_CMD_DUMP_VI_STATE_OUT_FUNC_VI_BASE_LEN 2
  4550. /* Count of VIs allocated to the owner function. */
  4551. #define MC_CMD_DUMP_VI_STATE_OUT_FUNC_VI_COUNT_OFST 6
  4552. #define MC_CMD_DUMP_VI_STATE_OUT_FUNC_VI_COUNT_LEN 2
  4553. /* Base interrupt vector allocated to this function. */
  4554. #define MC_CMD_DUMP_VI_STATE_OUT_FUNC_VECTOR_BASE_OFST 8
  4555. #define MC_CMD_DUMP_VI_STATE_OUT_FUNC_VECTOR_BASE_LEN 2
  4556. /* Number of interrupt vectors allocated to this function. */
  4557. #define MC_CMD_DUMP_VI_STATE_OUT_FUNC_VECTOR_COUNT_OFST 10
  4558. #define MC_CMD_DUMP_VI_STATE_OUT_FUNC_VECTOR_COUNT_LEN 2
  4559. /* Raw evq ptr table data. */
  4560. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EVQ_PTR_RAW_OFST 12
  4561. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EVQ_PTR_RAW_LEN 8
  4562. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EVQ_PTR_RAW_LO_OFST 12
  4563. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EVQ_PTR_RAW_HI_OFST 16
  4564. /* Raw evq timer table data. */
  4565. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_TIMER_RAW_OFST 20
  4566. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_TIMER_RAW_LEN 8
  4567. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_TIMER_RAW_LO_OFST 20
  4568. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_TIMER_RAW_HI_OFST 24
  4569. /* Combined metadata field. */
  4570. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_META_OFST 28
  4571. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_META_BUFS_BASE_LBN 0
  4572. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_META_BUFS_BASE_WIDTH 16
  4573. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_META_BUFS_NPAGES_LBN 16
  4574. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_META_BUFS_NPAGES_WIDTH 8
  4575. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_META_WKUP_REF_LBN 24
  4576. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_META_WKUP_REF_WIDTH 8
  4577. /* TXDPCPU raw table data for queue. */
  4578. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_0_OFST 32
  4579. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_0_LEN 8
  4580. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_0_LO_OFST 32
  4581. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_0_HI_OFST 36
  4582. /* TXDPCPU raw table data for queue. */
  4583. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_1_OFST 40
  4584. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_1_LEN 8
  4585. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_1_LO_OFST 40
  4586. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_1_HI_OFST 44
  4587. /* TXDPCPU raw table data for queue. */
  4588. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_2_OFST 48
  4589. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_2_LEN 8
  4590. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_2_LO_OFST 48
  4591. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_2_HI_OFST 52
  4592. /* Combined metadata field. */
  4593. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_OFST 56
  4594. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_LEN 8
  4595. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_LO_OFST 56
  4596. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_HI_OFST 60
  4597. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_BUFS_BASE_LBN 0
  4598. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_BUFS_BASE_WIDTH 16
  4599. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_BUFS_NPAGES_LBN 16
  4600. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_BUFS_NPAGES_WIDTH 8
  4601. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_QSTATE_LBN 24
  4602. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_QSTATE_WIDTH 8
  4603. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_WAITCOUNT_LBN 32
  4604. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_WAITCOUNT_WIDTH 8
  4605. #define MC_CMD_DUMP_VI_STATE_OUT_VI_PADDING_LBN 40
  4606. #define MC_CMD_DUMP_VI_STATE_OUT_VI_PADDING_WIDTH 24
  4607. /* RXDPCPU raw table data for queue. */
  4608. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_0_OFST 64
  4609. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_0_LEN 8
  4610. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_0_LO_OFST 64
  4611. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_0_HI_OFST 68
  4612. /* RXDPCPU raw table data for queue. */
  4613. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_1_OFST 72
  4614. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_1_LEN 8
  4615. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_1_LO_OFST 72
  4616. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_1_HI_OFST 76
  4617. /* Reserved, currently 0. */
  4618. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_2_OFST 80
  4619. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_2_LEN 8
  4620. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_2_LO_OFST 80
  4621. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_2_HI_OFST 84
  4622. /* Combined metadata field. */
  4623. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_OFST 88
  4624. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_LEN 8
  4625. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_LO_OFST 88
  4626. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_HI_OFST 92
  4627. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_BUFS_BASE_LBN 0
  4628. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_BUFS_BASE_WIDTH 16
  4629. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_BUFS_NPAGES_LBN 16
  4630. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_BUFS_NPAGES_WIDTH 8
  4631. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_QSTATE_LBN 24
  4632. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_QSTATE_WIDTH 8
  4633. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_WAITCOUNT_LBN 32
  4634. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_WAITCOUNT_WIDTH 8
  4635. /***********************************/
  4636. /* MC_CMD_ALLOC_PIOBUF
  4637. * Allocate a push I/O buffer for later use with a tx queue.
  4638. */
  4639. #define MC_CMD_ALLOC_PIOBUF 0x8f
  4640. #define MC_CMD_0x8f_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
  4641. /* MC_CMD_ALLOC_PIOBUF_IN msgrequest */
  4642. #define MC_CMD_ALLOC_PIOBUF_IN_LEN 0
  4643. /* MC_CMD_ALLOC_PIOBUF_OUT msgresponse */
  4644. #define MC_CMD_ALLOC_PIOBUF_OUT_LEN 4
  4645. /* Handle for allocated push I/O buffer. */
  4646. #define MC_CMD_ALLOC_PIOBUF_OUT_PIOBUF_HANDLE_OFST 0
  4647. /***********************************/
  4648. /* MC_CMD_FREE_PIOBUF
  4649. * Free a push I/O buffer.
  4650. */
  4651. #define MC_CMD_FREE_PIOBUF 0x90
  4652. #define MC_CMD_0x90_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
  4653. /* MC_CMD_FREE_PIOBUF_IN msgrequest */
  4654. #define MC_CMD_FREE_PIOBUF_IN_LEN 4
  4655. /* Handle for allocated push I/O buffer. */
  4656. #define MC_CMD_FREE_PIOBUF_IN_PIOBUF_HANDLE_OFST 0
  4657. /* MC_CMD_FREE_PIOBUF_OUT msgresponse */
  4658. #define MC_CMD_FREE_PIOBUF_OUT_LEN 0
  4659. /***********************************/
  4660. /* MC_CMD_GET_VI_TLP_PROCESSING
  4661. * Get TLP steering and ordering information for a VI.
  4662. */
  4663. #define MC_CMD_GET_VI_TLP_PROCESSING 0xb0
  4664. #define MC_CMD_0xb0_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  4665. /* MC_CMD_GET_VI_TLP_PROCESSING_IN msgrequest */
  4666. #define MC_CMD_GET_VI_TLP_PROCESSING_IN_LEN 4
  4667. /* VI number to get information for. */
  4668. #define MC_CMD_GET_VI_TLP_PROCESSING_IN_INSTANCE_OFST 0
  4669. /* MC_CMD_GET_VI_TLP_PROCESSING_OUT msgresponse */
  4670. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_LEN 4
  4671. /* Transaction processing steering hint 1 for use with the Rx Queue. */
  4672. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_TPH_TAG1_RX_OFST 0
  4673. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_TPH_TAG1_RX_LEN 1
  4674. /* Transaction processing steering hint 2 for use with the Ev Queue. */
  4675. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_TPH_TAG2_EV_OFST 1
  4676. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_TPH_TAG2_EV_LEN 1
  4677. /* Use Relaxed ordering model for TLPs on this VI. */
  4678. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_RELAXED_ORDERING_LBN 16
  4679. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_RELAXED_ORDERING_WIDTH 1
  4680. /* Use ID based ordering for TLPs on this VI. */
  4681. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_ID_BASED_ORDERING_LBN 17
  4682. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_ID_BASED_ORDERING_WIDTH 1
  4683. /* Set no snoop bit for TLPs on this VI. */
  4684. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_NO_SNOOP_LBN 18
  4685. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_NO_SNOOP_WIDTH 1
  4686. /* Enable TPH for TLPs on this VI. */
  4687. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_TPH_ON_LBN 19
  4688. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_TPH_ON_WIDTH 1
  4689. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_DATA_OFST 0
  4690. /***********************************/
  4691. /* MC_CMD_SET_VI_TLP_PROCESSING
  4692. * Set TLP steering and ordering information for a VI.
  4693. */
  4694. #define MC_CMD_SET_VI_TLP_PROCESSING 0xb1
  4695. #define MC_CMD_0xb1_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  4696. /* MC_CMD_SET_VI_TLP_PROCESSING_IN msgrequest */
  4697. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_LEN 8
  4698. /* VI number to set information for. */
  4699. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_INSTANCE_OFST 0
  4700. /* Transaction processing steering hint 1 for use with the Rx Queue. */
  4701. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_TPH_TAG1_RX_OFST 4
  4702. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_TPH_TAG1_RX_LEN 1
  4703. /* Transaction processing steering hint 2 for use with the Ev Queue. */
  4704. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_TPH_TAG2_EV_OFST 5
  4705. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_TPH_TAG2_EV_LEN 1
  4706. /* Use Relaxed ordering model for TLPs on this VI. */
  4707. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_RELAXED_ORDERING_LBN 48
  4708. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_RELAXED_ORDERING_WIDTH 1
  4709. /* Use ID based ordering for TLPs on this VI. */
  4710. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_ID_BASED_ORDERING_LBN 49
  4711. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_ID_BASED_ORDERING_WIDTH 1
  4712. /* Set the no snoop bit for TLPs on this VI. */
  4713. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_NO_SNOOP_LBN 50
  4714. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_NO_SNOOP_WIDTH 1
  4715. /* Enable TPH for TLPs on this VI. */
  4716. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_TPH_ON_LBN 51
  4717. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_TPH_ON_WIDTH 1
  4718. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_DATA_OFST 4
  4719. /* MC_CMD_SET_VI_TLP_PROCESSING_OUT msgresponse */
  4720. #define MC_CMD_SET_VI_TLP_PROCESSING_OUT_LEN 0
  4721. /***********************************/
  4722. /* MC_CMD_GET_TLP_PROCESSING_GLOBALS
  4723. * Get global PCIe steering and transaction processing configuration.
  4724. */
  4725. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS 0xbc
  4726. #define MC_CMD_0xbc_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  4727. /* MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN msgrequest */
  4728. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN_LEN 4
  4729. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN_TLP_GLOBAL_CATEGORY_OFST 0
  4730. /* enum: MISC. */
  4731. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN_TLP_GLOBAL_CATEGORY_MISC 0x0
  4732. /* enum: IDO. */
  4733. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN_TLP_GLOBAL_CATEGORY_IDO 0x1
  4734. /* enum: RO. */
  4735. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN_TLP_GLOBAL_CATEGORY_RO 0x2
  4736. /* enum: TPH Type. */
  4737. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN_TLP_GLOBAL_CATEGORY_TPH_TYPE 0x3
  4738. /* MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT msgresponse */
  4739. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_LEN 8
  4740. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_GLOBAL_CATEGORY_OFST 0
  4741. /* Enum values, see field(s): */
  4742. /* MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN/TLP_GLOBAL_CATEGORY */
  4743. /* Amalgamated TLP info word. */
  4744. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_WORD_OFST 4
  4745. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_MISC_WTAG_EN_LBN 0
  4746. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_MISC_WTAG_EN_WIDTH 1
  4747. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_MISC_SPARE_LBN 1
  4748. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_MISC_SPARE_WIDTH 31
  4749. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_DL_EN_LBN 0
  4750. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_DL_EN_WIDTH 1
  4751. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_TX_EN_LBN 1
  4752. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_TX_EN_WIDTH 1
  4753. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_EV_EN_LBN 2
  4754. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_EV_EN_WIDTH 1
  4755. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_RX_EN_LBN 3
  4756. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_RX_EN_WIDTH 1
  4757. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_SPARE_LBN 4
  4758. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_SPARE_WIDTH 28
  4759. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_RO_RXDMA_EN_LBN 0
  4760. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_RO_RXDMA_EN_WIDTH 1
  4761. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_RO_TXDMA_EN_LBN 1
  4762. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_RO_TXDMA_EN_WIDTH 1
  4763. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_RO_DL_EN_LBN 2
  4764. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_RO_DL_EN_WIDTH 1
  4765. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_RO_SPARE_LBN 3
  4766. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_RO_SPARE_WIDTH 29
  4767. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_MSIX_LBN 0
  4768. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_MSIX_WIDTH 2
  4769. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_DL_LBN 2
  4770. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_DL_WIDTH 2
  4771. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_TX_LBN 4
  4772. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_TX_WIDTH 2
  4773. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_EV_LBN 6
  4774. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_EV_WIDTH 2
  4775. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_RX_LBN 8
  4776. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_RX_WIDTH 2
  4777. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TLP_TYPE_SPARE_LBN 9
  4778. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TLP_TYPE_SPARE_WIDTH 23
  4779. /***********************************/
  4780. /* MC_CMD_SET_TLP_PROCESSING_GLOBALS
  4781. * Set global PCIe steering and transaction processing configuration.
  4782. */
  4783. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS 0xbd
  4784. #define MC_CMD_0xbd_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  4785. /* MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN msgrequest */
  4786. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_LEN 8
  4787. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_GLOBAL_CATEGORY_OFST 0
  4788. /* Enum values, see field(s): */
  4789. /* MC_CMD_GET_TLP_PROCESSING_GLOBALS/MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN/TLP_GLOBAL_CATEGORY */
  4790. /* Amalgamated TLP info word. */
  4791. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_WORD_OFST 4
  4792. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_MISC_WTAG_EN_LBN 0
  4793. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_MISC_WTAG_EN_WIDTH 1
  4794. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_IDO_DL_EN_LBN 0
  4795. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_IDO_DL_EN_WIDTH 1
  4796. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_IDO_TX_EN_LBN 1
  4797. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_IDO_TX_EN_WIDTH 1
  4798. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_IDO_EV_EN_LBN 2
  4799. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_IDO_EV_EN_WIDTH 1
  4800. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_IDO_RX_EN_LBN 3
  4801. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_IDO_RX_EN_WIDTH 1
  4802. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_RO_RXDMA_EN_LBN 0
  4803. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_RO_RXDMA_EN_WIDTH 1
  4804. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_RO_TXDMA_EN_LBN 1
  4805. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_RO_TXDMA_EN_WIDTH 1
  4806. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_RO_DL_EN_LBN 2
  4807. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_RO_DL_EN_WIDTH 1
  4808. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_MSIX_LBN 0
  4809. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_MSIX_WIDTH 2
  4810. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_DL_LBN 2
  4811. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_DL_WIDTH 2
  4812. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_TX_LBN 4
  4813. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_TX_WIDTH 2
  4814. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_EV_LBN 6
  4815. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_EV_WIDTH 2
  4816. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_RX_LBN 8
  4817. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_RX_WIDTH 2
  4818. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_SPARE_LBN 10
  4819. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_SPARE_WIDTH 22
  4820. /* MC_CMD_SET_TLP_PROCESSING_GLOBALS_OUT msgresponse */
  4821. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_OUT_LEN 0
  4822. /***********************************/
  4823. /* MC_CMD_SATELLITE_DOWNLOAD
  4824. * Download a new set of images to the satellite CPUs from the host.
  4825. */
  4826. #define MC_CMD_SATELLITE_DOWNLOAD 0x91
  4827. #define MC_CMD_0x91_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  4828. /* MC_CMD_SATELLITE_DOWNLOAD_IN msgrequest: The reset requirements for the CPUs
  4829. * are subtle, and so downloads must proceed in a number of phases.
  4830. *
  4831. * 1) PHASE_RESET with a target of TARGET_ALL and chunk ID/length of 0.
  4832. *
  4833. * 2) PHASE_IMEMS for each of the IMEM targets (target IDs 0-11). Each download
  4834. * may consist of multiple chunks. The final chunk (with CHUNK_ID_LAST) should
  4835. * be a checksum (a simple 32-bit sum) of the transferred data. An individual
  4836. * download may be aborted using CHUNK_ID_ABORT.
  4837. *
  4838. * 3) PHASE_VECTORS for each of the vector table targets (target IDs 12-15),
  4839. * similar to PHASE_IMEMS.
  4840. *
  4841. * 4) PHASE_READY with a target of TARGET_ALL and chunk ID/length of 0.
  4842. *
  4843. * After any error (a requested abort is not considered to be an error) the
  4844. * sequence must be restarted from PHASE_RESET.
  4845. */
  4846. #define MC_CMD_SATELLITE_DOWNLOAD_IN_LENMIN 20
  4847. #define MC_CMD_SATELLITE_DOWNLOAD_IN_LENMAX 252
  4848. #define MC_CMD_SATELLITE_DOWNLOAD_IN_LEN(num) (16+4*(num))
  4849. /* Download phase. (Note: the IDLE phase is used internally and is never valid
  4850. * in a command from the host.)
  4851. */
  4852. #define MC_CMD_SATELLITE_DOWNLOAD_IN_PHASE_OFST 0
  4853. #define MC_CMD_SATELLITE_DOWNLOAD_IN_PHASE_IDLE 0x0 /* enum */
  4854. #define MC_CMD_SATELLITE_DOWNLOAD_IN_PHASE_RESET 0x1 /* enum */
  4855. #define MC_CMD_SATELLITE_DOWNLOAD_IN_PHASE_IMEMS 0x2 /* enum */
  4856. #define MC_CMD_SATELLITE_DOWNLOAD_IN_PHASE_VECTORS 0x3 /* enum */
  4857. #define MC_CMD_SATELLITE_DOWNLOAD_IN_PHASE_READY 0x4 /* enum */
  4858. /* Target for download. (These match the blob numbers defined in
  4859. * mc_flash_layout.h.)
  4860. */
  4861. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_OFST 4
  4862. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  4863. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_TXDI_TEXT 0x0
  4864. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  4865. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_RXDI_TEXT 0x1
  4866. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  4867. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_TXDP_TEXT 0x2
  4868. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  4869. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_RXDP_TEXT 0x3
  4870. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  4871. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_RXHRSL_HR_LUT 0x4
  4872. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  4873. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_RXHRSL_HR_LUT_CFG 0x5
  4874. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  4875. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_TXHRSL_HR_LUT 0x6
  4876. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  4877. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_TXHRSL_HR_LUT_CFG 0x7
  4878. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  4879. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_RXHRSL_HR_PGM 0x8
  4880. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  4881. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_RXHRSL_SL_PGM 0x9
  4882. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  4883. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_TXHRSL_HR_PGM 0xa
  4884. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  4885. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_TXHRSL_SL_PGM 0xb
  4886. /* enum: Valid in phase 3 (PHASE_VECTORS) only */
  4887. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_RXDI_VTBL0 0xc
  4888. /* enum: Valid in phase 3 (PHASE_VECTORS) only */
  4889. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_TXDI_VTBL0 0xd
  4890. /* enum: Valid in phase 3 (PHASE_VECTORS) only */
  4891. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_RXDI_VTBL1 0xe
  4892. /* enum: Valid in phase 3 (PHASE_VECTORS) only */
  4893. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_TXDI_VTBL1 0xf
  4894. /* enum: Valid in phases 1 (PHASE_RESET) and 4 (PHASE_READY) only */
  4895. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_ALL 0xffffffff
  4896. /* Chunk ID, or CHUNK_ID_LAST or CHUNK_ID_ABORT */
  4897. #define MC_CMD_SATELLITE_DOWNLOAD_IN_CHUNK_ID_OFST 8
  4898. /* enum: Last chunk, containing checksum rather than data */
  4899. #define MC_CMD_SATELLITE_DOWNLOAD_IN_CHUNK_ID_LAST 0xffffffff
  4900. /* enum: Abort download of this item */
  4901. #define MC_CMD_SATELLITE_DOWNLOAD_IN_CHUNK_ID_ABORT 0xfffffffe
  4902. /* Length of this chunk in bytes */
  4903. #define MC_CMD_SATELLITE_DOWNLOAD_IN_CHUNK_LEN_OFST 12
  4904. /* Data for this chunk */
  4905. #define MC_CMD_SATELLITE_DOWNLOAD_IN_CHUNK_DATA_OFST 16
  4906. #define MC_CMD_SATELLITE_DOWNLOAD_IN_CHUNK_DATA_LEN 4
  4907. #define MC_CMD_SATELLITE_DOWNLOAD_IN_CHUNK_DATA_MINNUM 1
  4908. #define MC_CMD_SATELLITE_DOWNLOAD_IN_CHUNK_DATA_MAXNUM 59
  4909. /* MC_CMD_SATELLITE_DOWNLOAD_OUT msgresponse */
  4910. #define MC_CMD_SATELLITE_DOWNLOAD_OUT_LEN 8
  4911. /* Same as MC_CMD_ERR field, but included as 0 in success cases */
  4912. #define MC_CMD_SATELLITE_DOWNLOAD_OUT_RESULT_OFST 0
  4913. /* Extra status information */
  4914. #define MC_CMD_SATELLITE_DOWNLOAD_OUT_INFO_OFST 4
  4915. /* enum: Code download OK, completed. */
  4916. #define MC_CMD_SATELLITE_DOWNLOAD_OUT_OK_COMPLETE 0x0
  4917. /* enum: Code download aborted as requested. */
  4918. #define MC_CMD_SATELLITE_DOWNLOAD_OUT_OK_ABORTED 0x1
  4919. /* enum: Code download OK so far, send next chunk. */
  4920. #define MC_CMD_SATELLITE_DOWNLOAD_OUT_OK_NEXT_CHUNK 0x2
  4921. /* enum: Download phases out of sequence */
  4922. #define MC_CMD_SATELLITE_DOWNLOAD_OUT_ERR_BAD_PHASE 0x100
  4923. /* enum: Bad target for this phase */
  4924. #define MC_CMD_SATELLITE_DOWNLOAD_OUT_ERR_BAD_TARGET 0x101
  4925. /* enum: Chunk ID out of sequence */
  4926. #define MC_CMD_SATELLITE_DOWNLOAD_OUT_ERR_BAD_CHUNK_ID 0x200
  4927. /* enum: Chunk length zero or too large */
  4928. #define MC_CMD_SATELLITE_DOWNLOAD_OUT_ERR_BAD_CHUNK_LEN 0x201
  4929. /* enum: Checksum was incorrect */
  4930. #define MC_CMD_SATELLITE_DOWNLOAD_OUT_ERR_BAD_CHECKSUM 0x300
  4931. /***********************************/
  4932. /* MC_CMD_GET_CAPABILITIES
  4933. * Get device capabilities.
  4934. *
  4935. * This is supplementary to the MC_CMD_GET_BOARD_CFG command, and intended to
  4936. * reference inherent device capabilities as opposed to current NVRAM config.
  4937. */
  4938. #define MC_CMD_GET_CAPABILITIES 0xbe
  4939. #define MC_CMD_0xbe_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  4940. /* MC_CMD_GET_CAPABILITIES_IN msgrequest */
  4941. #define MC_CMD_GET_CAPABILITIES_IN_LEN 0
  4942. /* MC_CMD_GET_CAPABILITIES_OUT msgresponse */
  4943. #define MC_CMD_GET_CAPABILITIES_OUT_LEN 20
  4944. /* First word of flags. */
  4945. #define MC_CMD_GET_CAPABILITIES_OUT_FLAGS1_OFST 0
  4946. #define MC_CMD_GET_CAPABILITIES_OUT_TX_VLAN_INSERTION_LBN 19
  4947. #define MC_CMD_GET_CAPABILITIES_OUT_TX_VLAN_INSERTION_WIDTH 1
  4948. #define MC_CMD_GET_CAPABILITIES_OUT_RX_VLAN_STRIPPING_LBN 20
  4949. #define MC_CMD_GET_CAPABILITIES_OUT_RX_VLAN_STRIPPING_WIDTH 1
  4950. #define MC_CMD_GET_CAPABILITIES_OUT_TX_TSO_LBN 21
  4951. #define MC_CMD_GET_CAPABILITIES_OUT_TX_TSO_WIDTH 1
  4952. #define MC_CMD_GET_CAPABILITIES_OUT_RX_PREFIX_LEN_0_LBN 22
  4953. #define MC_CMD_GET_CAPABILITIES_OUT_RX_PREFIX_LEN_0_WIDTH 1
  4954. #define MC_CMD_GET_CAPABILITIES_OUT_RX_PREFIX_LEN_14_LBN 23
  4955. #define MC_CMD_GET_CAPABILITIES_OUT_RX_PREFIX_LEN_14_WIDTH 1
  4956. #define MC_CMD_GET_CAPABILITIES_OUT_RX_TIMESTAMP_LBN 24
  4957. #define MC_CMD_GET_CAPABILITIES_OUT_RX_TIMESTAMP_WIDTH 1
  4958. #define MC_CMD_GET_CAPABILITIES_OUT_RX_BATCHING_LBN 25
  4959. #define MC_CMD_GET_CAPABILITIES_OUT_RX_BATCHING_WIDTH 1
  4960. #define MC_CMD_GET_CAPABILITIES_OUT_MCAST_FILTER_CHAINING_LBN 26
  4961. #define MC_CMD_GET_CAPABILITIES_OUT_MCAST_FILTER_CHAINING_WIDTH 1
  4962. #define MC_CMD_GET_CAPABILITIES_OUT_PM_AND_RXDP_COUNTERS_LBN 27
  4963. #define MC_CMD_GET_CAPABILITIES_OUT_PM_AND_RXDP_COUNTERS_WIDTH 1
  4964. #define MC_CMD_GET_CAPABILITIES_OUT_EVB_LBN 30
  4965. #define MC_CMD_GET_CAPABILITIES_OUT_EVB_WIDTH 1
  4966. /* RxDPCPU firmware id. */
  4967. #define MC_CMD_GET_CAPABILITIES_OUT_RX_DPCPU_FW_ID_OFST 4
  4968. #define MC_CMD_GET_CAPABILITIES_OUT_RX_DPCPU_FW_ID_LEN 2
  4969. /* enum: Standard RXDP firmware */
  4970. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP 0x0
  4971. /* enum: Low latency RXDP firmware */
  4972. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_LOW_LATENCY 0x1
  4973. /* enum: RXDP Test firmware image 1 */
  4974. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_FW_TO_MC_CUT_THROUGH 0x101
  4975. /* enum: RXDP Test firmware image 2 */
  4976. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_FW_TO_MC_STORE_FORWARD 0x102
  4977. /* enum: RXDP Test firmware image 3 */
  4978. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_FW_TO_MC_STORE_FORWARD_FIRST 0x103
  4979. /* enum: RXDP Test firmware image 4 */
  4980. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_EVERY_EVENT_BATCHABLE 0x104
  4981. /* enum: RXDP Test firmware image 5 */
  4982. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_BACKPRESSURE 0x105
  4983. /* enum: RXDP Test firmware image 6 */
  4984. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_FW_PACKET_EDITS 0x106
  4985. /* enum: RXDP Test firmware image 7 */
  4986. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_FW_RX_HDR_SPLIT 0x107
  4987. /* enum: RXDP Test firmware image 8 */
  4988. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_FW_DISABLE_DL 0x108
  4989. /* TxDPCPU firmware id. */
  4990. #define MC_CMD_GET_CAPABILITIES_OUT_TX_DPCPU_FW_ID_OFST 6
  4991. #define MC_CMD_GET_CAPABILITIES_OUT_TX_DPCPU_FW_ID_LEN 2
  4992. /* enum: Standard TXDP firmware */
  4993. #define MC_CMD_GET_CAPABILITIES_OUT_TXDP 0x0
  4994. /* enum: Low latency TXDP firmware */
  4995. #define MC_CMD_GET_CAPABILITIES_OUT_TXDP_LOW_LATENCY 0x1
  4996. /* enum: TXDP Test firmware image 1 */
  4997. #define MC_CMD_GET_CAPABILITIES_OUT_TXDP_TEST_FW_TSO_EDIT 0x101
  4998. /* enum: TXDP Test firmware image 2 */
  4999. #define MC_CMD_GET_CAPABILITIES_OUT_TXDP_TEST_FW_PACKET_EDITS 0x102
  5000. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_VERSION_OFST 8
  5001. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_VERSION_LEN 2
  5002. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_VERSION_REV_LBN 0
  5003. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_VERSION_REV_WIDTH 12
  5004. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_VERSION_TYPE_LBN 12
  5005. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_VERSION_TYPE_WIDTH 4
  5006. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_FIRST_PKT 0x1 /* enum */
  5007. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_SIENA_COMPAT 0x2 /* enum */
  5008. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_VSWITCH 0x3 /* enum */
  5009. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_SIENA_COMPAT_PM 0x4 /* enum */
  5010. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_LOW_LATENCY 0x5 /* enum */
  5011. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_VERSION_OFST 10
  5012. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_VERSION_LEN 2
  5013. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_VERSION_REV_LBN 0
  5014. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_VERSION_REV_WIDTH 12
  5015. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_VERSION_TYPE_LBN 12
  5016. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_VERSION_TYPE_WIDTH 4
  5017. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_FIRST_PKT 0x1 /* enum */
  5018. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_SIENA_COMPAT 0x2 /* enum */
  5019. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_VSWITCH 0x3 /* enum */
  5020. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_SIENA_COMPAT_PM 0x4 /* enum */
  5021. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_LOW_LATENCY 0x5 /* enum */
  5022. /* Hardware capabilities of NIC */
  5023. #define MC_CMD_GET_CAPABILITIES_OUT_HW_CAPABILITIES_OFST 12
  5024. /* Licensed capabilities */
  5025. #define MC_CMD_GET_CAPABILITIES_OUT_LICENSE_CAPABILITIES_OFST 16
  5026. /***********************************/
  5027. /* MC_CMD_V2_EXTN
  5028. * Encapsulation for a v2 extended command
  5029. */
  5030. #define MC_CMD_V2_EXTN 0x7f
  5031. /* MC_CMD_V2_EXTN_IN msgrequest */
  5032. #define MC_CMD_V2_EXTN_IN_LEN 4
  5033. /* the extended command number */
  5034. #define MC_CMD_V2_EXTN_IN_EXTENDED_CMD_LBN 0
  5035. #define MC_CMD_V2_EXTN_IN_EXTENDED_CMD_WIDTH 15
  5036. #define MC_CMD_V2_EXTN_IN_UNUSED_LBN 15
  5037. #define MC_CMD_V2_EXTN_IN_UNUSED_WIDTH 1
  5038. /* the actual length of the encapsulated command (which is not in the v1
  5039. * header)
  5040. */
  5041. #define MC_CMD_V2_EXTN_IN_ACTUAL_LEN_LBN 16
  5042. #define MC_CMD_V2_EXTN_IN_ACTUAL_LEN_WIDTH 10
  5043. #define MC_CMD_V2_EXTN_IN_UNUSED2_LBN 26
  5044. #define MC_CMD_V2_EXTN_IN_UNUSED2_WIDTH 6
  5045. /***********************************/
  5046. /* MC_CMD_TCM_BUCKET_ALLOC
  5047. * Allocate a pacer bucket (for qau rp or a snapper test)
  5048. */
  5049. #define MC_CMD_TCM_BUCKET_ALLOC 0xb2
  5050. #define MC_CMD_0xb2_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5051. /* MC_CMD_TCM_BUCKET_ALLOC_IN msgrequest */
  5052. #define MC_CMD_TCM_BUCKET_ALLOC_IN_LEN 0
  5053. /* MC_CMD_TCM_BUCKET_ALLOC_OUT msgresponse */
  5054. #define MC_CMD_TCM_BUCKET_ALLOC_OUT_LEN 4
  5055. /* the bucket id */
  5056. #define MC_CMD_TCM_BUCKET_ALLOC_OUT_BUCKET_OFST 0
  5057. /***********************************/
  5058. /* MC_CMD_TCM_BUCKET_FREE
  5059. * Free a pacer bucket
  5060. */
  5061. #define MC_CMD_TCM_BUCKET_FREE 0xb3
  5062. #define MC_CMD_0xb3_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5063. /* MC_CMD_TCM_BUCKET_FREE_IN msgrequest */
  5064. #define MC_CMD_TCM_BUCKET_FREE_IN_LEN 4
  5065. /* the bucket id */
  5066. #define MC_CMD_TCM_BUCKET_FREE_IN_BUCKET_OFST 0
  5067. /* MC_CMD_TCM_BUCKET_FREE_OUT msgresponse */
  5068. #define MC_CMD_TCM_BUCKET_FREE_OUT_LEN 0
  5069. /***********************************/
  5070. /* MC_CMD_TCM_BUCKET_INIT
  5071. * Initialise pacer bucket with a given rate
  5072. */
  5073. #define MC_CMD_TCM_BUCKET_INIT 0xb4
  5074. #define MC_CMD_0xb4_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5075. /* MC_CMD_TCM_BUCKET_INIT_IN msgrequest */
  5076. #define MC_CMD_TCM_BUCKET_INIT_IN_LEN 8
  5077. /* the bucket id */
  5078. #define MC_CMD_TCM_BUCKET_INIT_IN_BUCKET_OFST 0
  5079. /* the rate in mbps */
  5080. #define MC_CMD_TCM_BUCKET_INIT_IN_RATE_OFST 4
  5081. /* MC_CMD_TCM_BUCKET_INIT_OUT msgresponse */
  5082. #define MC_CMD_TCM_BUCKET_INIT_OUT_LEN 0
  5083. /***********************************/
  5084. /* MC_CMD_TCM_TXQ_INIT
  5085. * Initialise txq in pacer with given options or set options
  5086. */
  5087. #define MC_CMD_TCM_TXQ_INIT 0xb5
  5088. #define MC_CMD_0xb5_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5089. /* MC_CMD_TCM_TXQ_INIT_IN msgrequest */
  5090. #define MC_CMD_TCM_TXQ_INIT_IN_LEN 28
  5091. /* the txq id */
  5092. #define MC_CMD_TCM_TXQ_INIT_IN_QID_OFST 0
  5093. /* the static priority associated with the txq */
  5094. #define MC_CMD_TCM_TXQ_INIT_IN_LABEL_OFST 4
  5095. /* bitmask of the priority queues this txq is inserted into */
  5096. #define MC_CMD_TCM_TXQ_INIT_IN_PQ_FLAGS_OFST 8
  5097. /* the reaction point (RP) bucket */
  5098. #define MC_CMD_TCM_TXQ_INIT_IN_RP_BKT_OFST 12
  5099. /* an already reserved bucket (typically set to bucket associated with outer
  5100. * vswitch)
  5101. */
  5102. #define MC_CMD_TCM_TXQ_INIT_IN_MAX_BKT1_OFST 16
  5103. /* an already reserved bucket (typically set to bucket associated with inner
  5104. * vswitch)
  5105. */
  5106. #define MC_CMD_TCM_TXQ_INIT_IN_MAX_BKT2_OFST 20
  5107. /* the min bucket (typically for ETS/minimum bandwidth) */
  5108. #define MC_CMD_TCM_TXQ_INIT_IN_MIN_BKT_OFST 24
  5109. /* MC_CMD_TCM_TXQ_INIT_OUT msgresponse */
  5110. #define MC_CMD_TCM_TXQ_INIT_OUT_LEN 0
  5111. /***********************************/
  5112. /* MC_CMD_LINK_PIOBUF
  5113. * Link a push I/O buffer to a TxQ
  5114. */
  5115. #define MC_CMD_LINK_PIOBUF 0x92
  5116. #define MC_CMD_0x92_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
  5117. /* MC_CMD_LINK_PIOBUF_IN msgrequest */
  5118. #define MC_CMD_LINK_PIOBUF_IN_LEN 8
  5119. /* Handle for allocated push I/O buffer. */
  5120. #define MC_CMD_LINK_PIOBUF_IN_PIOBUF_HANDLE_OFST 0
  5121. /* Function Local Instance (VI) number. */
  5122. #define MC_CMD_LINK_PIOBUF_IN_TXQ_INSTANCE_OFST 4
  5123. /* MC_CMD_LINK_PIOBUF_OUT msgresponse */
  5124. #define MC_CMD_LINK_PIOBUF_OUT_LEN 0
  5125. /***********************************/
  5126. /* MC_CMD_UNLINK_PIOBUF
  5127. * Unlink a push I/O buffer from a TxQ
  5128. */
  5129. #define MC_CMD_UNLINK_PIOBUF 0x93
  5130. #define MC_CMD_0x93_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
  5131. /* MC_CMD_UNLINK_PIOBUF_IN msgrequest */
  5132. #define MC_CMD_UNLINK_PIOBUF_IN_LEN 4
  5133. /* Function Local Instance (VI) number. */
  5134. #define MC_CMD_UNLINK_PIOBUF_IN_TXQ_INSTANCE_OFST 0
  5135. /* MC_CMD_UNLINK_PIOBUF_OUT msgresponse */
  5136. #define MC_CMD_UNLINK_PIOBUF_OUT_LEN 0
  5137. /***********************************/
  5138. /* MC_CMD_VSWITCH_ALLOC
  5139. * allocate and initialise a v-switch.
  5140. */
  5141. #define MC_CMD_VSWITCH_ALLOC 0x94
  5142. #define MC_CMD_0x94_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5143. /* MC_CMD_VSWITCH_ALLOC_IN msgrequest */
  5144. #define MC_CMD_VSWITCH_ALLOC_IN_LEN 16
  5145. /* The port to connect to the v-switch's upstream port. */
  5146. #define MC_CMD_VSWITCH_ALLOC_IN_UPSTREAM_PORT_ID_OFST 0
  5147. /* The type of v-switch to create. */
  5148. #define MC_CMD_VSWITCH_ALLOC_IN_TYPE_OFST 4
  5149. /* enum: VLAN */
  5150. #define MC_CMD_VSWITCH_ALLOC_IN_VSWITCH_TYPE_VLAN 0x1
  5151. /* enum: VEB */
  5152. #define MC_CMD_VSWITCH_ALLOC_IN_VSWITCH_TYPE_VEB 0x2
  5153. /* enum: VEPA */
  5154. #define MC_CMD_VSWITCH_ALLOC_IN_VSWITCH_TYPE_VEPA 0x3
  5155. /* Flags controlling v-port creation */
  5156. #define MC_CMD_VSWITCH_ALLOC_IN_FLAGS_OFST 8
  5157. #define MC_CMD_VSWITCH_ALLOC_IN_FLAG_AUTO_PORT_LBN 0
  5158. #define MC_CMD_VSWITCH_ALLOC_IN_FLAG_AUTO_PORT_WIDTH 1
  5159. /* The number of VLAN tags to support. */
  5160. #define MC_CMD_VSWITCH_ALLOC_IN_NUM_VLAN_TAGS_OFST 12
  5161. /* MC_CMD_VSWITCH_ALLOC_OUT msgresponse */
  5162. #define MC_CMD_VSWITCH_ALLOC_OUT_LEN 0
  5163. /***********************************/
  5164. /* MC_CMD_VSWITCH_FREE
  5165. * de-allocate a v-switch.
  5166. */
  5167. #define MC_CMD_VSWITCH_FREE 0x95
  5168. #define MC_CMD_0x95_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5169. /* MC_CMD_VSWITCH_FREE_IN msgrequest */
  5170. #define MC_CMD_VSWITCH_FREE_IN_LEN 4
  5171. /* The port to which the v-switch is connected. */
  5172. #define MC_CMD_VSWITCH_FREE_IN_UPSTREAM_PORT_ID_OFST 0
  5173. /* MC_CMD_VSWITCH_FREE_OUT msgresponse */
  5174. #define MC_CMD_VSWITCH_FREE_OUT_LEN 0
  5175. /***********************************/
  5176. /* MC_CMD_VPORT_ALLOC
  5177. * allocate a v-port.
  5178. */
  5179. #define MC_CMD_VPORT_ALLOC 0x96
  5180. #define MC_CMD_0x96_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5181. /* MC_CMD_VPORT_ALLOC_IN msgrequest */
  5182. #define MC_CMD_VPORT_ALLOC_IN_LEN 20
  5183. /* The port to which the v-switch is connected. */
  5184. #define MC_CMD_VPORT_ALLOC_IN_UPSTREAM_PORT_ID_OFST 0
  5185. /* The type of the new v-port. */
  5186. #define MC_CMD_VPORT_ALLOC_IN_TYPE_OFST 4
  5187. /* enum: VLAN (obsolete) */
  5188. #define MC_CMD_VPORT_ALLOC_IN_VPORT_TYPE_VLAN 0x1
  5189. /* enum: VEB (obsolete) */
  5190. #define MC_CMD_VPORT_ALLOC_IN_VPORT_TYPE_VEB 0x2
  5191. /* enum: VEPA (obsolete) */
  5192. #define MC_CMD_VPORT_ALLOC_IN_VPORT_TYPE_VEPA 0x3
  5193. /* enum: A normal v-port receives packets which match a specified MAC and/or
  5194. * VLAN.
  5195. */
  5196. #define MC_CMD_VPORT_ALLOC_IN_VPORT_TYPE_NORMAL 0x4
  5197. /* enum: An expansion v-port packets traffic which don't match any other
  5198. * v-port.
  5199. */
  5200. #define MC_CMD_VPORT_ALLOC_IN_VPORT_TYPE_EXPANSION 0x5
  5201. /* enum: An test v-port receives packets which match any filters installed by
  5202. * its downstream components.
  5203. */
  5204. #define MC_CMD_VPORT_ALLOC_IN_VPORT_TYPE_TEST 0x6
  5205. /* Flags controlling v-port creation */
  5206. #define MC_CMD_VPORT_ALLOC_IN_FLAGS_OFST 8
  5207. #define MC_CMD_VPORT_ALLOC_IN_FLAG_AUTO_PORT_LBN 0
  5208. #define MC_CMD_VPORT_ALLOC_IN_FLAG_AUTO_PORT_WIDTH 1
  5209. /* The number of VLAN tags to insert/remove. */
  5210. #define MC_CMD_VPORT_ALLOC_IN_NUM_VLAN_TAGS_OFST 12
  5211. /* The actual VLAN tags to insert/remove */
  5212. #define MC_CMD_VPORT_ALLOC_IN_VLAN_TAGS_OFST 16
  5213. #define MC_CMD_VPORT_ALLOC_IN_VLAN_TAG_0_LBN 0
  5214. #define MC_CMD_VPORT_ALLOC_IN_VLAN_TAG_0_WIDTH 16
  5215. #define MC_CMD_VPORT_ALLOC_IN_VLAN_TAG_1_LBN 16
  5216. #define MC_CMD_VPORT_ALLOC_IN_VLAN_TAG_1_WIDTH 16
  5217. /* MC_CMD_VPORT_ALLOC_OUT msgresponse */
  5218. #define MC_CMD_VPORT_ALLOC_OUT_LEN 4
  5219. /* The handle of the new v-port */
  5220. #define MC_CMD_VPORT_ALLOC_OUT_VPORT_ID_OFST 0
  5221. /***********************************/
  5222. /* MC_CMD_VPORT_FREE
  5223. * de-allocate a v-port.
  5224. */
  5225. #define MC_CMD_VPORT_FREE 0x97
  5226. #define MC_CMD_0x97_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5227. /* MC_CMD_VPORT_FREE_IN msgrequest */
  5228. #define MC_CMD_VPORT_FREE_IN_LEN 4
  5229. /* The handle of the v-port */
  5230. #define MC_CMD_VPORT_FREE_IN_VPORT_ID_OFST 0
  5231. /* MC_CMD_VPORT_FREE_OUT msgresponse */
  5232. #define MC_CMD_VPORT_FREE_OUT_LEN 0
  5233. /***********************************/
  5234. /* MC_CMD_VADAPTOR_ALLOC
  5235. * allocate a v-adaptor.
  5236. */
  5237. #define MC_CMD_VADAPTOR_ALLOC 0x98
  5238. #define MC_CMD_0x98_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5239. /* MC_CMD_VADAPTOR_ALLOC_IN msgrequest */
  5240. #define MC_CMD_VADAPTOR_ALLOC_IN_LEN 30
  5241. /* The port to connect to the v-adaptor's port. */
  5242. #define MC_CMD_VADAPTOR_ALLOC_IN_UPSTREAM_PORT_ID_OFST 0
  5243. /* Flags controlling v-adaptor creation */
  5244. #define MC_CMD_VADAPTOR_ALLOC_IN_FLAGS_OFST 8
  5245. #define MC_CMD_VADAPTOR_ALLOC_IN_FLAG_AUTO_VADAPTOR_LBN 0
  5246. #define MC_CMD_VADAPTOR_ALLOC_IN_FLAG_AUTO_VADAPTOR_WIDTH 1
  5247. /* The number of VLAN tags to strip on receive */
  5248. #define MC_CMD_VADAPTOR_ALLOC_IN_NUM_VLANS_OFST 12
  5249. /* The number of VLAN tags to transparently insert/remove. */
  5250. #define MC_CMD_VADAPTOR_ALLOC_IN_NUM_VLAN_TAGS_OFST 16
  5251. /* The actual VLAN tags to insert/remove */
  5252. #define MC_CMD_VADAPTOR_ALLOC_IN_VLAN_TAGS_OFST 20
  5253. #define MC_CMD_VADAPTOR_ALLOC_IN_VLAN_TAG_0_LBN 0
  5254. #define MC_CMD_VADAPTOR_ALLOC_IN_VLAN_TAG_0_WIDTH 16
  5255. #define MC_CMD_VADAPTOR_ALLOC_IN_VLAN_TAG_1_LBN 16
  5256. #define MC_CMD_VADAPTOR_ALLOC_IN_VLAN_TAG_1_WIDTH 16
  5257. /* The MAC address to assign to this v-adaptor */
  5258. #define MC_CMD_VADAPTOR_ALLOC_IN_MACADDR_OFST 24
  5259. #define MC_CMD_VADAPTOR_ALLOC_IN_MACADDR_LEN 6
  5260. /* enum: Derive the MAC address from the upstream port */
  5261. #define MC_CMD_VADAPTOR_ALLOC_IN_AUTO_MAC 0x0
  5262. /* MC_CMD_VADAPTOR_ALLOC_OUT msgresponse */
  5263. #define MC_CMD_VADAPTOR_ALLOC_OUT_LEN 0
  5264. /***********************************/
  5265. /* MC_CMD_VADAPTOR_FREE
  5266. * de-allocate a v-adaptor.
  5267. */
  5268. #define MC_CMD_VADAPTOR_FREE 0x99
  5269. #define MC_CMD_0x99_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5270. /* MC_CMD_VADAPTOR_FREE_IN msgrequest */
  5271. #define MC_CMD_VADAPTOR_FREE_IN_LEN 4
  5272. /* The port to which the v-adaptor is connected. */
  5273. #define MC_CMD_VADAPTOR_FREE_IN_UPSTREAM_PORT_ID_OFST 0
  5274. /* MC_CMD_VADAPTOR_FREE_OUT msgresponse */
  5275. #define MC_CMD_VADAPTOR_FREE_OUT_LEN 0
  5276. /***********************************/
  5277. /* MC_CMD_VADAPTOR_SET_MAC
  5278. * assign a new MAC address to a v-adaptor.
  5279. */
  5280. #define MC_CMD_VADAPTOR_SET_MAC 0x5d
  5281. #define MC_CMD_0x5d_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5282. /* MC_CMD_VADAPTOR_SET_MAC_IN msgrequest */
  5283. #define MC_CMD_VADAPTOR_SET_MAC_IN_LEN 10
  5284. /* The port to which the v-adaptor is connected. */
  5285. #define MC_CMD_VADAPTOR_SET_MAC_IN_UPSTREAM_PORT_ID_OFST 0
  5286. /* The new MAC address to assign to this v-adaptor */
  5287. #define MC_CMD_VADAPTOR_SET_MAC_IN_MACADDR_OFST 4
  5288. #define MC_CMD_VADAPTOR_SET_MAC_IN_MACADDR_LEN 6
  5289. /* MC_CMD_VADAPTOR_SET_MAC_OUT msgresponse */
  5290. #define MC_CMD_VADAPTOR_SET_MAC_OUT_LEN 0
  5291. /***********************************/
  5292. /* MC_CMD_VADAPTOR_GET_MAC
  5293. * read the MAC address assigned to a v-adaptor.
  5294. */
  5295. #define MC_CMD_VADAPTOR_GET_MAC 0x5e
  5296. #define MC_CMD_0x5e_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5297. /* MC_CMD_VADAPTOR_GET_MAC_IN msgrequest */
  5298. #define MC_CMD_VADAPTOR_GET_MAC_IN_LEN 4
  5299. /* The port to which the v-adaptor is connected. */
  5300. #define MC_CMD_VADAPTOR_GET_MAC_IN_UPSTREAM_PORT_ID_OFST 0
  5301. /* MC_CMD_VADAPTOR_GET_MAC_OUT msgresponse */
  5302. #define MC_CMD_VADAPTOR_GET_MAC_OUT_LEN 6
  5303. /* The MAC address assigned to this v-adaptor */
  5304. #define MC_CMD_VADAPTOR_GET_MAC_OUT_MACADDR_OFST 0
  5305. #define MC_CMD_VADAPTOR_GET_MAC_OUT_MACADDR_LEN 6
  5306. /***********************************/
  5307. /* MC_CMD_EVB_PORT_ASSIGN
  5308. * assign a port to a PCI function.
  5309. */
  5310. #define MC_CMD_EVB_PORT_ASSIGN 0x9a
  5311. #define MC_CMD_0x9a_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5312. /* MC_CMD_EVB_PORT_ASSIGN_IN msgrequest */
  5313. #define MC_CMD_EVB_PORT_ASSIGN_IN_LEN 8
  5314. /* The port to assign. */
  5315. #define MC_CMD_EVB_PORT_ASSIGN_IN_PORT_ID_OFST 0
  5316. /* The target function to modify. */
  5317. #define MC_CMD_EVB_PORT_ASSIGN_IN_FUNCTION_OFST 4
  5318. #define MC_CMD_EVB_PORT_ASSIGN_IN_PF_LBN 0
  5319. #define MC_CMD_EVB_PORT_ASSIGN_IN_PF_WIDTH 16
  5320. #define MC_CMD_EVB_PORT_ASSIGN_IN_VF_LBN 16
  5321. #define MC_CMD_EVB_PORT_ASSIGN_IN_VF_WIDTH 16
  5322. /* MC_CMD_EVB_PORT_ASSIGN_OUT msgresponse */
  5323. #define MC_CMD_EVB_PORT_ASSIGN_OUT_LEN 0
  5324. /***********************************/
  5325. /* MC_CMD_RDWR_A64_REGIONS
  5326. * Assign the 64 bit region addresses.
  5327. */
  5328. #define MC_CMD_RDWR_A64_REGIONS 0x9b
  5329. #define MC_CMD_0x9b_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  5330. /* MC_CMD_RDWR_A64_REGIONS_IN msgrequest */
  5331. #define MC_CMD_RDWR_A64_REGIONS_IN_LEN 17
  5332. #define MC_CMD_RDWR_A64_REGIONS_IN_REGION0_OFST 0
  5333. #define MC_CMD_RDWR_A64_REGIONS_IN_REGION1_OFST 4
  5334. #define MC_CMD_RDWR_A64_REGIONS_IN_REGION2_OFST 8
  5335. #define MC_CMD_RDWR_A64_REGIONS_IN_REGION3_OFST 12
  5336. /* Write enable bits 0-3, set to write, clear to read. */
  5337. #define MC_CMD_RDWR_A64_REGIONS_IN_WRITE_MASK_LBN 128
  5338. #define MC_CMD_RDWR_A64_REGIONS_IN_WRITE_MASK_WIDTH 4
  5339. #define MC_CMD_RDWR_A64_REGIONS_IN_WRITE_MASK_BYTE_OFST 16
  5340. #define MC_CMD_RDWR_A64_REGIONS_IN_WRITE_MASK_BYTE_LEN 1
  5341. /* MC_CMD_RDWR_A64_REGIONS_OUT msgresponse: This data always included
  5342. * regardless of state of write bits in the request.
  5343. */
  5344. #define MC_CMD_RDWR_A64_REGIONS_OUT_LEN 16
  5345. #define MC_CMD_RDWR_A64_REGIONS_OUT_REGION0_OFST 0
  5346. #define MC_CMD_RDWR_A64_REGIONS_OUT_REGION1_OFST 4
  5347. #define MC_CMD_RDWR_A64_REGIONS_OUT_REGION2_OFST 8
  5348. #define MC_CMD_RDWR_A64_REGIONS_OUT_REGION3_OFST 12
  5349. /***********************************/
  5350. /* MC_CMD_ONLOAD_STACK_ALLOC
  5351. * Allocate an Onload stack ID.
  5352. */
  5353. #define MC_CMD_ONLOAD_STACK_ALLOC 0x9c
  5354. #define MC_CMD_0x9c_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
  5355. /* MC_CMD_ONLOAD_STACK_ALLOC_IN msgrequest */
  5356. #define MC_CMD_ONLOAD_STACK_ALLOC_IN_LEN 4
  5357. /* The handle of the owning upstream port */
  5358. #define MC_CMD_ONLOAD_STACK_ALLOC_IN_UPSTREAM_PORT_ID_OFST 0
  5359. /* MC_CMD_ONLOAD_STACK_ALLOC_OUT msgresponse */
  5360. #define MC_CMD_ONLOAD_STACK_ALLOC_OUT_LEN 4
  5361. /* The handle of the new Onload stack */
  5362. #define MC_CMD_ONLOAD_STACK_ALLOC_OUT_ONLOAD_STACK_ID_OFST 0
  5363. /***********************************/
  5364. /* MC_CMD_ONLOAD_STACK_FREE
  5365. * Free an Onload stack ID.
  5366. */
  5367. #define MC_CMD_ONLOAD_STACK_FREE 0x9d
  5368. #define MC_CMD_0x9d_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
  5369. /* MC_CMD_ONLOAD_STACK_FREE_IN msgrequest */
  5370. #define MC_CMD_ONLOAD_STACK_FREE_IN_LEN 4
  5371. /* The handle of the Onload stack */
  5372. #define MC_CMD_ONLOAD_STACK_FREE_IN_ONLOAD_STACK_ID_OFST 0
  5373. /* MC_CMD_ONLOAD_STACK_FREE_OUT msgresponse */
  5374. #define MC_CMD_ONLOAD_STACK_FREE_OUT_LEN 0
  5375. /***********************************/
  5376. /* MC_CMD_RSS_CONTEXT_ALLOC
  5377. * Allocate an RSS context.
  5378. */
  5379. #define MC_CMD_RSS_CONTEXT_ALLOC 0x9e
  5380. #define MC_CMD_0x9e_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5381. /* MC_CMD_RSS_CONTEXT_ALLOC_IN msgrequest */
  5382. #define MC_CMD_RSS_CONTEXT_ALLOC_IN_LEN 12
  5383. /* The handle of the owning upstream port */
  5384. #define MC_CMD_RSS_CONTEXT_ALLOC_IN_UPSTREAM_PORT_ID_OFST 0
  5385. /* The type of context to allocate */
  5386. #define MC_CMD_RSS_CONTEXT_ALLOC_IN_TYPE_OFST 4
  5387. /* enum: Allocate a context for exclusive use. The key and indirection table
  5388. * must be explicitly configured.
  5389. */
  5390. #define MC_CMD_RSS_CONTEXT_ALLOC_IN_TYPE_EXCLUSIVE 0x0
  5391. /* enum: Allocate a context for shared use; this will spread across a range of
  5392. * queues, but the key and indirection table are pre-configured and may not be
  5393. * changed. For this mode, NUM_QUEUES must 2, 4, 8, 16, 32 or 64.
  5394. */
  5395. #define MC_CMD_RSS_CONTEXT_ALLOC_IN_TYPE_SHARED 0x1
  5396. /* Number of queues spanned by this context, in the range 1-64; valid offsets
  5397. * in the indirection table will be in the range 0 to NUM_QUEUES-1.
  5398. */
  5399. #define MC_CMD_RSS_CONTEXT_ALLOC_IN_NUM_QUEUES_OFST 8
  5400. /* MC_CMD_RSS_CONTEXT_ALLOC_OUT msgresponse */
  5401. #define MC_CMD_RSS_CONTEXT_ALLOC_OUT_LEN 4
  5402. /* The handle of the new RSS context */
  5403. #define MC_CMD_RSS_CONTEXT_ALLOC_OUT_RSS_CONTEXT_ID_OFST 0
  5404. /***********************************/
  5405. /* MC_CMD_RSS_CONTEXT_FREE
  5406. * Free an RSS context.
  5407. */
  5408. #define MC_CMD_RSS_CONTEXT_FREE 0x9f
  5409. #define MC_CMD_0x9f_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5410. /* MC_CMD_RSS_CONTEXT_FREE_IN msgrequest */
  5411. #define MC_CMD_RSS_CONTEXT_FREE_IN_LEN 4
  5412. /* The handle of the RSS context */
  5413. #define MC_CMD_RSS_CONTEXT_FREE_IN_RSS_CONTEXT_ID_OFST 0
  5414. /* MC_CMD_RSS_CONTEXT_FREE_OUT msgresponse */
  5415. #define MC_CMD_RSS_CONTEXT_FREE_OUT_LEN 0
  5416. /***********************************/
  5417. /* MC_CMD_RSS_CONTEXT_SET_KEY
  5418. * Set the Toeplitz hash key for an RSS context.
  5419. */
  5420. #define MC_CMD_RSS_CONTEXT_SET_KEY 0xa0
  5421. #define MC_CMD_0xa0_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5422. /* MC_CMD_RSS_CONTEXT_SET_KEY_IN msgrequest */
  5423. #define MC_CMD_RSS_CONTEXT_SET_KEY_IN_LEN 44
  5424. /* The handle of the RSS context */
  5425. #define MC_CMD_RSS_CONTEXT_SET_KEY_IN_RSS_CONTEXT_ID_OFST 0
  5426. /* The 40-byte Toeplitz hash key (TBD endianness issues?) */
  5427. #define MC_CMD_RSS_CONTEXT_SET_KEY_IN_TOEPLITZ_KEY_OFST 4
  5428. #define MC_CMD_RSS_CONTEXT_SET_KEY_IN_TOEPLITZ_KEY_LEN 40
  5429. /* MC_CMD_RSS_CONTEXT_SET_KEY_OUT msgresponse */
  5430. #define MC_CMD_RSS_CONTEXT_SET_KEY_OUT_LEN 0
  5431. /***********************************/
  5432. /* MC_CMD_RSS_CONTEXT_GET_KEY
  5433. * Get the Toeplitz hash key for an RSS context.
  5434. */
  5435. #define MC_CMD_RSS_CONTEXT_GET_KEY 0xa1
  5436. #define MC_CMD_0xa1_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5437. /* MC_CMD_RSS_CONTEXT_GET_KEY_IN msgrequest */
  5438. #define MC_CMD_RSS_CONTEXT_GET_KEY_IN_LEN 4
  5439. /* The handle of the RSS context */
  5440. #define MC_CMD_RSS_CONTEXT_GET_KEY_IN_RSS_CONTEXT_ID_OFST 0
  5441. /* MC_CMD_RSS_CONTEXT_GET_KEY_OUT msgresponse */
  5442. #define MC_CMD_RSS_CONTEXT_GET_KEY_OUT_LEN 44
  5443. /* The 40-byte Toeplitz hash key (TBD endianness issues?) */
  5444. #define MC_CMD_RSS_CONTEXT_GET_KEY_OUT_TOEPLITZ_KEY_OFST 4
  5445. #define MC_CMD_RSS_CONTEXT_GET_KEY_OUT_TOEPLITZ_KEY_LEN 40
  5446. /***********************************/
  5447. /* MC_CMD_RSS_CONTEXT_SET_TABLE
  5448. * Set the indirection table for an RSS context.
  5449. */
  5450. #define MC_CMD_RSS_CONTEXT_SET_TABLE 0xa2
  5451. #define MC_CMD_0xa2_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5452. /* MC_CMD_RSS_CONTEXT_SET_TABLE_IN msgrequest */
  5453. #define MC_CMD_RSS_CONTEXT_SET_TABLE_IN_LEN 132
  5454. /* The handle of the RSS context */
  5455. #define MC_CMD_RSS_CONTEXT_SET_TABLE_IN_RSS_CONTEXT_ID_OFST 0
  5456. /* The 128-byte indirection table (1 byte per entry) */
  5457. #define MC_CMD_RSS_CONTEXT_SET_TABLE_IN_INDIRECTION_TABLE_OFST 4
  5458. #define MC_CMD_RSS_CONTEXT_SET_TABLE_IN_INDIRECTION_TABLE_LEN 128
  5459. /* MC_CMD_RSS_CONTEXT_SET_TABLE_OUT msgresponse */
  5460. #define MC_CMD_RSS_CONTEXT_SET_TABLE_OUT_LEN 0
  5461. /***********************************/
  5462. /* MC_CMD_RSS_CONTEXT_GET_TABLE
  5463. * Get the indirection table for an RSS context.
  5464. */
  5465. #define MC_CMD_RSS_CONTEXT_GET_TABLE 0xa3
  5466. #define MC_CMD_0xa3_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5467. /* MC_CMD_RSS_CONTEXT_GET_TABLE_IN msgrequest */
  5468. #define MC_CMD_RSS_CONTEXT_GET_TABLE_IN_LEN 4
  5469. /* The handle of the RSS context */
  5470. #define MC_CMD_RSS_CONTEXT_GET_TABLE_IN_RSS_CONTEXT_ID_OFST 0
  5471. /* MC_CMD_RSS_CONTEXT_GET_TABLE_OUT msgresponse */
  5472. #define MC_CMD_RSS_CONTEXT_GET_TABLE_OUT_LEN 132
  5473. /* The 128-byte indirection table (1 byte per entry) */
  5474. #define MC_CMD_RSS_CONTEXT_GET_TABLE_OUT_INDIRECTION_TABLE_OFST 4
  5475. #define MC_CMD_RSS_CONTEXT_GET_TABLE_OUT_INDIRECTION_TABLE_LEN 128
  5476. /***********************************/
  5477. /* MC_CMD_RSS_CONTEXT_SET_FLAGS
  5478. * Set various control flags for an RSS context.
  5479. */
  5480. #define MC_CMD_RSS_CONTEXT_SET_FLAGS 0xe1
  5481. #define MC_CMD_0xe1_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5482. /* MC_CMD_RSS_CONTEXT_SET_FLAGS_IN msgrequest */
  5483. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_LEN 8
  5484. /* The handle of the RSS context */
  5485. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_RSS_CONTEXT_ID_OFST 0
  5486. /* Hash control flags */
  5487. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_FLAGS_OFST 4
  5488. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV4_EN_LBN 0
  5489. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV4_EN_WIDTH 1
  5490. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_TCPV4_EN_LBN 1
  5491. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_TCPV4_EN_WIDTH 1
  5492. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV6_EN_LBN 2
  5493. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV6_EN_WIDTH 1
  5494. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_TCPV6_EN_LBN 3
  5495. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_TCPV6_EN_WIDTH 1
  5496. /* MC_CMD_RSS_CONTEXT_SET_FLAGS_OUT msgresponse */
  5497. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_OUT_LEN 0
  5498. /***********************************/
  5499. /* MC_CMD_RSS_CONTEXT_GET_FLAGS
  5500. * Get various control flags for an RSS context.
  5501. */
  5502. #define MC_CMD_RSS_CONTEXT_GET_FLAGS 0xe2
  5503. #define MC_CMD_0xe2_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5504. /* MC_CMD_RSS_CONTEXT_GET_FLAGS_IN msgrequest */
  5505. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_IN_LEN 4
  5506. /* The handle of the RSS context */
  5507. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_IN_RSS_CONTEXT_ID_OFST 0
  5508. /* MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT msgresponse */
  5509. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_LEN 8
  5510. /* Hash control flags */
  5511. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_FLAGS_OFST 4
  5512. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TOEPLITZ_IPV4_EN_LBN 0
  5513. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TOEPLITZ_IPV4_EN_WIDTH 1
  5514. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TOEPLITZ_TCPV4_EN_LBN 1
  5515. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TOEPLITZ_TCPV4_EN_WIDTH 1
  5516. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TOEPLITZ_IPV6_EN_LBN 2
  5517. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TOEPLITZ_IPV6_EN_WIDTH 1
  5518. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TOEPLITZ_TCPV6_EN_LBN 3
  5519. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TOEPLITZ_TCPV6_EN_WIDTH 1
  5520. /***********************************/
  5521. /* MC_CMD_DOT1P_MAPPING_ALLOC
  5522. * Allocate a .1p mapping.
  5523. */
  5524. #define MC_CMD_DOT1P_MAPPING_ALLOC 0xa4
  5525. #define MC_CMD_0xa4_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  5526. /* MC_CMD_DOT1P_MAPPING_ALLOC_IN msgrequest */
  5527. #define MC_CMD_DOT1P_MAPPING_ALLOC_IN_LEN 8
  5528. /* The handle of the owning upstream port */
  5529. #define MC_CMD_DOT1P_MAPPING_ALLOC_IN_UPSTREAM_PORT_ID_OFST 0
  5530. /* Number of queues spanned by this mapping, in the range 1-64; valid fixed
  5531. * offsets in the mapping table will be in the range 0 to NUM_QUEUES-1, and
  5532. * referenced RSS contexts must span no more than this number.
  5533. */
  5534. #define MC_CMD_DOT1P_MAPPING_ALLOC_IN_NUM_QUEUES_OFST 4
  5535. /* MC_CMD_DOT1P_MAPPING_ALLOC_OUT msgresponse */
  5536. #define MC_CMD_DOT1P_MAPPING_ALLOC_OUT_LEN 4
  5537. /* The handle of the new .1p mapping */
  5538. #define MC_CMD_DOT1P_MAPPING_ALLOC_OUT_DOT1P_MAPPING_ID_OFST 0
  5539. /***********************************/
  5540. /* MC_CMD_DOT1P_MAPPING_FREE
  5541. * Free a .1p mapping.
  5542. */
  5543. #define MC_CMD_DOT1P_MAPPING_FREE 0xa5
  5544. #define MC_CMD_0xa5_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  5545. /* MC_CMD_DOT1P_MAPPING_FREE_IN msgrequest */
  5546. #define MC_CMD_DOT1P_MAPPING_FREE_IN_LEN 4
  5547. /* The handle of the .1p mapping */
  5548. #define MC_CMD_DOT1P_MAPPING_FREE_IN_DOT1P_MAPPING_ID_OFST 0
  5549. /* MC_CMD_DOT1P_MAPPING_FREE_OUT msgresponse */
  5550. #define MC_CMD_DOT1P_MAPPING_FREE_OUT_LEN 0
  5551. /***********************************/
  5552. /* MC_CMD_DOT1P_MAPPING_SET_TABLE
  5553. * Set the mapping table for a .1p mapping.
  5554. */
  5555. #define MC_CMD_DOT1P_MAPPING_SET_TABLE 0xa6
  5556. #define MC_CMD_0xa6_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  5557. /* MC_CMD_DOT1P_MAPPING_SET_TABLE_IN msgrequest */
  5558. #define MC_CMD_DOT1P_MAPPING_SET_TABLE_IN_LEN 36
  5559. /* The handle of the .1p mapping */
  5560. #define MC_CMD_DOT1P_MAPPING_SET_TABLE_IN_DOT1P_MAPPING_ID_OFST 0
  5561. /* Per-priority mappings (1 32-bit word per entry - an offset or RSS context
  5562. * handle)
  5563. */
  5564. #define MC_CMD_DOT1P_MAPPING_SET_TABLE_IN_MAPPING_TABLE_OFST 4
  5565. #define MC_CMD_DOT1P_MAPPING_SET_TABLE_IN_MAPPING_TABLE_LEN 32
  5566. /* MC_CMD_DOT1P_MAPPING_SET_TABLE_OUT msgresponse */
  5567. #define MC_CMD_DOT1P_MAPPING_SET_TABLE_OUT_LEN 0
  5568. /***********************************/
  5569. /* MC_CMD_DOT1P_MAPPING_GET_TABLE
  5570. * Get the mapping table for a .1p mapping.
  5571. */
  5572. #define MC_CMD_DOT1P_MAPPING_GET_TABLE 0xa7
  5573. #define MC_CMD_0xa7_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  5574. /* MC_CMD_DOT1P_MAPPING_GET_TABLE_IN msgrequest */
  5575. #define MC_CMD_DOT1P_MAPPING_GET_TABLE_IN_LEN 4
  5576. /* The handle of the .1p mapping */
  5577. #define MC_CMD_DOT1P_MAPPING_GET_TABLE_IN_DOT1P_MAPPING_ID_OFST 0
  5578. /* MC_CMD_DOT1P_MAPPING_GET_TABLE_OUT msgresponse */
  5579. #define MC_CMD_DOT1P_MAPPING_GET_TABLE_OUT_LEN 36
  5580. /* Per-priority mappings (1 32-bit word per entry - an offset or RSS context
  5581. * handle)
  5582. */
  5583. #define MC_CMD_DOT1P_MAPPING_GET_TABLE_OUT_MAPPING_TABLE_OFST 4
  5584. #define MC_CMD_DOT1P_MAPPING_GET_TABLE_OUT_MAPPING_TABLE_LEN 32
  5585. /***********************************/
  5586. /* MC_CMD_GET_VECTOR_CFG
  5587. * Get Interrupt Vector config for this PF.
  5588. */
  5589. #define MC_CMD_GET_VECTOR_CFG 0xbf
  5590. #define MC_CMD_0xbf_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5591. /* MC_CMD_GET_VECTOR_CFG_IN msgrequest */
  5592. #define MC_CMD_GET_VECTOR_CFG_IN_LEN 0
  5593. /* MC_CMD_GET_VECTOR_CFG_OUT msgresponse */
  5594. #define MC_CMD_GET_VECTOR_CFG_OUT_LEN 12
  5595. /* Base absolute interrupt vector number. */
  5596. #define MC_CMD_GET_VECTOR_CFG_OUT_VEC_BASE_OFST 0
  5597. /* Number of interrupt vectors allocate to this PF. */
  5598. #define MC_CMD_GET_VECTOR_CFG_OUT_VECS_PER_PF_OFST 4
  5599. /* Number of interrupt vectors to allocate per VF. */
  5600. #define MC_CMD_GET_VECTOR_CFG_OUT_VECS_PER_VF_OFST 8
  5601. /***********************************/
  5602. /* MC_CMD_SET_VECTOR_CFG
  5603. * Set Interrupt Vector config for this PF.
  5604. */
  5605. #define MC_CMD_SET_VECTOR_CFG 0xc0
  5606. #define MC_CMD_0xc0_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5607. /* MC_CMD_SET_VECTOR_CFG_IN msgrequest */
  5608. #define MC_CMD_SET_VECTOR_CFG_IN_LEN 12
  5609. /* Base absolute interrupt vector number, or MC_CMD_RESOURCE_INSTANCE_ANY to
  5610. * let the system find a suitable base.
  5611. */
  5612. #define MC_CMD_SET_VECTOR_CFG_IN_VEC_BASE_OFST 0
  5613. /* Number of interrupt vectors allocate to this PF. */
  5614. #define MC_CMD_SET_VECTOR_CFG_IN_VECS_PER_PF_OFST 4
  5615. /* Number of interrupt vectors to allocate per VF. */
  5616. #define MC_CMD_SET_VECTOR_CFG_IN_VECS_PER_VF_OFST 8
  5617. /* MC_CMD_SET_VECTOR_CFG_OUT msgresponse */
  5618. #define MC_CMD_SET_VECTOR_CFG_OUT_LEN 0
  5619. /***********************************/
  5620. /* MC_CMD_RMON_RX_CLASS_STATS
  5621. * Retrieve rmon rx class statistics
  5622. */
  5623. #define MC_CMD_RMON_RX_CLASS_STATS 0xc3
  5624. /* MC_CMD_RMON_RX_CLASS_STATS_IN msgrequest */
  5625. #define MC_CMD_RMON_RX_CLASS_STATS_IN_LEN 4
  5626. /* flags */
  5627. #define MC_CMD_RMON_RX_CLASS_STATS_IN_FLAGS_OFST 0
  5628. #define MC_CMD_RMON_RX_CLASS_STATS_IN_CLASS_LBN 0
  5629. #define MC_CMD_RMON_RX_CLASS_STATS_IN_CLASS_WIDTH 8
  5630. #define MC_CMD_RMON_RX_CLASS_STATS_IN_RST_LBN 8
  5631. #define MC_CMD_RMON_RX_CLASS_STATS_IN_RST_WIDTH 1
  5632. /* MC_CMD_RMON_RX_CLASS_STATS_OUT msgresponse */
  5633. #define MC_CMD_RMON_RX_CLASS_STATS_OUT_LENMIN 4
  5634. #define MC_CMD_RMON_RX_CLASS_STATS_OUT_LENMAX 252
  5635. #define MC_CMD_RMON_RX_CLASS_STATS_OUT_LEN(num) (0+4*(num))
  5636. /* Array of stats */
  5637. #define MC_CMD_RMON_RX_CLASS_STATS_OUT_BUFFER_OFST 0
  5638. #define MC_CMD_RMON_RX_CLASS_STATS_OUT_BUFFER_LEN 4
  5639. #define MC_CMD_RMON_RX_CLASS_STATS_OUT_BUFFER_MINNUM 1
  5640. #define MC_CMD_RMON_RX_CLASS_STATS_OUT_BUFFER_MAXNUM 63
  5641. /***********************************/
  5642. /* MC_CMD_RMON_TX_CLASS_STATS
  5643. * Retrieve rmon tx class statistics
  5644. */
  5645. #define MC_CMD_RMON_TX_CLASS_STATS 0xc4
  5646. /* MC_CMD_RMON_TX_CLASS_STATS_IN msgrequest */
  5647. #define MC_CMD_RMON_TX_CLASS_STATS_IN_LEN 4
  5648. /* flags */
  5649. #define MC_CMD_RMON_TX_CLASS_STATS_IN_FLAGS_OFST 0
  5650. #define MC_CMD_RMON_TX_CLASS_STATS_IN_CLASS_LBN 0
  5651. #define MC_CMD_RMON_TX_CLASS_STATS_IN_CLASS_WIDTH 8
  5652. #define MC_CMD_RMON_TX_CLASS_STATS_IN_RST_LBN 8
  5653. #define MC_CMD_RMON_TX_CLASS_STATS_IN_RST_WIDTH 1
  5654. /* MC_CMD_RMON_TX_CLASS_STATS_OUT msgresponse */
  5655. #define MC_CMD_RMON_TX_CLASS_STATS_OUT_LENMIN 4
  5656. #define MC_CMD_RMON_TX_CLASS_STATS_OUT_LENMAX 252
  5657. #define MC_CMD_RMON_TX_CLASS_STATS_OUT_LEN(num) (0+4*(num))
  5658. /* Array of stats */
  5659. #define MC_CMD_RMON_TX_CLASS_STATS_OUT_BUFFER_OFST 0
  5660. #define MC_CMD_RMON_TX_CLASS_STATS_OUT_BUFFER_LEN 4
  5661. #define MC_CMD_RMON_TX_CLASS_STATS_OUT_BUFFER_MINNUM 1
  5662. #define MC_CMD_RMON_TX_CLASS_STATS_OUT_BUFFER_MAXNUM 63
  5663. /***********************************/
  5664. /* MC_CMD_RMON_RX_SUPER_CLASS_STATS
  5665. * Retrieve rmon rx super_class statistics
  5666. */
  5667. #define MC_CMD_RMON_RX_SUPER_CLASS_STATS 0xc5
  5668. /* MC_CMD_RMON_RX_SUPER_CLASS_STATS_IN msgrequest */
  5669. #define MC_CMD_RMON_RX_SUPER_CLASS_STATS_IN_LEN 4
  5670. /* flags */
  5671. #define MC_CMD_RMON_RX_SUPER_CLASS_STATS_IN_FLAGS_OFST 0
  5672. #define MC_CMD_RMON_RX_SUPER_CLASS_STATS_IN_SUPER_CLASS_LBN 0
  5673. #define MC_CMD_RMON_RX_SUPER_CLASS_STATS_IN_SUPER_CLASS_WIDTH 4
  5674. #define MC_CMD_RMON_RX_SUPER_CLASS_STATS_IN_RST_LBN 4
  5675. #define MC_CMD_RMON_RX_SUPER_CLASS_STATS_IN_RST_WIDTH 1
  5676. /* MC_CMD_RMON_RX_SUPER_CLASS_STATS_OUT msgresponse */
  5677. #define MC_CMD_RMON_RX_SUPER_CLASS_STATS_OUT_LENMIN 4
  5678. #define MC_CMD_RMON_RX_SUPER_CLASS_STATS_OUT_LENMAX 252
  5679. #define MC_CMD_RMON_RX_SUPER_CLASS_STATS_OUT_LEN(num) (0+4*(num))
  5680. /* Array of stats */
  5681. #define MC_CMD_RMON_RX_SUPER_CLASS_STATS_OUT_BUFFER_OFST 0
  5682. #define MC_CMD_RMON_RX_SUPER_CLASS_STATS_OUT_BUFFER_LEN 4
  5683. #define MC_CMD_RMON_RX_SUPER_CLASS_STATS_OUT_BUFFER_MINNUM 1
  5684. #define MC_CMD_RMON_RX_SUPER_CLASS_STATS_OUT_BUFFER_MAXNUM 63
  5685. /***********************************/
  5686. /* MC_CMD_RMON_TX_SUPER_CLASS_STATS
  5687. * Retrieve rmon tx super_class statistics
  5688. */
  5689. #define MC_CMD_RMON_TX_SUPER_CLASS_STATS 0xc6
  5690. /* MC_CMD_RMON_TX_SUPER_CLASS_STATS_IN msgrequest */
  5691. #define MC_CMD_RMON_TX_SUPER_CLASS_STATS_IN_LEN 4
  5692. /* flags */
  5693. #define MC_CMD_RMON_TX_SUPER_CLASS_STATS_IN_FLAGS_OFST 0
  5694. #define MC_CMD_RMON_TX_SUPER_CLASS_STATS_IN_SUPER_CLASS_LBN 0
  5695. #define MC_CMD_RMON_TX_SUPER_CLASS_STATS_IN_SUPER_CLASS_WIDTH 4
  5696. #define MC_CMD_RMON_TX_SUPER_CLASS_STATS_IN_RST_LBN 4
  5697. #define MC_CMD_RMON_TX_SUPER_CLASS_STATS_IN_RST_WIDTH 1
  5698. /* MC_CMD_RMON_TX_SUPER_CLASS_STATS_OUT msgresponse */
  5699. #define MC_CMD_RMON_TX_SUPER_CLASS_STATS_OUT_LENMIN 4
  5700. #define MC_CMD_RMON_TX_SUPER_CLASS_STATS_OUT_LENMAX 252
  5701. #define MC_CMD_RMON_TX_SUPER_CLASS_STATS_OUT_LEN(num) (0+4*(num))
  5702. /* Array of stats */
  5703. #define MC_CMD_RMON_TX_SUPER_CLASS_STATS_OUT_BUFFER_OFST 0
  5704. #define MC_CMD_RMON_TX_SUPER_CLASS_STATS_OUT_BUFFER_LEN 4
  5705. #define MC_CMD_RMON_TX_SUPER_CLASS_STATS_OUT_BUFFER_MINNUM 1
  5706. #define MC_CMD_RMON_TX_SUPER_CLASS_STATS_OUT_BUFFER_MAXNUM 63
  5707. /***********************************/
  5708. /* MC_CMD_RMON_RX_ADD_QID_TO_CLASS
  5709. * Add qid to class for statistics collection
  5710. */
  5711. #define MC_CMD_RMON_RX_ADD_QID_TO_CLASS 0xc7
  5712. /* MC_CMD_RMON_RX_ADD_QID_TO_CLASS_IN msgrequest */
  5713. #define MC_CMD_RMON_RX_ADD_QID_TO_CLASS_IN_LEN 12
  5714. /* class */
  5715. #define MC_CMD_RMON_RX_ADD_QID_TO_CLASS_IN_CLASS_OFST 0
  5716. /* qid */
  5717. #define MC_CMD_RMON_RX_ADD_QID_TO_CLASS_IN_QID_OFST 4
  5718. /* flags */
  5719. #define MC_CMD_RMON_RX_ADD_QID_TO_CLASS_IN_FLAGS_OFST 8
  5720. #define MC_CMD_RMON_RX_ADD_QID_TO_CLASS_IN_SUPER_CLASS_LBN 0
  5721. #define MC_CMD_RMON_RX_ADD_QID_TO_CLASS_IN_SUPER_CLASS_WIDTH 4
  5722. #define MC_CMD_RMON_RX_ADD_QID_TO_CLASS_IN_PE_DELTA_LBN 4
  5723. #define MC_CMD_RMON_RX_ADD_QID_TO_CLASS_IN_PE_DELTA_WIDTH 4
  5724. #define MC_CMD_RMON_RX_ADD_QID_TO_CLASS_IN_MTU_LBN 8
  5725. #define MC_CMD_RMON_RX_ADD_QID_TO_CLASS_IN_MTU_WIDTH 14
  5726. /* MC_CMD_RMON_RX_ADD_QID_TO_CLASS_OUT msgresponse */
  5727. #define MC_CMD_RMON_RX_ADD_QID_TO_CLASS_OUT_LEN 0
  5728. /***********************************/
  5729. /* MC_CMD_RMON_TX_ADD_QID_TO_CLASS
  5730. * Add qid to class for statistics collection
  5731. */
  5732. #define MC_CMD_RMON_TX_ADD_QID_TO_CLASS 0xc8
  5733. /* MC_CMD_RMON_TX_ADD_QID_TO_CLASS_IN msgrequest */
  5734. #define MC_CMD_RMON_TX_ADD_QID_TO_CLASS_IN_LEN 12
  5735. /* class */
  5736. #define MC_CMD_RMON_TX_ADD_QID_TO_CLASS_IN_CLASS_OFST 0
  5737. /* qid */
  5738. #define MC_CMD_RMON_TX_ADD_QID_TO_CLASS_IN_QID_OFST 4
  5739. /* flags */
  5740. #define MC_CMD_RMON_TX_ADD_QID_TO_CLASS_IN_FLAGS_OFST 8
  5741. #define MC_CMD_RMON_TX_ADD_QID_TO_CLASS_IN_SUPER_CLASS_LBN 0
  5742. #define MC_CMD_RMON_TX_ADD_QID_TO_CLASS_IN_SUPER_CLASS_WIDTH 4
  5743. #define MC_CMD_RMON_TX_ADD_QID_TO_CLASS_IN_PE_DELTA_LBN 4
  5744. #define MC_CMD_RMON_TX_ADD_QID_TO_CLASS_IN_PE_DELTA_WIDTH 4
  5745. #define MC_CMD_RMON_TX_ADD_QID_TO_CLASS_IN_MTU_LBN 8
  5746. #define MC_CMD_RMON_TX_ADD_QID_TO_CLASS_IN_MTU_WIDTH 14
  5747. /* MC_CMD_RMON_TX_ADD_QID_TO_CLASS_OUT msgresponse */
  5748. #define MC_CMD_RMON_TX_ADD_QID_TO_CLASS_OUT_LEN 0
  5749. /***********************************/
  5750. /* MC_CMD_RMON_MC_ADD_QID_TO_CLASS
  5751. * Add qid to class for statistics collection
  5752. */
  5753. #define MC_CMD_RMON_MC_ADD_QID_TO_CLASS 0xc9
  5754. /* MC_CMD_RMON_MC_ADD_QID_TO_CLASS_IN msgrequest */
  5755. #define MC_CMD_RMON_MC_ADD_QID_TO_CLASS_IN_LEN 12
  5756. /* class */
  5757. #define MC_CMD_RMON_MC_ADD_QID_TO_CLASS_IN_CLASS_OFST 0
  5758. /* qid */
  5759. #define MC_CMD_RMON_MC_ADD_QID_TO_CLASS_IN_QID_OFST 4
  5760. /* flags */
  5761. #define MC_CMD_RMON_MC_ADD_QID_TO_CLASS_IN_FLAGS_OFST 8
  5762. #define MC_CMD_RMON_MC_ADD_QID_TO_CLASS_IN_SUPER_CLASS_LBN 0
  5763. #define MC_CMD_RMON_MC_ADD_QID_TO_CLASS_IN_SUPER_CLASS_WIDTH 4
  5764. #define MC_CMD_RMON_MC_ADD_QID_TO_CLASS_IN_PE_DELTA_LBN 4
  5765. #define MC_CMD_RMON_MC_ADD_QID_TO_CLASS_IN_PE_DELTA_WIDTH 4
  5766. #define MC_CMD_RMON_MC_ADD_QID_TO_CLASS_IN_MTU_LBN 8
  5767. #define MC_CMD_RMON_MC_ADD_QID_TO_CLASS_IN_MTU_WIDTH 14
  5768. /* MC_CMD_RMON_MC_ADD_QID_TO_CLASS_OUT msgresponse */
  5769. #define MC_CMD_RMON_MC_ADD_QID_TO_CLASS_OUT_LEN 0
  5770. /***********************************/
  5771. /* MC_CMD_RMON_ALLOC_CLASS
  5772. * Allocate an rmon class
  5773. */
  5774. #define MC_CMD_RMON_ALLOC_CLASS 0xca
  5775. /* MC_CMD_RMON_ALLOC_CLASS_IN msgrequest */
  5776. #define MC_CMD_RMON_ALLOC_CLASS_IN_LEN 0
  5777. /* MC_CMD_RMON_ALLOC_CLASS_OUT msgresponse */
  5778. #define MC_CMD_RMON_ALLOC_CLASS_OUT_LEN 4
  5779. /* class */
  5780. #define MC_CMD_RMON_ALLOC_CLASS_OUT_CLASS_OFST 0
  5781. /***********************************/
  5782. /* MC_CMD_RMON_DEALLOC_CLASS
  5783. * Deallocate an rmon class
  5784. */
  5785. #define MC_CMD_RMON_DEALLOC_CLASS 0xcb
  5786. /* MC_CMD_RMON_DEALLOC_CLASS_IN msgrequest */
  5787. #define MC_CMD_RMON_DEALLOC_CLASS_IN_LEN 4
  5788. /* class */
  5789. #define MC_CMD_RMON_DEALLOC_CLASS_IN_CLASS_OFST 0
  5790. /* MC_CMD_RMON_DEALLOC_CLASS_OUT msgresponse */
  5791. #define MC_CMD_RMON_DEALLOC_CLASS_OUT_LEN 0
  5792. /***********************************/
  5793. /* MC_CMD_RMON_ALLOC_SUPER_CLASS
  5794. * Allocate an rmon super_class
  5795. */
  5796. #define MC_CMD_RMON_ALLOC_SUPER_CLASS 0xcc
  5797. /* MC_CMD_RMON_ALLOC_SUPER_CLASS_IN msgrequest */
  5798. #define MC_CMD_RMON_ALLOC_SUPER_CLASS_IN_LEN 0
  5799. /* MC_CMD_RMON_ALLOC_SUPER_CLASS_OUT msgresponse */
  5800. #define MC_CMD_RMON_ALLOC_SUPER_CLASS_OUT_LEN 4
  5801. /* super_class */
  5802. #define MC_CMD_RMON_ALLOC_SUPER_CLASS_OUT_SUPER_CLASS_OFST 0
  5803. /***********************************/
  5804. /* MC_CMD_RMON_DEALLOC_SUPER_CLASS
  5805. * Deallocate an rmon tx super_class
  5806. */
  5807. #define MC_CMD_RMON_DEALLOC_SUPER_CLASS 0xcd
  5808. /* MC_CMD_RMON_DEALLOC_SUPER_CLASS_IN msgrequest */
  5809. #define MC_CMD_RMON_DEALLOC_SUPER_CLASS_IN_LEN 4
  5810. /* super_class */
  5811. #define MC_CMD_RMON_DEALLOC_SUPER_CLASS_IN_SUPER_CLASS_OFST 0
  5812. /* MC_CMD_RMON_DEALLOC_SUPER_CLASS_OUT msgresponse */
  5813. #define MC_CMD_RMON_DEALLOC_SUPER_CLASS_OUT_LEN 0
  5814. /***********************************/
  5815. /* MC_CMD_RMON_RX_UP_CONV_STATS
  5816. * Retrieve up converter statistics
  5817. */
  5818. #define MC_CMD_RMON_RX_UP_CONV_STATS 0xce
  5819. /* MC_CMD_RMON_RX_UP_CONV_STATS_IN msgrequest */
  5820. #define MC_CMD_RMON_RX_UP_CONV_STATS_IN_LEN 4
  5821. /* flags */
  5822. #define MC_CMD_RMON_RX_UP_CONV_STATS_IN_FLAGS_OFST 0
  5823. #define MC_CMD_RMON_RX_UP_CONV_STATS_IN_PORT_LBN 0
  5824. #define MC_CMD_RMON_RX_UP_CONV_STATS_IN_PORT_WIDTH 2
  5825. #define MC_CMD_RMON_RX_UP_CONV_STATS_IN_RST_LBN 2
  5826. #define MC_CMD_RMON_RX_UP_CONV_STATS_IN_RST_WIDTH 1
  5827. /* MC_CMD_RMON_RX_UP_CONV_STATS_OUT msgresponse */
  5828. #define MC_CMD_RMON_RX_UP_CONV_STATS_OUT_LENMIN 4
  5829. #define MC_CMD_RMON_RX_UP_CONV_STATS_OUT_LENMAX 252
  5830. #define MC_CMD_RMON_RX_UP_CONV_STATS_OUT_LEN(num) (0+4*(num))
  5831. /* Array of stats */
  5832. #define MC_CMD_RMON_RX_UP_CONV_STATS_OUT_BUFFER_OFST 0
  5833. #define MC_CMD_RMON_RX_UP_CONV_STATS_OUT_BUFFER_LEN 4
  5834. #define MC_CMD_RMON_RX_UP_CONV_STATS_OUT_BUFFER_MINNUM 1
  5835. #define MC_CMD_RMON_RX_UP_CONV_STATS_OUT_BUFFER_MAXNUM 63
  5836. /***********************************/
  5837. /* MC_CMD_RMON_RX_IPI_STATS
  5838. * Retrieve rx ipi stats
  5839. */
  5840. #define MC_CMD_RMON_RX_IPI_STATS 0xcf
  5841. /* MC_CMD_RMON_RX_IPI_STATS_IN msgrequest */
  5842. #define MC_CMD_RMON_RX_IPI_STATS_IN_LEN 4
  5843. /* flags */
  5844. #define MC_CMD_RMON_RX_IPI_STATS_IN_FLAGS_OFST 0
  5845. #define MC_CMD_RMON_RX_IPI_STATS_IN_VFIFO_LBN 0
  5846. #define MC_CMD_RMON_RX_IPI_STATS_IN_VFIFO_WIDTH 5
  5847. #define MC_CMD_RMON_RX_IPI_STATS_IN_RST_LBN 5
  5848. #define MC_CMD_RMON_RX_IPI_STATS_IN_RST_WIDTH 1
  5849. /* MC_CMD_RMON_RX_IPI_STATS_OUT msgresponse */
  5850. #define MC_CMD_RMON_RX_IPI_STATS_OUT_LENMIN 4
  5851. #define MC_CMD_RMON_RX_IPI_STATS_OUT_LENMAX 252
  5852. #define MC_CMD_RMON_RX_IPI_STATS_OUT_LEN(num) (0+4*(num))
  5853. /* Array of stats */
  5854. #define MC_CMD_RMON_RX_IPI_STATS_OUT_BUFFER_OFST 0
  5855. #define MC_CMD_RMON_RX_IPI_STATS_OUT_BUFFER_LEN 4
  5856. #define MC_CMD_RMON_RX_IPI_STATS_OUT_BUFFER_MINNUM 1
  5857. #define MC_CMD_RMON_RX_IPI_STATS_OUT_BUFFER_MAXNUM 63
  5858. /***********************************/
  5859. /* MC_CMD_RMON_RX_IPSEC_CNTXT_PTR_STATS
  5860. * Retrieve rx ipsec cntxt_ptr indexed stats
  5861. */
  5862. #define MC_CMD_RMON_RX_IPSEC_CNTXT_PTR_STATS 0xd0
  5863. /* MC_CMD_RMON_RX_IPSEC_CNTXT_PTR_STATS_IN msgrequest */
  5864. #define MC_CMD_RMON_RX_IPSEC_CNTXT_PTR_STATS_IN_LEN 4
  5865. /* flags */
  5866. #define MC_CMD_RMON_RX_IPSEC_CNTXT_PTR_STATS_IN_FLAGS_OFST 0
  5867. #define MC_CMD_RMON_RX_IPSEC_CNTXT_PTR_STATS_IN_CNTXT_PTR_LBN 0
  5868. #define MC_CMD_RMON_RX_IPSEC_CNTXT_PTR_STATS_IN_CNTXT_PTR_WIDTH 9
  5869. #define MC_CMD_RMON_RX_IPSEC_CNTXT_PTR_STATS_IN_RST_LBN 9
  5870. #define MC_CMD_RMON_RX_IPSEC_CNTXT_PTR_STATS_IN_RST_WIDTH 1
  5871. /* MC_CMD_RMON_RX_IPSEC_CNTXT_PTR_STATS_OUT msgresponse */
  5872. #define MC_CMD_RMON_RX_IPSEC_CNTXT_PTR_STATS_OUT_LENMIN 4
  5873. #define MC_CMD_RMON_RX_IPSEC_CNTXT_PTR_STATS_OUT_LENMAX 252
  5874. #define MC_CMD_RMON_RX_IPSEC_CNTXT_PTR_STATS_OUT_LEN(num) (0+4*(num))
  5875. /* Array of stats */
  5876. #define MC_CMD_RMON_RX_IPSEC_CNTXT_PTR_STATS_OUT_BUFFER_OFST 0
  5877. #define MC_CMD_RMON_RX_IPSEC_CNTXT_PTR_STATS_OUT_BUFFER_LEN 4
  5878. #define MC_CMD_RMON_RX_IPSEC_CNTXT_PTR_STATS_OUT_BUFFER_MINNUM 1
  5879. #define MC_CMD_RMON_RX_IPSEC_CNTXT_PTR_STATS_OUT_BUFFER_MAXNUM 63
  5880. /***********************************/
  5881. /* MC_CMD_RMON_RX_IPSEC_PORT_STATS
  5882. * Retrieve rx ipsec port indexed stats
  5883. */
  5884. #define MC_CMD_RMON_RX_IPSEC_PORT_STATS 0xd1
  5885. /* MC_CMD_RMON_RX_IPSEC_PORT_STATS_IN msgrequest */
  5886. #define MC_CMD_RMON_RX_IPSEC_PORT_STATS_IN_LEN 4
  5887. /* flags */
  5888. #define MC_CMD_RMON_RX_IPSEC_PORT_STATS_IN_FLAGS_OFST 0
  5889. #define MC_CMD_RMON_RX_IPSEC_PORT_STATS_IN_PORT_LBN 0
  5890. #define MC_CMD_RMON_RX_IPSEC_PORT_STATS_IN_PORT_WIDTH 2
  5891. #define MC_CMD_RMON_RX_IPSEC_PORT_STATS_IN_RST_LBN 2
  5892. #define MC_CMD_RMON_RX_IPSEC_PORT_STATS_IN_RST_WIDTH 1
  5893. /* MC_CMD_RMON_RX_IPSEC_PORT_STATS_OUT msgresponse */
  5894. #define MC_CMD_RMON_RX_IPSEC_PORT_STATS_OUT_LENMIN 4
  5895. #define MC_CMD_RMON_RX_IPSEC_PORT_STATS_OUT_LENMAX 252
  5896. #define MC_CMD_RMON_RX_IPSEC_PORT_STATS_OUT_LEN(num) (0+4*(num))
  5897. /* Array of stats */
  5898. #define MC_CMD_RMON_RX_IPSEC_PORT_STATS_OUT_BUFFER_OFST 0
  5899. #define MC_CMD_RMON_RX_IPSEC_PORT_STATS_OUT_BUFFER_LEN 4
  5900. #define MC_CMD_RMON_RX_IPSEC_PORT_STATS_OUT_BUFFER_MINNUM 1
  5901. #define MC_CMD_RMON_RX_IPSEC_PORT_STATS_OUT_BUFFER_MAXNUM 63
  5902. /***********************************/
  5903. /* MC_CMD_RMON_RX_IPSEC_OFLOW_STATS
  5904. * Retrieve tx ipsec overflow
  5905. */
  5906. #define MC_CMD_RMON_RX_IPSEC_OFLOW_STATS 0xd2
  5907. /* MC_CMD_RMON_RX_IPSEC_OFLOW_STATS_IN msgrequest */
  5908. #define MC_CMD_RMON_RX_IPSEC_OFLOW_STATS_IN_LEN 4
  5909. /* flags */
  5910. #define MC_CMD_RMON_RX_IPSEC_OFLOW_STATS_IN_FLAGS_OFST 0
  5911. #define MC_CMD_RMON_RX_IPSEC_OFLOW_STATS_IN_PORT_LBN 0
  5912. #define MC_CMD_RMON_RX_IPSEC_OFLOW_STATS_IN_PORT_WIDTH 2
  5913. #define MC_CMD_RMON_RX_IPSEC_OFLOW_STATS_IN_RST_LBN 2
  5914. #define MC_CMD_RMON_RX_IPSEC_OFLOW_STATS_IN_RST_WIDTH 1
  5915. /* MC_CMD_RMON_RX_IPSEC_OFLOW_STATS_OUT msgresponse */
  5916. #define MC_CMD_RMON_RX_IPSEC_OFLOW_STATS_OUT_LENMIN 4
  5917. #define MC_CMD_RMON_RX_IPSEC_OFLOW_STATS_OUT_LENMAX 252
  5918. #define MC_CMD_RMON_RX_IPSEC_OFLOW_STATS_OUT_LEN(num) (0+4*(num))
  5919. /* Array of stats */
  5920. #define MC_CMD_RMON_RX_IPSEC_OFLOW_STATS_OUT_BUFFER_OFST 0
  5921. #define MC_CMD_RMON_RX_IPSEC_OFLOW_STATS_OUT_BUFFER_LEN 4
  5922. #define MC_CMD_RMON_RX_IPSEC_OFLOW_STATS_OUT_BUFFER_MINNUM 1
  5923. #define MC_CMD_RMON_RX_IPSEC_OFLOW_STATS_OUT_BUFFER_MAXNUM 63
  5924. /***********************************/
  5925. /* MC_CMD_VPORT_ADD_MAC_ADDRESS
  5926. * Add a MAC address to a v-port
  5927. */
  5928. #define MC_CMD_VPORT_ADD_MAC_ADDRESS 0xa8
  5929. #define MC_CMD_0xa8_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5930. /* MC_CMD_VPORT_ADD_MAC_ADDRESS_IN msgrequest */
  5931. #define MC_CMD_VPORT_ADD_MAC_ADDRESS_IN_LEN 10
  5932. /* The handle of the v-port */
  5933. #define MC_CMD_VPORT_ADD_MAC_ADDRESS_IN_VPORT_ID_OFST 0
  5934. /* MAC address to add */
  5935. #define MC_CMD_VPORT_ADD_MAC_ADDRESS_IN_MACADDR_OFST 4
  5936. #define MC_CMD_VPORT_ADD_MAC_ADDRESS_IN_MACADDR_LEN 6
  5937. /* MC_CMD_VPORT_ADD_MAC_ADDRESS_OUT msgresponse */
  5938. #define MC_CMD_VPORT_ADD_MAC_ADDRESS_OUT_LEN 0
  5939. /***********************************/
  5940. /* MC_CMD_VPORT_DEL_MAC_ADDRESS
  5941. * Delete a MAC address from a v-port
  5942. */
  5943. #define MC_CMD_VPORT_DEL_MAC_ADDRESS 0xa9
  5944. #define MC_CMD_0xa9_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5945. /* MC_CMD_VPORT_DEL_MAC_ADDRESS_IN msgrequest */
  5946. #define MC_CMD_VPORT_DEL_MAC_ADDRESS_IN_LEN 10
  5947. /* The handle of the v-port */
  5948. #define MC_CMD_VPORT_DEL_MAC_ADDRESS_IN_VPORT_ID_OFST 0
  5949. /* MAC address to add */
  5950. #define MC_CMD_VPORT_DEL_MAC_ADDRESS_IN_MACADDR_OFST 4
  5951. #define MC_CMD_VPORT_DEL_MAC_ADDRESS_IN_MACADDR_LEN 6
  5952. /* MC_CMD_VPORT_DEL_MAC_ADDRESS_OUT msgresponse */
  5953. #define MC_CMD_VPORT_DEL_MAC_ADDRESS_OUT_LEN 0
  5954. /***********************************/
  5955. /* MC_CMD_VPORT_GET_MAC_ADDRESSES
  5956. * Delete a MAC address from a v-port
  5957. */
  5958. #define MC_CMD_VPORT_GET_MAC_ADDRESSES 0xaa
  5959. #define MC_CMD_0xaa_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5960. /* MC_CMD_VPORT_GET_MAC_ADDRESSES_IN msgrequest */
  5961. #define MC_CMD_VPORT_GET_MAC_ADDRESSES_IN_LEN 4
  5962. /* The handle of the v-port */
  5963. #define MC_CMD_VPORT_GET_MAC_ADDRESSES_IN_VPORT_ID_OFST 0
  5964. /* MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT msgresponse */
  5965. #define MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_LENMIN 4
  5966. #define MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_LENMAX 250
  5967. #define MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_LEN(num) (4+6*(num))
  5968. /* The number of MAC addresses returned */
  5969. #define MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_MACADDR_COUNT_OFST 0
  5970. /* Array of MAC addresses */
  5971. #define MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_MACADDR_OFST 4
  5972. #define MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_MACADDR_LEN 6
  5973. #define MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_MACADDR_MINNUM 0
  5974. #define MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_MACADDR_MAXNUM 41
  5975. /***********************************/
  5976. /* MC_CMD_DUMP_BUFTBL_ENTRIES
  5977. * Dump buffer table entries, mainly for command client debug use. Dumps
  5978. * absolute entries, and does not use chunk handles. All entries must be in
  5979. * range, and used for q page mapping, Although the latter restriction may be
  5980. * lifted in future.
  5981. */
  5982. #define MC_CMD_DUMP_BUFTBL_ENTRIES 0xab
  5983. #define MC_CMD_0xab_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  5984. /* MC_CMD_DUMP_BUFTBL_ENTRIES_IN msgrequest */
  5985. #define MC_CMD_DUMP_BUFTBL_ENTRIES_IN_LEN 8
  5986. /* Index of the first buffer table entry. */
  5987. #define MC_CMD_DUMP_BUFTBL_ENTRIES_IN_FIRSTID_OFST 0
  5988. /* Number of buffer table entries to dump. */
  5989. #define MC_CMD_DUMP_BUFTBL_ENTRIES_IN_NUMENTRIES_OFST 4
  5990. /* MC_CMD_DUMP_BUFTBL_ENTRIES_OUT msgresponse */
  5991. #define MC_CMD_DUMP_BUFTBL_ENTRIES_OUT_LENMIN 12
  5992. #define MC_CMD_DUMP_BUFTBL_ENTRIES_OUT_LENMAX 252
  5993. #define MC_CMD_DUMP_BUFTBL_ENTRIES_OUT_LEN(num) (0+12*(num))
  5994. /* Raw buffer table entries, laid out as BUFTBL_ENTRY. */
  5995. #define MC_CMD_DUMP_BUFTBL_ENTRIES_OUT_ENTRY_OFST 0
  5996. #define MC_CMD_DUMP_BUFTBL_ENTRIES_OUT_ENTRY_LEN 12
  5997. #define MC_CMD_DUMP_BUFTBL_ENTRIES_OUT_ENTRY_MINNUM 1
  5998. #define MC_CMD_DUMP_BUFTBL_ENTRIES_OUT_ENTRY_MAXNUM 21
  5999. /***********************************/
  6000. /* MC_CMD_SET_RXDP_CONFIG
  6001. * Set global RXDP configuration settings
  6002. */
  6003. #define MC_CMD_SET_RXDP_CONFIG 0xc1
  6004. #define MC_CMD_0xc1_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  6005. /* MC_CMD_SET_RXDP_CONFIG_IN msgrequest */
  6006. #define MC_CMD_SET_RXDP_CONFIG_IN_LEN 4
  6007. #define MC_CMD_SET_RXDP_CONFIG_IN_DATA_OFST 0
  6008. #define MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_DMA_LBN 0
  6009. #define MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_DMA_WIDTH 1
  6010. /* MC_CMD_SET_RXDP_CONFIG_OUT msgresponse */
  6011. #define MC_CMD_SET_RXDP_CONFIG_OUT_LEN 0
  6012. /***********************************/
  6013. /* MC_CMD_GET_RXDP_CONFIG
  6014. * Get global RXDP configuration settings
  6015. */
  6016. #define MC_CMD_GET_RXDP_CONFIG 0xc2
  6017. #define MC_CMD_0xc2_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  6018. /* MC_CMD_GET_RXDP_CONFIG_IN msgrequest */
  6019. #define MC_CMD_GET_RXDP_CONFIG_IN_LEN 0
  6020. /* MC_CMD_GET_RXDP_CONFIG_OUT msgresponse */
  6021. #define MC_CMD_GET_RXDP_CONFIG_OUT_LEN 4
  6022. #define MC_CMD_GET_RXDP_CONFIG_OUT_DATA_OFST 0
  6023. #define MC_CMD_GET_RXDP_CONFIG_OUT_PAD_HOST_DMA_LBN 0
  6024. #define MC_CMD_GET_RXDP_CONFIG_OUT_PAD_HOST_DMA_WIDTH 1
  6025. /***********************************/
  6026. /* MC_CMD_RMON_RX_CLASS_DROPS_STATS
  6027. * Retrieve rx class drop stats
  6028. */
  6029. #define MC_CMD_RMON_RX_CLASS_DROPS_STATS 0xd3
  6030. /* MC_CMD_RMON_RX_CLASS_DROPS_STATS_IN msgrequest */
  6031. #define MC_CMD_RMON_RX_CLASS_DROPS_STATS_IN_LEN 4
  6032. /* flags */
  6033. #define MC_CMD_RMON_RX_CLASS_DROPS_STATS_IN_FLAGS_OFST 0
  6034. #define MC_CMD_RMON_RX_CLASS_DROPS_STATS_IN_CLASS_LBN 0
  6035. #define MC_CMD_RMON_RX_CLASS_DROPS_STATS_IN_CLASS_WIDTH 8
  6036. #define MC_CMD_RMON_RX_CLASS_DROPS_STATS_IN_RST_LBN 8
  6037. #define MC_CMD_RMON_RX_CLASS_DROPS_STATS_IN_RST_WIDTH 1
  6038. /* MC_CMD_RMON_RX_CLASS_DROPS_STATS_OUT msgresponse */
  6039. #define MC_CMD_RMON_RX_CLASS_DROPS_STATS_OUT_LENMIN 4
  6040. #define MC_CMD_RMON_RX_CLASS_DROPS_STATS_OUT_LENMAX 252
  6041. #define MC_CMD_RMON_RX_CLASS_DROPS_STATS_OUT_LEN(num) (0+4*(num))
  6042. /* Array of stats */
  6043. #define MC_CMD_RMON_RX_CLASS_DROPS_STATS_OUT_BUFFER_OFST 0
  6044. #define MC_CMD_RMON_RX_CLASS_DROPS_STATS_OUT_BUFFER_LEN 4
  6045. #define MC_CMD_RMON_RX_CLASS_DROPS_STATS_OUT_BUFFER_MINNUM 1
  6046. #define MC_CMD_RMON_RX_CLASS_DROPS_STATS_OUT_BUFFER_MAXNUM 63
  6047. /***********************************/
  6048. /* MC_CMD_RMON_RX_SUPER_CLASS_DROPS_STATS
  6049. * Retrieve rx super class drop stats
  6050. */
  6051. #define MC_CMD_RMON_RX_SUPER_CLASS_DROPS_STATS 0xd4
  6052. /* MC_CMD_RMON_RX_SUPER_CLASS_DROPS_STATS_IN msgrequest */
  6053. #define MC_CMD_RMON_RX_SUPER_CLASS_DROPS_STATS_IN_LEN 4
  6054. /* flags */
  6055. #define MC_CMD_RMON_RX_SUPER_CLASS_DROPS_STATS_IN_FLAGS_OFST 0
  6056. #define MC_CMD_RMON_RX_SUPER_CLASS_DROPS_STATS_IN_SUPER_CLASS_LBN 0
  6057. #define MC_CMD_RMON_RX_SUPER_CLASS_DROPS_STATS_IN_SUPER_CLASS_WIDTH 4
  6058. #define MC_CMD_RMON_RX_SUPER_CLASS_DROPS_STATS_IN_RST_LBN 4
  6059. #define MC_CMD_RMON_RX_SUPER_CLASS_DROPS_STATS_IN_RST_WIDTH 1
  6060. /* MC_CMD_RMON_RX_SUPER_CLASS_DROPS_STATS_OUT msgresponse */
  6061. #define MC_CMD_RMON_RX_SUPER_CLASS_DROPS_STATS_OUT_LENMIN 4
  6062. #define MC_CMD_RMON_RX_SUPER_CLASS_DROPS_STATS_OUT_LENMAX 252
  6063. #define MC_CMD_RMON_RX_SUPER_CLASS_DROPS_STATS_OUT_LEN(num) (0+4*(num))
  6064. /* Array of stats */
  6065. #define MC_CMD_RMON_RX_SUPER_CLASS_DROPS_STATS_OUT_BUFFER_OFST 0
  6066. #define MC_CMD_RMON_RX_SUPER_CLASS_DROPS_STATS_OUT_BUFFER_LEN 4
  6067. #define MC_CMD_RMON_RX_SUPER_CLASS_DROPS_STATS_OUT_BUFFER_MINNUM 1
  6068. #define MC_CMD_RMON_RX_SUPER_CLASS_DROPS_STATS_OUT_BUFFER_MAXNUM 63
  6069. /***********************************/
  6070. /* MC_CMD_RMON_RX_ERRORS_STATS
  6071. * Retrieve rxdp errors
  6072. */
  6073. #define MC_CMD_RMON_RX_ERRORS_STATS 0xd5
  6074. /* MC_CMD_RMON_RX_ERRORS_STATS_IN msgrequest */
  6075. #define MC_CMD_RMON_RX_ERRORS_STATS_IN_LEN 4
  6076. /* flags */
  6077. #define MC_CMD_RMON_RX_ERRORS_STATS_IN_FLAGS_OFST 0
  6078. #define MC_CMD_RMON_RX_ERRORS_STATS_IN_QID_LBN 0
  6079. #define MC_CMD_RMON_RX_ERRORS_STATS_IN_QID_WIDTH 11
  6080. #define MC_CMD_RMON_RX_ERRORS_STATS_IN_RST_LBN 11
  6081. #define MC_CMD_RMON_RX_ERRORS_STATS_IN_RST_WIDTH 1
  6082. /* MC_CMD_RMON_RX_ERRORS_STATS_OUT msgresponse */
  6083. #define MC_CMD_RMON_RX_ERRORS_STATS_OUT_LENMIN 4
  6084. #define MC_CMD_RMON_RX_ERRORS_STATS_OUT_LENMAX 252
  6085. #define MC_CMD_RMON_RX_ERRORS_STATS_OUT_LEN(num) (0+4*(num))
  6086. /* Array of stats */
  6087. #define MC_CMD_RMON_RX_ERRORS_STATS_OUT_BUFFER_OFST 0
  6088. #define MC_CMD_RMON_RX_ERRORS_STATS_OUT_BUFFER_LEN 4
  6089. #define MC_CMD_RMON_RX_ERRORS_STATS_OUT_BUFFER_MINNUM 1
  6090. #define MC_CMD_RMON_RX_ERRORS_STATS_OUT_BUFFER_MAXNUM 63
  6091. /***********************************/
  6092. /* MC_CMD_RMON_RX_OVERFLOW_STATS
  6093. * Retrieve rxdp overflow
  6094. */
  6095. #define MC_CMD_RMON_RX_OVERFLOW_STATS 0xd6
  6096. /* MC_CMD_RMON_RX_OVERFLOW_STATS_IN msgrequest */
  6097. #define MC_CMD_RMON_RX_OVERFLOW_STATS_IN_LEN 4
  6098. /* flags */
  6099. #define MC_CMD_RMON_RX_OVERFLOW_STATS_IN_FLAGS_OFST 0
  6100. #define MC_CMD_RMON_RX_OVERFLOW_STATS_IN_CLASS_LBN 0
  6101. #define MC_CMD_RMON_RX_OVERFLOW_STATS_IN_CLASS_WIDTH 8
  6102. #define MC_CMD_RMON_RX_OVERFLOW_STATS_IN_RST_LBN 8
  6103. #define MC_CMD_RMON_RX_OVERFLOW_STATS_IN_RST_WIDTH 1
  6104. /* MC_CMD_RMON_RX_OVERFLOW_STATS_OUT msgresponse */
  6105. #define MC_CMD_RMON_RX_OVERFLOW_STATS_OUT_LENMIN 4
  6106. #define MC_CMD_RMON_RX_OVERFLOW_STATS_OUT_LENMAX 252
  6107. #define MC_CMD_RMON_RX_OVERFLOW_STATS_OUT_LEN(num) (0+4*(num))
  6108. /* Array of stats */
  6109. #define MC_CMD_RMON_RX_OVERFLOW_STATS_OUT_BUFFER_OFST 0
  6110. #define MC_CMD_RMON_RX_OVERFLOW_STATS_OUT_BUFFER_LEN 4
  6111. #define MC_CMD_RMON_RX_OVERFLOW_STATS_OUT_BUFFER_MINNUM 1
  6112. #define MC_CMD_RMON_RX_OVERFLOW_STATS_OUT_BUFFER_MAXNUM 63
  6113. /***********************************/
  6114. /* MC_CMD_RMON_TX_IPI_STATS
  6115. * Retrieve tx ipi stats
  6116. */
  6117. #define MC_CMD_RMON_TX_IPI_STATS 0xd7
  6118. /* MC_CMD_RMON_TX_IPI_STATS_IN msgrequest */
  6119. #define MC_CMD_RMON_TX_IPI_STATS_IN_LEN 4
  6120. /* flags */
  6121. #define MC_CMD_RMON_TX_IPI_STATS_IN_FLAGS_OFST 0
  6122. #define MC_CMD_RMON_TX_IPI_STATS_IN_VFIFO_LBN 0
  6123. #define MC_CMD_RMON_TX_IPI_STATS_IN_VFIFO_WIDTH 5
  6124. #define MC_CMD_RMON_TX_IPI_STATS_IN_RST_LBN 5
  6125. #define MC_CMD_RMON_TX_IPI_STATS_IN_RST_WIDTH 1
  6126. /* MC_CMD_RMON_TX_IPI_STATS_OUT msgresponse */
  6127. #define MC_CMD_RMON_TX_IPI_STATS_OUT_LENMIN 4
  6128. #define MC_CMD_RMON_TX_IPI_STATS_OUT_LENMAX 252
  6129. #define MC_CMD_RMON_TX_IPI_STATS_OUT_LEN(num) (0+4*(num))
  6130. /* Array of stats */
  6131. #define MC_CMD_RMON_TX_IPI_STATS_OUT_BUFFER_OFST 0
  6132. #define MC_CMD_RMON_TX_IPI_STATS_OUT_BUFFER_LEN 4
  6133. #define MC_CMD_RMON_TX_IPI_STATS_OUT_BUFFER_MINNUM 1
  6134. #define MC_CMD_RMON_TX_IPI_STATS_OUT_BUFFER_MAXNUM 63
  6135. /***********************************/
  6136. /* MC_CMD_RMON_TX_IPSEC_CNTXT_PTR_STATS
  6137. * Retrieve tx ipsec counters by cntxt_ptr
  6138. */
  6139. #define MC_CMD_RMON_TX_IPSEC_CNTXT_PTR_STATS 0xd8
  6140. /* MC_CMD_RMON_TX_IPSEC_CNTXT_PTR_STATS_IN msgrequest */
  6141. #define MC_CMD_RMON_TX_IPSEC_CNTXT_PTR_STATS_IN_LEN 4
  6142. /* flags */
  6143. #define MC_CMD_RMON_TX_IPSEC_CNTXT_PTR_STATS_IN_FLAGS_OFST 0
  6144. #define MC_CMD_RMON_TX_IPSEC_CNTXT_PTR_STATS_IN_CNTXT_PTR_LBN 0
  6145. #define MC_CMD_RMON_TX_IPSEC_CNTXT_PTR_STATS_IN_CNTXT_PTR_WIDTH 9
  6146. #define MC_CMD_RMON_TX_IPSEC_CNTXT_PTR_STATS_IN_RST_LBN 9
  6147. #define MC_CMD_RMON_TX_IPSEC_CNTXT_PTR_STATS_IN_RST_WIDTH 1
  6148. /* MC_CMD_RMON_TX_IPSEC_CNTXT_PTR_STATS_OUT msgresponse */
  6149. #define MC_CMD_RMON_TX_IPSEC_CNTXT_PTR_STATS_OUT_LENMIN 4
  6150. #define MC_CMD_RMON_TX_IPSEC_CNTXT_PTR_STATS_OUT_LENMAX 252
  6151. #define MC_CMD_RMON_TX_IPSEC_CNTXT_PTR_STATS_OUT_LEN(num) (0+4*(num))
  6152. /* Array of stats */
  6153. #define MC_CMD_RMON_TX_IPSEC_CNTXT_PTR_STATS_OUT_BUFFER_OFST 0
  6154. #define MC_CMD_RMON_TX_IPSEC_CNTXT_PTR_STATS_OUT_BUFFER_LEN 4
  6155. #define MC_CMD_RMON_TX_IPSEC_CNTXT_PTR_STATS_OUT_BUFFER_MINNUM 1
  6156. #define MC_CMD_RMON_TX_IPSEC_CNTXT_PTR_STATS_OUT_BUFFER_MAXNUM 63
  6157. /***********************************/
  6158. /* MC_CMD_RMON_TX_IPSEC_PORT_STATS
  6159. * Retrieve tx ipsec counters by port
  6160. */
  6161. #define MC_CMD_RMON_TX_IPSEC_PORT_STATS 0xd9
  6162. /* MC_CMD_RMON_TX_IPSEC_PORT_STATS_IN msgrequest */
  6163. #define MC_CMD_RMON_TX_IPSEC_PORT_STATS_IN_LEN 4
  6164. /* flags */
  6165. #define MC_CMD_RMON_TX_IPSEC_PORT_STATS_IN_FLAGS_OFST 0
  6166. #define MC_CMD_RMON_TX_IPSEC_PORT_STATS_IN_PORT_LBN 0
  6167. #define MC_CMD_RMON_TX_IPSEC_PORT_STATS_IN_PORT_WIDTH 2
  6168. #define MC_CMD_RMON_TX_IPSEC_PORT_STATS_IN_RST_LBN 2
  6169. #define MC_CMD_RMON_TX_IPSEC_PORT_STATS_IN_RST_WIDTH 1
  6170. /* MC_CMD_RMON_TX_IPSEC_PORT_STATS_OUT msgresponse */
  6171. #define MC_CMD_RMON_TX_IPSEC_PORT_STATS_OUT_LENMIN 4
  6172. #define MC_CMD_RMON_TX_IPSEC_PORT_STATS_OUT_LENMAX 252
  6173. #define MC_CMD_RMON_TX_IPSEC_PORT_STATS_OUT_LEN(num) (0+4*(num))
  6174. /* Array of stats */
  6175. #define MC_CMD_RMON_TX_IPSEC_PORT_STATS_OUT_BUFFER_OFST 0
  6176. #define MC_CMD_RMON_TX_IPSEC_PORT_STATS_OUT_BUFFER_LEN 4
  6177. #define MC_CMD_RMON_TX_IPSEC_PORT_STATS_OUT_BUFFER_MINNUM 1
  6178. #define MC_CMD_RMON_TX_IPSEC_PORT_STATS_OUT_BUFFER_MAXNUM 63
  6179. /***********************************/
  6180. /* MC_CMD_RMON_TX_IPSEC_OFLOW_STATS
  6181. * Retrieve tx ipsec overflow
  6182. */
  6183. #define MC_CMD_RMON_TX_IPSEC_OFLOW_STATS 0xda
  6184. /* MC_CMD_RMON_TX_IPSEC_OFLOW_STATS_IN msgrequest */
  6185. #define MC_CMD_RMON_TX_IPSEC_OFLOW_STATS_IN_LEN 4
  6186. /* flags */
  6187. #define MC_CMD_RMON_TX_IPSEC_OFLOW_STATS_IN_FLAGS_OFST 0
  6188. #define MC_CMD_RMON_TX_IPSEC_OFLOW_STATS_IN_PORT_LBN 0
  6189. #define MC_CMD_RMON_TX_IPSEC_OFLOW_STATS_IN_PORT_WIDTH 2
  6190. #define MC_CMD_RMON_TX_IPSEC_OFLOW_STATS_IN_RST_LBN 2
  6191. #define MC_CMD_RMON_TX_IPSEC_OFLOW_STATS_IN_RST_WIDTH 1
  6192. /* MC_CMD_RMON_TX_IPSEC_OFLOW_STATS_OUT msgresponse */
  6193. #define MC_CMD_RMON_TX_IPSEC_OFLOW_STATS_OUT_LENMIN 4
  6194. #define MC_CMD_RMON_TX_IPSEC_OFLOW_STATS_OUT_LENMAX 252
  6195. #define MC_CMD_RMON_TX_IPSEC_OFLOW_STATS_OUT_LEN(num) (0+4*(num))
  6196. /* Array of stats */
  6197. #define MC_CMD_RMON_TX_IPSEC_OFLOW_STATS_OUT_BUFFER_OFST 0
  6198. #define MC_CMD_RMON_TX_IPSEC_OFLOW_STATS_OUT_BUFFER_LEN 4
  6199. #define MC_CMD_RMON_TX_IPSEC_OFLOW_STATS_OUT_BUFFER_MINNUM 1
  6200. #define MC_CMD_RMON_TX_IPSEC_OFLOW_STATS_OUT_BUFFER_MAXNUM 63
  6201. /***********************************/
  6202. /* MC_CMD_RMON_TX_NOWHERE_STATS
  6203. * Retrieve tx nowhere stats
  6204. */
  6205. #define MC_CMD_RMON_TX_NOWHERE_STATS 0xdb
  6206. /* MC_CMD_RMON_TX_NOWHERE_STATS_IN msgrequest */
  6207. #define MC_CMD_RMON_TX_NOWHERE_STATS_IN_LEN 4
  6208. /* flags */
  6209. #define MC_CMD_RMON_TX_NOWHERE_STATS_IN_FLAGS_OFST 0
  6210. #define MC_CMD_RMON_TX_NOWHERE_STATS_IN_CLASS_LBN 0
  6211. #define MC_CMD_RMON_TX_NOWHERE_STATS_IN_CLASS_WIDTH 8
  6212. #define MC_CMD_RMON_TX_NOWHERE_STATS_IN_RST_LBN 8
  6213. #define MC_CMD_RMON_TX_NOWHERE_STATS_IN_RST_WIDTH 1
  6214. /* MC_CMD_RMON_TX_NOWHERE_STATS_OUT msgresponse */
  6215. #define MC_CMD_RMON_TX_NOWHERE_STATS_OUT_LENMIN 4
  6216. #define MC_CMD_RMON_TX_NOWHERE_STATS_OUT_LENMAX 252
  6217. #define MC_CMD_RMON_TX_NOWHERE_STATS_OUT_LEN(num) (0+4*(num))
  6218. /* Array of stats */
  6219. #define MC_CMD_RMON_TX_NOWHERE_STATS_OUT_BUFFER_OFST 0
  6220. #define MC_CMD_RMON_TX_NOWHERE_STATS_OUT_BUFFER_LEN 4
  6221. #define MC_CMD_RMON_TX_NOWHERE_STATS_OUT_BUFFER_MINNUM 1
  6222. #define MC_CMD_RMON_TX_NOWHERE_STATS_OUT_BUFFER_MAXNUM 63
  6223. /***********************************/
  6224. /* MC_CMD_RMON_TX_NOWHERE_QBB_STATS
  6225. * Retrieve tx nowhere qbb stats
  6226. */
  6227. #define MC_CMD_RMON_TX_NOWHERE_QBB_STATS 0xdc
  6228. /* MC_CMD_RMON_TX_NOWHERE_QBB_STATS_IN msgrequest */
  6229. #define MC_CMD_RMON_TX_NOWHERE_QBB_STATS_IN_LEN 4
  6230. /* flags */
  6231. #define MC_CMD_RMON_TX_NOWHERE_QBB_STATS_IN_FLAGS_OFST 0
  6232. #define MC_CMD_RMON_TX_NOWHERE_QBB_STATS_IN_PRIORITY_LBN 0
  6233. #define MC_CMD_RMON_TX_NOWHERE_QBB_STATS_IN_PRIORITY_WIDTH 3
  6234. #define MC_CMD_RMON_TX_NOWHERE_QBB_STATS_IN_RST_LBN 3
  6235. #define MC_CMD_RMON_TX_NOWHERE_QBB_STATS_IN_RST_WIDTH 1
  6236. /* MC_CMD_RMON_TX_NOWHERE_QBB_STATS_OUT msgresponse */
  6237. #define MC_CMD_RMON_TX_NOWHERE_QBB_STATS_OUT_LENMIN 4
  6238. #define MC_CMD_RMON_TX_NOWHERE_QBB_STATS_OUT_LENMAX 252
  6239. #define MC_CMD_RMON_TX_NOWHERE_QBB_STATS_OUT_LEN(num) (0+4*(num))
  6240. /* Array of stats */
  6241. #define MC_CMD_RMON_TX_NOWHERE_QBB_STATS_OUT_BUFFER_OFST 0
  6242. #define MC_CMD_RMON_TX_NOWHERE_QBB_STATS_OUT_BUFFER_LEN 4
  6243. #define MC_CMD_RMON_TX_NOWHERE_QBB_STATS_OUT_BUFFER_MINNUM 1
  6244. #define MC_CMD_RMON_TX_NOWHERE_QBB_STATS_OUT_BUFFER_MAXNUM 63
  6245. /***********************************/
  6246. /* MC_CMD_RMON_TX_ERRORS_STATS
  6247. * Retrieve rxdp errors
  6248. */
  6249. #define MC_CMD_RMON_TX_ERRORS_STATS 0xdd
  6250. /* MC_CMD_RMON_TX_ERRORS_STATS_IN msgrequest */
  6251. #define MC_CMD_RMON_TX_ERRORS_STATS_IN_LEN 4
  6252. /* flags */
  6253. #define MC_CMD_RMON_TX_ERRORS_STATS_IN_FLAGS_OFST 0
  6254. #define MC_CMD_RMON_TX_ERRORS_STATS_IN_QID_LBN 0
  6255. #define MC_CMD_RMON_TX_ERRORS_STATS_IN_QID_WIDTH 11
  6256. #define MC_CMD_RMON_TX_ERRORS_STATS_IN_RST_LBN 11
  6257. #define MC_CMD_RMON_TX_ERRORS_STATS_IN_RST_WIDTH 1
  6258. /* MC_CMD_RMON_TX_ERRORS_STATS_OUT msgresponse */
  6259. #define MC_CMD_RMON_TX_ERRORS_STATS_OUT_LENMIN 4
  6260. #define MC_CMD_RMON_TX_ERRORS_STATS_OUT_LENMAX 252
  6261. #define MC_CMD_RMON_TX_ERRORS_STATS_OUT_LEN(num) (0+4*(num))
  6262. /* Array of stats */
  6263. #define MC_CMD_RMON_TX_ERRORS_STATS_OUT_BUFFER_OFST 0
  6264. #define MC_CMD_RMON_TX_ERRORS_STATS_OUT_BUFFER_LEN 4
  6265. #define MC_CMD_RMON_TX_ERRORS_STATS_OUT_BUFFER_MINNUM 1
  6266. #define MC_CMD_RMON_TX_ERRORS_STATS_OUT_BUFFER_MAXNUM 63
  6267. /***********************************/
  6268. /* MC_CMD_RMON_TX_OVERFLOW_STATS
  6269. * Retrieve rxdp overflow
  6270. */
  6271. #define MC_CMD_RMON_TX_OVERFLOW_STATS 0xde
  6272. /* MC_CMD_RMON_TX_OVERFLOW_STATS_IN msgrequest */
  6273. #define MC_CMD_RMON_TX_OVERFLOW_STATS_IN_LEN 4
  6274. /* flags */
  6275. #define MC_CMD_RMON_TX_OVERFLOW_STATS_IN_FLAGS_OFST 0
  6276. #define MC_CMD_RMON_TX_OVERFLOW_STATS_IN_CLASS_LBN 0
  6277. #define MC_CMD_RMON_TX_OVERFLOW_STATS_IN_CLASS_WIDTH 8
  6278. #define MC_CMD_RMON_TX_OVERFLOW_STATS_IN_RST_LBN 8
  6279. #define MC_CMD_RMON_TX_OVERFLOW_STATS_IN_RST_WIDTH 1
  6280. /* MC_CMD_RMON_TX_OVERFLOW_STATS_OUT msgresponse */
  6281. #define MC_CMD_RMON_TX_OVERFLOW_STATS_OUT_LENMIN 4
  6282. #define MC_CMD_RMON_TX_OVERFLOW_STATS_OUT_LENMAX 252
  6283. #define MC_CMD_RMON_TX_OVERFLOW_STATS_OUT_LEN(num) (0+4*(num))
  6284. /* Array of stats */
  6285. #define MC_CMD_RMON_TX_OVERFLOW_STATS_OUT_BUFFER_OFST 0
  6286. #define MC_CMD_RMON_TX_OVERFLOW_STATS_OUT_BUFFER_LEN 4
  6287. #define MC_CMD_RMON_TX_OVERFLOW_STATS_OUT_BUFFER_MINNUM 1
  6288. #define MC_CMD_RMON_TX_OVERFLOW_STATS_OUT_BUFFER_MAXNUM 63
  6289. /***********************************/
  6290. /* MC_CMD_RMON_COLLECT_CLASS_STATS
  6291. * Explicitly collect class stats at the specified evb port
  6292. */
  6293. #define MC_CMD_RMON_COLLECT_CLASS_STATS 0xdf
  6294. /* MC_CMD_RMON_COLLECT_CLASS_STATS_IN msgrequest */
  6295. #define MC_CMD_RMON_COLLECT_CLASS_STATS_IN_LEN 4
  6296. /* The port id associated with the vport/pport at which to collect class stats
  6297. */
  6298. #define MC_CMD_RMON_COLLECT_CLASS_STATS_IN_PORT_ID_OFST 0
  6299. /* MC_CMD_RMON_COLLECT_CLASS_STATS_OUT msgresponse */
  6300. #define MC_CMD_RMON_COLLECT_CLASS_STATS_OUT_LEN 4
  6301. /* class */
  6302. #define MC_CMD_RMON_COLLECT_CLASS_STATS_OUT_CLASS_OFST 0
  6303. /***********************************/
  6304. /* MC_CMD_RMON_COLLECT_SUPER_CLASS_STATS
  6305. * Explicitly collect class stats at the specified evb port
  6306. */
  6307. #define MC_CMD_RMON_COLLECT_SUPER_CLASS_STATS 0xe0
  6308. /* MC_CMD_RMON_COLLECT_SUPER_CLASS_STATS_IN msgrequest */
  6309. #define MC_CMD_RMON_COLLECT_SUPER_CLASS_STATS_IN_LEN 4
  6310. /* The port id associated with the vport/pport at which to collect class stats
  6311. */
  6312. #define MC_CMD_RMON_COLLECT_SUPER_CLASS_STATS_IN_PORT_ID_OFST 0
  6313. /* MC_CMD_RMON_COLLECT_SUPER_CLASS_STATS_OUT msgresponse */
  6314. #define MC_CMD_RMON_COLLECT_SUPER_CLASS_STATS_OUT_LEN 4
  6315. /* super_class */
  6316. #define MC_CMD_RMON_COLLECT_SUPER_CLASS_STATS_OUT_SUPER_CLASS_OFST 0
  6317. /***********************************/
  6318. /* MC_CMD_GET_CLOCK
  6319. * Return the system and PDCPU clock frequencies.
  6320. */
  6321. #define MC_CMD_GET_CLOCK 0xac
  6322. #define MC_CMD_0xac_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  6323. /* MC_CMD_GET_CLOCK_IN msgrequest */
  6324. #define MC_CMD_GET_CLOCK_IN_LEN 0
  6325. /* MC_CMD_GET_CLOCK_OUT msgresponse */
  6326. #define MC_CMD_GET_CLOCK_OUT_LEN 8
  6327. /* System frequency, MHz */
  6328. #define MC_CMD_GET_CLOCK_OUT_SYS_FREQ_OFST 0
  6329. /* DPCPU frequency, MHz */
  6330. #define MC_CMD_GET_CLOCK_OUT_DPCPU_FREQ_OFST 4
  6331. /***********************************/
  6332. /* MC_CMD_SET_CLOCK
  6333. * Control the system and DPCPU clock frequencies. Changes are lost reboot.
  6334. */
  6335. #define MC_CMD_SET_CLOCK 0xad
  6336. #define MC_CMD_0xad_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  6337. /* MC_CMD_SET_CLOCK_IN msgrequest */
  6338. #define MC_CMD_SET_CLOCK_IN_LEN 12
  6339. /* Requested system frequency in MHz; 0 leaves unchanged. */
  6340. #define MC_CMD_SET_CLOCK_IN_SYS_FREQ_OFST 0
  6341. /* Requested inter-core frequency in MHz; 0 leaves unchanged. */
  6342. #define MC_CMD_SET_CLOCK_IN_ICORE_FREQ_OFST 4
  6343. /* Request DPCPU frequency in MHz; 0 leaves unchanged. */
  6344. #define MC_CMD_SET_CLOCK_IN_DPCPU_FREQ_OFST 8
  6345. /* MC_CMD_SET_CLOCK_OUT msgresponse */
  6346. #define MC_CMD_SET_CLOCK_OUT_LEN 12
  6347. /* Resulting system frequency in MHz */
  6348. #define MC_CMD_SET_CLOCK_OUT_SYS_FREQ_OFST 0
  6349. /* Resulting inter-core frequency in MHz */
  6350. #define MC_CMD_SET_CLOCK_OUT_ICORE_FREQ_OFST 4
  6351. /* Resulting DPCPU frequency in MHz */
  6352. #define MC_CMD_SET_CLOCK_OUT_DPCPU_FREQ_OFST 8
  6353. /***********************************/
  6354. /* MC_CMD_DPCPU_RPC
  6355. * Send an arbitrary DPCPU message.
  6356. */
  6357. #define MC_CMD_DPCPU_RPC 0xae
  6358. #define MC_CMD_0xae_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  6359. /* MC_CMD_DPCPU_RPC_IN msgrequest */
  6360. #define MC_CMD_DPCPU_RPC_IN_LEN 36
  6361. #define MC_CMD_DPCPU_RPC_IN_CPU_OFST 0
  6362. /* enum: RxDPCPU */
  6363. #define MC_CMD_DPCPU_RPC_IN_DPCPU_RX 0x0
  6364. /* enum: TxDPCPU0 */
  6365. #define MC_CMD_DPCPU_RPC_IN_DPCPU_TX0 0x1
  6366. /* enum: TxDPCPU1 */
  6367. #define MC_CMD_DPCPU_RPC_IN_DPCPU_TX1 0x2
  6368. /* First 8 bits [39:32] of DATA are consumed by MC-DPCPU protocol and must be
  6369. * initialised to zero
  6370. */
  6371. #define MC_CMD_DPCPU_RPC_IN_DATA_OFST 4
  6372. #define MC_CMD_DPCPU_RPC_IN_DATA_LEN 32
  6373. #define MC_CMD_DPCPU_RPC_IN_HDR_CMD_CMDNUM_LBN 8
  6374. #define MC_CMD_DPCPU_RPC_IN_HDR_CMD_CMDNUM_WIDTH 8
  6375. #define MC_CMD_DPCPU_RPC_IN_CMDNUM_TXDPCPU_READ 0x6 /* enum */
  6376. #define MC_CMD_DPCPU_RPC_IN_CMDNUM_TXDPCPU_WRITE 0x7 /* enum */
  6377. #define MC_CMD_DPCPU_RPC_IN_CMDNUM_TXDPCPU_SELF_TEST 0xc /* enum */
  6378. #define MC_CMD_DPCPU_RPC_IN_CMDNUM_TXDPCPU_CSR_ACCESS 0xe /* enum */
  6379. #define MC_CMD_DPCPU_RPC_IN_CMDNUM_RXDPCPU_READ 0x46 /* enum */
  6380. #define MC_CMD_DPCPU_RPC_IN_CMDNUM_RXDPCPU_WRITE 0x47 /* enum */
  6381. #define MC_CMD_DPCPU_RPC_IN_CMDNUM_RXDPCPU_SELF_TEST 0x4a /* enum */
  6382. #define MC_CMD_DPCPU_RPC_IN_CMDNUM_RXDPCPU_CSR_ACCESS 0x4c /* enum */
  6383. #define MC_CMD_DPCPU_RPC_IN_CMDNUM_RXDPCPU_SET_MC_REPLAY_CNTXT 0x4d /* enum */
  6384. #define MC_CMD_DPCPU_RPC_IN_HDR_CMD_REQ_OBJID_LBN 16
  6385. #define MC_CMD_DPCPU_RPC_IN_HDR_CMD_REQ_OBJID_WIDTH 16
  6386. #define MC_CMD_DPCPU_RPC_IN_HDR_CMD_REQ_ADDR_LBN 16
  6387. #define MC_CMD_DPCPU_RPC_IN_HDR_CMD_REQ_ADDR_WIDTH 16
  6388. #define MC_CMD_DPCPU_RPC_IN_HDR_CMD_REQ_COUNT_LBN 48
  6389. #define MC_CMD_DPCPU_RPC_IN_HDR_CMD_REQ_COUNT_WIDTH 16
  6390. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_INFO_LBN 16
  6391. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_INFO_WIDTH 240
  6392. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_CMD_LBN 16
  6393. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_CMD_WIDTH 16
  6394. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_CMD_STOP_RETURN_RESULT 0x0 /* enum */
  6395. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_CMD_START_READ 0x1 /* enum */
  6396. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_CMD_START_WRITE 0x2 /* enum */
  6397. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_CMD_START_WRITE_READ 0x3 /* enum */
  6398. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_CMD_START_PIPELINED_READ 0x4 /* enum */
  6399. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_START_DELAY_LBN 48
  6400. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_START_DELAY_WIDTH 16
  6401. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_RPT_COUNT_LBN 64
  6402. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_RPT_COUNT_WIDTH 16
  6403. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_GAP_DELAY_LBN 80
  6404. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_GAP_DELAY_WIDTH 16
  6405. #define MC_CMD_DPCPU_RPC_IN_MC_REPLAY_MODE_LBN 16
  6406. #define MC_CMD_DPCPU_RPC_IN_MC_REPLAY_MODE_WIDTH 16
  6407. #define MC_CMD_DPCPU_RPC_IN_MC_REPLAY_MODE_CUT_THROUGH 0x1 /* enum */
  6408. #define MC_CMD_DPCPU_RPC_IN_MC_REPLAY_MODE_STORE_FORWARD 0x2 /* enum */
  6409. #define MC_CMD_DPCPU_RPC_IN_MC_REPLAY_MODE_STORE_FORWARD_FIRST 0x3 /* enum */
  6410. #define MC_CMD_DPCPU_RPC_IN_MC_REPLAY_CNTXT_LBN 64
  6411. #define MC_CMD_DPCPU_RPC_IN_MC_REPLAY_CNTXT_WIDTH 16
  6412. #define MC_CMD_DPCPU_RPC_IN_WDATA_OFST 12
  6413. #define MC_CMD_DPCPU_RPC_IN_WDATA_LEN 24
  6414. /* Register data to write. Only valid in write/write-read. */
  6415. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_DATA_OFST 16
  6416. /* Register address. */
  6417. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_ADDRESS_OFST 20
  6418. /* MC_CMD_DPCPU_RPC_OUT msgresponse */
  6419. #define MC_CMD_DPCPU_RPC_OUT_LEN 36
  6420. #define MC_CMD_DPCPU_RPC_OUT_RC_OFST 0
  6421. /* DATA */
  6422. #define MC_CMD_DPCPU_RPC_OUT_DATA_OFST 4
  6423. #define MC_CMD_DPCPU_RPC_OUT_DATA_LEN 32
  6424. #define MC_CMD_DPCPU_RPC_OUT_HDR_CMD_RESP_ERRCODE_LBN 32
  6425. #define MC_CMD_DPCPU_RPC_OUT_HDR_CMD_RESP_ERRCODE_WIDTH 16
  6426. #define MC_CMD_DPCPU_RPC_OUT_CSR_ACCESS_READ_COUNT_LBN 48
  6427. #define MC_CMD_DPCPU_RPC_OUT_CSR_ACCESS_READ_COUNT_WIDTH 16
  6428. #define MC_CMD_DPCPU_RPC_OUT_RDATA_OFST 12
  6429. #define MC_CMD_DPCPU_RPC_OUT_RDATA_LEN 24
  6430. #define MC_CMD_DPCPU_RPC_OUT_CSR_ACCESS_READ_VAL_1_OFST 12
  6431. #define MC_CMD_DPCPU_RPC_OUT_CSR_ACCESS_READ_VAL_2_OFST 16
  6432. #define MC_CMD_DPCPU_RPC_OUT_CSR_ACCESS_READ_VAL_3_OFST 20
  6433. #define MC_CMD_DPCPU_RPC_OUT_CSR_ACCESS_READ_VAL_4_OFST 24
  6434. /***********************************/
  6435. /* MC_CMD_TRIGGER_INTERRUPT
  6436. * Trigger an interrupt by prodding the BIU.
  6437. */
  6438. #define MC_CMD_TRIGGER_INTERRUPT 0xe3
  6439. #define MC_CMD_0xe3_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  6440. /* MC_CMD_TRIGGER_INTERRUPT_IN msgrequest */
  6441. #define MC_CMD_TRIGGER_INTERRUPT_IN_LEN 4
  6442. /* Interrupt level relative to base for function. */
  6443. #define MC_CMD_TRIGGER_INTERRUPT_IN_INTR_LEVEL_OFST 0
  6444. /* MC_CMD_TRIGGER_INTERRUPT_OUT msgresponse */
  6445. #define MC_CMD_TRIGGER_INTERRUPT_OUT_LEN 0
  6446. /***********************************/
  6447. /* MC_CMD_CAP_BLK_READ
  6448. * Read multiple 64bit words from capture block memory
  6449. */
  6450. #define MC_CMD_CAP_BLK_READ 0xe7
  6451. #define MC_CMD_0xe7_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  6452. /* MC_CMD_CAP_BLK_READ_IN msgrequest */
  6453. #define MC_CMD_CAP_BLK_READ_IN_LEN 12
  6454. #define MC_CMD_CAP_BLK_READ_IN_CAP_REG_OFST 0
  6455. #define MC_CMD_CAP_BLK_READ_IN_ADDR_OFST 4
  6456. #define MC_CMD_CAP_BLK_READ_IN_COUNT_OFST 8
  6457. /* MC_CMD_CAP_BLK_READ_OUT msgresponse */
  6458. #define MC_CMD_CAP_BLK_READ_OUT_LENMIN 8
  6459. #define MC_CMD_CAP_BLK_READ_OUT_LENMAX 248
  6460. #define MC_CMD_CAP_BLK_READ_OUT_LEN(num) (0+8*(num))
  6461. #define MC_CMD_CAP_BLK_READ_OUT_BUFFER_OFST 0
  6462. #define MC_CMD_CAP_BLK_READ_OUT_BUFFER_LEN 8
  6463. #define MC_CMD_CAP_BLK_READ_OUT_BUFFER_LO_OFST 0
  6464. #define MC_CMD_CAP_BLK_READ_OUT_BUFFER_HI_OFST 4
  6465. #define MC_CMD_CAP_BLK_READ_OUT_BUFFER_MINNUM 1
  6466. #define MC_CMD_CAP_BLK_READ_OUT_BUFFER_MAXNUM 31
  6467. /***********************************/
  6468. /* MC_CMD_DUMP_DO
  6469. * Take a dump of the DUT state
  6470. */
  6471. #define MC_CMD_DUMP_DO 0xe8
  6472. #define MC_CMD_0xe8_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  6473. /* MC_CMD_DUMP_DO_IN msgrequest */
  6474. #define MC_CMD_DUMP_DO_IN_LEN 52
  6475. #define MC_CMD_DUMP_DO_IN_PADDING_OFST 0
  6476. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_OFST 4
  6477. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM 0x0 /* enum */
  6478. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_DEFAULT 0x1 /* enum */
  6479. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_TYPE_OFST 8
  6480. #define MC_CMD_DUMP_DO_IN_DUMP_LOCATION_NVRAM 0x1 /* enum */
  6481. #define MC_CMD_DUMP_DO_IN_DUMP_LOCATION_HOST_MEMORY 0x2 /* enum */
  6482. #define MC_CMD_DUMP_DO_IN_DUMP_LOCATION_HOST_MEMORY_MLI 0x3 /* enum */
  6483. #define MC_CMD_DUMP_DO_IN_DUMP_LOCATION_UART 0x4 /* enum */
  6484. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_NVRAM_PARTITION_TYPE_ID_OFST 12
  6485. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_NVRAM_OFFSET_OFST 16
  6486. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_ADDR_LO_OFST 12
  6487. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_ADDR_HI_OFST 16
  6488. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_LO_OFST 12
  6489. #define MC_CMD_DUMP_DO_IN_HOST_MEMORY_MLI_PAGE_SIZE 0x1000 /* enum */
  6490. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_HI_OFST 16
  6491. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_MLI_DEPTH_OFST 20
  6492. #define MC_CMD_DUMP_DO_IN_HOST_MEMORY_MLI_MAX_DEPTH 0x2 /* enum */
  6493. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_UART_PORT_OFST 12
  6494. /* enum: The uart port this command was received over (if using a uart
  6495. * transport)
  6496. */
  6497. #define MC_CMD_DUMP_DO_IN_UART_PORT_SRC 0xff
  6498. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_SIZE_OFST 24
  6499. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_OFST 28
  6500. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM 0x0 /* enum */
  6501. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_NVRAM_DUMP_PARTITION 0x1 /* enum */
  6502. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_TYPE_OFST 32
  6503. /* Enum values, see field(s): */
  6504. /* MC_CMD_DUMP_DO_IN/DUMPSPEC_SRC_CUSTOM_TYPE */
  6505. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_NVRAM_PARTITION_TYPE_ID_OFST 36
  6506. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_NVRAM_OFFSET_OFST 40
  6507. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_ADDR_LO_OFST 36
  6508. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_ADDR_HI_OFST 40
  6509. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_LO_OFST 36
  6510. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_HI_OFST 40
  6511. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_MLI_DEPTH_OFST 44
  6512. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_UART_PORT_OFST 36
  6513. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_SIZE_OFST 48
  6514. /* MC_CMD_DUMP_DO_OUT msgresponse */
  6515. #define MC_CMD_DUMP_DO_OUT_LEN 4
  6516. #define MC_CMD_DUMP_DO_OUT_DUMPFILE_SIZE_OFST 0
  6517. /***********************************/
  6518. /* MC_CMD_DUMP_CONFIGURE_UNSOLICITED
  6519. * Configure unsolicited dumps
  6520. */
  6521. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED 0xe9
  6522. #define MC_CMD_0xe9_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  6523. /* MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN msgrequest */
  6524. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_LEN 52
  6525. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_ENABLE_OFST 0
  6526. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_OFST 4
  6527. /* Enum values, see field(s): */
  6528. /* MC_CMD_DUMP_DO/MC_CMD_DUMP_DO_IN/DUMPSPEC_SRC */
  6529. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_TYPE_OFST 8
  6530. /* Enum values, see field(s): */
  6531. /* MC_CMD_DUMP_DO/MC_CMD_DUMP_DO_IN/DUMPSPEC_SRC_CUSTOM_TYPE */
  6532. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_NVRAM_PARTITION_TYPE_ID_OFST 12
  6533. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_NVRAM_OFFSET_OFST 16
  6534. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_ADDR_LO_OFST 12
  6535. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_ADDR_HI_OFST 16
  6536. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_LO_OFST 12
  6537. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_HI_OFST 16
  6538. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_MLI_DEPTH_OFST 20
  6539. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_UART_PORT_OFST 12
  6540. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_SIZE_OFST 24
  6541. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_OFST 28
  6542. /* Enum values, see field(s): */
  6543. /* MC_CMD_DUMP_DO/MC_CMD_DUMP_DO_IN/DUMPFILE_DST */
  6544. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_TYPE_OFST 32
  6545. /* Enum values, see field(s): */
  6546. /* MC_CMD_DUMP_DO/MC_CMD_DUMP_DO_IN/DUMPSPEC_SRC_CUSTOM_TYPE */
  6547. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_NVRAM_PARTITION_TYPE_ID_OFST 36
  6548. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_NVRAM_OFFSET_OFST 40
  6549. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_ADDR_LO_OFST 36
  6550. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_ADDR_HI_OFST 40
  6551. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_LO_OFST 36
  6552. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_HI_OFST 40
  6553. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_MLI_DEPTH_OFST 44
  6554. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_UART_PORT_OFST 36
  6555. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_SIZE_OFST 48
  6556. /***********************************/
  6557. /* MC_CMD_SET_PSU
  6558. * Adjusts power supply parameters. This is a warranty-voiding operation.
  6559. * Returns: ENOENT if the parameter or rail specified does not exist, EINVAL if
  6560. * the parameter is out of range.
  6561. */
  6562. #define MC_CMD_SET_PSU 0xea
  6563. #define MC_CMD_0xea_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  6564. /* MC_CMD_SET_PSU_IN msgrequest */
  6565. #define MC_CMD_SET_PSU_IN_LEN 12
  6566. #define MC_CMD_SET_PSU_IN_PARAM_OFST 0
  6567. #define MC_CMD_SET_PSU_IN_PARAM_SUPPLY_VOLTAGE 0x0 /* enum */
  6568. #define MC_CMD_SET_PSU_IN_RAIL_OFST 4
  6569. #define MC_CMD_SET_PSU_IN_RAIL_0V9 0x0 /* enum */
  6570. #define MC_CMD_SET_PSU_IN_RAIL_1V2 0x1 /* enum */
  6571. /* desired value, eg voltage in mV */
  6572. #define MC_CMD_SET_PSU_IN_VALUE_OFST 8
  6573. /* MC_CMD_SET_PSU_OUT msgresponse */
  6574. #define MC_CMD_SET_PSU_OUT_LEN 0
  6575. /***********************************/
  6576. /* MC_CMD_GET_FUNCTION_INFO
  6577. * Get function information. PF and VF number.
  6578. */
  6579. #define MC_CMD_GET_FUNCTION_INFO 0xec
  6580. #define MC_CMD_0xec_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  6581. /* MC_CMD_GET_FUNCTION_INFO_IN msgrequest */
  6582. #define MC_CMD_GET_FUNCTION_INFO_IN_LEN 0
  6583. /* MC_CMD_GET_FUNCTION_INFO_OUT msgresponse */
  6584. #define MC_CMD_GET_FUNCTION_INFO_OUT_LEN 8
  6585. #define MC_CMD_GET_FUNCTION_INFO_OUT_PF_OFST 0
  6586. #define MC_CMD_GET_FUNCTION_INFO_OUT_VF_OFST 4
  6587. /***********************************/
  6588. /* MC_CMD_ENABLE_OFFLINE_BIST
  6589. * Enters offline BIST mode. All queues are torn down, chip enters quiescent
  6590. * mode, calling function gets exclusive MCDI ownership. The only way out is
  6591. * reboot.
  6592. */
  6593. #define MC_CMD_ENABLE_OFFLINE_BIST 0xed
  6594. #define MC_CMD_0xed_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  6595. /* MC_CMD_ENABLE_OFFLINE_BIST_IN msgrequest */
  6596. #define MC_CMD_ENABLE_OFFLINE_BIST_IN_LEN 0
  6597. /* MC_CMD_ENABLE_OFFLINE_BIST_OUT msgresponse */
  6598. #define MC_CMD_ENABLE_OFFLINE_BIST_OUT_LEN 0
  6599. /***********************************/
  6600. /* MC_CMD_UART_SEND_DATA
  6601. * Send checksummed[sic] block of data over the uart. Response is a placeholder
  6602. * should we wish to make this reliable; currently requests are fire-and-
  6603. * forget.
  6604. */
  6605. #define MC_CMD_UART_SEND_DATA 0xee
  6606. #define MC_CMD_0xee_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  6607. /* MC_CMD_UART_SEND_DATA_OUT msgrequest */
  6608. #define MC_CMD_UART_SEND_DATA_OUT_LENMIN 16
  6609. #define MC_CMD_UART_SEND_DATA_OUT_LENMAX 252
  6610. #define MC_CMD_UART_SEND_DATA_OUT_LEN(num) (16+1*(num))
  6611. /* CRC32 over OFFSET, LENGTH, RESERVED, DATA */
  6612. #define MC_CMD_UART_SEND_DATA_OUT_CHECKSUM_OFST 0
  6613. /* Offset at which to write the data */
  6614. #define MC_CMD_UART_SEND_DATA_OUT_OFFSET_OFST 4
  6615. /* Length of data */
  6616. #define MC_CMD_UART_SEND_DATA_OUT_LENGTH_OFST 8
  6617. /* Reserved for future use */
  6618. #define MC_CMD_UART_SEND_DATA_OUT_RESERVED_OFST 12
  6619. #define MC_CMD_UART_SEND_DATA_OUT_DATA_OFST 16
  6620. #define MC_CMD_UART_SEND_DATA_OUT_DATA_LEN 1
  6621. #define MC_CMD_UART_SEND_DATA_OUT_DATA_MINNUM 0
  6622. #define MC_CMD_UART_SEND_DATA_OUT_DATA_MAXNUM 236
  6623. /* MC_CMD_UART_SEND_DATA_IN msgresponse */
  6624. #define MC_CMD_UART_SEND_DATA_IN_LEN 0
  6625. /***********************************/
  6626. /* MC_CMD_UART_RECV_DATA
  6627. * Request checksummed[sic] block of data over the uart. Only a placeholder,
  6628. * subject to change and not currently implemented.
  6629. */
  6630. #define MC_CMD_UART_RECV_DATA 0xef
  6631. #define MC_CMD_0xef_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  6632. /* MC_CMD_UART_RECV_DATA_OUT msgrequest */
  6633. #define MC_CMD_UART_RECV_DATA_OUT_LEN 16
  6634. /* CRC32 over OFFSET, LENGTH, RESERVED */
  6635. #define MC_CMD_UART_RECV_DATA_OUT_CHECKSUM_OFST 0
  6636. /* Offset from which to read the data */
  6637. #define MC_CMD_UART_RECV_DATA_OUT_OFFSET_OFST 4
  6638. /* Length of data */
  6639. #define MC_CMD_UART_RECV_DATA_OUT_LENGTH_OFST 8
  6640. /* Reserved for future use */
  6641. #define MC_CMD_UART_RECV_DATA_OUT_RESERVED_OFST 12
  6642. /* MC_CMD_UART_RECV_DATA_IN msgresponse */
  6643. #define MC_CMD_UART_RECV_DATA_IN_LENMIN 16
  6644. #define MC_CMD_UART_RECV_DATA_IN_LENMAX 252
  6645. #define MC_CMD_UART_RECV_DATA_IN_LEN(num) (16+1*(num))
  6646. /* CRC32 over RESERVED1, RESERVED2, RESERVED3, DATA */
  6647. #define MC_CMD_UART_RECV_DATA_IN_CHECKSUM_OFST 0
  6648. /* Offset at which to write the data */
  6649. #define MC_CMD_UART_RECV_DATA_IN_RESERVED1_OFST 4
  6650. /* Length of data */
  6651. #define MC_CMD_UART_RECV_DATA_IN_RESERVED2_OFST 8
  6652. /* Reserved for future use */
  6653. #define MC_CMD_UART_RECV_DATA_IN_RESERVED3_OFST 12
  6654. #define MC_CMD_UART_RECV_DATA_IN_DATA_OFST 16
  6655. #define MC_CMD_UART_RECV_DATA_IN_DATA_LEN 1
  6656. #define MC_CMD_UART_RECV_DATA_IN_DATA_MINNUM 0
  6657. #define MC_CMD_UART_RECV_DATA_IN_DATA_MAXNUM 236
  6658. /***********************************/
  6659. /* MC_CMD_READ_FUSES
  6660. * Read data programmed into the device One-Time-Programmable (OTP) Fuses
  6661. */
  6662. #define MC_CMD_READ_FUSES 0xf0
  6663. #define MC_CMD_0xf0_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  6664. /* MC_CMD_READ_FUSES_IN msgrequest */
  6665. #define MC_CMD_READ_FUSES_IN_LEN 8
  6666. /* Offset in OTP to read */
  6667. #define MC_CMD_READ_FUSES_IN_OFFSET_OFST 0
  6668. /* Length of data to read in bytes */
  6669. #define MC_CMD_READ_FUSES_IN_LENGTH_OFST 4
  6670. /* MC_CMD_READ_FUSES_OUT msgresponse */
  6671. #define MC_CMD_READ_FUSES_OUT_LENMIN 4
  6672. #define MC_CMD_READ_FUSES_OUT_LENMAX 252
  6673. #define MC_CMD_READ_FUSES_OUT_LEN(num) (4+1*(num))
  6674. /* Length of returned OTP data in bytes */
  6675. #define MC_CMD_READ_FUSES_OUT_LENGTH_OFST 0
  6676. /* Returned data */
  6677. #define MC_CMD_READ_FUSES_OUT_DATA_OFST 4
  6678. #define MC_CMD_READ_FUSES_OUT_DATA_LEN 1
  6679. #define MC_CMD_READ_FUSES_OUT_DATA_MINNUM 0
  6680. #define MC_CMD_READ_FUSES_OUT_DATA_MAXNUM 248
  6681. /***********************************/
  6682. /* MC_CMD_KR_TUNE
  6683. * Get or set KR Serdes RXEQ and TX Driver settings
  6684. */
  6685. #define MC_CMD_KR_TUNE 0xf1
  6686. #define MC_CMD_0xf1_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  6687. /* MC_CMD_KR_TUNE_IN msgrequest */
  6688. #define MC_CMD_KR_TUNE_IN_LENMIN 4
  6689. #define MC_CMD_KR_TUNE_IN_LENMAX 252
  6690. #define MC_CMD_KR_TUNE_IN_LEN(num) (4+4*(num))
  6691. /* Requested operation */
  6692. #define MC_CMD_KR_TUNE_IN_KR_TUNE_OP_OFST 0
  6693. #define MC_CMD_KR_TUNE_IN_KR_TUNE_OP_LEN 1
  6694. /* enum: Get current RXEQ settings */
  6695. #define MC_CMD_KR_TUNE_IN_RXEQ_GET 0x0
  6696. /* enum: Override RXEQ settings */
  6697. #define MC_CMD_KR_TUNE_IN_RXEQ_SET 0x1
  6698. /* enum: Get current TX Driver settings */
  6699. #define MC_CMD_KR_TUNE_IN_TXEQ_GET 0x2
  6700. /* enum: Override TX Driver settings */
  6701. #define MC_CMD_KR_TUNE_IN_TXEQ_SET 0x3
  6702. /* enum: Force KR Serdes reset / recalibration */
  6703. #define MC_CMD_KR_TUNE_IN_RECAL 0x4
  6704. /* enum: Start KR Serdes Eye diagram plot on a given lane. Lane must have valid
  6705. * signal.
  6706. */
  6707. #define MC_CMD_KR_TUNE_IN_START_EYE_PLOT 0x5
  6708. /* enum: Poll KR Serdes Eye diagram plot. Returns one row of BER data. The
  6709. * caller should call this command repeatedly after starting eye plot, until no
  6710. * more data is returned.
  6711. */
  6712. #define MC_CMD_KR_TUNE_IN_POLL_EYE_PLOT 0x6
  6713. /* Align the arguments to 32 bits */
  6714. #define MC_CMD_KR_TUNE_IN_KR_TUNE_RSVD_OFST 1
  6715. #define MC_CMD_KR_TUNE_IN_KR_TUNE_RSVD_LEN 3
  6716. /* Arguments specific to the operation */
  6717. #define MC_CMD_KR_TUNE_IN_KR_TUNE_ARGS_OFST 4
  6718. #define MC_CMD_KR_TUNE_IN_KR_TUNE_ARGS_LEN 4
  6719. #define MC_CMD_KR_TUNE_IN_KR_TUNE_ARGS_MINNUM 0
  6720. #define MC_CMD_KR_TUNE_IN_KR_TUNE_ARGS_MAXNUM 62
  6721. /* MC_CMD_KR_TUNE_OUT msgresponse */
  6722. #define MC_CMD_KR_TUNE_OUT_LEN 0
  6723. /* MC_CMD_KR_TUNE_RXEQ_GET_IN msgrequest */
  6724. #define MC_CMD_KR_TUNE_RXEQ_GET_IN_LEN 4
  6725. /* Requested operation */
  6726. #define MC_CMD_KR_TUNE_RXEQ_GET_IN_KR_TUNE_OP_OFST 0
  6727. #define MC_CMD_KR_TUNE_RXEQ_GET_IN_KR_TUNE_OP_LEN 1
  6728. /* Align the arguments to 32 bits */
  6729. #define MC_CMD_KR_TUNE_RXEQ_GET_IN_KR_TUNE_RSVD_OFST 1
  6730. #define MC_CMD_KR_TUNE_RXEQ_GET_IN_KR_TUNE_RSVD_LEN 3
  6731. /* MC_CMD_KR_TUNE_RXEQ_GET_OUT msgresponse */
  6732. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_LENMIN 4
  6733. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_LENMAX 252
  6734. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_LEN(num) (0+4*(num))
  6735. /* RXEQ Parameter */
  6736. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_OFST 0
  6737. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_LEN 4
  6738. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_MINNUM 1
  6739. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_MAXNUM 63
  6740. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_ID_LBN 0
  6741. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_ID_WIDTH 8
  6742. /* enum: Attenuation (0-15) */
  6743. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_ATT 0x0
  6744. /* enum: CTLE Boost (0-15) */
  6745. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_BOOST 0x1
  6746. /* enum: Edge DFE Tap1 (0 - max negative, 64 - zero, 127 - max positive) */
  6747. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_EDFE_TAP1 0x2
  6748. /* enum: Edge DFE Tap2 (0 - max negative, 32 - zero, 63 - max positive) */
  6749. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_EDFE_TAP2 0x3
  6750. /* enum: Edge DFE Tap3 (0 - max negative, 32 - zero, 63 - max positive) */
  6751. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_EDFE_TAP3 0x4
  6752. /* enum: Edge DFE Tap4 (0 - max negative, 32 - zero, 63 - max positive) */
  6753. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_EDFE_TAP4 0x5
  6754. /* enum: Edge DFE Tap5 (0 - max negative, 32 - zero, 63 - max positive) */
  6755. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_EDFE_TAP5 0x6
  6756. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_LANE_LBN 8
  6757. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_LANE_WIDTH 3
  6758. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_LANE_0 0x0 /* enum */
  6759. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_LANE_1 0x1 /* enum */
  6760. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_LANE_2 0x2 /* enum */
  6761. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_LANE_3 0x3 /* enum */
  6762. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_LANE_ALL 0x4 /* enum */
  6763. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_AUTOCAL_LBN 11
  6764. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_AUTOCAL_WIDTH 1
  6765. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_RESERVED_LBN 12
  6766. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_RESERVED_WIDTH 4
  6767. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_INITIAL_LBN 16
  6768. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_INITIAL_WIDTH 8
  6769. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_CURRENT_LBN 24
  6770. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_CURRENT_WIDTH 8
  6771. /* MC_CMD_KR_TUNE_RXEQ_SET_IN msgrequest */
  6772. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_LENMIN 8
  6773. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_LENMAX 252
  6774. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_LEN(num) (4+4*(num))
  6775. /* Requested operation */
  6776. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_KR_TUNE_OP_OFST 0
  6777. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_KR_TUNE_OP_LEN 1
  6778. /* Align the arguments to 32 bits */
  6779. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_KR_TUNE_RSVD_OFST 1
  6780. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_KR_TUNE_RSVD_LEN 3
  6781. /* RXEQ Parameter */
  6782. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_OFST 4
  6783. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_LEN 4
  6784. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_MINNUM 1
  6785. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_MAXNUM 62
  6786. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_ID_LBN 0
  6787. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_ID_WIDTH 8
  6788. /* Enum values, see field(s): */
  6789. /* MC_CMD_KR_TUNE_RXEQ_GET_OUT/PARAM_ID */
  6790. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_LANE_LBN 8
  6791. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_LANE_WIDTH 3
  6792. /* Enum values, see field(s): */
  6793. /* MC_CMD_KR_TUNE_RXEQ_GET_OUT/PARAM_LANE */
  6794. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_AUTOCAL_LBN 11
  6795. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_AUTOCAL_WIDTH 1
  6796. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_RESERVED_LBN 12
  6797. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_RESERVED_WIDTH 4
  6798. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_INITIAL_LBN 16
  6799. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_INITIAL_WIDTH 8
  6800. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_RESERVED2_LBN 24
  6801. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_RESERVED2_WIDTH 8
  6802. /* MC_CMD_KR_TUNE_RXEQ_SET_OUT msgresponse */
  6803. #define MC_CMD_KR_TUNE_RXEQ_SET_OUT_LEN 0
  6804. /* MC_CMD_KR_TUNE_TXEQ_GET_IN msgrequest */
  6805. #define MC_CMD_KR_TUNE_TXEQ_GET_IN_LEN 4
  6806. /* Requested operation */
  6807. #define MC_CMD_KR_TUNE_TXEQ_GET_IN_KR_TUNE_OP_OFST 0
  6808. #define MC_CMD_KR_TUNE_TXEQ_GET_IN_KR_TUNE_OP_LEN 1
  6809. /* Align the arguments to 32 bits */
  6810. #define MC_CMD_KR_TUNE_TXEQ_GET_IN_KR_TUNE_RSVD_OFST 1
  6811. #define MC_CMD_KR_TUNE_TXEQ_GET_IN_KR_TUNE_RSVD_LEN 3
  6812. /* MC_CMD_KR_TUNE_TXEQ_GET_OUT msgresponse */
  6813. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_LENMIN 4
  6814. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_LENMAX 252
  6815. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_LEN(num) (0+4*(num))
  6816. /* TXEQ Parameter */
  6817. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_OFST 0
  6818. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_LEN 4
  6819. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_MINNUM 1
  6820. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_MAXNUM 63
  6821. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_ID_LBN 0
  6822. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_ID_WIDTH 8
  6823. /* enum: TX Amplitude */
  6824. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_LEV 0x0
  6825. /* enum: De-Emphasis Tap1 Magnitude (0-7) */
  6826. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_MODE 0x1
  6827. /* enum: De-Emphasis Tap1 Fine */
  6828. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_DTLEV 0x2
  6829. /* enum: De-Emphasis Tap2 Magnitude (0-6) */
  6830. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_D2 0x3
  6831. /* enum: De-Emphasis Tap2 Fine */
  6832. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_D2TLEV 0x4
  6833. /* enum: Pre-Emphasis Magnitude */
  6834. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_E 0x5
  6835. /* enum: Pre-Emphasis Fine */
  6836. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_ETLEV 0x6
  6837. /* enum: TX Slew Rate Coarse control */
  6838. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_PREDRV_DLY 0x7
  6839. /* enum: TX Slew Rate Fine control */
  6840. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_SR_SET 0x8
  6841. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_LANE_LBN 8
  6842. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_LANE_WIDTH 3
  6843. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_LANE_0 0x0 /* enum */
  6844. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_LANE_1 0x1 /* enum */
  6845. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_LANE_2 0x2 /* enum */
  6846. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_LANE_3 0x3 /* enum */
  6847. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_LANE_ALL 0x4 /* enum */
  6848. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_RESERVED_LBN 11
  6849. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_RESERVED_WIDTH 5
  6850. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_INITIAL_LBN 16
  6851. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_INITIAL_WIDTH 8
  6852. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_RESERVED2_LBN 24
  6853. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_RESERVED2_WIDTH 8
  6854. /* MC_CMD_KR_TUNE_TXEQ_SET_IN msgrequest */
  6855. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_LENMIN 8
  6856. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_LENMAX 252
  6857. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_LEN(num) (4+4*(num))
  6858. /* Requested operation */
  6859. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_KR_TUNE_OP_OFST 0
  6860. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_KR_TUNE_OP_LEN 1
  6861. /* Align the arguments to 32 bits */
  6862. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_KR_TUNE_RSVD_OFST 1
  6863. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_KR_TUNE_RSVD_LEN 3
  6864. /* TXEQ Parameter */
  6865. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_OFST 4
  6866. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_LEN 4
  6867. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_MINNUM 1
  6868. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_MAXNUM 62
  6869. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_ID_LBN 0
  6870. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_ID_WIDTH 8
  6871. /* Enum values, see field(s): */
  6872. /* MC_CMD_KR_TUNE_TXEQ_GET_OUT/PARAM_ID */
  6873. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_LANE_LBN 8
  6874. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_LANE_WIDTH 3
  6875. /* Enum values, see field(s): */
  6876. /* MC_CMD_KR_TUNE_TXEQ_GET_OUT/PARAM_LANE */
  6877. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_RESERVED_LBN 11
  6878. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_RESERVED_WIDTH 5
  6879. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_INITIAL_LBN 16
  6880. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_INITIAL_WIDTH 8
  6881. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_RESERVED2_LBN 24
  6882. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_RESERVED2_WIDTH 8
  6883. /* MC_CMD_KR_TUNE_TXEQ_SET_OUT msgresponse */
  6884. #define MC_CMD_KR_TUNE_TXEQ_SET_OUT_LEN 0
  6885. /* MC_CMD_KR_TUNE_RECAL_IN msgrequest */
  6886. #define MC_CMD_KR_TUNE_RECAL_IN_LEN 4
  6887. /* Requested operation */
  6888. #define MC_CMD_KR_TUNE_RECAL_IN_KR_TUNE_OP_OFST 0
  6889. #define MC_CMD_KR_TUNE_RECAL_IN_KR_TUNE_OP_LEN 1
  6890. /* Align the arguments to 32 bits */
  6891. #define MC_CMD_KR_TUNE_RECAL_IN_KR_TUNE_RSVD_OFST 1
  6892. #define MC_CMD_KR_TUNE_RECAL_IN_KR_TUNE_RSVD_LEN 3
  6893. /* MC_CMD_KR_TUNE_RECAL_OUT msgresponse */
  6894. #define MC_CMD_KR_TUNE_RECAL_OUT_LEN 0
  6895. /* MC_CMD_KR_TUNE_START_EYE_PLOT_IN msgrequest */
  6896. #define MC_CMD_KR_TUNE_START_EYE_PLOT_IN_LEN 8
  6897. /* Requested operation */
  6898. #define MC_CMD_KR_TUNE_START_EYE_PLOT_IN_KR_TUNE_OP_OFST 0
  6899. #define MC_CMD_KR_TUNE_START_EYE_PLOT_IN_KR_TUNE_OP_LEN 1
  6900. /* Align the arguments to 32 bits */
  6901. #define MC_CMD_KR_TUNE_START_EYE_PLOT_IN_KR_TUNE_RSVD_OFST 1
  6902. #define MC_CMD_KR_TUNE_START_EYE_PLOT_IN_KR_TUNE_RSVD_LEN 3
  6903. #define MC_CMD_KR_TUNE_START_EYE_PLOT_IN_LANE_OFST 4
  6904. /* MC_CMD_KR_TUNE_START_EYE_PLOT_OUT msgresponse */
  6905. #define MC_CMD_KR_TUNE_START_EYE_PLOT_OUT_LEN 0
  6906. /* MC_CMD_KR_TUNE_POLL_EYE_PLOT_IN msgrequest */
  6907. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_IN_LEN 4
  6908. /* Requested operation */
  6909. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_IN_KR_TUNE_OP_OFST 0
  6910. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_IN_KR_TUNE_OP_LEN 1
  6911. /* Align the arguments to 32 bits */
  6912. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_IN_KR_TUNE_RSVD_OFST 1
  6913. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_IN_KR_TUNE_RSVD_LEN 3
  6914. /* MC_CMD_KR_TUNE_POLL_EYE_PLOT_OUT msgresponse */
  6915. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_OUT_LENMIN 0
  6916. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_OUT_LENMAX 252
  6917. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_OUT_LEN(num) (0+2*(num))
  6918. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_OUT_SAMPLES_OFST 0
  6919. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_OUT_SAMPLES_LEN 2
  6920. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_OUT_SAMPLES_MINNUM 0
  6921. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_OUT_SAMPLES_MAXNUM 126
  6922. /***********************************/
  6923. /* MC_CMD_PCIE_TUNE
  6924. * Get or set PCIE Serdes RXEQ and TX Driver settings
  6925. */
  6926. #define MC_CMD_PCIE_TUNE 0xf2
  6927. #define MC_CMD_0xf2_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  6928. /* MC_CMD_PCIE_TUNE_IN msgrequest */
  6929. #define MC_CMD_PCIE_TUNE_IN_LENMIN 4
  6930. #define MC_CMD_PCIE_TUNE_IN_LENMAX 252
  6931. #define MC_CMD_PCIE_TUNE_IN_LEN(num) (4+4*(num))
  6932. /* Requested operation */
  6933. #define MC_CMD_PCIE_TUNE_IN_PCIE_TUNE_OP_OFST 0
  6934. #define MC_CMD_PCIE_TUNE_IN_PCIE_TUNE_OP_LEN 1
  6935. /* enum: Get current RXEQ settings */
  6936. #define MC_CMD_PCIE_TUNE_IN_RXEQ_GET 0x0
  6937. /* enum: Override RXEQ settings */
  6938. #define MC_CMD_PCIE_TUNE_IN_RXEQ_SET 0x1
  6939. /* enum: Get current TX Driver settings */
  6940. #define MC_CMD_PCIE_TUNE_IN_TXEQ_GET 0x2
  6941. /* enum: Override TX Driver settings */
  6942. #define MC_CMD_PCIE_TUNE_IN_TXEQ_SET 0x3
  6943. /* enum: Start PCIe Serdes Eye diagram plot on a given lane. */
  6944. #define MC_CMD_PCIE_TUNE_IN_START_EYE_PLOT 0x5
  6945. /* enum: Poll PCIe Serdes Eye diagram plot. Returns one row of BER data. The
  6946. * caller should call this command repeatedly after starting eye plot, until no
  6947. * more data is returned.
  6948. */
  6949. #define MC_CMD_PCIE_TUNE_IN_POLL_EYE_PLOT 0x6
  6950. /* Align the arguments to 32 bits */
  6951. #define MC_CMD_PCIE_TUNE_IN_PCIE_TUNE_RSVD_OFST 1
  6952. #define MC_CMD_PCIE_TUNE_IN_PCIE_TUNE_RSVD_LEN 3
  6953. /* Arguments specific to the operation */
  6954. #define MC_CMD_PCIE_TUNE_IN_PCIE_TUNE_ARGS_OFST 4
  6955. #define MC_CMD_PCIE_TUNE_IN_PCIE_TUNE_ARGS_LEN 4
  6956. #define MC_CMD_PCIE_TUNE_IN_PCIE_TUNE_ARGS_MINNUM 0
  6957. #define MC_CMD_PCIE_TUNE_IN_PCIE_TUNE_ARGS_MAXNUM 62
  6958. /* MC_CMD_PCIE_TUNE_OUT msgresponse */
  6959. #define MC_CMD_PCIE_TUNE_OUT_LEN 0
  6960. /* MC_CMD_PCIE_TUNE_RXEQ_GET_IN msgrequest */
  6961. #define MC_CMD_PCIE_TUNE_RXEQ_GET_IN_LEN 4
  6962. /* Requested operation */
  6963. #define MC_CMD_PCIE_TUNE_RXEQ_GET_IN_PCIE_TUNE_OP_OFST 0
  6964. #define MC_CMD_PCIE_TUNE_RXEQ_GET_IN_PCIE_TUNE_OP_LEN 1
  6965. /* Align the arguments to 32 bits */
  6966. #define MC_CMD_PCIE_TUNE_RXEQ_GET_IN_PCIE_TUNE_RSVD_OFST 1
  6967. #define MC_CMD_PCIE_TUNE_RXEQ_GET_IN_PCIE_TUNE_RSVD_LEN 3
  6968. /* MC_CMD_PCIE_TUNE_RXEQ_GET_OUT msgresponse */
  6969. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LENMIN 4
  6970. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LENMAX 252
  6971. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LEN(num) (0+4*(num))
  6972. /* RXEQ Parameter */
  6973. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_OFST 0
  6974. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_LEN 4
  6975. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_MINNUM 1
  6976. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_MAXNUM 63
  6977. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_ID_LBN 0
  6978. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_ID_WIDTH 8
  6979. /* enum: Attenuation (0-15) */
  6980. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_ATT 0x0
  6981. /* enum: CTLE Boost (0-15) */
  6982. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_BOOST 0x1
  6983. /* enum: DFE Tap1 (0 - max negative, 64 - zero, 127 - max positive) */
  6984. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_DFE_TAP1 0x2
  6985. /* enum: DFE Tap2 (0 - max negative, 32 - zero, 63 - max positive) */
  6986. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_DFE_TAP2 0x3
  6987. /* enum: DFE Tap3 (0 - max negative, 32 - zero, 63 - max positive) */
  6988. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_DFE_TAP3 0x4
  6989. /* enum: DFE Tap4 (0 - max negative, 32 - zero, 63 - max positive) */
  6990. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_DFE_TAP4 0x5
  6991. /* enum: DFE Tap5 (0 - max negative, 32 - zero, 63 - max positive) */
  6992. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_DFE_TAP5 0x6
  6993. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_LANE_LBN 8
  6994. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_LANE_WIDTH 4
  6995. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_0 0x0 /* enum */
  6996. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_1 0x1 /* enum */
  6997. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_2 0x2 /* enum */
  6998. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_3 0x3 /* enum */
  6999. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_4 0x4 /* enum */
  7000. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_5 0x5 /* enum */
  7001. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_6 0x6 /* enum */
  7002. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_7 0x7 /* enum */
  7003. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_ALL 0x8 /* enum */
  7004. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_RESERVED_LBN 12
  7005. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_RESERVED_WIDTH 12
  7006. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_CURRENT_LBN 24
  7007. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_CURRENT_WIDTH 8
  7008. /* MC_CMD_PCIE_TUNE_TXEQ_GET_IN msgrequest */
  7009. #define MC_CMD_PCIE_TUNE_TXEQ_GET_IN_LEN 4
  7010. /* Requested operation */
  7011. #define MC_CMD_PCIE_TUNE_TXEQ_GET_IN_PCIE_TUNE_OP_OFST 0
  7012. #define MC_CMD_PCIE_TUNE_TXEQ_GET_IN_PCIE_TUNE_OP_LEN 1
  7013. /* Align the arguments to 32 bits */
  7014. #define MC_CMD_PCIE_TUNE_TXEQ_GET_IN_PCIE_TUNE_RSVD_OFST 1
  7015. #define MC_CMD_PCIE_TUNE_TXEQ_GET_IN_PCIE_TUNE_RSVD_LEN 3
  7016. /* MC_CMD_PCIE_TUNE_TXEQ_GET_OUT msgresponse */
  7017. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_LENMIN 4
  7018. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_LENMAX 252
  7019. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_LEN(num) (0+4*(num))
  7020. /* RXEQ Parameter */
  7021. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_OFST 0
  7022. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_LEN 4
  7023. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_MINNUM 1
  7024. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_MAXNUM 63
  7025. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_ID_LBN 0
  7026. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_ID_WIDTH 8
  7027. /* enum: TxMargin (PIPE) */
  7028. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_TXMARGIN 0x0
  7029. /* enum: TxSwing (PIPE) */
  7030. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_TXSWING 0x1
  7031. /* enum: De-emphasis coefficient C(-1) (PIPE) */
  7032. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_CM1 0x2
  7033. /* enum: De-emphasis coefficient C(0) (PIPE) */
  7034. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_C0 0x3
  7035. /* enum: De-emphasis coefficient C(+1) (PIPE) */
  7036. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_CP1 0x4
  7037. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_LANE_LBN 8
  7038. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_LANE_WIDTH 4
  7039. /* Enum values, see field(s): */
  7040. /* MC_CMD_PCIE_TUNE_RXEQ_GET_OUT/PARAM_LANE */
  7041. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_RESERVED_LBN 12
  7042. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_RESERVED_WIDTH 12
  7043. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_CURRENT_LBN 24
  7044. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_CURRENT_WIDTH 8
  7045. /* MC_CMD_PCIE_TUNE_START_EYE_PLOT_IN msgrequest */
  7046. #define MC_CMD_PCIE_TUNE_START_EYE_PLOT_IN_LEN 8
  7047. /* Requested operation */
  7048. #define MC_CMD_PCIE_TUNE_START_EYE_PLOT_IN_PCIE_TUNE_OP_OFST 0
  7049. #define MC_CMD_PCIE_TUNE_START_EYE_PLOT_IN_PCIE_TUNE_OP_LEN 1
  7050. /* Align the arguments to 32 bits */
  7051. #define MC_CMD_PCIE_TUNE_START_EYE_PLOT_IN_PCIE_TUNE_RSVD_OFST 1
  7052. #define MC_CMD_PCIE_TUNE_START_EYE_PLOT_IN_PCIE_TUNE_RSVD_LEN 3
  7053. #define MC_CMD_PCIE_TUNE_START_EYE_PLOT_IN_LANE_OFST 4
  7054. /* MC_CMD_PCIE_TUNE_START_EYE_PLOT_OUT msgresponse */
  7055. #define MC_CMD_PCIE_TUNE_START_EYE_PLOT_OUT_LEN 0
  7056. /* MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_IN msgrequest */
  7057. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_IN_LEN 4
  7058. /* Requested operation */
  7059. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_IN_PCIE_TUNE_OP_OFST 0
  7060. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_IN_PCIE_TUNE_OP_LEN 1
  7061. /* Align the arguments to 32 bits */
  7062. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_IN_PCIE_TUNE_RSVD_OFST 1
  7063. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_IN_PCIE_TUNE_RSVD_LEN 3
  7064. /* MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_OUT msgresponse */
  7065. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_OUT_LENMIN 0
  7066. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_OUT_LENMAX 252
  7067. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_OUT_LEN(num) (0+2*(num))
  7068. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_OUT_SAMPLES_OFST 0
  7069. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_OUT_SAMPLES_LEN 2
  7070. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_OUT_SAMPLES_MINNUM 0
  7071. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_OUT_SAMPLES_MAXNUM 126
  7072. /***********************************/
  7073. /* MC_CMD_LICENSING
  7074. * Operations on the NVRAM_PARTITION_TYPE_LICENSE application license partition
  7075. */
  7076. #define MC_CMD_LICENSING 0xf3
  7077. #define MC_CMD_0xf3_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  7078. /* MC_CMD_LICENSING_IN msgrequest */
  7079. #define MC_CMD_LICENSING_IN_LEN 4
  7080. /* identifies the type of operation requested */
  7081. #define MC_CMD_LICENSING_IN_OP_OFST 0
  7082. /* enum: re-read and apply licenses after a license key partition update; note
  7083. * that this operation returns a zero-length response
  7084. */
  7085. #define MC_CMD_LICENSING_IN_OP_UPDATE_LICENSE 0x0
  7086. /* enum: report counts of installed licenses */
  7087. #define MC_CMD_LICENSING_IN_OP_GET_KEY_STATS 0x1
  7088. /* MC_CMD_LICENSING_OUT msgresponse */
  7089. #define MC_CMD_LICENSING_OUT_LEN 28
  7090. /* count of application keys which are valid */
  7091. #define MC_CMD_LICENSING_OUT_VALID_APP_KEYS_OFST 0
  7092. /* sum of UNVERIFIABLE_APP_KEYS + WRONG_NODE_APP_KEYS (for compatibility with
  7093. * MC_CMD_FC_OP_LICENSE)
  7094. */
  7095. #define MC_CMD_LICENSING_OUT_INVALID_APP_KEYS_OFST 4
  7096. /* count of application keys which are invalid due to being blacklisted */
  7097. #define MC_CMD_LICENSING_OUT_BLACKLISTED_APP_KEYS_OFST 8
  7098. /* count of application keys which are invalid due to being unverifiable */
  7099. #define MC_CMD_LICENSING_OUT_UNVERIFIABLE_APP_KEYS_OFST 12
  7100. /* count of application keys which are invalid due to being for the wrong node
  7101. */
  7102. #define MC_CMD_LICENSING_OUT_WRONG_NODE_APP_KEYS_OFST 16
  7103. /* licensing state (for diagnostics; the exact meaning of the bits in this
  7104. * field are private to the firmware)
  7105. */
  7106. #define MC_CMD_LICENSING_OUT_LICENSING_STATE_OFST 20
  7107. /* licensing subsystem self-test report (for manftest) */
  7108. #define MC_CMD_LICENSING_OUT_LICENSING_SELF_TEST_OFST 24
  7109. /* enum: licensing subsystem self-test failed */
  7110. #define MC_CMD_LICENSING_OUT_SELF_TEST_FAIL 0x0
  7111. /* enum: licensing subsystem self-test passed */
  7112. #define MC_CMD_LICENSING_OUT_SELF_TEST_PASS 0x1
  7113. /***********************************/
  7114. /* MC_CMD_MC2MC_PROXY
  7115. * Execute an arbitrary MCDI command on the slave MC of a dual-core device.
  7116. * This will fail on a single-core system.
  7117. */
  7118. #define MC_CMD_MC2MC_PROXY 0xf4
  7119. #define MC_CMD_0xf4_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  7120. /* MC_CMD_MC2MC_PROXY_IN msgrequest */
  7121. #define MC_CMD_MC2MC_PROXY_IN_LEN 0
  7122. /* MC_CMD_MC2MC_PROXY_OUT msgresponse */
  7123. #define MC_CMD_MC2MC_PROXY_OUT_LEN 0
  7124. /***********************************/
  7125. /* MC_CMD_GET_LICENSED_APP_STATE
  7126. * Query the state of an individual licensed application. (Note that the actual
  7127. * state may be invalidated by the MC_CMD_LICENSING OP_UPDATE_LICENSE operation
  7128. * or a reboot of the MC.)
  7129. */
  7130. #define MC_CMD_GET_LICENSED_APP_STATE 0xf5
  7131. #define MC_CMD_0xf5_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  7132. /* MC_CMD_GET_LICENSED_APP_STATE_IN msgrequest */
  7133. #define MC_CMD_GET_LICENSED_APP_STATE_IN_LEN 4
  7134. /* application ID to query (LICENSED_APP_ID_xxx) */
  7135. #define MC_CMD_GET_LICENSED_APP_STATE_IN_APP_ID_OFST 0
  7136. /* MC_CMD_GET_LICENSED_APP_STATE_OUT msgresponse */
  7137. #define MC_CMD_GET_LICENSED_APP_STATE_OUT_LEN 4
  7138. /* state of this application */
  7139. #define MC_CMD_GET_LICENSED_APP_STATE_OUT_STATE_OFST 0
  7140. /* enum: no (or invalid) license is present for the application */
  7141. #define MC_CMD_GET_LICENSED_APP_STATE_OUT_NOT_LICENSED 0x0
  7142. /* enum: a valid license is present for the application */
  7143. #define MC_CMD_GET_LICENSED_APP_STATE_OUT_LICENSED 0x1
  7144. /***********************************/
  7145. /* MC_CMD_LICENSED_APP_OP
  7146. * Perform an action for an individual licensed application.
  7147. */
  7148. #define MC_CMD_LICENSED_APP_OP 0xf6
  7149. #define MC_CMD_0xf6_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  7150. /* MC_CMD_LICENSED_APP_OP_IN msgrequest */
  7151. #define MC_CMD_LICENSED_APP_OP_IN_LENMIN 8
  7152. #define MC_CMD_LICENSED_APP_OP_IN_LENMAX 252
  7153. #define MC_CMD_LICENSED_APP_OP_IN_LEN(num) (8+4*(num))
  7154. /* application ID */
  7155. #define MC_CMD_LICENSED_APP_OP_IN_APP_ID_OFST 0
  7156. /* the type of operation requested */
  7157. #define MC_CMD_LICENSED_APP_OP_IN_OP_OFST 4
  7158. /* enum: validate application */
  7159. #define MC_CMD_LICENSED_APP_OP_IN_OP_VALIDATE 0x0
  7160. /* arguments specific to this particular operation */
  7161. #define MC_CMD_LICENSED_APP_OP_IN_ARGS_OFST 8
  7162. #define MC_CMD_LICENSED_APP_OP_IN_ARGS_LEN 4
  7163. #define MC_CMD_LICENSED_APP_OP_IN_ARGS_MINNUM 0
  7164. #define MC_CMD_LICENSED_APP_OP_IN_ARGS_MAXNUM 61
  7165. /* MC_CMD_LICENSED_APP_OP_OUT msgresponse */
  7166. #define MC_CMD_LICENSED_APP_OP_OUT_LENMIN 0
  7167. #define MC_CMD_LICENSED_APP_OP_OUT_LENMAX 252
  7168. #define MC_CMD_LICENSED_APP_OP_OUT_LEN(num) (0+4*(num))
  7169. /* result specific to this particular operation */
  7170. #define MC_CMD_LICENSED_APP_OP_OUT_RESULT_OFST 0
  7171. #define MC_CMD_LICENSED_APP_OP_OUT_RESULT_LEN 4
  7172. #define MC_CMD_LICENSED_APP_OP_OUT_RESULT_MINNUM 0
  7173. #define MC_CMD_LICENSED_APP_OP_OUT_RESULT_MAXNUM 63
  7174. /* MC_CMD_LICENSED_APP_OP_VALIDATE_IN msgrequest */
  7175. #define MC_CMD_LICENSED_APP_OP_VALIDATE_IN_LEN 72
  7176. /* application ID */
  7177. #define MC_CMD_LICENSED_APP_OP_VALIDATE_IN_APP_ID_OFST 0
  7178. /* the type of operation requested */
  7179. #define MC_CMD_LICENSED_APP_OP_VALIDATE_IN_OP_OFST 4
  7180. /* validation challenge */
  7181. #define MC_CMD_LICENSED_APP_OP_VALIDATE_IN_CHALLENGE_OFST 8
  7182. #define MC_CMD_LICENSED_APP_OP_VALIDATE_IN_CHALLENGE_LEN 64
  7183. /* MC_CMD_LICENSED_APP_OP_VALIDATE_OUT msgresponse */
  7184. #define MC_CMD_LICENSED_APP_OP_VALIDATE_OUT_LEN 68
  7185. /* feature expiry (time_t) */
  7186. #define MC_CMD_LICENSED_APP_OP_VALIDATE_OUT_EXPIRY_OFST 0
  7187. /* validation response */
  7188. #define MC_CMD_LICENSED_APP_OP_VALIDATE_OUT_RESPONSE_OFST 4
  7189. #define MC_CMD_LICENSED_APP_OP_VALIDATE_OUT_RESPONSE_LEN 64
  7190. /***********************************/
  7191. /* MC_CMD_SET_PORT_SNIFF_CONFIG
  7192. * Configure port sniffing for the physical port associated with the calling
  7193. * function. Only a privileged function may change the port sniffing
  7194. * configuration. A copy of all traffic delivered to the host (non-promiscuous
  7195. * mode) or all traffic arriving at the port (promiscuous mode) may be
  7196. * delivered to a specific queue, or a set of queues with RSS.
  7197. */
  7198. #define MC_CMD_SET_PORT_SNIFF_CONFIG 0xf7
  7199. #define MC_CMD_0xf7_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  7200. /* MC_CMD_SET_PORT_SNIFF_CONFIG_IN msgrequest */
  7201. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_LEN 16
  7202. /* configuration flags */
  7203. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_FLAGS_OFST 0
  7204. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_ENABLE_LBN 0
  7205. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_ENABLE_WIDTH 1
  7206. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_PROMISCUOUS_LBN 1
  7207. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_PROMISCUOUS_WIDTH 1
  7208. /* receive queue handle (for RSS mode, this is the base queue) */
  7209. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_RX_QUEUE_OFST 4
  7210. /* receive mode */
  7211. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_RX_MODE_OFST 8
  7212. /* enum: receive to just the specified queue */
  7213. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_RX_MODE_SIMPLE 0x0
  7214. /* enum: receive to multiple queues using RSS context */
  7215. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_RX_MODE_RSS 0x1
  7216. /* RSS context (for RX_MODE_RSS) as returned by MC_CMD_RSS_CONTEXT_ALLOC. Note
  7217. * that these handles should be considered opaque to the host, although a value
  7218. * of 0xFFFFFFFF is guaranteed never to be a valid handle.
  7219. */
  7220. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_RX_CONTEXT_OFST 12
  7221. /* MC_CMD_SET_PORT_SNIFF_CONFIG_OUT msgresponse */
  7222. #define MC_CMD_SET_PORT_SNIFF_CONFIG_OUT_LEN 0
  7223. /***********************************/
  7224. /* MC_CMD_GET_PORT_SNIFF_CONFIG
  7225. * Obtain the current port sniffing configuration for the physical port
  7226. * associated with the calling function. Only a privileged function may read
  7227. * the configuration.
  7228. */
  7229. #define MC_CMD_GET_PORT_SNIFF_CONFIG 0xf8
  7230. #define MC_CMD_0xf8_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  7231. /* MC_CMD_GET_PORT_SNIFF_CONFIG_IN msgrequest */
  7232. #define MC_CMD_GET_PORT_SNIFF_CONFIG_IN_LEN 0
  7233. /* MC_CMD_GET_PORT_SNIFF_CONFIG_OUT msgresponse */
  7234. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_LEN 16
  7235. /* configuration flags */
  7236. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_FLAGS_OFST 0
  7237. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_ENABLE_LBN 0
  7238. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_ENABLE_WIDTH 1
  7239. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_PROMISCUOUS_LBN 1
  7240. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_PROMISCUOUS_WIDTH 1
  7241. /* receiving queue handle (for RSS mode, this is the base queue) */
  7242. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_RX_QUEUE_OFST 4
  7243. /* receive mode */
  7244. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_RX_MODE_OFST 8
  7245. /* enum: receiving to just the specified queue */
  7246. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_RX_MODE_SIMPLE 0x0
  7247. /* enum: receiving to multiple queues using RSS context */
  7248. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_RX_MODE_RSS 0x1
  7249. /* RSS context (for RX_MODE_RSS) */
  7250. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_RX_CONTEXT_OFST 12
  7251. #endif /* MCDI_PCOL_H */