mcdi_pcol.h 679 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /****************************************************************************
  3. * Driver for Solarflare network controllers and boards
  4. * Copyright 2009-2013 Solarflare Communications Inc.
  5. */
  6. #ifndef MCDI_PCOL_H
  7. #define MCDI_PCOL_H
  8. /* Values to be written into FMCR_CZ_RESET_STATE_REG to control boot. */
  9. /* Power-on reset state */
  10. #define MC_FW_STATE_POR (1)
  11. /* If this is set in MC_RESET_STATE_REG then it should be
  12. * possible to jump into IMEM without loading code from flash. */
  13. #define MC_FW_WARM_BOOT_OK (2)
  14. /* The MC main image has started to boot. */
  15. #define MC_FW_STATE_BOOTING (4)
  16. /* The Scheduler has started. */
  17. #define MC_FW_STATE_SCHED (8)
  18. /* If this is set in MC_RESET_STATE_REG then it should be
  19. * possible to jump into IMEM without loading code from flash.
  20. * Unlike a warm boot, assume DMEM has been reloaded, so that
  21. * the MC persistent data must be reinitialised. */
  22. #define MC_FW_TEPID_BOOT_OK (16)
  23. /* We have entered the main firmware via recovery mode. This
  24. * means that MC persistent data must be reinitialised, but that
  25. * we shouldn't touch PCIe config. */
  26. #define MC_FW_RECOVERY_MODE_PCIE_INIT_OK (32)
  27. /* BIST state has been initialized */
  28. #define MC_FW_BIST_INIT_OK (128)
  29. /* Siena MC shared memmory offsets */
  30. /* The 'doorbell' addresses are hard-wired to alert the MC when written */
  31. #define MC_SMEM_P0_DOORBELL_OFST 0x000
  32. #define MC_SMEM_P1_DOORBELL_OFST 0x004
  33. /* The rest of these are firmware-defined */
  34. #define MC_SMEM_P0_PDU_OFST 0x008
  35. #define MC_SMEM_P1_PDU_OFST 0x108
  36. #define MC_SMEM_PDU_LEN 0x100
  37. #define MC_SMEM_P0_PTP_TIME_OFST 0x7f0
  38. #define MC_SMEM_P0_STATUS_OFST 0x7f8
  39. #define MC_SMEM_P1_STATUS_OFST 0x7fc
  40. /* Values to be written to the per-port status dword in shared
  41. * memory on reboot and assert */
  42. #define MC_STATUS_DWORD_REBOOT (0xb007b007)
  43. #define MC_STATUS_DWORD_ASSERT (0xdeaddead)
  44. /* Check whether an mcfw version (in host order) belongs to a bootloader */
  45. #define MC_FW_VERSION_IS_BOOTLOADER(_v) (((_v) >> 16) == 0xb007)
  46. /* The current version of the MCDI protocol.
  47. *
  48. * Note that the ROM burnt into the card only talks V0, so at the very
  49. * least every driver must support version 0 and MCDI_PCOL_VERSION
  50. */
  51. #define MCDI_PCOL_VERSION 2
  52. /* Unused commands: 0x23, 0x27, 0x30, 0x31 */
  53. /* MCDI version 1
  54. *
  55. * Each MCDI request starts with an MCDI_HEADER, which is a 32bit
  56. * structure, filled in by the client.
  57. *
  58. * 0 7 8 16 20 22 23 24 31
  59. * | CODE | R | LEN | SEQ | Rsvd | E | R | XFLAGS |
  60. * | | |
  61. * | | \--- Response
  62. * | \------- Error
  63. * \------------------------------ Resync (always set)
  64. *
  65. * The client writes it's request into MC shared memory, and rings the
  66. * doorbell. Each request is completed by either by the MC writting
  67. * back into shared memory, or by writting out an event.
  68. *
  69. * All MCDI commands support completion by shared memory response. Each
  70. * request may also contain additional data (accounted for by HEADER.LEN),
  71. * and some response's may also contain additional data (again, accounted
  72. * for by HEADER.LEN).
  73. *
  74. * Some MCDI commands support completion by event, in which any associated
  75. * response data is included in the event.
  76. *
  77. * The protocol requires one response to be delivered for every request, a
  78. * request should not be sent unless the response for the previous request
  79. * has been received (either by polling shared memory, or by receiving
  80. * an event).
  81. */
  82. /** Request/Response structure */
  83. #define MCDI_HEADER_OFST 0
  84. #define MCDI_HEADER_CODE_LBN 0
  85. #define MCDI_HEADER_CODE_WIDTH 7
  86. #define MCDI_HEADER_RESYNC_LBN 7
  87. #define MCDI_HEADER_RESYNC_WIDTH 1
  88. #define MCDI_HEADER_DATALEN_LBN 8
  89. #define MCDI_HEADER_DATALEN_WIDTH 8
  90. #define MCDI_HEADER_SEQ_LBN 16
  91. #define MCDI_HEADER_SEQ_WIDTH 4
  92. #define MCDI_HEADER_RSVD_LBN 20
  93. #define MCDI_HEADER_RSVD_WIDTH 1
  94. #define MCDI_HEADER_NOT_EPOCH_LBN 21
  95. #define MCDI_HEADER_NOT_EPOCH_WIDTH 1
  96. #define MCDI_HEADER_ERROR_LBN 22
  97. #define MCDI_HEADER_ERROR_WIDTH 1
  98. #define MCDI_HEADER_RESPONSE_LBN 23
  99. #define MCDI_HEADER_RESPONSE_WIDTH 1
  100. #define MCDI_HEADER_XFLAGS_LBN 24
  101. #define MCDI_HEADER_XFLAGS_WIDTH 8
  102. /* Request response using event */
  103. #define MCDI_HEADER_XFLAGS_EVREQ 0x01
  104. /* Request (and signal) early doorbell return */
  105. #define MCDI_HEADER_XFLAGS_DBRET 0x02
  106. /* Maximum number of payload bytes */
  107. #define MCDI_CTL_SDU_LEN_MAX_V1 0xfc
  108. #define MCDI_CTL_SDU_LEN_MAX_V2 0x400
  109. #define MCDI_CTL_SDU_LEN_MAX MCDI_CTL_SDU_LEN_MAX_V2
  110. /* The MC can generate events for two reasons:
  111. * - To advance a shared memory request if XFLAGS_EVREQ was set
  112. * - As a notification (link state, i2c event), controlled
  113. * via MC_CMD_LOG_CTRL
  114. *
  115. * Both events share a common structure:
  116. *
  117. * 0 32 33 36 44 52 60
  118. * | Data | Cont | Level | Src | Code | Rsvd |
  119. * |
  120. * \ There is another event pending in this notification
  121. *
  122. * If Code==CMDDONE, then the fields are further interpreted as:
  123. *
  124. * - LEVEL==INFO Command succeeded
  125. * - LEVEL==ERR Command failed
  126. *
  127. * 0 8 16 24 32
  128. * | Seq | Datalen | Errno | Rsvd |
  129. *
  130. * These fields are taken directly out of the standard MCDI header, i.e.,
  131. * LEVEL==ERR, Datalen == 0 => Reboot
  132. *
  133. * Events can be squirted out of the UART (using LOG_CTRL) without a
  134. * MCDI header. An event can be distinguished from a MCDI response by
  135. * examining the first byte which is 0xc0. This corresponds to the
  136. * non-existent MCDI command MC_CMD_DEBUG_LOG.
  137. *
  138. * 0 7 8
  139. * | command | Resync | = 0xc0
  140. *
  141. * Since the event is written in big-endian byte order, this works
  142. * providing bits 56-63 of the event are 0xc0.
  143. *
  144. * 56 60 63
  145. * | Rsvd | Code | = 0xc0
  146. *
  147. * Which means for convenience the event code is 0xc for all MC
  148. * generated events.
  149. */
  150. #define FSE_AZ_EV_CODE_MCDI_EVRESPONSE 0xc
  151. /* Operation not permitted. */
  152. #define MC_CMD_ERR_EPERM 1
  153. /* Non-existent command target */
  154. #define MC_CMD_ERR_ENOENT 2
  155. /* assert() has killed the MC */
  156. #define MC_CMD_ERR_EINTR 4
  157. /* I/O failure */
  158. #define MC_CMD_ERR_EIO 5
  159. /* Already exists */
  160. #define MC_CMD_ERR_EEXIST 6
  161. /* Try again */
  162. #define MC_CMD_ERR_EAGAIN 11
  163. /* Out of memory */
  164. #define MC_CMD_ERR_ENOMEM 12
  165. /* Caller does not hold required locks */
  166. #define MC_CMD_ERR_EACCES 13
  167. /* Resource is currently unavailable (e.g. lock contention) */
  168. #define MC_CMD_ERR_EBUSY 16
  169. /* No such device */
  170. #define MC_CMD_ERR_ENODEV 19
  171. /* Invalid argument to target */
  172. #define MC_CMD_ERR_EINVAL 22
  173. /* Broken pipe */
  174. #define MC_CMD_ERR_EPIPE 32
  175. /* Read-only */
  176. #define MC_CMD_ERR_EROFS 30
  177. /* Out of range */
  178. #define MC_CMD_ERR_ERANGE 34
  179. /* Non-recursive resource is already acquired */
  180. #define MC_CMD_ERR_EDEADLK 35
  181. /* Operation not implemented */
  182. #define MC_CMD_ERR_ENOSYS 38
  183. /* Operation timed out */
  184. #define MC_CMD_ERR_ETIME 62
  185. /* Link has been severed */
  186. #define MC_CMD_ERR_ENOLINK 67
  187. /* Protocol error */
  188. #define MC_CMD_ERR_EPROTO 71
  189. /* Operation not supported */
  190. #define MC_CMD_ERR_ENOTSUP 95
  191. /* Address not available */
  192. #define MC_CMD_ERR_EADDRNOTAVAIL 99
  193. /* Not connected */
  194. #define MC_CMD_ERR_ENOTCONN 107
  195. /* Operation already in progress */
  196. #define MC_CMD_ERR_EALREADY 114
  197. /* Resource allocation failed. */
  198. #define MC_CMD_ERR_ALLOC_FAIL 0x1000
  199. /* V-adaptor not found. */
  200. #define MC_CMD_ERR_NO_VADAPTOR 0x1001
  201. /* EVB port not found. */
  202. #define MC_CMD_ERR_NO_EVB_PORT 0x1002
  203. /* V-switch not found. */
  204. #define MC_CMD_ERR_NO_VSWITCH 0x1003
  205. /* Too many VLAN tags. */
  206. #define MC_CMD_ERR_VLAN_LIMIT 0x1004
  207. /* Bad PCI function number. */
  208. #define MC_CMD_ERR_BAD_PCI_FUNC 0x1005
  209. /* Invalid VLAN mode. */
  210. #define MC_CMD_ERR_BAD_VLAN_MODE 0x1006
  211. /* Invalid v-switch type. */
  212. #define MC_CMD_ERR_BAD_VSWITCH_TYPE 0x1007
  213. /* Invalid v-port type. */
  214. #define MC_CMD_ERR_BAD_VPORT_TYPE 0x1008
  215. /* MAC address exists. */
  216. #define MC_CMD_ERR_MAC_EXIST 0x1009
  217. /* Slave core not present */
  218. #define MC_CMD_ERR_SLAVE_NOT_PRESENT 0x100a
  219. /* The datapath is disabled. */
  220. #define MC_CMD_ERR_DATAPATH_DISABLED 0x100b
  221. /* The requesting client is not a function */
  222. #define MC_CMD_ERR_CLIENT_NOT_FN 0x100c
  223. /* The requested operation might require the
  224. command to be passed between MCs, and the
  225. transport doesn't support that. Should
  226. only ever been seen over the UART. */
  227. #define MC_CMD_ERR_TRANSPORT_NOPROXY 0x100d
  228. /* VLAN tag(s) exists */
  229. #define MC_CMD_ERR_VLAN_EXIST 0x100e
  230. /* No MAC address assigned to an EVB port */
  231. #define MC_CMD_ERR_NO_MAC_ADDR 0x100f
  232. /* Notifies the driver that the request has been relayed
  233. * to an admin function for authorization. The driver should
  234. * wait for a PROXY_RESPONSE event and then resend its request.
  235. * This error code is followed by a 32-bit handle that
  236. * helps matching it with the respective PROXY_RESPONSE event. */
  237. #define MC_CMD_ERR_PROXY_PENDING 0x1010
  238. #define MC_CMD_ERR_PROXY_PENDING_HANDLE_OFST 4
  239. /* The request cannot be passed for authorization because
  240. * another request from the same function is currently being
  241. * authorized. The drvier should try again later. */
  242. #define MC_CMD_ERR_PROXY_INPROGRESS 0x1011
  243. /* Returned by MC_CMD_PROXY_COMPLETE if the caller is not the function
  244. * that has enabled proxying or BLOCK_INDEX points to a function that
  245. * doesn't await an authorization. */
  246. #define MC_CMD_ERR_PROXY_UNEXPECTED 0x1012
  247. /* This code is currently only used internally in FW. Its meaning is that
  248. * an operation failed due to lack of SR-IOV privilege.
  249. * Normally it is translated to EPERM by send_cmd_err(),
  250. * but it may also be used to trigger some special mechanism
  251. * for handling such case, e.g. to relay the failed request
  252. * to a designated admin function for authorization. */
  253. #define MC_CMD_ERR_NO_PRIVILEGE 0x1013
  254. /* Workaround 26807 could not be turned on/off because some functions
  255. * have already installed filters. See the comment at
  256. * MC_CMD_WORKAROUND_BUG26807.
  257. * May also returned for other operations such as sub-variant switching. */
  258. #define MC_CMD_ERR_FILTERS_PRESENT 0x1014
  259. /* The clock whose frequency you've attempted to set set
  260. * doesn't exist on this NIC */
  261. #define MC_CMD_ERR_NO_CLOCK 0x1015
  262. /* Returned by MC_CMD_TESTASSERT if the action that should
  263. * have caused an assertion failed to do so. */
  264. #define MC_CMD_ERR_UNREACHABLE 0x1016
  265. /* This command needs to be processed in the background but there were no
  266. * resources to do so. Send it again after a command has completed. */
  267. #define MC_CMD_ERR_QUEUE_FULL 0x1017
  268. /* The operation could not be completed because the PCIe link has gone
  269. * away. This error code is never expected to be returned over the TLP
  270. * transport. */
  271. #define MC_CMD_ERR_NO_PCIE 0x1018
  272. /* The operation could not be completed because the datapath has gone
  273. * away. This is distinct from MC_CMD_ERR_DATAPATH_DISABLED in that the
  274. * datapath absence may be temporary*/
  275. #define MC_CMD_ERR_NO_DATAPATH 0x1019
  276. /* The operation could not complete because some VIs are allocated */
  277. #define MC_CMD_ERR_VIS_PRESENT 0x101a
  278. /* The operation could not complete because some PIO buffers are allocated */
  279. #define MC_CMD_ERR_PIOBUFS_PRESENT 0x101b
  280. #define MC_CMD_ERR_CODE_OFST 0
  281. /* We define 8 "escape" commands to allow
  282. for command number space extension */
  283. #define MC_CMD_CMD_SPACE_ESCAPE_0 0x78
  284. #define MC_CMD_CMD_SPACE_ESCAPE_1 0x79
  285. #define MC_CMD_CMD_SPACE_ESCAPE_2 0x7A
  286. #define MC_CMD_CMD_SPACE_ESCAPE_3 0x7B
  287. #define MC_CMD_CMD_SPACE_ESCAPE_4 0x7C
  288. #define MC_CMD_CMD_SPACE_ESCAPE_5 0x7D
  289. #define MC_CMD_CMD_SPACE_ESCAPE_6 0x7E
  290. #define MC_CMD_CMD_SPACE_ESCAPE_7 0x7F
  291. /* Vectors in the boot ROM */
  292. /* Point to the copycode entry point. */
  293. #define SIENA_MC_BOOTROM_COPYCODE_VEC (0x800 - 3 * 0x4)
  294. #define HUNT_MC_BOOTROM_COPYCODE_VEC (0x8000 - 3 * 0x4)
  295. #define MEDFORD_MC_BOOTROM_COPYCODE_VEC (0x10000 - 3 * 0x4)
  296. /* Points to the recovery mode entry point. Misnamed but kept for compatibility. */
  297. #define SIENA_MC_BOOTROM_NOFLASH_VEC (0x800 - 2 * 0x4)
  298. #define HUNT_MC_BOOTROM_NOFLASH_VEC (0x8000 - 2 * 0x4)
  299. #define MEDFORD_MC_BOOTROM_NOFLASH_VEC (0x10000 - 2 * 0x4)
  300. /* Points to the recovery mode entry point. Same as above, but the right name. */
  301. #define SIENA_MC_BOOTROM_RECOVERY_VEC (0x800 - 2 * 0x4)
  302. #define HUNT_MC_BOOTROM_RECOVERY_VEC (0x8000 - 2 * 0x4)
  303. #define MEDFORD_MC_BOOTROM_RECOVERY_VEC (0x10000 - 2 * 0x4)
  304. /* Points to noflash mode entry point. */
  305. #define MEDFORD_MC_BOOTROM_REAL_NOFLASH_VEC (0x10000 - 4 * 0x4)
  306. /* The command set exported by the boot ROM (MCDI v0) */
  307. #define MC_CMD_GET_VERSION_V0_SUPPORTED_FUNCS { \
  308. (1 << MC_CMD_READ32) | \
  309. (1 << MC_CMD_WRITE32) | \
  310. (1 << MC_CMD_COPYCODE) | \
  311. (1 << MC_CMD_GET_VERSION), \
  312. 0, 0, 0 }
  313. #define MC_CMD_SENSOR_INFO_OUT_OFFSET_OFST(_x) \
  314. (MC_CMD_SENSOR_ENTRY_OFST + (_x))
  315. #define MC_CMD_DBI_WRITE_IN_ADDRESS_OFST(n) \
  316. (MC_CMD_DBI_WRITE_IN_DBIWROP_OFST + \
  317. MC_CMD_DBIWROP_TYPEDEF_ADDRESS_OFST + \
  318. (n) * MC_CMD_DBIWROP_TYPEDEF_LEN)
  319. #define MC_CMD_DBI_WRITE_IN_BYTE_MASK_OFST(n) \
  320. (MC_CMD_DBI_WRITE_IN_DBIWROP_OFST + \
  321. MC_CMD_DBIWROP_TYPEDEF_BYTE_MASK_OFST + \
  322. (n) * MC_CMD_DBIWROP_TYPEDEF_LEN)
  323. #define MC_CMD_DBI_WRITE_IN_VALUE_OFST(n) \
  324. (MC_CMD_DBI_WRITE_IN_DBIWROP_OFST + \
  325. MC_CMD_DBIWROP_TYPEDEF_VALUE_OFST + \
  326. (n) * MC_CMD_DBIWROP_TYPEDEF_LEN)
  327. /* This may be ORed with an EVB_PORT_ID_xxx constant to pass a non-default
  328. * stack ID (which must be in the range 1-255) along with an EVB port ID.
  329. */
  330. #define EVB_STACK_ID(n) (((n) & 0xff) << 16)
  331. /* Version 2 adds an optional argument to error returns: the errno value
  332. * may be followed by the (0-based) number of the first argument that
  333. * could not be processed.
  334. */
  335. #define MC_CMD_ERR_ARG_OFST 4
  336. /* No space */
  337. #define MC_CMD_ERR_ENOSPC 28
  338. /* MCDI_EVENT structuredef */
  339. #define MCDI_EVENT_LEN 8
  340. #define MCDI_EVENT_CONT_LBN 32
  341. #define MCDI_EVENT_CONT_WIDTH 1
  342. #define MCDI_EVENT_LEVEL_LBN 33
  343. #define MCDI_EVENT_LEVEL_WIDTH 3
  344. /* enum: Info. */
  345. #define MCDI_EVENT_LEVEL_INFO 0x0
  346. /* enum: Warning. */
  347. #define MCDI_EVENT_LEVEL_WARN 0x1
  348. /* enum: Error. */
  349. #define MCDI_EVENT_LEVEL_ERR 0x2
  350. /* enum: Fatal. */
  351. #define MCDI_EVENT_LEVEL_FATAL 0x3
  352. #define MCDI_EVENT_DATA_OFST 0
  353. #define MCDI_EVENT_DATA_LEN 4
  354. #define MCDI_EVENT_CMDDONE_SEQ_LBN 0
  355. #define MCDI_EVENT_CMDDONE_SEQ_WIDTH 8
  356. #define MCDI_EVENT_CMDDONE_DATALEN_LBN 8
  357. #define MCDI_EVENT_CMDDONE_DATALEN_WIDTH 8
  358. #define MCDI_EVENT_CMDDONE_ERRNO_LBN 16
  359. #define MCDI_EVENT_CMDDONE_ERRNO_WIDTH 8
  360. #define MCDI_EVENT_LINKCHANGE_LP_CAP_LBN 0
  361. #define MCDI_EVENT_LINKCHANGE_LP_CAP_WIDTH 16
  362. #define MCDI_EVENT_LINKCHANGE_SPEED_LBN 16
  363. #define MCDI_EVENT_LINKCHANGE_SPEED_WIDTH 4
  364. /* enum: Link is down or link speed could not be determined */
  365. #define MCDI_EVENT_LINKCHANGE_SPEED_UNKNOWN 0x0
  366. /* enum: 100Mbs */
  367. #define MCDI_EVENT_LINKCHANGE_SPEED_100M 0x1
  368. /* enum: 1Gbs */
  369. #define MCDI_EVENT_LINKCHANGE_SPEED_1G 0x2
  370. /* enum: 10Gbs */
  371. #define MCDI_EVENT_LINKCHANGE_SPEED_10G 0x3
  372. /* enum: 40Gbs */
  373. #define MCDI_EVENT_LINKCHANGE_SPEED_40G 0x4
  374. /* enum: 25Gbs */
  375. #define MCDI_EVENT_LINKCHANGE_SPEED_25G 0x5
  376. /* enum: 50Gbs */
  377. #define MCDI_EVENT_LINKCHANGE_SPEED_50G 0x6
  378. /* enum: 100Gbs */
  379. #define MCDI_EVENT_LINKCHANGE_SPEED_100G 0x7
  380. #define MCDI_EVENT_LINKCHANGE_FCNTL_LBN 20
  381. #define MCDI_EVENT_LINKCHANGE_FCNTL_WIDTH 4
  382. #define MCDI_EVENT_LINKCHANGE_LINK_FLAGS_LBN 24
  383. #define MCDI_EVENT_LINKCHANGE_LINK_FLAGS_WIDTH 8
  384. #define MCDI_EVENT_SENSOREVT_MONITOR_LBN 0
  385. #define MCDI_EVENT_SENSOREVT_MONITOR_WIDTH 8
  386. #define MCDI_EVENT_SENSOREVT_STATE_LBN 8
  387. #define MCDI_EVENT_SENSOREVT_STATE_WIDTH 8
  388. #define MCDI_EVENT_SENSOREVT_VALUE_LBN 16
  389. #define MCDI_EVENT_SENSOREVT_VALUE_WIDTH 16
  390. #define MCDI_EVENT_FWALERT_DATA_LBN 8
  391. #define MCDI_EVENT_FWALERT_DATA_WIDTH 24
  392. #define MCDI_EVENT_FWALERT_REASON_LBN 0
  393. #define MCDI_EVENT_FWALERT_REASON_WIDTH 8
  394. /* enum: SRAM Access. */
  395. #define MCDI_EVENT_FWALERT_REASON_SRAM_ACCESS 0x1
  396. #define MCDI_EVENT_FLR_VF_LBN 0
  397. #define MCDI_EVENT_FLR_VF_WIDTH 8
  398. #define MCDI_EVENT_TX_ERR_TXQ_LBN 0
  399. #define MCDI_EVENT_TX_ERR_TXQ_WIDTH 12
  400. #define MCDI_EVENT_TX_ERR_TYPE_LBN 12
  401. #define MCDI_EVENT_TX_ERR_TYPE_WIDTH 4
  402. /* enum: Descriptor loader reported failure */
  403. #define MCDI_EVENT_TX_ERR_DL_FAIL 0x1
  404. /* enum: Descriptor ring empty and no EOP seen for packet */
  405. #define MCDI_EVENT_TX_ERR_NO_EOP 0x2
  406. /* enum: Overlength packet */
  407. #define MCDI_EVENT_TX_ERR_2BIG 0x3
  408. /* enum: Malformed option descriptor */
  409. #define MCDI_EVENT_TX_BAD_OPTDESC 0x5
  410. /* enum: Option descriptor part way through a packet */
  411. #define MCDI_EVENT_TX_OPT_IN_PKT 0x8
  412. /* enum: DMA or PIO data access error */
  413. #define MCDI_EVENT_TX_ERR_BAD_DMA_OR_PIO 0x9
  414. #define MCDI_EVENT_TX_ERR_INFO_LBN 16
  415. #define MCDI_EVENT_TX_ERR_INFO_WIDTH 16
  416. #define MCDI_EVENT_TX_FLUSH_TO_DRIVER_LBN 12
  417. #define MCDI_EVENT_TX_FLUSH_TO_DRIVER_WIDTH 1
  418. #define MCDI_EVENT_TX_FLUSH_TXQ_LBN 0
  419. #define MCDI_EVENT_TX_FLUSH_TXQ_WIDTH 12
  420. #define MCDI_EVENT_PTP_ERR_TYPE_LBN 0
  421. #define MCDI_EVENT_PTP_ERR_TYPE_WIDTH 8
  422. /* enum: PLL lost lock */
  423. #define MCDI_EVENT_PTP_ERR_PLL_LOST 0x1
  424. /* enum: Filter overflow (PDMA) */
  425. #define MCDI_EVENT_PTP_ERR_FILTER 0x2
  426. /* enum: FIFO overflow (FPGA) */
  427. #define MCDI_EVENT_PTP_ERR_FIFO 0x3
  428. /* enum: Merge queue overflow */
  429. #define MCDI_EVENT_PTP_ERR_QUEUE 0x4
  430. #define MCDI_EVENT_AOE_ERR_TYPE_LBN 0
  431. #define MCDI_EVENT_AOE_ERR_TYPE_WIDTH 8
  432. /* enum: AOE failed to load - no valid image? */
  433. #define MCDI_EVENT_AOE_NO_LOAD 0x1
  434. /* enum: AOE FC reported an exception */
  435. #define MCDI_EVENT_AOE_FC_ASSERT 0x2
  436. /* enum: AOE FC watchdogged */
  437. #define MCDI_EVENT_AOE_FC_WATCHDOG 0x3
  438. /* enum: AOE FC failed to start */
  439. #define MCDI_EVENT_AOE_FC_NO_START 0x4
  440. /* enum: Generic AOE fault - likely to have been reported via other means too
  441. * but intended for use by aoex driver.
  442. */
  443. #define MCDI_EVENT_AOE_FAULT 0x5
  444. /* enum: Results of reprogramming the CPLD (status in AOE_ERR_DATA) */
  445. #define MCDI_EVENT_AOE_CPLD_REPROGRAMMED 0x6
  446. /* enum: AOE loaded successfully */
  447. #define MCDI_EVENT_AOE_LOAD 0x7
  448. /* enum: AOE DMA operation completed (LSB of HOST_HANDLE in AOE_ERR_DATA) */
  449. #define MCDI_EVENT_AOE_DMA 0x8
  450. /* enum: AOE byteblaster connected/disconnected (Connection status in
  451. * AOE_ERR_DATA)
  452. */
  453. #define MCDI_EVENT_AOE_BYTEBLASTER 0x9
  454. /* enum: DDR ECC status update */
  455. #define MCDI_EVENT_AOE_DDR_ECC_STATUS 0xa
  456. /* enum: PTP status update */
  457. #define MCDI_EVENT_AOE_PTP_STATUS 0xb
  458. /* enum: FPGA header incorrect */
  459. #define MCDI_EVENT_AOE_FPGA_LOAD_HEADER_ERR 0xc
  460. /* enum: FPGA Powered Off due to error in powering up FPGA */
  461. #define MCDI_EVENT_AOE_FPGA_POWER_OFF 0xd
  462. /* enum: AOE FPGA load failed due to MC to MUM communication failure */
  463. #define MCDI_EVENT_AOE_FPGA_LOAD_FAILED 0xe
  464. /* enum: Notify that invalid flash type detected */
  465. #define MCDI_EVENT_AOE_INVALID_FPGA_FLASH_TYPE 0xf
  466. /* enum: Notify that the attempt to run FPGA Controller firmware timedout */
  467. #define MCDI_EVENT_AOE_FC_RUN_TIMEDOUT 0x10
  468. /* enum: Failure to probe one or more FPGA boot flash chips */
  469. #define MCDI_EVENT_AOE_FPGA_BOOT_FLASH_INVALID 0x11
  470. /* enum: FPGA boot-flash contains an invalid image header */
  471. #define MCDI_EVENT_AOE_FPGA_BOOT_FLASH_HDR_INVALID 0x12
  472. /* enum: Failed to program clocks required by the FPGA */
  473. #define MCDI_EVENT_AOE_FPGA_CLOCKS_PROGRAM_FAILED 0x13
  474. /* enum: Notify that FPGA Controller is alive to serve MCDI requests */
  475. #define MCDI_EVENT_AOE_FC_RUNNING 0x14
  476. #define MCDI_EVENT_AOE_ERR_DATA_LBN 8
  477. #define MCDI_EVENT_AOE_ERR_DATA_WIDTH 8
  478. #define MCDI_EVENT_AOE_ERR_FC_ASSERT_INFO_LBN 8
  479. #define MCDI_EVENT_AOE_ERR_FC_ASSERT_INFO_WIDTH 8
  480. /* enum: FC Assert happened, but the register information is not available */
  481. #define MCDI_EVENT_AOE_ERR_FC_ASSERT_SEEN 0x0
  482. /* enum: The register information for FC Assert is ready for readinng by driver
  483. */
  484. #define MCDI_EVENT_AOE_ERR_FC_ASSERT_DATA_READY 0x1
  485. #define MCDI_EVENT_AOE_ERR_CODE_FPGA_HEADER_VERIFY_FAILED_LBN 8
  486. #define MCDI_EVENT_AOE_ERR_CODE_FPGA_HEADER_VERIFY_FAILED_WIDTH 8
  487. /* enum: Reading from NV failed */
  488. #define MCDI_EVENT_AOE_ERR_FPGA_HEADER_NV_READ_FAIL 0x0
  489. /* enum: Invalid Magic Number if FPGA header */
  490. #define MCDI_EVENT_AOE_ERR_FPGA_HEADER_MAGIC_FAIL 0x1
  491. /* enum: Invalid Silicon type detected in header */
  492. #define MCDI_EVENT_AOE_ERR_FPGA_HEADER_SILICON_TYPE 0x2
  493. /* enum: Unsupported VRatio */
  494. #define MCDI_EVENT_AOE_ERR_FPGA_HEADER_VRATIO 0x3
  495. /* enum: Unsupported DDR Type */
  496. #define MCDI_EVENT_AOE_ERR_FPGA_HEADER_DDR_TYPE 0x4
  497. /* enum: DDR Voltage out of supported range */
  498. #define MCDI_EVENT_AOE_ERR_FPGA_HEADER_DDR_VOLTAGE 0x5
  499. /* enum: Unsupported DDR speed */
  500. #define MCDI_EVENT_AOE_ERR_FPGA_HEADER_DDR_SPEED 0x6
  501. /* enum: Unsupported DDR size */
  502. #define MCDI_EVENT_AOE_ERR_FPGA_HEADER_DDR_SIZE 0x7
  503. /* enum: Unsupported DDR rank */
  504. #define MCDI_EVENT_AOE_ERR_FPGA_HEADER_DDR_RANK 0x8
  505. #define MCDI_EVENT_AOE_ERR_CODE_INVALID_FPGA_FLASH_TYPE_INFO_LBN 8
  506. #define MCDI_EVENT_AOE_ERR_CODE_INVALID_FPGA_FLASH_TYPE_INFO_WIDTH 8
  507. /* enum: Primary boot flash */
  508. #define MCDI_EVENT_AOE_FLASH_TYPE_BOOT_PRIMARY 0x0
  509. /* enum: Secondary boot flash */
  510. #define MCDI_EVENT_AOE_FLASH_TYPE_BOOT_SECONDARY 0x1
  511. #define MCDI_EVENT_AOE_ERR_CODE_FPGA_POWER_OFF_LBN 8
  512. #define MCDI_EVENT_AOE_ERR_CODE_FPGA_POWER_OFF_WIDTH 8
  513. #define MCDI_EVENT_AOE_ERR_CODE_FPGA_LOAD_FAILED_LBN 8
  514. #define MCDI_EVENT_AOE_ERR_CODE_FPGA_LOAD_FAILED_WIDTH 8
  515. #define MCDI_EVENT_RX_ERR_RXQ_LBN 0
  516. #define MCDI_EVENT_RX_ERR_RXQ_WIDTH 12
  517. #define MCDI_EVENT_RX_ERR_TYPE_LBN 12
  518. #define MCDI_EVENT_RX_ERR_TYPE_WIDTH 4
  519. #define MCDI_EVENT_RX_ERR_INFO_LBN 16
  520. #define MCDI_EVENT_RX_ERR_INFO_WIDTH 16
  521. #define MCDI_EVENT_RX_FLUSH_TO_DRIVER_LBN 12
  522. #define MCDI_EVENT_RX_FLUSH_TO_DRIVER_WIDTH 1
  523. #define MCDI_EVENT_RX_FLUSH_RXQ_LBN 0
  524. #define MCDI_EVENT_RX_FLUSH_RXQ_WIDTH 12
  525. #define MCDI_EVENT_MC_REBOOT_COUNT_LBN 0
  526. #define MCDI_EVENT_MC_REBOOT_COUNT_WIDTH 16
  527. #define MCDI_EVENT_MUM_ERR_TYPE_LBN 0
  528. #define MCDI_EVENT_MUM_ERR_TYPE_WIDTH 8
  529. /* enum: MUM failed to load - no valid image? */
  530. #define MCDI_EVENT_MUM_NO_LOAD 0x1
  531. /* enum: MUM f/w reported an exception */
  532. #define MCDI_EVENT_MUM_ASSERT 0x2
  533. /* enum: MUM not kicking watchdog */
  534. #define MCDI_EVENT_MUM_WATCHDOG 0x3
  535. #define MCDI_EVENT_MUM_ERR_DATA_LBN 8
  536. #define MCDI_EVENT_MUM_ERR_DATA_WIDTH 8
  537. #define MCDI_EVENT_DBRET_SEQ_LBN 0
  538. #define MCDI_EVENT_DBRET_SEQ_WIDTH 8
  539. #define MCDI_EVENT_SUC_ERR_TYPE_LBN 0
  540. #define MCDI_EVENT_SUC_ERR_TYPE_WIDTH 8
  541. /* enum: Corrupted or bad SUC application. */
  542. #define MCDI_EVENT_SUC_BAD_APP 0x1
  543. /* enum: SUC application reported an assert. */
  544. #define MCDI_EVENT_SUC_ASSERT 0x2
  545. /* enum: SUC application reported an exception. */
  546. #define MCDI_EVENT_SUC_EXCEPTION 0x3
  547. /* enum: SUC watchdog timer expired. */
  548. #define MCDI_EVENT_SUC_WATCHDOG 0x4
  549. #define MCDI_EVENT_SUC_ERR_ADDRESS_LBN 8
  550. #define MCDI_EVENT_SUC_ERR_ADDRESS_WIDTH 24
  551. #define MCDI_EVENT_SUC_ERR_DATA_LBN 8
  552. #define MCDI_EVENT_SUC_ERR_DATA_WIDTH 24
  553. #define MCDI_EVENT_DATA_LBN 0
  554. #define MCDI_EVENT_DATA_WIDTH 32
  555. #define MCDI_EVENT_SRC_LBN 36
  556. #define MCDI_EVENT_SRC_WIDTH 8
  557. #define MCDI_EVENT_EV_CODE_LBN 60
  558. #define MCDI_EVENT_EV_CODE_WIDTH 4
  559. #define MCDI_EVENT_CODE_LBN 44
  560. #define MCDI_EVENT_CODE_WIDTH 8
  561. /* enum: Event generated by host software */
  562. #define MCDI_EVENT_SW_EVENT 0x0
  563. /* enum: Bad assert. */
  564. #define MCDI_EVENT_CODE_BADSSERT 0x1
  565. /* enum: PM Notice. */
  566. #define MCDI_EVENT_CODE_PMNOTICE 0x2
  567. /* enum: Command done. */
  568. #define MCDI_EVENT_CODE_CMDDONE 0x3
  569. /* enum: Link change. */
  570. #define MCDI_EVENT_CODE_LINKCHANGE 0x4
  571. /* enum: Sensor Event. */
  572. #define MCDI_EVENT_CODE_SENSOREVT 0x5
  573. /* enum: Schedule error. */
  574. #define MCDI_EVENT_CODE_SCHEDERR 0x6
  575. /* enum: Reboot. */
  576. #define MCDI_EVENT_CODE_REBOOT 0x7
  577. /* enum: Mac stats DMA. */
  578. #define MCDI_EVENT_CODE_MAC_STATS_DMA 0x8
  579. /* enum: Firmware alert. */
  580. #define MCDI_EVENT_CODE_FWALERT 0x9
  581. /* enum: Function level reset. */
  582. #define MCDI_EVENT_CODE_FLR 0xa
  583. /* enum: Transmit error */
  584. #define MCDI_EVENT_CODE_TX_ERR 0xb
  585. /* enum: Tx flush has completed */
  586. #define MCDI_EVENT_CODE_TX_FLUSH 0xc
  587. /* enum: PTP packet received timestamp */
  588. #define MCDI_EVENT_CODE_PTP_RX 0xd
  589. /* enum: PTP NIC failure */
  590. #define MCDI_EVENT_CODE_PTP_FAULT 0xe
  591. /* enum: PTP PPS event */
  592. #define MCDI_EVENT_CODE_PTP_PPS 0xf
  593. /* enum: Rx flush has completed */
  594. #define MCDI_EVENT_CODE_RX_FLUSH 0x10
  595. /* enum: Receive error */
  596. #define MCDI_EVENT_CODE_RX_ERR 0x11
  597. /* enum: AOE fault */
  598. #define MCDI_EVENT_CODE_AOE 0x12
  599. /* enum: Network port calibration failed (VCAL). */
  600. #define MCDI_EVENT_CODE_VCAL_FAIL 0x13
  601. /* enum: HW PPS event */
  602. #define MCDI_EVENT_CODE_HW_PPS 0x14
  603. /* enum: The MC has rebooted (huntington and later, siena uses CODE_REBOOT and
  604. * a different format)
  605. */
  606. #define MCDI_EVENT_CODE_MC_REBOOT 0x15
  607. /* enum: the MC has detected a parity error */
  608. #define MCDI_EVENT_CODE_PAR_ERR 0x16
  609. /* enum: the MC has detected a correctable error */
  610. #define MCDI_EVENT_CODE_ECC_CORR_ERR 0x17
  611. /* enum: the MC has detected an uncorrectable error */
  612. #define MCDI_EVENT_CODE_ECC_FATAL_ERR 0x18
  613. /* enum: The MC has entered offline BIST mode */
  614. #define MCDI_EVENT_CODE_MC_BIST 0x19
  615. /* enum: PTP tick event providing current NIC time */
  616. #define MCDI_EVENT_CODE_PTP_TIME 0x1a
  617. /* enum: MUM fault */
  618. #define MCDI_EVENT_CODE_MUM 0x1b
  619. /* enum: notify the designated PF of a new authorization request */
  620. #define MCDI_EVENT_CODE_PROXY_REQUEST 0x1c
  621. /* enum: notify a function that awaits an authorization that its request has
  622. * been processed and it may now resend the command
  623. */
  624. #define MCDI_EVENT_CODE_PROXY_RESPONSE 0x1d
  625. /* enum: MCDI command accepted. New commands can be issued but this command is
  626. * not done yet.
  627. */
  628. #define MCDI_EVENT_CODE_DBRET 0x1e
  629. /* enum: The MC has detected a fault on the SUC */
  630. #define MCDI_EVENT_CODE_SUC 0x1f
  631. /* enum: Artificial event generated by host and posted via MC for test
  632. * purposes.
  633. */
  634. #define MCDI_EVENT_CODE_TESTGEN 0xfa
  635. #define MCDI_EVENT_CMDDONE_DATA_OFST 0
  636. #define MCDI_EVENT_CMDDONE_DATA_LEN 4
  637. #define MCDI_EVENT_CMDDONE_DATA_LBN 0
  638. #define MCDI_EVENT_CMDDONE_DATA_WIDTH 32
  639. #define MCDI_EVENT_LINKCHANGE_DATA_OFST 0
  640. #define MCDI_EVENT_LINKCHANGE_DATA_LEN 4
  641. #define MCDI_EVENT_LINKCHANGE_DATA_LBN 0
  642. #define MCDI_EVENT_LINKCHANGE_DATA_WIDTH 32
  643. #define MCDI_EVENT_SENSOREVT_DATA_OFST 0
  644. #define MCDI_EVENT_SENSOREVT_DATA_LEN 4
  645. #define MCDI_EVENT_SENSOREVT_DATA_LBN 0
  646. #define MCDI_EVENT_SENSOREVT_DATA_WIDTH 32
  647. #define MCDI_EVENT_MAC_STATS_DMA_GENERATION_OFST 0
  648. #define MCDI_EVENT_MAC_STATS_DMA_GENERATION_LEN 4
  649. #define MCDI_EVENT_MAC_STATS_DMA_GENERATION_LBN 0
  650. #define MCDI_EVENT_MAC_STATS_DMA_GENERATION_WIDTH 32
  651. #define MCDI_EVENT_TX_ERR_DATA_OFST 0
  652. #define MCDI_EVENT_TX_ERR_DATA_LEN 4
  653. #define MCDI_EVENT_TX_ERR_DATA_LBN 0
  654. #define MCDI_EVENT_TX_ERR_DATA_WIDTH 32
  655. /* For CODE_PTP_RX, CODE_PTP_PPS and CODE_HW_PPS events the seconds field of
  656. * timestamp
  657. */
  658. #define MCDI_EVENT_PTP_SECONDS_OFST 0
  659. #define MCDI_EVENT_PTP_SECONDS_LEN 4
  660. #define MCDI_EVENT_PTP_SECONDS_LBN 0
  661. #define MCDI_EVENT_PTP_SECONDS_WIDTH 32
  662. /* For CODE_PTP_RX, CODE_PTP_PPS and CODE_HW_PPS events the major field of
  663. * timestamp
  664. */
  665. #define MCDI_EVENT_PTP_MAJOR_OFST 0
  666. #define MCDI_EVENT_PTP_MAJOR_LEN 4
  667. #define MCDI_EVENT_PTP_MAJOR_LBN 0
  668. #define MCDI_EVENT_PTP_MAJOR_WIDTH 32
  669. /* For CODE_PTP_RX, CODE_PTP_PPS and CODE_HW_PPS events the nanoseconds field
  670. * of timestamp
  671. */
  672. #define MCDI_EVENT_PTP_NANOSECONDS_OFST 0
  673. #define MCDI_EVENT_PTP_NANOSECONDS_LEN 4
  674. #define MCDI_EVENT_PTP_NANOSECONDS_LBN 0
  675. #define MCDI_EVENT_PTP_NANOSECONDS_WIDTH 32
  676. /* For CODE_PTP_RX, CODE_PTP_PPS and CODE_HW_PPS events the minor field of
  677. * timestamp
  678. */
  679. #define MCDI_EVENT_PTP_MINOR_OFST 0
  680. #define MCDI_EVENT_PTP_MINOR_LEN 4
  681. #define MCDI_EVENT_PTP_MINOR_LBN 0
  682. #define MCDI_EVENT_PTP_MINOR_WIDTH 32
  683. /* For CODE_PTP_RX events, the lowest four bytes of sourceUUID from PTP packet
  684. */
  685. #define MCDI_EVENT_PTP_UUID_OFST 0
  686. #define MCDI_EVENT_PTP_UUID_LEN 4
  687. #define MCDI_EVENT_PTP_UUID_LBN 0
  688. #define MCDI_EVENT_PTP_UUID_WIDTH 32
  689. #define MCDI_EVENT_RX_ERR_DATA_OFST 0
  690. #define MCDI_EVENT_RX_ERR_DATA_LEN 4
  691. #define MCDI_EVENT_RX_ERR_DATA_LBN 0
  692. #define MCDI_EVENT_RX_ERR_DATA_WIDTH 32
  693. #define MCDI_EVENT_PAR_ERR_DATA_OFST 0
  694. #define MCDI_EVENT_PAR_ERR_DATA_LEN 4
  695. #define MCDI_EVENT_PAR_ERR_DATA_LBN 0
  696. #define MCDI_EVENT_PAR_ERR_DATA_WIDTH 32
  697. #define MCDI_EVENT_ECC_CORR_ERR_DATA_OFST 0
  698. #define MCDI_EVENT_ECC_CORR_ERR_DATA_LEN 4
  699. #define MCDI_EVENT_ECC_CORR_ERR_DATA_LBN 0
  700. #define MCDI_EVENT_ECC_CORR_ERR_DATA_WIDTH 32
  701. #define MCDI_EVENT_ECC_FATAL_ERR_DATA_OFST 0
  702. #define MCDI_EVENT_ECC_FATAL_ERR_DATA_LEN 4
  703. #define MCDI_EVENT_ECC_FATAL_ERR_DATA_LBN 0
  704. #define MCDI_EVENT_ECC_FATAL_ERR_DATA_WIDTH 32
  705. /* For CODE_PTP_TIME events, the major value of the PTP clock */
  706. #define MCDI_EVENT_PTP_TIME_MAJOR_OFST 0
  707. #define MCDI_EVENT_PTP_TIME_MAJOR_LEN 4
  708. #define MCDI_EVENT_PTP_TIME_MAJOR_LBN 0
  709. #define MCDI_EVENT_PTP_TIME_MAJOR_WIDTH 32
  710. /* For CODE_PTP_TIME events, bits 19-26 of the minor value of the PTP clock */
  711. #define MCDI_EVENT_PTP_TIME_MINOR_26_19_LBN 36
  712. #define MCDI_EVENT_PTP_TIME_MINOR_26_19_WIDTH 8
  713. /* For CODE_PTP_TIME events, most significant bits of the minor value of the
  714. * PTP clock. This is a more generic equivalent of PTP_TIME_MINOR_26_19.
  715. */
  716. #define MCDI_EVENT_PTP_TIME_MINOR_MS_8BITS_LBN 36
  717. #define MCDI_EVENT_PTP_TIME_MINOR_MS_8BITS_WIDTH 8
  718. /* For CODE_PTP_TIME events where report sync status is enabled, indicates
  719. * whether the NIC clock has ever been set
  720. */
  721. #define MCDI_EVENT_PTP_TIME_NIC_CLOCK_VALID_LBN 36
  722. #define MCDI_EVENT_PTP_TIME_NIC_CLOCK_VALID_WIDTH 1
  723. /* For CODE_PTP_TIME events where report sync status is enabled, indicates
  724. * whether the NIC and System clocks are in sync
  725. */
  726. #define MCDI_EVENT_PTP_TIME_HOST_NIC_IN_SYNC_LBN 37
  727. #define MCDI_EVENT_PTP_TIME_HOST_NIC_IN_SYNC_WIDTH 1
  728. /* For CODE_PTP_TIME events where report sync status is enabled, bits 21-26 of
  729. * the minor value of the PTP clock
  730. */
  731. #define MCDI_EVENT_PTP_TIME_MINOR_26_21_LBN 38
  732. #define MCDI_EVENT_PTP_TIME_MINOR_26_21_WIDTH 6
  733. /* For CODE_PTP_TIME events, most significant bits of the minor value of the
  734. * PTP clock. This is a more generic equivalent of PTP_TIME_MINOR_26_21.
  735. */
  736. #define MCDI_EVENT_PTP_TIME_MINOR_MS_6BITS_LBN 38
  737. #define MCDI_EVENT_PTP_TIME_MINOR_MS_6BITS_WIDTH 6
  738. #define MCDI_EVENT_PROXY_REQUEST_BUFF_INDEX_OFST 0
  739. #define MCDI_EVENT_PROXY_REQUEST_BUFF_INDEX_LEN 4
  740. #define MCDI_EVENT_PROXY_REQUEST_BUFF_INDEX_LBN 0
  741. #define MCDI_EVENT_PROXY_REQUEST_BUFF_INDEX_WIDTH 32
  742. #define MCDI_EVENT_PROXY_RESPONSE_HANDLE_OFST 0
  743. #define MCDI_EVENT_PROXY_RESPONSE_HANDLE_LEN 4
  744. #define MCDI_EVENT_PROXY_RESPONSE_HANDLE_LBN 0
  745. #define MCDI_EVENT_PROXY_RESPONSE_HANDLE_WIDTH 32
  746. /* Zero means that the request has been completed or authorized, and the driver
  747. * should resend it. A non-zero value means that the authorization has been
  748. * denied, and gives the reason. Typically it will be EPERM.
  749. */
  750. #define MCDI_EVENT_PROXY_RESPONSE_RC_LBN 36
  751. #define MCDI_EVENT_PROXY_RESPONSE_RC_WIDTH 8
  752. #define MCDI_EVENT_DBRET_DATA_OFST 0
  753. #define MCDI_EVENT_DBRET_DATA_LEN 4
  754. #define MCDI_EVENT_DBRET_DATA_LBN 0
  755. #define MCDI_EVENT_DBRET_DATA_WIDTH 32
  756. /* FCDI_EVENT structuredef */
  757. #define FCDI_EVENT_LEN 8
  758. #define FCDI_EVENT_CONT_LBN 32
  759. #define FCDI_EVENT_CONT_WIDTH 1
  760. #define FCDI_EVENT_LEVEL_LBN 33
  761. #define FCDI_EVENT_LEVEL_WIDTH 3
  762. /* enum: Info. */
  763. #define FCDI_EVENT_LEVEL_INFO 0x0
  764. /* enum: Warning. */
  765. #define FCDI_EVENT_LEVEL_WARN 0x1
  766. /* enum: Error. */
  767. #define FCDI_EVENT_LEVEL_ERR 0x2
  768. /* enum: Fatal. */
  769. #define FCDI_EVENT_LEVEL_FATAL 0x3
  770. #define FCDI_EVENT_DATA_OFST 0
  771. #define FCDI_EVENT_DATA_LEN 4
  772. #define FCDI_EVENT_LINK_STATE_STATUS_LBN 0
  773. #define FCDI_EVENT_LINK_STATE_STATUS_WIDTH 1
  774. #define FCDI_EVENT_LINK_DOWN 0x0 /* enum */
  775. #define FCDI_EVENT_LINK_UP 0x1 /* enum */
  776. #define FCDI_EVENT_DATA_LBN 0
  777. #define FCDI_EVENT_DATA_WIDTH 32
  778. #define FCDI_EVENT_SRC_LBN 36
  779. #define FCDI_EVENT_SRC_WIDTH 8
  780. #define FCDI_EVENT_EV_CODE_LBN 60
  781. #define FCDI_EVENT_EV_CODE_WIDTH 4
  782. #define FCDI_EVENT_CODE_LBN 44
  783. #define FCDI_EVENT_CODE_WIDTH 8
  784. /* enum: The FC was rebooted. */
  785. #define FCDI_EVENT_CODE_REBOOT 0x1
  786. /* enum: Bad assert. */
  787. #define FCDI_EVENT_CODE_ASSERT 0x2
  788. /* enum: DDR3 test result. */
  789. #define FCDI_EVENT_CODE_DDR_TEST_RESULT 0x3
  790. /* enum: Link status. */
  791. #define FCDI_EVENT_CODE_LINK_STATE 0x4
  792. /* enum: A timed read is ready to be serviced. */
  793. #define FCDI_EVENT_CODE_TIMED_READ 0x5
  794. /* enum: One or more PPS IN events */
  795. #define FCDI_EVENT_CODE_PPS_IN 0x6
  796. /* enum: Tick event from PTP clock */
  797. #define FCDI_EVENT_CODE_PTP_TICK 0x7
  798. /* enum: ECC error counters */
  799. #define FCDI_EVENT_CODE_DDR_ECC_STATUS 0x8
  800. /* enum: Current status of PTP */
  801. #define FCDI_EVENT_CODE_PTP_STATUS 0x9
  802. /* enum: Port id config to map MC-FC port idx */
  803. #define FCDI_EVENT_CODE_PORT_CONFIG 0xa
  804. /* enum: Boot result or error code */
  805. #define FCDI_EVENT_CODE_BOOT_RESULT 0xb
  806. #define FCDI_EVENT_REBOOT_SRC_LBN 36
  807. #define FCDI_EVENT_REBOOT_SRC_WIDTH 8
  808. #define FCDI_EVENT_REBOOT_FC_FW 0x0 /* enum */
  809. #define FCDI_EVENT_REBOOT_FC_BOOTLOADER 0x1 /* enum */
  810. #define FCDI_EVENT_ASSERT_INSTR_ADDRESS_OFST 0
  811. #define FCDI_EVENT_ASSERT_INSTR_ADDRESS_LEN 4
  812. #define FCDI_EVENT_ASSERT_INSTR_ADDRESS_LBN 0
  813. #define FCDI_EVENT_ASSERT_INSTR_ADDRESS_WIDTH 32
  814. #define FCDI_EVENT_ASSERT_TYPE_LBN 36
  815. #define FCDI_EVENT_ASSERT_TYPE_WIDTH 8
  816. #define FCDI_EVENT_DDR_TEST_RESULT_STATUS_CODE_LBN 36
  817. #define FCDI_EVENT_DDR_TEST_RESULT_STATUS_CODE_WIDTH 8
  818. #define FCDI_EVENT_DDR_TEST_RESULT_RESULT_OFST 0
  819. #define FCDI_EVENT_DDR_TEST_RESULT_RESULT_LEN 4
  820. #define FCDI_EVENT_DDR_TEST_RESULT_RESULT_LBN 0
  821. #define FCDI_EVENT_DDR_TEST_RESULT_RESULT_WIDTH 32
  822. #define FCDI_EVENT_LINK_STATE_DATA_OFST 0
  823. #define FCDI_EVENT_LINK_STATE_DATA_LEN 4
  824. #define FCDI_EVENT_LINK_STATE_DATA_LBN 0
  825. #define FCDI_EVENT_LINK_STATE_DATA_WIDTH 32
  826. #define FCDI_EVENT_PTP_STATE_OFST 0
  827. #define FCDI_EVENT_PTP_STATE_LEN 4
  828. #define FCDI_EVENT_PTP_UNDEFINED 0x0 /* enum */
  829. #define FCDI_EVENT_PTP_SETUP_FAILED 0x1 /* enum */
  830. #define FCDI_EVENT_PTP_OPERATIONAL 0x2 /* enum */
  831. #define FCDI_EVENT_PTP_STATE_LBN 0
  832. #define FCDI_EVENT_PTP_STATE_WIDTH 32
  833. #define FCDI_EVENT_DDR_ECC_STATUS_BANK_ID_LBN 36
  834. #define FCDI_EVENT_DDR_ECC_STATUS_BANK_ID_WIDTH 8
  835. #define FCDI_EVENT_DDR_ECC_STATUS_STATUS_OFST 0
  836. #define FCDI_EVENT_DDR_ECC_STATUS_STATUS_LEN 4
  837. #define FCDI_EVENT_DDR_ECC_STATUS_STATUS_LBN 0
  838. #define FCDI_EVENT_DDR_ECC_STATUS_STATUS_WIDTH 32
  839. /* Index of MC port being referred to */
  840. #define FCDI_EVENT_PORT_CONFIG_SRC_LBN 36
  841. #define FCDI_EVENT_PORT_CONFIG_SRC_WIDTH 8
  842. /* FC Port index that matches the MC port index in SRC */
  843. #define FCDI_EVENT_PORT_CONFIG_DATA_OFST 0
  844. #define FCDI_EVENT_PORT_CONFIG_DATA_LEN 4
  845. #define FCDI_EVENT_PORT_CONFIG_DATA_LBN 0
  846. #define FCDI_EVENT_PORT_CONFIG_DATA_WIDTH 32
  847. #define FCDI_EVENT_BOOT_RESULT_OFST 0
  848. #define FCDI_EVENT_BOOT_RESULT_LEN 4
  849. /* Enum values, see field(s): */
  850. /* MC_CMD_AOE/MC_CMD_AOE_OUT_INFO/FC_BOOT_RESULT */
  851. #define FCDI_EVENT_BOOT_RESULT_LBN 0
  852. #define FCDI_EVENT_BOOT_RESULT_WIDTH 32
  853. /* FCDI_EXTENDED_EVENT_PPS structuredef: Extended FCDI event to send PPS events
  854. * to the MC. Note that this structure | is overlayed over a normal FCDI event
  855. * such that bits 32-63 containing | event code, level, source etc remain the
  856. * same. In this case the data | field of the header is defined to be the
  857. * number of timestamps
  858. */
  859. #define FCDI_EXTENDED_EVENT_PPS_LENMIN 16
  860. #define FCDI_EXTENDED_EVENT_PPS_LENMAX 248
  861. #define FCDI_EXTENDED_EVENT_PPS_LEN(num) (8+8*(num))
  862. /* Number of timestamps following */
  863. #define FCDI_EXTENDED_EVENT_PPS_COUNT_OFST 0
  864. #define FCDI_EXTENDED_EVENT_PPS_COUNT_LEN 4
  865. #define FCDI_EXTENDED_EVENT_PPS_COUNT_LBN 0
  866. #define FCDI_EXTENDED_EVENT_PPS_COUNT_WIDTH 32
  867. /* Seconds field of a timestamp record */
  868. #define FCDI_EXTENDED_EVENT_PPS_SECONDS_OFST 8
  869. #define FCDI_EXTENDED_EVENT_PPS_SECONDS_LEN 4
  870. #define FCDI_EXTENDED_EVENT_PPS_SECONDS_LBN 64
  871. #define FCDI_EXTENDED_EVENT_PPS_SECONDS_WIDTH 32
  872. /* Nanoseconds field of a timestamp record */
  873. #define FCDI_EXTENDED_EVENT_PPS_NANOSECONDS_OFST 12
  874. #define FCDI_EXTENDED_EVENT_PPS_NANOSECONDS_LEN 4
  875. #define FCDI_EXTENDED_EVENT_PPS_NANOSECONDS_LBN 96
  876. #define FCDI_EXTENDED_EVENT_PPS_NANOSECONDS_WIDTH 32
  877. /* Timestamp records comprising the event */
  878. #define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_OFST 8
  879. #define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_LEN 8
  880. #define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_LO_OFST 8
  881. #define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_HI_OFST 12
  882. #define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_MINNUM 1
  883. #define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_MAXNUM 30
  884. #define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_LBN 64
  885. #define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_WIDTH 64
  886. /* MUM_EVENT structuredef */
  887. #define MUM_EVENT_LEN 8
  888. #define MUM_EVENT_CONT_LBN 32
  889. #define MUM_EVENT_CONT_WIDTH 1
  890. #define MUM_EVENT_LEVEL_LBN 33
  891. #define MUM_EVENT_LEVEL_WIDTH 3
  892. /* enum: Info. */
  893. #define MUM_EVENT_LEVEL_INFO 0x0
  894. /* enum: Warning. */
  895. #define MUM_EVENT_LEVEL_WARN 0x1
  896. /* enum: Error. */
  897. #define MUM_EVENT_LEVEL_ERR 0x2
  898. /* enum: Fatal. */
  899. #define MUM_EVENT_LEVEL_FATAL 0x3
  900. #define MUM_EVENT_DATA_OFST 0
  901. #define MUM_EVENT_DATA_LEN 4
  902. #define MUM_EVENT_SENSOR_ID_LBN 0
  903. #define MUM_EVENT_SENSOR_ID_WIDTH 8
  904. /* Enum values, see field(s): */
  905. /* MC_CMD_SENSOR_INFO/MC_CMD_SENSOR_INFO_OUT/MASK */
  906. #define MUM_EVENT_SENSOR_STATE_LBN 8
  907. #define MUM_EVENT_SENSOR_STATE_WIDTH 8
  908. #define MUM_EVENT_PORT_PHY_READY_LBN 0
  909. #define MUM_EVENT_PORT_PHY_READY_WIDTH 1
  910. #define MUM_EVENT_PORT_PHY_LINK_UP_LBN 1
  911. #define MUM_EVENT_PORT_PHY_LINK_UP_WIDTH 1
  912. #define MUM_EVENT_PORT_PHY_TX_LOL_LBN 2
  913. #define MUM_EVENT_PORT_PHY_TX_LOL_WIDTH 1
  914. #define MUM_EVENT_PORT_PHY_RX_LOL_LBN 3
  915. #define MUM_EVENT_PORT_PHY_RX_LOL_WIDTH 1
  916. #define MUM_EVENT_PORT_PHY_TX_LOS_LBN 4
  917. #define MUM_EVENT_PORT_PHY_TX_LOS_WIDTH 1
  918. #define MUM_EVENT_PORT_PHY_RX_LOS_LBN 5
  919. #define MUM_EVENT_PORT_PHY_RX_LOS_WIDTH 1
  920. #define MUM_EVENT_PORT_PHY_TX_FAULT_LBN 6
  921. #define MUM_EVENT_PORT_PHY_TX_FAULT_WIDTH 1
  922. #define MUM_EVENT_DATA_LBN 0
  923. #define MUM_EVENT_DATA_WIDTH 32
  924. #define MUM_EVENT_SRC_LBN 36
  925. #define MUM_EVENT_SRC_WIDTH 8
  926. #define MUM_EVENT_EV_CODE_LBN 60
  927. #define MUM_EVENT_EV_CODE_WIDTH 4
  928. #define MUM_EVENT_CODE_LBN 44
  929. #define MUM_EVENT_CODE_WIDTH 8
  930. /* enum: The MUM was rebooted. */
  931. #define MUM_EVENT_CODE_REBOOT 0x1
  932. /* enum: Bad assert. */
  933. #define MUM_EVENT_CODE_ASSERT 0x2
  934. /* enum: Sensor failure. */
  935. #define MUM_EVENT_CODE_SENSOR 0x3
  936. /* enum: Link fault has been asserted, or has cleared. */
  937. #define MUM_EVENT_CODE_QSFP_LASI_INTERRUPT 0x4
  938. #define MUM_EVENT_SENSOR_DATA_OFST 0
  939. #define MUM_EVENT_SENSOR_DATA_LEN 4
  940. #define MUM_EVENT_SENSOR_DATA_LBN 0
  941. #define MUM_EVENT_SENSOR_DATA_WIDTH 32
  942. #define MUM_EVENT_PORT_PHY_FLAGS_OFST 0
  943. #define MUM_EVENT_PORT_PHY_FLAGS_LEN 4
  944. #define MUM_EVENT_PORT_PHY_FLAGS_LBN 0
  945. #define MUM_EVENT_PORT_PHY_FLAGS_WIDTH 32
  946. #define MUM_EVENT_PORT_PHY_COPPER_LEN_OFST 0
  947. #define MUM_EVENT_PORT_PHY_COPPER_LEN_LEN 4
  948. #define MUM_EVENT_PORT_PHY_COPPER_LEN_LBN 0
  949. #define MUM_EVENT_PORT_PHY_COPPER_LEN_WIDTH 32
  950. #define MUM_EVENT_PORT_PHY_CAPS_OFST 0
  951. #define MUM_EVENT_PORT_PHY_CAPS_LEN 4
  952. #define MUM_EVENT_PORT_PHY_CAPS_LBN 0
  953. #define MUM_EVENT_PORT_PHY_CAPS_WIDTH 32
  954. #define MUM_EVENT_PORT_PHY_TECH_OFST 0
  955. #define MUM_EVENT_PORT_PHY_TECH_LEN 4
  956. #define MUM_EVENT_PORT_PHY_STATE_QSFP_MODULE_TECH_UNKNOWN 0x0 /* enum */
  957. #define MUM_EVENT_PORT_PHY_STATE_QSFP_MODULE_TECH_OPTICAL 0x1 /* enum */
  958. #define MUM_EVENT_PORT_PHY_STATE_QSFP_MODULE_TECH_COPPER_PASSIVE 0x2 /* enum */
  959. #define MUM_EVENT_PORT_PHY_STATE_QSFP_MODULE_TECH_COPPER_PASSIVE_EQUALIZED 0x3 /* enum */
  960. #define MUM_EVENT_PORT_PHY_STATE_QSFP_MODULE_TECH_COPPER_ACTIVE_LIMITING 0x4 /* enum */
  961. #define MUM_EVENT_PORT_PHY_STATE_QSFP_MODULE_TECH_COPPER_ACTIVE_LINEAR 0x5 /* enum */
  962. #define MUM_EVENT_PORT_PHY_STATE_QSFP_MODULE_TECH_BASE_T 0x6 /* enum */
  963. #define MUM_EVENT_PORT_PHY_STATE_QSFP_MODULE_TECH_LOOPBACK_PASSIVE 0x7 /* enum */
  964. #define MUM_EVENT_PORT_PHY_TECH_LBN 0
  965. #define MUM_EVENT_PORT_PHY_TECH_WIDTH 32
  966. #define MUM_EVENT_PORT_PHY_SRC_DATA_ID_LBN 36
  967. #define MUM_EVENT_PORT_PHY_SRC_DATA_ID_WIDTH 4
  968. #define MUM_EVENT_PORT_PHY_SRC_DATA_ID_FLAGS 0x0 /* enum */
  969. #define MUM_EVENT_PORT_PHY_SRC_DATA_ID_COPPER_LEN 0x1 /* enum */
  970. #define MUM_EVENT_PORT_PHY_SRC_DATA_ID_CAPS 0x2 /* enum */
  971. #define MUM_EVENT_PORT_PHY_SRC_DATA_ID_TECH 0x3 /* enum */
  972. #define MUM_EVENT_PORT_PHY_SRC_DATA_ID_MAX 0x4 /* enum */
  973. #define MUM_EVENT_PORT_PHY_SRC_PORT_NO_LBN 40
  974. #define MUM_EVENT_PORT_PHY_SRC_PORT_NO_WIDTH 4
  975. /***********************************/
  976. /* MC_CMD_READ32
  977. * Read multiple 32byte words from MC memory. Note - this command really
  978. * belongs to INSECURE category but is required by shmboot. The command handler
  979. * has additional checks to reject insecure calls.
  980. */
  981. #define MC_CMD_READ32 0x1
  982. #define MC_CMD_0x1_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  983. /* MC_CMD_READ32_IN msgrequest */
  984. #define MC_CMD_READ32_IN_LEN 8
  985. #define MC_CMD_READ32_IN_ADDR_OFST 0
  986. #define MC_CMD_READ32_IN_ADDR_LEN 4
  987. #define MC_CMD_READ32_IN_NUMWORDS_OFST 4
  988. #define MC_CMD_READ32_IN_NUMWORDS_LEN 4
  989. /* MC_CMD_READ32_OUT msgresponse */
  990. #define MC_CMD_READ32_OUT_LENMIN 4
  991. #define MC_CMD_READ32_OUT_LENMAX 252
  992. #define MC_CMD_READ32_OUT_LEN(num) (0+4*(num))
  993. #define MC_CMD_READ32_OUT_BUFFER_OFST 0
  994. #define MC_CMD_READ32_OUT_BUFFER_LEN 4
  995. #define MC_CMD_READ32_OUT_BUFFER_MINNUM 1
  996. #define MC_CMD_READ32_OUT_BUFFER_MAXNUM 63
  997. /***********************************/
  998. /* MC_CMD_WRITE32
  999. * Write multiple 32byte words to MC memory.
  1000. */
  1001. #define MC_CMD_WRITE32 0x2
  1002. #define MC_CMD_0x2_PRIVILEGE_CTG SRIOV_CTG_INSECURE
  1003. /* MC_CMD_WRITE32_IN msgrequest */
  1004. #define MC_CMD_WRITE32_IN_LENMIN 8
  1005. #define MC_CMD_WRITE32_IN_LENMAX 252
  1006. #define MC_CMD_WRITE32_IN_LEN(num) (4+4*(num))
  1007. #define MC_CMD_WRITE32_IN_ADDR_OFST 0
  1008. #define MC_CMD_WRITE32_IN_ADDR_LEN 4
  1009. #define MC_CMD_WRITE32_IN_BUFFER_OFST 4
  1010. #define MC_CMD_WRITE32_IN_BUFFER_LEN 4
  1011. #define MC_CMD_WRITE32_IN_BUFFER_MINNUM 1
  1012. #define MC_CMD_WRITE32_IN_BUFFER_MAXNUM 62
  1013. /* MC_CMD_WRITE32_OUT msgresponse */
  1014. #define MC_CMD_WRITE32_OUT_LEN 0
  1015. /***********************************/
  1016. /* MC_CMD_COPYCODE
  1017. * Copy MC code between two locations and jump. Note - this command really
  1018. * belongs to INSECURE category but is required by shmboot. The command handler
  1019. * has additional checks to reject insecure calls.
  1020. */
  1021. #define MC_CMD_COPYCODE 0x3
  1022. #define MC_CMD_0x3_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  1023. /* MC_CMD_COPYCODE_IN msgrequest */
  1024. #define MC_CMD_COPYCODE_IN_LEN 16
  1025. /* Source address
  1026. *
  1027. * The main image should be entered via a copy of a single word from and to a
  1028. * magic address, which controls various aspects of the boot. The magic address
  1029. * is a bitfield, with each bit as documented below.
  1030. */
  1031. #define MC_CMD_COPYCODE_IN_SRC_ADDR_OFST 0
  1032. #define MC_CMD_COPYCODE_IN_SRC_ADDR_LEN 4
  1033. /* enum: Deprecated; equivalent to setting BOOT_MAGIC_PRESENT (see below) */
  1034. #define MC_CMD_COPYCODE_HUNT_NO_MAGIC_ADDR 0x10000
  1035. /* enum: Deprecated; equivalent to setting BOOT_MAGIC_PRESENT and
  1036. * BOOT_MAGIC_SATELLITE_CPUS_NOT_LOADED (see below)
  1037. */
  1038. #define MC_CMD_COPYCODE_HUNT_NO_DATAPATH_MAGIC_ADDR 0x1d0d0
  1039. /* enum: Deprecated; equivalent to setting BOOT_MAGIC_PRESENT,
  1040. * BOOT_MAGIC_SATELLITE_CPUS_NOT_LOADED and BOOT_MAGIC_IGNORE_CONFIG (see
  1041. * below)
  1042. */
  1043. #define MC_CMD_COPYCODE_HUNT_IGNORE_CONFIG_MAGIC_ADDR 0x1badc
  1044. #define MC_CMD_COPYCODE_IN_BOOT_MAGIC_PRESENT_LBN 17
  1045. #define MC_CMD_COPYCODE_IN_BOOT_MAGIC_PRESENT_WIDTH 1
  1046. #define MC_CMD_COPYCODE_IN_BOOT_MAGIC_SATELLITE_CPUS_NOT_LOADED_LBN 2
  1047. #define MC_CMD_COPYCODE_IN_BOOT_MAGIC_SATELLITE_CPUS_NOT_LOADED_WIDTH 1
  1048. #define MC_CMD_COPYCODE_IN_BOOT_MAGIC_IGNORE_CONFIG_LBN 3
  1049. #define MC_CMD_COPYCODE_IN_BOOT_MAGIC_IGNORE_CONFIG_WIDTH 1
  1050. #define MC_CMD_COPYCODE_IN_BOOT_MAGIC_SKIP_BOOT_ICORE_SYNC_LBN 4
  1051. #define MC_CMD_COPYCODE_IN_BOOT_MAGIC_SKIP_BOOT_ICORE_SYNC_WIDTH 1
  1052. #define MC_CMD_COPYCODE_IN_BOOT_MAGIC_FORCE_STANDALONE_LBN 5
  1053. #define MC_CMD_COPYCODE_IN_BOOT_MAGIC_FORCE_STANDALONE_WIDTH 1
  1054. #define MC_CMD_COPYCODE_IN_BOOT_MAGIC_DISABLE_XIP_LBN 6
  1055. #define MC_CMD_COPYCODE_IN_BOOT_MAGIC_DISABLE_XIP_WIDTH 1
  1056. /* Destination address */
  1057. #define MC_CMD_COPYCODE_IN_DEST_ADDR_OFST 4
  1058. #define MC_CMD_COPYCODE_IN_DEST_ADDR_LEN 4
  1059. #define MC_CMD_COPYCODE_IN_NUMWORDS_OFST 8
  1060. #define MC_CMD_COPYCODE_IN_NUMWORDS_LEN 4
  1061. /* Address of where to jump after copy. */
  1062. #define MC_CMD_COPYCODE_IN_JUMP_OFST 12
  1063. #define MC_CMD_COPYCODE_IN_JUMP_LEN 4
  1064. /* enum: Control should return to the caller rather than jumping */
  1065. #define MC_CMD_COPYCODE_JUMP_NONE 0x1
  1066. /* MC_CMD_COPYCODE_OUT msgresponse */
  1067. #define MC_CMD_COPYCODE_OUT_LEN 0
  1068. /***********************************/
  1069. /* MC_CMD_SET_FUNC
  1070. * Select function for function-specific commands.
  1071. */
  1072. #define MC_CMD_SET_FUNC 0x4
  1073. #define MC_CMD_0x4_PRIVILEGE_CTG SRIOV_CTG_INSECURE
  1074. /* MC_CMD_SET_FUNC_IN msgrequest */
  1075. #define MC_CMD_SET_FUNC_IN_LEN 4
  1076. /* Set function */
  1077. #define MC_CMD_SET_FUNC_IN_FUNC_OFST 0
  1078. #define MC_CMD_SET_FUNC_IN_FUNC_LEN 4
  1079. /* MC_CMD_SET_FUNC_OUT msgresponse */
  1080. #define MC_CMD_SET_FUNC_OUT_LEN 0
  1081. /***********************************/
  1082. /* MC_CMD_GET_BOOT_STATUS
  1083. * Get the instruction address from which the MC booted.
  1084. */
  1085. #define MC_CMD_GET_BOOT_STATUS 0x5
  1086. #define MC_CMD_0x5_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  1087. /* MC_CMD_GET_BOOT_STATUS_IN msgrequest */
  1088. #define MC_CMD_GET_BOOT_STATUS_IN_LEN 0
  1089. /* MC_CMD_GET_BOOT_STATUS_OUT msgresponse */
  1090. #define MC_CMD_GET_BOOT_STATUS_OUT_LEN 8
  1091. /* ?? */
  1092. #define MC_CMD_GET_BOOT_STATUS_OUT_BOOT_OFFSET_OFST 0
  1093. #define MC_CMD_GET_BOOT_STATUS_OUT_BOOT_OFFSET_LEN 4
  1094. /* enum: indicates that the MC wasn't flash booted */
  1095. #define MC_CMD_GET_BOOT_STATUS_OUT_BOOT_OFFSET_NULL 0xdeadbeef
  1096. #define MC_CMD_GET_BOOT_STATUS_OUT_FLAGS_OFST 4
  1097. #define MC_CMD_GET_BOOT_STATUS_OUT_FLAGS_LEN 4
  1098. #define MC_CMD_GET_BOOT_STATUS_OUT_FLAGS_WATCHDOG_LBN 0
  1099. #define MC_CMD_GET_BOOT_STATUS_OUT_FLAGS_WATCHDOG_WIDTH 1
  1100. #define MC_CMD_GET_BOOT_STATUS_OUT_FLAGS_PRIMARY_LBN 1
  1101. #define MC_CMD_GET_BOOT_STATUS_OUT_FLAGS_PRIMARY_WIDTH 1
  1102. #define MC_CMD_GET_BOOT_STATUS_OUT_FLAGS_BACKUP_LBN 2
  1103. #define MC_CMD_GET_BOOT_STATUS_OUT_FLAGS_BACKUP_WIDTH 1
  1104. /***********************************/
  1105. /* MC_CMD_GET_ASSERTS
  1106. * Get (and optionally clear) the current assertion status. Only
  1107. * OUT.GLOBAL_FLAGS is guaranteed to exist in the completion payload. The other
  1108. * fields will only be present if OUT.GLOBAL_FLAGS != NO_FAILS
  1109. */
  1110. #define MC_CMD_GET_ASSERTS 0x6
  1111. #define MC_CMD_0x6_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  1112. /* MC_CMD_GET_ASSERTS_IN msgrequest */
  1113. #define MC_CMD_GET_ASSERTS_IN_LEN 4
  1114. /* Set to clear assertion */
  1115. #define MC_CMD_GET_ASSERTS_IN_CLEAR_OFST 0
  1116. #define MC_CMD_GET_ASSERTS_IN_CLEAR_LEN 4
  1117. /* MC_CMD_GET_ASSERTS_OUT msgresponse */
  1118. #define MC_CMD_GET_ASSERTS_OUT_LEN 140
  1119. /* Assertion status flag. */
  1120. #define MC_CMD_GET_ASSERTS_OUT_GLOBAL_FLAGS_OFST 0
  1121. #define MC_CMD_GET_ASSERTS_OUT_GLOBAL_FLAGS_LEN 4
  1122. /* enum: No assertions have failed. */
  1123. #define MC_CMD_GET_ASSERTS_FLAGS_NO_FAILS 0x1
  1124. /* enum: A system-level assertion has failed. */
  1125. #define MC_CMD_GET_ASSERTS_FLAGS_SYS_FAIL 0x2
  1126. /* enum: A thread-level assertion has failed. */
  1127. #define MC_CMD_GET_ASSERTS_FLAGS_THR_FAIL 0x3
  1128. /* enum: The system was reset by the watchdog. */
  1129. #define MC_CMD_GET_ASSERTS_FLAGS_WDOG_FIRED 0x4
  1130. /* enum: An illegal address trap stopped the system (huntington and later) */
  1131. #define MC_CMD_GET_ASSERTS_FLAGS_ADDR_TRAP 0x5
  1132. /* Failing PC value */
  1133. #define MC_CMD_GET_ASSERTS_OUT_SAVED_PC_OFFS_OFST 4
  1134. #define MC_CMD_GET_ASSERTS_OUT_SAVED_PC_OFFS_LEN 4
  1135. /* Saved GP regs */
  1136. #define MC_CMD_GET_ASSERTS_OUT_GP_REGS_OFFS_OFST 8
  1137. #define MC_CMD_GET_ASSERTS_OUT_GP_REGS_OFFS_LEN 4
  1138. #define MC_CMD_GET_ASSERTS_OUT_GP_REGS_OFFS_NUM 31
  1139. /* enum: A magic value hinting that the value in this register at the time of
  1140. * the failure has likely been lost.
  1141. */
  1142. #define MC_CMD_GET_ASSERTS_REG_NO_DATA 0xda7a1057
  1143. /* Failing thread address */
  1144. #define MC_CMD_GET_ASSERTS_OUT_THREAD_OFFS_OFST 132
  1145. #define MC_CMD_GET_ASSERTS_OUT_THREAD_OFFS_LEN 4
  1146. #define MC_CMD_GET_ASSERTS_OUT_RESERVED_OFST 136
  1147. #define MC_CMD_GET_ASSERTS_OUT_RESERVED_LEN 4
  1148. /***********************************/
  1149. /* MC_CMD_LOG_CTRL
  1150. * Configure the output stream for log events such as link state changes,
  1151. * sensor notifications and MCDI completions
  1152. */
  1153. #define MC_CMD_LOG_CTRL 0x7
  1154. #define MC_CMD_0x7_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  1155. /* MC_CMD_LOG_CTRL_IN msgrequest */
  1156. #define MC_CMD_LOG_CTRL_IN_LEN 8
  1157. /* Log destination */
  1158. #define MC_CMD_LOG_CTRL_IN_LOG_DEST_OFST 0
  1159. #define MC_CMD_LOG_CTRL_IN_LOG_DEST_LEN 4
  1160. /* enum: UART. */
  1161. #define MC_CMD_LOG_CTRL_IN_LOG_DEST_UART 0x1
  1162. /* enum: Event queue. */
  1163. #define MC_CMD_LOG_CTRL_IN_LOG_DEST_EVQ 0x2
  1164. /* Legacy argument. Must be zero. */
  1165. #define MC_CMD_LOG_CTRL_IN_LOG_DEST_EVQ_OFST 4
  1166. #define MC_CMD_LOG_CTRL_IN_LOG_DEST_EVQ_LEN 4
  1167. /* MC_CMD_LOG_CTRL_OUT msgresponse */
  1168. #define MC_CMD_LOG_CTRL_OUT_LEN 0
  1169. /***********************************/
  1170. /* MC_CMD_GET_VERSION
  1171. * Get version information about the MC firmware.
  1172. */
  1173. #define MC_CMD_GET_VERSION 0x8
  1174. #define MC_CMD_0x8_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  1175. /* MC_CMD_GET_VERSION_IN msgrequest */
  1176. #define MC_CMD_GET_VERSION_IN_LEN 0
  1177. /* MC_CMD_GET_VERSION_EXT_IN msgrequest: Asks for the extended version */
  1178. #define MC_CMD_GET_VERSION_EXT_IN_LEN 4
  1179. /* placeholder, set to 0 */
  1180. #define MC_CMD_GET_VERSION_EXT_IN_EXT_FLAGS_OFST 0
  1181. #define MC_CMD_GET_VERSION_EXT_IN_EXT_FLAGS_LEN 4
  1182. /* MC_CMD_GET_VERSION_V0_OUT msgresponse: deprecated version format */
  1183. #define MC_CMD_GET_VERSION_V0_OUT_LEN 4
  1184. #define MC_CMD_GET_VERSION_OUT_FIRMWARE_OFST 0
  1185. #define MC_CMD_GET_VERSION_OUT_FIRMWARE_LEN 4
  1186. /* enum: Reserved version number to indicate "any" version. */
  1187. #define MC_CMD_GET_VERSION_OUT_FIRMWARE_ANY 0xffffffff
  1188. /* enum: Bootrom version value for Siena. */
  1189. #define MC_CMD_GET_VERSION_OUT_FIRMWARE_SIENA_BOOTROM 0xb0070000
  1190. /* enum: Bootrom version value for Huntington. */
  1191. #define MC_CMD_GET_VERSION_OUT_FIRMWARE_HUNT_BOOTROM 0xb0070001
  1192. /* enum: Bootrom version value for Medford2. */
  1193. #define MC_CMD_GET_VERSION_OUT_FIRMWARE_MEDFORD2_BOOTROM 0xb0070002
  1194. /* MC_CMD_GET_VERSION_OUT msgresponse */
  1195. #define MC_CMD_GET_VERSION_OUT_LEN 32
  1196. /* MC_CMD_GET_VERSION_OUT_FIRMWARE_OFST 0 */
  1197. /* MC_CMD_GET_VERSION_OUT_FIRMWARE_LEN 4 */
  1198. /* Enum values, see field(s): */
  1199. /* MC_CMD_GET_VERSION_V0_OUT/MC_CMD_GET_VERSION_OUT_FIRMWARE */
  1200. #define MC_CMD_GET_VERSION_OUT_PCOL_OFST 4
  1201. #define MC_CMD_GET_VERSION_OUT_PCOL_LEN 4
  1202. /* 128bit mask of functions supported by the current firmware */
  1203. #define MC_CMD_GET_VERSION_OUT_SUPPORTED_FUNCS_OFST 8
  1204. #define MC_CMD_GET_VERSION_OUT_SUPPORTED_FUNCS_LEN 16
  1205. #define MC_CMD_GET_VERSION_OUT_VERSION_OFST 24
  1206. #define MC_CMD_GET_VERSION_OUT_VERSION_LEN 8
  1207. #define MC_CMD_GET_VERSION_OUT_VERSION_LO_OFST 24
  1208. #define MC_CMD_GET_VERSION_OUT_VERSION_HI_OFST 28
  1209. /* MC_CMD_GET_VERSION_EXT_OUT msgresponse */
  1210. #define MC_CMD_GET_VERSION_EXT_OUT_LEN 48
  1211. /* MC_CMD_GET_VERSION_OUT_FIRMWARE_OFST 0 */
  1212. /* MC_CMD_GET_VERSION_OUT_FIRMWARE_LEN 4 */
  1213. /* Enum values, see field(s): */
  1214. /* MC_CMD_GET_VERSION_V0_OUT/MC_CMD_GET_VERSION_OUT_FIRMWARE */
  1215. #define MC_CMD_GET_VERSION_EXT_OUT_PCOL_OFST 4
  1216. #define MC_CMD_GET_VERSION_EXT_OUT_PCOL_LEN 4
  1217. /* 128bit mask of functions supported by the current firmware */
  1218. #define MC_CMD_GET_VERSION_EXT_OUT_SUPPORTED_FUNCS_OFST 8
  1219. #define MC_CMD_GET_VERSION_EXT_OUT_SUPPORTED_FUNCS_LEN 16
  1220. #define MC_CMD_GET_VERSION_EXT_OUT_VERSION_OFST 24
  1221. #define MC_CMD_GET_VERSION_EXT_OUT_VERSION_LEN 8
  1222. #define MC_CMD_GET_VERSION_EXT_OUT_VERSION_LO_OFST 24
  1223. #define MC_CMD_GET_VERSION_EXT_OUT_VERSION_HI_OFST 28
  1224. /* extra info */
  1225. #define MC_CMD_GET_VERSION_EXT_OUT_EXTRA_OFST 32
  1226. #define MC_CMD_GET_VERSION_EXT_OUT_EXTRA_LEN 16
  1227. /***********************************/
  1228. /* MC_CMD_PTP
  1229. * Perform PTP operation
  1230. */
  1231. #define MC_CMD_PTP 0xb
  1232. #define MC_CMD_0xb_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  1233. /* MC_CMD_PTP_IN msgrequest */
  1234. #define MC_CMD_PTP_IN_LEN 1
  1235. /* PTP operation code */
  1236. #define MC_CMD_PTP_IN_OP_OFST 0
  1237. #define MC_CMD_PTP_IN_OP_LEN 1
  1238. /* enum: Enable PTP packet timestamping operation. */
  1239. #define MC_CMD_PTP_OP_ENABLE 0x1
  1240. /* enum: Disable PTP packet timestamping operation. */
  1241. #define MC_CMD_PTP_OP_DISABLE 0x2
  1242. /* enum: Send a PTP packet. This operation is used on Siena and Huntington.
  1243. * From Medford onwards it is not supported: on those platforms PTP transmit
  1244. * timestamping is done using the fast path.
  1245. */
  1246. #define MC_CMD_PTP_OP_TRANSMIT 0x3
  1247. /* enum: Read the current NIC time. */
  1248. #define MC_CMD_PTP_OP_READ_NIC_TIME 0x4
  1249. /* enum: Get the current PTP status. Note that the clock frequency returned (in
  1250. * Hz) is rounded to the nearest MHz (e.g. 666000000 for 666666666).
  1251. */
  1252. #define MC_CMD_PTP_OP_STATUS 0x5
  1253. /* enum: Adjust the PTP NIC's time. */
  1254. #define MC_CMD_PTP_OP_ADJUST 0x6
  1255. /* enum: Synchronize host and NIC time. */
  1256. #define MC_CMD_PTP_OP_SYNCHRONIZE 0x7
  1257. /* enum: Basic manufacturing tests. Siena PTP adapters only. */
  1258. #define MC_CMD_PTP_OP_MANFTEST_BASIC 0x8
  1259. /* enum: Packet based manufacturing tests. Siena PTP adapters only. */
  1260. #define MC_CMD_PTP_OP_MANFTEST_PACKET 0x9
  1261. /* enum: Reset some of the PTP related statistics */
  1262. #define MC_CMD_PTP_OP_RESET_STATS 0xa
  1263. /* enum: Debug operations to MC. */
  1264. #define MC_CMD_PTP_OP_DEBUG 0xb
  1265. /* enum: Read an FPGA register. Siena PTP adapters only. */
  1266. #define MC_CMD_PTP_OP_FPGAREAD 0xc
  1267. /* enum: Write an FPGA register. Siena PTP adapters only. */
  1268. #define MC_CMD_PTP_OP_FPGAWRITE 0xd
  1269. /* enum: Apply an offset to the NIC clock */
  1270. #define MC_CMD_PTP_OP_CLOCK_OFFSET_ADJUST 0xe
  1271. /* enum: Change the frequency correction applied to the NIC clock */
  1272. #define MC_CMD_PTP_OP_CLOCK_FREQ_ADJUST 0xf
  1273. /* enum: Set the MC packet filter VLAN tags for received PTP packets.
  1274. * Deprecated for Huntington onwards.
  1275. */
  1276. #define MC_CMD_PTP_OP_RX_SET_VLAN_FILTER 0x10
  1277. /* enum: Set the MC packet filter UUID for received PTP packets. Deprecated for
  1278. * Huntington onwards.
  1279. */
  1280. #define MC_CMD_PTP_OP_RX_SET_UUID_FILTER 0x11
  1281. /* enum: Set the MC packet filter Domain for received PTP packets. Deprecated
  1282. * for Huntington onwards.
  1283. */
  1284. #define MC_CMD_PTP_OP_RX_SET_DOMAIN_FILTER 0x12
  1285. /* enum: Set the clock source. Required for snapper tests on Huntington and
  1286. * Medford. Not implemented for Siena or Medford2.
  1287. */
  1288. #define MC_CMD_PTP_OP_SET_CLK_SRC 0x13
  1289. /* enum: Reset value of Timer Reg. Not implemented. */
  1290. #define MC_CMD_PTP_OP_RST_CLK 0x14
  1291. /* enum: Enable the forwarding of PPS events to the host */
  1292. #define MC_CMD_PTP_OP_PPS_ENABLE 0x15
  1293. /* enum: Get the time format used by this NIC for PTP operations */
  1294. #define MC_CMD_PTP_OP_GET_TIME_FORMAT 0x16
  1295. /* enum: Get the clock attributes. NOTE- extended version of
  1296. * MC_CMD_PTP_OP_GET_TIME_FORMAT
  1297. */
  1298. #define MC_CMD_PTP_OP_GET_ATTRIBUTES 0x16
  1299. /* enum: Get corrections that should be applied to the various different
  1300. * timestamps
  1301. */
  1302. #define MC_CMD_PTP_OP_GET_TIMESTAMP_CORRECTIONS 0x17
  1303. /* enum: Subscribe to receive periodic time events indicating the current NIC
  1304. * time
  1305. */
  1306. #define MC_CMD_PTP_OP_TIME_EVENT_SUBSCRIBE 0x18
  1307. /* enum: Unsubscribe to stop receiving time events */
  1308. #define MC_CMD_PTP_OP_TIME_EVENT_UNSUBSCRIBE 0x19
  1309. /* enum: PPS based manfacturing tests. Requires PPS output to be looped to PPS
  1310. * input on the same NIC. Siena PTP adapters only.
  1311. */
  1312. #define MC_CMD_PTP_OP_MANFTEST_PPS 0x1a
  1313. /* enum: Set the PTP sync status. Status is used by firmware to report to event
  1314. * subscribers.
  1315. */
  1316. #define MC_CMD_PTP_OP_SET_SYNC_STATUS 0x1b
  1317. /* enum: Above this for future use. */
  1318. #define MC_CMD_PTP_OP_MAX 0x1c
  1319. /* MC_CMD_PTP_IN_ENABLE msgrequest */
  1320. #define MC_CMD_PTP_IN_ENABLE_LEN 16
  1321. #define MC_CMD_PTP_IN_CMD_OFST 0
  1322. #define MC_CMD_PTP_IN_CMD_LEN 4
  1323. #define MC_CMD_PTP_IN_PERIPH_ID_OFST 4
  1324. #define MC_CMD_PTP_IN_PERIPH_ID_LEN 4
  1325. /* Not used. Events are always sent to function relative queue 0. */
  1326. #define MC_CMD_PTP_IN_ENABLE_QUEUE_OFST 8
  1327. #define MC_CMD_PTP_IN_ENABLE_QUEUE_LEN 4
  1328. /* PTP timestamping mode. Not used from Huntington onwards. */
  1329. #define MC_CMD_PTP_IN_ENABLE_MODE_OFST 12
  1330. #define MC_CMD_PTP_IN_ENABLE_MODE_LEN 4
  1331. /* enum: PTP, version 1 */
  1332. #define MC_CMD_PTP_MODE_V1 0x0
  1333. /* enum: PTP, version 1, with VLAN headers - deprecated */
  1334. #define MC_CMD_PTP_MODE_V1_VLAN 0x1
  1335. /* enum: PTP, version 2 */
  1336. #define MC_CMD_PTP_MODE_V2 0x2
  1337. /* enum: PTP, version 2, with VLAN headers - deprecated */
  1338. #define MC_CMD_PTP_MODE_V2_VLAN 0x3
  1339. /* enum: PTP, version 2, with improved UUID filtering */
  1340. #define MC_CMD_PTP_MODE_V2_ENHANCED 0x4
  1341. /* enum: FCoE (seconds and microseconds) */
  1342. #define MC_CMD_PTP_MODE_FCOE 0x5
  1343. /* MC_CMD_PTP_IN_DISABLE msgrequest */
  1344. #define MC_CMD_PTP_IN_DISABLE_LEN 8
  1345. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1346. /* MC_CMD_PTP_IN_CMD_LEN 4 */
  1347. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1348. /* MC_CMD_PTP_IN_PERIPH_ID_LEN 4 */
  1349. /* MC_CMD_PTP_IN_TRANSMIT msgrequest */
  1350. #define MC_CMD_PTP_IN_TRANSMIT_LENMIN 13
  1351. #define MC_CMD_PTP_IN_TRANSMIT_LENMAX 252
  1352. #define MC_CMD_PTP_IN_TRANSMIT_LEN(num) (12+1*(num))
  1353. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1354. /* MC_CMD_PTP_IN_CMD_LEN 4 */
  1355. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1356. /* MC_CMD_PTP_IN_PERIPH_ID_LEN 4 */
  1357. /* Transmit packet length */
  1358. #define MC_CMD_PTP_IN_TRANSMIT_LENGTH_OFST 8
  1359. #define MC_CMD_PTP_IN_TRANSMIT_LENGTH_LEN 4
  1360. /* Transmit packet data */
  1361. #define MC_CMD_PTP_IN_TRANSMIT_PACKET_OFST 12
  1362. #define MC_CMD_PTP_IN_TRANSMIT_PACKET_LEN 1
  1363. #define MC_CMD_PTP_IN_TRANSMIT_PACKET_MINNUM 1
  1364. #define MC_CMD_PTP_IN_TRANSMIT_PACKET_MAXNUM 240
  1365. /* MC_CMD_PTP_IN_READ_NIC_TIME msgrequest */
  1366. #define MC_CMD_PTP_IN_READ_NIC_TIME_LEN 8
  1367. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1368. /* MC_CMD_PTP_IN_CMD_LEN 4 */
  1369. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1370. /* MC_CMD_PTP_IN_PERIPH_ID_LEN 4 */
  1371. /* MC_CMD_PTP_IN_READ_NIC_TIME_V2 msgrequest */
  1372. #define MC_CMD_PTP_IN_READ_NIC_TIME_V2_LEN 8
  1373. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1374. /* MC_CMD_PTP_IN_CMD_LEN 4 */
  1375. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1376. /* MC_CMD_PTP_IN_PERIPH_ID_LEN 4 */
  1377. /* MC_CMD_PTP_IN_STATUS msgrequest */
  1378. #define MC_CMD_PTP_IN_STATUS_LEN 8
  1379. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1380. /* MC_CMD_PTP_IN_CMD_LEN 4 */
  1381. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1382. /* MC_CMD_PTP_IN_PERIPH_ID_LEN 4 */
  1383. /* MC_CMD_PTP_IN_ADJUST msgrequest */
  1384. #define MC_CMD_PTP_IN_ADJUST_LEN 24
  1385. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1386. /* MC_CMD_PTP_IN_CMD_LEN 4 */
  1387. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1388. /* MC_CMD_PTP_IN_PERIPH_ID_LEN 4 */
  1389. /* Frequency adjustment 40 bit fixed point ns */
  1390. #define MC_CMD_PTP_IN_ADJUST_FREQ_OFST 8
  1391. #define MC_CMD_PTP_IN_ADJUST_FREQ_LEN 8
  1392. #define MC_CMD_PTP_IN_ADJUST_FREQ_LO_OFST 8
  1393. #define MC_CMD_PTP_IN_ADJUST_FREQ_HI_OFST 12
  1394. /* enum: Number of fractional bits in frequency adjustment */
  1395. #define MC_CMD_PTP_IN_ADJUST_BITS 0x28
  1396. /* enum: Number of fractional bits in frequency adjustment when FP44_FREQ_ADJ
  1397. * is indicated in the MC_CMD_PTP_OUT_GET_ATTRIBUTES command CAPABILITIES
  1398. * field.
  1399. */
  1400. #define MC_CMD_PTP_IN_ADJUST_BITS_FP44 0x2c
  1401. /* Time adjustment in seconds */
  1402. #define MC_CMD_PTP_IN_ADJUST_SECONDS_OFST 16
  1403. #define MC_CMD_PTP_IN_ADJUST_SECONDS_LEN 4
  1404. /* Time adjustment major value */
  1405. #define MC_CMD_PTP_IN_ADJUST_MAJOR_OFST 16
  1406. #define MC_CMD_PTP_IN_ADJUST_MAJOR_LEN 4
  1407. /* Time adjustment in nanoseconds */
  1408. #define MC_CMD_PTP_IN_ADJUST_NANOSECONDS_OFST 20
  1409. #define MC_CMD_PTP_IN_ADJUST_NANOSECONDS_LEN 4
  1410. /* Time adjustment minor value */
  1411. #define MC_CMD_PTP_IN_ADJUST_MINOR_OFST 20
  1412. #define MC_CMD_PTP_IN_ADJUST_MINOR_LEN 4
  1413. /* MC_CMD_PTP_IN_ADJUST_V2 msgrequest */
  1414. #define MC_CMD_PTP_IN_ADJUST_V2_LEN 28
  1415. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1416. /* MC_CMD_PTP_IN_CMD_LEN 4 */
  1417. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1418. /* MC_CMD_PTP_IN_PERIPH_ID_LEN 4 */
  1419. /* Frequency adjustment 40 bit fixed point ns */
  1420. #define MC_CMD_PTP_IN_ADJUST_V2_FREQ_OFST 8
  1421. #define MC_CMD_PTP_IN_ADJUST_V2_FREQ_LEN 8
  1422. #define MC_CMD_PTP_IN_ADJUST_V2_FREQ_LO_OFST 8
  1423. #define MC_CMD_PTP_IN_ADJUST_V2_FREQ_HI_OFST 12
  1424. /* enum: Number of fractional bits in frequency adjustment */
  1425. /* MC_CMD_PTP_IN_ADJUST_BITS 0x28 */
  1426. /* enum: Number of fractional bits in frequency adjustment when FP44_FREQ_ADJ
  1427. * is indicated in the MC_CMD_PTP_OUT_GET_ATTRIBUTES command CAPABILITIES
  1428. * field.
  1429. */
  1430. /* MC_CMD_PTP_IN_ADJUST_BITS_FP44 0x2c */
  1431. /* Time adjustment in seconds */
  1432. #define MC_CMD_PTP_IN_ADJUST_V2_SECONDS_OFST 16
  1433. #define MC_CMD_PTP_IN_ADJUST_V2_SECONDS_LEN 4
  1434. /* Time adjustment major value */
  1435. #define MC_CMD_PTP_IN_ADJUST_V2_MAJOR_OFST 16
  1436. #define MC_CMD_PTP_IN_ADJUST_V2_MAJOR_LEN 4
  1437. /* Time adjustment in nanoseconds */
  1438. #define MC_CMD_PTP_IN_ADJUST_V2_NANOSECONDS_OFST 20
  1439. #define MC_CMD_PTP_IN_ADJUST_V2_NANOSECONDS_LEN 4
  1440. /* Time adjustment minor value */
  1441. #define MC_CMD_PTP_IN_ADJUST_V2_MINOR_OFST 20
  1442. #define MC_CMD_PTP_IN_ADJUST_V2_MINOR_LEN 4
  1443. /* Upper 32bits of major time offset adjustment */
  1444. #define MC_CMD_PTP_IN_ADJUST_V2_MAJOR_HI_OFST 24
  1445. #define MC_CMD_PTP_IN_ADJUST_V2_MAJOR_HI_LEN 4
  1446. /* MC_CMD_PTP_IN_SYNCHRONIZE msgrequest */
  1447. #define MC_CMD_PTP_IN_SYNCHRONIZE_LEN 20
  1448. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1449. /* MC_CMD_PTP_IN_CMD_LEN 4 */
  1450. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1451. /* MC_CMD_PTP_IN_PERIPH_ID_LEN 4 */
  1452. /* Number of time readings to capture */
  1453. #define MC_CMD_PTP_IN_SYNCHRONIZE_NUMTIMESETS_OFST 8
  1454. #define MC_CMD_PTP_IN_SYNCHRONIZE_NUMTIMESETS_LEN 4
  1455. /* Host address in which to write "synchronization started" indication (64
  1456. * bits)
  1457. */
  1458. #define MC_CMD_PTP_IN_SYNCHRONIZE_START_ADDR_OFST 12
  1459. #define MC_CMD_PTP_IN_SYNCHRONIZE_START_ADDR_LEN 8
  1460. #define MC_CMD_PTP_IN_SYNCHRONIZE_START_ADDR_LO_OFST 12
  1461. #define MC_CMD_PTP_IN_SYNCHRONIZE_START_ADDR_HI_OFST 16
  1462. /* MC_CMD_PTP_IN_MANFTEST_BASIC msgrequest */
  1463. #define MC_CMD_PTP_IN_MANFTEST_BASIC_LEN 8
  1464. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1465. /* MC_CMD_PTP_IN_CMD_LEN 4 */
  1466. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1467. /* MC_CMD_PTP_IN_PERIPH_ID_LEN 4 */
  1468. /* MC_CMD_PTP_IN_MANFTEST_PACKET msgrequest */
  1469. #define MC_CMD_PTP_IN_MANFTEST_PACKET_LEN 12
  1470. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1471. /* MC_CMD_PTP_IN_CMD_LEN 4 */
  1472. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1473. /* MC_CMD_PTP_IN_PERIPH_ID_LEN 4 */
  1474. /* Enable or disable packet testing */
  1475. #define MC_CMD_PTP_IN_MANFTEST_PACKET_TEST_ENABLE_OFST 8
  1476. #define MC_CMD_PTP_IN_MANFTEST_PACKET_TEST_ENABLE_LEN 4
  1477. /* MC_CMD_PTP_IN_RESET_STATS msgrequest: Reset PTP statistics */
  1478. #define MC_CMD_PTP_IN_RESET_STATS_LEN 8
  1479. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1480. /* MC_CMD_PTP_IN_CMD_LEN 4 */
  1481. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1482. /* MC_CMD_PTP_IN_PERIPH_ID_LEN 4 */
  1483. /* MC_CMD_PTP_IN_DEBUG msgrequest */
  1484. #define MC_CMD_PTP_IN_DEBUG_LEN 12
  1485. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1486. /* MC_CMD_PTP_IN_CMD_LEN 4 */
  1487. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1488. /* MC_CMD_PTP_IN_PERIPH_ID_LEN 4 */
  1489. /* Debug operations */
  1490. #define MC_CMD_PTP_IN_DEBUG_DEBUG_PARAM_OFST 8
  1491. #define MC_CMD_PTP_IN_DEBUG_DEBUG_PARAM_LEN 4
  1492. /* MC_CMD_PTP_IN_FPGAREAD msgrequest */
  1493. #define MC_CMD_PTP_IN_FPGAREAD_LEN 16
  1494. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1495. /* MC_CMD_PTP_IN_CMD_LEN 4 */
  1496. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1497. /* MC_CMD_PTP_IN_PERIPH_ID_LEN 4 */
  1498. #define MC_CMD_PTP_IN_FPGAREAD_ADDR_OFST 8
  1499. #define MC_CMD_PTP_IN_FPGAREAD_ADDR_LEN 4
  1500. #define MC_CMD_PTP_IN_FPGAREAD_NUMBYTES_OFST 12
  1501. #define MC_CMD_PTP_IN_FPGAREAD_NUMBYTES_LEN 4
  1502. /* MC_CMD_PTP_IN_FPGAWRITE msgrequest */
  1503. #define MC_CMD_PTP_IN_FPGAWRITE_LENMIN 13
  1504. #define MC_CMD_PTP_IN_FPGAWRITE_LENMAX 252
  1505. #define MC_CMD_PTP_IN_FPGAWRITE_LEN(num) (12+1*(num))
  1506. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1507. /* MC_CMD_PTP_IN_CMD_LEN 4 */
  1508. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1509. /* MC_CMD_PTP_IN_PERIPH_ID_LEN 4 */
  1510. #define MC_CMD_PTP_IN_FPGAWRITE_ADDR_OFST 8
  1511. #define MC_CMD_PTP_IN_FPGAWRITE_ADDR_LEN 4
  1512. #define MC_CMD_PTP_IN_FPGAWRITE_BUFFER_OFST 12
  1513. #define MC_CMD_PTP_IN_FPGAWRITE_BUFFER_LEN 1
  1514. #define MC_CMD_PTP_IN_FPGAWRITE_BUFFER_MINNUM 1
  1515. #define MC_CMD_PTP_IN_FPGAWRITE_BUFFER_MAXNUM 240
  1516. /* MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST msgrequest */
  1517. #define MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_LEN 16
  1518. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1519. /* MC_CMD_PTP_IN_CMD_LEN 4 */
  1520. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1521. /* MC_CMD_PTP_IN_PERIPH_ID_LEN 4 */
  1522. /* Time adjustment in seconds */
  1523. #define MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_SECONDS_OFST 8
  1524. #define MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_SECONDS_LEN 4
  1525. /* Time adjustment major value */
  1526. #define MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_MAJOR_OFST 8
  1527. #define MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_MAJOR_LEN 4
  1528. /* Time adjustment in nanoseconds */
  1529. #define MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_NANOSECONDS_OFST 12
  1530. #define MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_NANOSECONDS_LEN 4
  1531. /* Time adjustment minor value */
  1532. #define MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_MINOR_OFST 12
  1533. #define MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_MINOR_LEN 4
  1534. /* MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_V2 msgrequest */
  1535. #define MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_V2_LEN 20
  1536. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1537. /* MC_CMD_PTP_IN_CMD_LEN 4 */
  1538. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1539. /* MC_CMD_PTP_IN_PERIPH_ID_LEN 4 */
  1540. /* Time adjustment in seconds */
  1541. #define MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_V2_SECONDS_OFST 8
  1542. #define MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_V2_SECONDS_LEN 4
  1543. /* Time adjustment major value */
  1544. #define MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_V2_MAJOR_OFST 8
  1545. #define MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_V2_MAJOR_LEN 4
  1546. /* Time adjustment in nanoseconds */
  1547. #define MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_V2_NANOSECONDS_OFST 12
  1548. #define MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_V2_NANOSECONDS_LEN 4
  1549. /* Time adjustment minor value */
  1550. #define MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_V2_MINOR_OFST 12
  1551. #define MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_V2_MINOR_LEN 4
  1552. /* Upper 32bits of major time offset adjustment */
  1553. #define MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_V2_MAJOR_HI_OFST 16
  1554. #define MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_V2_MAJOR_HI_LEN 4
  1555. /* MC_CMD_PTP_IN_CLOCK_FREQ_ADJUST msgrequest */
  1556. #define MC_CMD_PTP_IN_CLOCK_FREQ_ADJUST_LEN 16
  1557. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1558. /* MC_CMD_PTP_IN_CMD_LEN 4 */
  1559. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1560. /* MC_CMD_PTP_IN_PERIPH_ID_LEN 4 */
  1561. /* Frequency adjustment 40 bit fixed point ns */
  1562. #define MC_CMD_PTP_IN_CLOCK_FREQ_ADJUST_FREQ_OFST 8
  1563. #define MC_CMD_PTP_IN_CLOCK_FREQ_ADJUST_FREQ_LEN 8
  1564. #define MC_CMD_PTP_IN_CLOCK_FREQ_ADJUST_FREQ_LO_OFST 8
  1565. #define MC_CMD_PTP_IN_CLOCK_FREQ_ADJUST_FREQ_HI_OFST 12
  1566. /* Enum values, see field(s): */
  1567. /* MC_CMD_PTP/MC_CMD_PTP_IN_ADJUST/FREQ */
  1568. /* MC_CMD_PTP_IN_RX_SET_VLAN_FILTER msgrequest */
  1569. #define MC_CMD_PTP_IN_RX_SET_VLAN_FILTER_LEN 24
  1570. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1571. /* MC_CMD_PTP_IN_CMD_LEN 4 */
  1572. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1573. /* MC_CMD_PTP_IN_PERIPH_ID_LEN 4 */
  1574. /* Number of VLAN tags, 0 if not VLAN */
  1575. #define MC_CMD_PTP_IN_RX_SET_VLAN_FILTER_NUM_VLAN_TAGS_OFST 8
  1576. #define MC_CMD_PTP_IN_RX_SET_VLAN_FILTER_NUM_VLAN_TAGS_LEN 4
  1577. /* Set of VLAN tags to filter against */
  1578. #define MC_CMD_PTP_IN_RX_SET_VLAN_FILTER_VLAN_TAG_OFST 12
  1579. #define MC_CMD_PTP_IN_RX_SET_VLAN_FILTER_VLAN_TAG_LEN 4
  1580. #define MC_CMD_PTP_IN_RX_SET_VLAN_FILTER_VLAN_TAG_NUM 3
  1581. /* MC_CMD_PTP_IN_RX_SET_UUID_FILTER msgrequest */
  1582. #define MC_CMD_PTP_IN_RX_SET_UUID_FILTER_LEN 20
  1583. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1584. /* MC_CMD_PTP_IN_CMD_LEN 4 */
  1585. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1586. /* MC_CMD_PTP_IN_PERIPH_ID_LEN 4 */
  1587. /* 1 to enable UUID filtering, 0 to disable */
  1588. #define MC_CMD_PTP_IN_RX_SET_UUID_FILTER_ENABLE_OFST 8
  1589. #define MC_CMD_PTP_IN_RX_SET_UUID_FILTER_ENABLE_LEN 4
  1590. /* UUID to filter against */
  1591. #define MC_CMD_PTP_IN_RX_SET_UUID_FILTER_UUID_OFST 12
  1592. #define MC_CMD_PTP_IN_RX_SET_UUID_FILTER_UUID_LEN 8
  1593. #define MC_CMD_PTP_IN_RX_SET_UUID_FILTER_UUID_LO_OFST 12
  1594. #define MC_CMD_PTP_IN_RX_SET_UUID_FILTER_UUID_HI_OFST 16
  1595. /* MC_CMD_PTP_IN_RX_SET_DOMAIN_FILTER msgrequest */
  1596. #define MC_CMD_PTP_IN_RX_SET_DOMAIN_FILTER_LEN 16
  1597. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1598. /* MC_CMD_PTP_IN_CMD_LEN 4 */
  1599. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1600. /* MC_CMD_PTP_IN_PERIPH_ID_LEN 4 */
  1601. /* 1 to enable Domain filtering, 0 to disable */
  1602. #define MC_CMD_PTP_IN_RX_SET_DOMAIN_FILTER_ENABLE_OFST 8
  1603. #define MC_CMD_PTP_IN_RX_SET_DOMAIN_FILTER_ENABLE_LEN 4
  1604. /* Domain number to filter against */
  1605. #define MC_CMD_PTP_IN_RX_SET_DOMAIN_FILTER_DOMAIN_OFST 12
  1606. #define MC_CMD_PTP_IN_RX_SET_DOMAIN_FILTER_DOMAIN_LEN 4
  1607. /* MC_CMD_PTP_IN_SET_CLK_SRC msgrequest */
  1608. #define MC_CMD_PTP_IN_SET_CLK_SRC_LEN 12
  1609. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1610. /* MC_CMD_PTP_IN_CMD_LEN 4 */
  1611. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1612. /* MC_CMD_PTP_IN_PERIPH_ID_LEN 4 */
  1613. /* Set the clock source. */
  1614. #define MC_CMD_PTP_IN_SET_CLK_SRC_CLK_OFST 8
  1615. #define MC_CMD_PTP_IN_SET_CLK_SRC_CLK_LEN 4
  1616. /* enum: Internal. */
  1617. #define MC_CMD_PTP_CLK_SRC_INTERNAL 0x0
  1618. /* enum: External. */
  1619. #define MC_CMD_PTP_CLK_SRC_EXTERNAL 0x1
  1620. /* MC_CMD_PTP_IN_RST_CLK msgrequest: Reset value of Timer Reg. */
  1621. #define MC_CMD_PTP_IN_RST_CLK_LEN 8
  1622. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1623. /* MC_CMD_PTP_IN_CMD_LEN 4 */
  1624. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1625. /* MC_CMD_PTP_IN_PERIPH_ID_LEN 4 */
  1626. /* MC_CMD_PTP_IN_PPS_ENABLE msgrequest */
  1627. #define MC_CMD_PTP_IN_PPS_ENABLE_LEN 12
  1628. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1629. /* MC_CMD_PTP_IN_CMD_LEN 4 */
  1630. /* Enable or disable */
  1631. #define MC_CMD_PTP_IN_PPS_ENABLE_OP_OFST 4
  1632. #define MC_CMD_PTP_IN_PPS_ENABLE_OP_LEN 4
  1633. /* enum: Enable */
  1634. #define MC_CMD_PTP_ENABLE_PPS 0x0
  1635. /* enum: Disable */
  1636. #define MC_CMD_PTP_DISABLE_PPS 0x1
  1637. /* Not used. Events are always sent to function relative queue 0. */
  1638. #define MC_CMD_PTP_IN_PPS_ENABLE_QUEUE_ID_OFST 8
  1639. #define MC_CMD_PTP_IN_PPS_ENABLE_QUEUE_ID_LEN 4
  1640. /* MC_CMD_PTP_IN_GET_TIME_FORMAT msgrequest */
  1641. #define MC_CMD_PTP_IN_GET_TIME_FORMAT_LEN 8
  1642. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1643. /* MC_CMD_PTP_IN_CMD_LEN 4 */
  1644. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1645. /* MC_CMD_PTP_IN_PERIPH_ID_LEN 4 */
  1646. /* MC_CMD_PTP_IN_GET_ATTRIBUTES msgrequest */
  1647. #define MC_CMD_PTP_IN_GET_ATTRIBUTES_LEN 8
  1648. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1649. /* MC_CMD_PTP_IN_CMD_LEN 4 */
  1650. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1651. /* MC_CMD_PTP_IN_PERIPH_ID_LEN 4 */
  1652. /* MC_CMD_PTP_IN_GET_TIMESTAMP_CORRECTIONS msgrequest */
  1653. #define MC_CMD_PTP_IN_GET_TIMESTAMP_CORRECTIONS_LEN 8
  1654. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1655. /* MC_CMD_PTP_IN_CMD_LEN 4 */
  1656. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1657. /* MC_CMD_PTP_IN_PERIPH_ID_LEN 4 */
  1658. /* MC_CMD_PTP_IN_TIME_EVENT_SUBSCRIBE msgrequest */
  1659. #define MC_CMD_PTP_IN_TIME_EVENT_SUBSCRIBE_LEN 12
  1660. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1661. /* MC_CMD_PTP_IN_CMD_LEN 4 */
  1662. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1663. /* MC_CMD_PTP_IN_PERIPH_ID_LEN 4 */
  1664. /* Original field containing queue ID. Now extended to include flags. */
  1665. #define MC_CMD_PTP_IN_TIME_EVENT_SUBSCRIBE_QUEUE_OFST 8
  1666. #define MC_CMD_PTP_IN_TIME_EVENT_SUBSCRIBE_QUEUE_LEN 4
  1667. #define MC_CMD_PTP_IN_TIME_EVENT_SUBSCRIBE_QUEUE_ID_LBN 0
  1668. #define MC_CMD_PTP_IN_TIME_EVENT_SUBSCRIBE_QUEUE_ID_WIDTH 16
  1669. #define MC_CMD_PTP_IN_TIME_EVENT_SUBSCRIBE_REPORT_SYNC_STATUS_LBN 31
  1670. #define MC_CMD_PTP_IN_TIME_EVENT_SUBSCRIBE_REPORT_SYNC_STATUS_WIDTH 1
  1671. /* MC_CMD_PTP_IN_TIME_EVENT_UNSUBSCRIBE msgrequest */
  1672. #define MC_CMD_PTP_IN_TIME_EVENT_UNSUBSCRIBE_LEN 16
  1673. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1674. /* MC_CMD_PTP_IN_CMD_LEN 4 */
  1675. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1676. /* MC_CMD_PTP_IN_PERIPH_ID_LEN 4 */
  1677. /* Unsubscribe options */
  1678. #define MC_CMD_PTP_IN_TIME_EVENT_UNSUBSCRIBE_CONTROL_OFST 8
  1679. #define MC_CMD_PTP_IN_TIME_EVENT_UNSUBSCRIBE_CONTROL_LEN 4
  1680. /* enum: Unsubscribe a single queue */
  1681. #define MC_CMD_PTP_IN_TIME_EVENT_UNSUBSCRIBE_SINGLE 0x0
  1682. /* enum: Unsubscribe all queues */
  1683. #define MC_CMD_PTP_IN_TIME_EVENT_UNSUBSCRIBE_ALL 0x1
  1684. /* Event queue ID */
  1685. #define MC_CMD_PTP_IN_TIME_EVENT_UNSUBSCRIBE_QUEUE_OFST 12
  1686. #define MC_CMD_PTP_IN_TIME_EVENT_UNSUBSCRIBE_QUEUE_LEN 4
  1687. /* MC_CMD_PTP_IN_MANFTEST_PPS msgrequest */
  1688. #define MC_CMD_PTP_IN_MANFTEST_PPS_LEN 12
  1689. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1690. /* MC_CMD_PTP_IN_CMD_LEN 4 */
  1691. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1692. /* MC_CMD_PTP_IN_PERIPH_ID_LEN 4 */
  1693. /* 1 to enable PPS test mode, 0 to disable and return result. */
  1694. #define MC_CMD_PTP_IN_MANFTEST_PPS_TEST_ENABLE_OFST 8
  1695. #define MC_CMD_PTP_IN_MANFTEST_PPS_TEST_ENABLE_LEN 4
  1696. /* MC_CMD_PTP_IN_SET_SYNC_STATUS msgrequest */
  1697. #define MC_CMD_PTP_IN_SET_SYNC_STATUS_LEN 24
  1698. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1699. /* MC_CMD_PTP_IN_CMD_LEN 4 */
  1700. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1701. /* MC_CMD_PTP_IN_PERIPH_ID_LEN 4 */
  1702. /* NIC - Host System Clock Synchronization status */
  1703. #define MC_CMD_PTP_IN_SET_SYNC_STATUS_STATUS_OFST 8
  1704. #define MC_CMD_PTP_IN_SET_SYNC_STATUS_STATUS_LEN 4
  1705. /* enum: Host System clock and NIC clock are not in sync */
  1706. #define MC_CMD_PTP_IN_SET_SYNC_STATUS_NOT_IN_SYNC 0x0
  1707. /* enum: Host System clock and NIC clock are synchronized */
  1708. #define MC_CMD_PTP_IN_SET_SYNC_STATUS_IN_SYNC 0x1
  1709. /* If synchronized, number of seconds until clocks should be considered to be
  1710. * no longer in sync.
  1711. */
  1712. #define MC_CMD_PTP_IN_SET_SYNC_STATUS_TIMEOUT_OFST 12
  1713. #define MC_CMD_PTP_IN_SET_SYNC_STATUS_TIMEOUT_LEN 4
  1714. #define MC_CMD_PTP_IN_SET_SYNC_STATUS_RESERVED0_OFST 16
  1715. #define MC_CMD_PTP_IN_SET_SYNC_STATUS_RESERVED0_LEN 4
  1716. #define MC_CMD_PTP_IN_SET_SYNC_STATUS_RESERVED1_OFST 20
  1717. #define MC_CMD_PTP_IN_SET_SYNC_STATUS_RESERVED1_LEN 4
  1718. /* MC_CMD_PTP_OUT msgresponse */
  1719. #define MC_CMD_PTP_OUT_LEN 0
  1720. /* MC_CMD_PTP_OUT_TRANSMIT msgresponse */
  1721. #define MC_CMD_PTP_OUT_TRANSMIT_LEN 8
  1722. /* Value of seconds timestamp */
  1723. #define MC_CMD_PTP_OUT_TRANSMIT_SECONDS_OFST 0
  1724. #define MC_CMD_PTP_OUT_TRANSMIT_SECONDS_LEN 4
  1725. /* Timestamp major value */
  1726. #define MC_CMD_PTP_OUT_TRANSMIT_MAJOR_OFST 0
  1727. #define MC_CMD_PTP_OUT_TRANSMIT_MAJOR_LEN 4
  1728. /* Value of nanoseconds timestamp */
  1729. #define MC_CMD_PTP_OUT_TRANSMIT_NANOSECONDS_OFST 4
  1730. #define MC_CMD_PTP_OUT_TRANSMIT_NANOSECONDS_LEN 4
  1731. /* Timestamp minor value */
  1732. #define MC_CMD_PTP_OUT_TRANSMIT_MINOR_OFST 4
  1733. #define MC_CMD_PTP_OUT_TRANSMIT_MINOR_LEN 4
  1734. /* MC_CMD_PTP_OUT_TIME_EVENT_SUBSCRIBE msgresponse */
  1735. #define MC_CMD_PTP_OUT_TIME_EVENT_SUBSCRIBE_LEN 0
  1736. /* MC_CMD_PTP_OUT_TIME_EVENT_UNSUBSCRIBE msgresponse */
  1737. #define MC_CMD_PTP_OUT_TIME_EVENT_UNSUBSCRIBE_LEN 0
  1738. /* MC_CMD_PTP_OUT_READ_NIC_TIME msgresponse */
  1739. #define MC_CMD_PTP_OUT_READ_NIC_TIME_LEN 8
  1740. /* Value of seconds timestamp */
  1741. #define MC_CMD_PTP_OUT_READ_NIC_TIME_SECONDS_OFST 0
  1742. #define MC_CMD_PTP_OUT_READ_NIC_TIME_SECONDS_LEN 4
  1743. /* Timestamp major value */
  1744. #define MC_CMD_PTP_OUT_READ_NIC_TIME_MAJOR_OFST 0
  1745. #define MC_CMD_PTP_OUT_READ_NIC_TIME_MAJOR_LEN 4
  1746. /* Value of nanoseconds timestamp */
  1747. #define MC_CMD_PTP_OUT_READ_NIC_TIME_NANOSECONDS_OFST 4
  1748. #define MC_CMD_PTP_OUT_READ_NIC_TIME_NANOSECONDS_LEN 4
  1749. /* Timestamp minor value */
  1750. #define MC_CMD_PTP_OUT_READ_NIC_TIME_MINOR_OFST 4
  1751. #define MC_CMD_PTP_OUT_READ_NIC_TIME_MINOR_LEN 4
  1752. /* MC_CMD_PTP_OUT_READ_NIC_TIME_V2 msgresponse */
  1753. #define MC_CMD_PTP_OUT_READ_NIC_TIME_V2_LEN 12
  1754. /* Value of seconds timestamp */
  1755. #define MC_CMD_PTP_OUT_READ_NIC_TIME_V2_SECONDS_OFST 0
  1756. #define MC_CMD_PTP_OUT_READ_NIC_TIME_V2_SECONDS_LEN 4
  1757. /* Timestamp major value */
  1758. #define MC_CMD_PTP_OUT_READ_NIC_TIME_V2_MAJOR_OFST 0
  1759. #define MC_CMD_PTP_OUT_READ_NIC_TIME_V2_MAJOR_LEN 4
  1760. /* Value of nanoseconds timestamp */
  1761. #define MC_CMD_PTP_OUT_READ_NIC_TIME_V2_NANOSECONDS_OFST 4
  1762. #define MC_CMD_PTP_OUT_READ_NIC_TIME_V2_NANOSECONDS_LEN 4
  1763. /* Timestamp minor value */
  1764. #define MC_CMD_PTP_OUT_READ_NIC_TIME_V2_MINOR_OFST 4
  1765. #define MC_CMD_PTP_OUT_READ_NIC_TIME_V2_MINOR_LEN 4
  1766. /* Upper 32bits of major timestamp value */
  1767. #define MC_CMD_PTP_OUT_READ_NIC_TIME_V2_MAJOR_HI_OFST 8
  1768. #define MC_CMD_PTP_OUT_READ_NIC_TIME_V2_MAJOR_HI_LEN 4
  1769. /* MC_CMD_PTP_OUT_STATUS msgresponse */
  1770. #define MC_CMD_PTP_OUT_STATUS_LEN 64
  1771. /* Frequency of NIC's hardware clock */
  1772. #define MC_CMD_PTP_OUT_STATUS_CLOCK_FREQ_OFST 0
  1773. #define MC_CMD_PTP_OUT_STATUS_CLOCK_FREQ_LEN 4
  1774. /* Number of packets transmitted and timestamped */
  1775. #define MC_CMD_PTP_OUT_STATUS_STATS_TX_OFST 4
  1776. #define MC_CMD_PTP_OUT_STATUS_STATS_TX_LEN 4
  1777. /* Number of packets received and timestamped */
  1778. #define MC_CMD_PTP_OUT_STATUS_STATS_RX_OFST 8
  1779. #define MC_CMD_PTP_OUT_STATUS_STATS_RX_LEN 4
  1780. /* Number of packets timestamped by the FPGA */
  1781. #define MC_CMD_PTP_OUT_STATUS_STATS_TS_OFST 12
  1782. #define MC_CMD_PTP_OUT_STATUS_STATS_TS_LEN 4
  1783. /* Number of packets filter matched */
  1784. #define MC_CMD_PTP_OUT_STATUS_STATS_FM_OFST 16
  1785. #define MC_CMD_PTP_OUT_STATUS_STATS_FM_LEN 4
  1786. /* Number of packets not filter matched */
  1787. #define MC_CMD_PTP_OUT_STATUS_STATS_NFM_OFST 20
  1788. #define MC_CMD_PTP_OUT_STATUS_STATS_NFM_LEN 4
  1789. /* Number of PPS overflows (noise on input?) */
  1790. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_OFLOW_OFST 24
  1791. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_OFLOW_LEN 4
  1792. /* Number of PPS bad periods */
  1793. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_BAD_OFST 28
  1794. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_BAD_LEN 4
  1795. /* Minimum period of PPS pulse in nanoseconds */
  1796. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_PER_MIN_OFST 32
  1797. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_PER_MIN_LEN 4
  1798. /* Maximum period of PPS pulse in nanoseconds */
  1799. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_PER_MAX_OFST 36
  1800. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_PER_MAX_LEN 4
  1801. /* Last period of PPS pulse in nanoseconds */
  1802. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_PER_LAST_OFST 40
  1803. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_PER_LAST_LEN 4
  1804. /* Mean period of PPS pulse in nanoseconds */
  1805. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_PER_MEAN_OFST 44
  1806. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_PER_MEAN_LEN 4
  1807. /* Minimum offset of PPS pulse in nanoseconds (signed) */
  1808. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_OFF_MIN_OFST 48
  1809. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_OFF_MIN_LEN 4
  1810. /* Maximum offset of PPS pulse in nanoseconds (signed) */
  1811. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_OFF_MAX_OFST 52
  1812. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_OFF_MAX_LEN 4
  1813. /* Last offset of PPS pulse in nanoseconds (signed) */
  1814. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_OFF_LAST_OFST 56
  1815. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_OFF_LAST_LEN 4
  1816. /* Mean offset of PPS pulse in nanoseconds (signed) */
  1817. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_OFF_MEAN_OFST 60
  1818. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_OFF_MEAN_LEN 4
  1819. /* MC_CMD_PTP_OUT_SYNCHRONIZE msgresponse */
  1820. #define MC_CMD_PTP_OUT_SYNCHRONIZE_LENMIN 20
  1821. #define MC_CMD_PTP_OUT_SYNCHRONIZE_LENMAX 240
  1822. #define MC_CMD_PTP_OUT_SYNCHRONIZE_LEN(num) (0+20*(num))
  1823. /* A set of host and NIC times */
  1824. #define MC_CMD_PTP_OUT_SYNCHRONIZE_TIMESET_OFST 0
  1825. #define MC_CMD_PTP_OUT_SYNCHRONIZE_TIMESET_LEN 20
  1826. #define MC_CMD_PTP_OUT_SYNCHRONIZE_TIMESET_MINNUM 1
  1827. #define MC_CMD_PTP_OUT_SYNCHRONIZE_TIMESET_MAXNUM 12
  1828. /* Host time immediately before NIC's hardware clock read */
  1829. #define MC_CMD_PTP_OUT_SYNCHRONIZE_HOSTSTART_OFST 0
  1830. #define MC_CMD_PTP_OUT_SYNCHRONIZE_HOSTSTART_LEN 4
  1831. /* Value of seconds timestamp */
  1832. #define MC_CMD_PTP_OUT_SYNCHRONIZE_SECONDS_OFST 4
  1833. #define MC_CMD_PTP_OUT_SYNCHRONIZE_SECONDS_LEN 4
  1834. /* Timestamp major value */
  1835. #define MC_CMD_PTP_OUT_SYNCHRONIZE_MAJOR_OFST 4
  1836. #define MC_CMD_PTP_OUT_SYNCHRONIZE_MAJOR_LEN 4
  1837. /* Value of nanoseconds timestamp */
  1838. #define MC_CMD_PTP_OUT_SYNCHRONIZE_NANOSECONDS_OFST 8
  1839. #define MC_CMD_PTP_OUT_SYNCHRONIZE_NANOSECONDS_LEN 4
  1840. /* Timestamp minor value */
  1841. #define MC_CMD_PTP_OUT_SYNCHRONIZE_MINOR_OFST 8
  1842. #define MC_CMD_PTP_OUT_SYNCHRONIZE_MINOR_LEN 4
  1843. /* Host time immediately after NIC's hardware clock read */
  1844. #define MC_CMD_PTP_OUT_SYNCHRONIZE_HOSTEND_OFST 12
  1845. #define MC_CMD_PTP_OUT_SYNCHRONIZE_HOSTEND_LEN 4
  1846. /* Number of nanoseconds waited after reading NIC's hardware clock */
  1847. #define MC_CMD_PTP_OUT_SYNCHRONIZE_WAITNS_OFST 16
  1848. #define MC_CMD_PTP_OUT_SYNCHRONIZE_WAITNS_LEN 4
  1849. /* MC_CMD_PTP_OUT_MANFTEST_BASIC msgresponse */
  1850. #define MC_CMD_PTP_OUT_MANFTEST_BASIC_LEN 8
  1851. /* Results of testing */
  1852. #define MC_CMD_PTP_OUT_MANFTEST_BASIC_TEST_RESULT_OFST 0
  1853. #define MC_CMD_PTP_OUT_MANFTEST_BASIC_TEST_RESULT_LEN 4
  1854. /* enum: Successful test */
  1855. #define MC_CMD_PTP_MANF_SUCCESS 0x0
  1856. /* enum: FPGA load failed */
  1857. #define MC_CMD_PTP_MANF_FPGA_LOAD 0x1
  1858. /* enum: FPGA version invalid */
  1859. #define MC_CMD_PTP_MANF_FPGA_VERSION 0x2
  1860. /* enum: FPGA registers incorrect */
  1861. #define MC_CMD_PTP_MANF_FPGA_REGISTERS 0x3
  1862. /* enum: Oscillator possibly not working? */
  1863. #define MC_CMD_PTP_MANF_OSCILLATOR 0x4
  1864. /* enum: Timestamps not increasing */
  1865. #define MC_CMD_PTP_MANF_TIMESTAMPS 0x5
  1866. /* enum: Mismatched packet count */
  1867. #define MC_CMD_PTP_MANF_PACKET_COUNT 0x6
  1868. /* enum: Mismatched packet count (Siena filter and FPGA) */
  1869. #define MC_CMD_PTP_MANF_FILTER_COUNT 0x7
  1870. /* enum: Not enough packets to perform timestamp check */
  1871. #define MC_CMD_PTP_MANF_PACKET_ENOUGH 0x8
  1872. /* enum: Timestamp trigger GPIO not working */
  1873. #define MC_CMD_PTP_MANF_GPIO_TRIGGER 0x9
  1874. /* enum: Insufficient PPS events to perform checks */
  1875. #define MC_CMD_PTP_MANF_PPS_ENOUGH 0xa
  1876. /* enum: PPS time event period not sufficiently close to 1s. */
  1877. #define MC_CMD_PTP_MANF_PPS_PERIOD 0xb
  1878. /* enum: PPS time event nS reading not sufficiently close to zero. */
  1879. #define MC_CMD_PTP_MANF_PPS_NS 0xc
  1880. /* enum: PTP peripheral registers incorrect */
  1881. #define MC_CMD_PTP_MANF_REGISTERS 0xd
  1882. /* enum: Failed to read time from PTP peripheral */
  1883. #define MC_CMD_PTP_MANF_CLOCK_READ 0xe
  1884. /* Presence of external oscillator */
  1885. #define MC_CMD_PTP_OUT_MANFTEST_BASIC_TEST_EXTOSC_OFST 4
  1886. #define MC_CMD_PTP_OUT_MANFTEST_BASIC_TEST_EXTOSC_LEN 4
  1887. /* MC_CMD_PTP_OUT_MANFTEST_PACKET msgresponse */
  1888. #define MC_CMD_PTP_OUT_MANFTEST_PACKET_LEN 12
  1889. /* Results of testing */
  1890. #define MC_CMD_PTP_OUT_MANFTEST_PACKET_TEST_RESULT_OFST 0
  1891. #define MC_CMD_PTP_OUT_MANFTEST_PACKET_TEST_RESULT_LEN 4
  1892. /* Number of packets received by FPGA */
  1893. #define MC_CMD_PTP_OUT_MANFTEST_PACKET_TEST_FPGACOUNT_OFST 4
  1894. #define MC_CMD_PTP_OUT_MANFTEST_PACKET_TEST_FPGACOUNT_LEN 4
  1895. /* Number of packets received by Siena filters */
  1896. #define MC_CMD_PTP_OUT_MANFTEST_PACKET_TEST_FILTERCOUNT_OFST 8
  1897. #define MC_CMD_PTP_OUT_MANFTEST_PACKET_TEST_FILTERCOUNT_LEN 4
  1898. /* MC_CMD_PTP_OUT_FPGAREAD msgresponse */
  1899. #define MC_CMD_PTP_OUT_FPGAREAD_LENMIN 1
  1900. #define MC_CMD_PTP_OUT_FPGAREAD_LENMAX 252
  1901. #define MC_CMD_PTP_OUT_FPGAREAD_LEN(num) (0+1*(num))
  1902. #define MC_CMD_PTP_OUT_FPGAREAD_BUFFER_OFST 0
  1903. #define MC_CMD_PTP_OUT_FPGAREAD_BUFFER_LEN 1
  1904. #define MC_CMD_PTP_OUT_FPGAREAD_BUFFER_MINNUM 1
  1905. #define MC_CMD_PTP_OUT_FPGAREAD_BUFFER_MAXNUM 252
  1906. /* MC_CMD_PTP_OUT_GET_TIME_FORMAT msgresponse */
  1907. #define MC_CMD_PTP_OUT_GET_TIME_FORMAT_LEN 4
  1908. /* Time format required/used by for this NIC. Applies to all PTP MCDI
  1909. * operations that pass times between the host and firmware. If this operation
  1910. * is not supported (older firmware) a format of seconds and nanoseconds should
  1911. * be assumed. Note this enum is deprecated. Do not add to it- use the
  1912. * TIME_FORMAT field in MC_CMD_PTP_OUT_GET_ATTRIBUTES instead.
  1913. */
  1914. #define MC_CMD_PTP_OUT_GET_TIME_FORMAT_FORMAT_OFST 0
  1915. #define MC_CMD_PTP_OUT_GET_TIME_FORMAT_FORMAT_LEN 4
  1916. /* enum: Times are in seconds and nanoseconds */
  1917. #define MC_CMD_PTP_OUT_GET_TIME_FORMAT_SECONDS_NANOSECONDS 0x0
  1918. /* enum: Major register has units of 16 second per tick, minor 8 ns per tick */
  1919. #define MC_CMD_PTP_OUT_GET_TIME_FORMAT_16SECONDS_8NANOSECONDS 0x1
  1920. /* enum: Major register has units of seconds, minor 2^-27s per tick */
  1921. #define MC_CMD_PTP_OUT_GET_TIME_FORMAT_SECONDS_27FRACTION 0x2
  1922. /* MC_CMD_PTP_OUT_GET_ATTRIBUTES msgresponse */
  1923. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_LEN 24
  1924. /* Time format required/used by for this NIC. Applies to all PTP MCDI
  1925. * operations that pass times between the host and firmware. If this operation
  1926. * is not supported (older firmware) a format of seconds and nanoseconds should
  1927. * be assumed.
  1928. */
  1929. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_TIME_FORMAT_OFST 0
  1930. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_TIME_FORMAT_LEN 4
  1931. /* enum: Times are in seconds and nanoseconds */
  1932. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_SECONDS_NANOSECONDS 0x0
  1933. /* enum: Major register has units of 16 second per tick, minor 8 ns per tick */
  1934. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_16SECONDS_8NANOSECONDS 0x1
  1935. /* enum: Major register has units of seconds, minor 2^-27s per tick */
  1936. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_SECONDS_27FRACTION 0x2
  1937. /* enum: Major register units are seconds, minor units are quarter nanoseconds
  1938. */
  1939. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_SECONDS_QTR_NANOSECONDS 0x3
  1940. /* Minimum acceptable value for a corrected synchronization timeset. When
  1941. * comparing host and NIC clock times, the MC returns a set of samples that
  1942. * contain the host start and end time, the MC time when the host start was
  1943. * detected and the time the MC waited between reading the time and detecting
  1944. * the host end. The corrected sync window is the difference between the host
  1945. * end and start times minus the time that the MC waited for host end.
  1946. */
  1947. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_SYNC_WINDOW_MIN_OFST 4
  1948. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_SYNC_WINDOW_MIN_LEN 4
  1949. /* Various PTP capabilities */
  1950. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_CAPABILITIES_OFST 8
  1951. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_CAPABILITIES_LEN 4
  1952. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_REPORT_SYNC_STATUS_LBN 0
  1953. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_REPORT_SYNC_STATUS_WIDTH 1
  1954. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_RX_TSTAMP_OOB_LBN 1
  1955. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_RX_TSTAMP_OOB_WIDTH 1
  1956. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_64BIT_SECONDS_LBN 2
  1957. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_64BIT_SECONDS_WIDTH 1
  1958. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_FP44_FREQ_ADJ_LBN 3
  1959. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_FP44_FREQ_ADJ_WIDTH 1
  1960. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_RESERVED0_OFST 12
  1961. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_RESERVED0_LEN 4
  1962. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_RESERVED1_OFST 16
  1963. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_RESERVED1_LEN 4
  1964. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_RESERVED2_OFST 20
  1965. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_RESERVED2_LEN 4
  1966. /* MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS msgresponse */
  1967. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_LEN 16
  1968. /* Uncorrected error on PTP transmit timestamps in NIC clock format */
  1969. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_TRANSMIT_OFST 0
  1970. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_TRANSMIT_LEN 4
  1971. /* Uncorrected error on PTP receive timestamps in NIC clock format */
  1972. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_RECEIVE_OFST 4
  1973. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_RECEIVE_LEN 4
  1974. /* Uncorrected error on PPS output in NIC clock format */
  1975. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_PPS_OUT_OFST 8
  1976. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_PPS_OUT_LEN 4
  1977. /* Uncorrected error on PPS input in NIC clock format */
  1978. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_PPS_IN_OFST 12
  1979. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_PPS_IN_LEN 4
  1980. /* MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_V2 msgresponse */
  1981. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_V2_LEN 24
  1982. /* Uncorrected error on PTP transmit timestamps in NIC clock format */
  1983. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_V2_PTP_TX_OFST 0
  1984. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_V2_PTP_TX_LEN 4
  1985. /* Uncorrected error on PTP receive timestamps in NIC clock format */
  1986. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_V2_PTP_RX_OFST 4
  1987. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_V2_PTP_RX_LEN 4
  1988. /* Uncorrected error on PPS output in NIC clock format */
  1989. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_V2_PPS_OUT_OFST 8
  1990. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_V2_PPS_OUT_LEN 4
  1991. /* Uncorrected error on PPS input in NIC clock format */
  1992. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_V2_PPS_IN_OFST 12
  1993. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_V2_PPS_IN_LEN 4
  1994. /* Uncorrected error on non-PTP transmit timestamps in NIC clock format */
  1995. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_V2_GENERAL_TX_OFST 16
  1996. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_V2_GENERAL_TX_LEN 4
  1997. /* Uncorrected error on non-PTP receive timestamps in NIC clock format */
  1998. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_V2_GENERAL_RX_OFST 20
  1999. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_V2_GENERAL_RX_LEN 4
  2000. /* MC_CMD_PTP_OUT_MANFTEST_PPS msgresponse */
  2001. #define MC_CMD_PTP_OUT_MANFTEST_PPS_LEN 4
  2002. /* Results of testing */
  2003. #define MC_CMD_PTP_OUT_MANFTEST_PPS_TEST_RESULT_OFST 0
  2004. #define MC_CMD_PTP_OUT_MANFTEST_PPS_TEST_RESULT_LEN 4
  2005. /* Enum values, see field(s): */
  2006. /* MC_CMD_PTP_OUT_MANFTEST_BASIC/TEST_RESULT */
  2007. /* MC_CMD_PTP_OUT_SET_SYNC_STATUS msgresponse */
  2008. #define MC_CMD_PTP_OUT_SET_SYNC_STATUS_LEN 0
  2009. /***********************************/
  2010. /* MC_CMD_CSR_READ32
  2011. * Read 32bit words from the indirect memory map.
  2012. */
  2013. #define MC_CMD_CSR_READ32 0xc
  2014. #define MC_CMD_0xc_PRIVILEGE_CTG SRIOV_CTG_INSECURE
  2015. /* MC_CMD_CSR_READ32_IN msgrequest */
  2016. #define MC_CMD_CSR_READ32_IN_LEN 12
  2017. /* Address */
  2018. #define MC_CMD_CSR_READ32_IN_ADDR_OFST 0
  2019. #define MC_CMD_CSR_READ32_IN_ADDR_LEN 4
  2020. #define MC_CMD_CSR_READ32_IN_STEP_OFST 4
  2021. #define MC_CMD_CSR_READ32_IN_STEP_LEN 4
  2022. #define MC_CMD_CSR_READ32_IN_NUMWORDS_OFST 8
  2023. #define MC_CMD_CSR_READ32_IN_NUMWORDS_LEN 4
  2024. /* MC_CMD_CSR_READ32_OUT msgresponse */
  2025. #define MC_CMD_CSR_READ32_OUT_LENMIN 4
  2026. #define MC_CMD_CSR_READ32_OUT_LENMAX 252
  2027. #define MC_CMD_CSR_READ32_OUT_LEN(num) (0+4*(num))
  2028. /* The last dword is the status, not a value read */
  2029. #define MC_CMD_CSR_READ32_OUT_BUFFER_OFST 0
  2030. #define MC_CMD_CSR_READ32_OUT_BUFFER_LEN 4
  2031. #define MC_CMD_CSR_READ32_OUT_BUFFER_MINNUM 1
  2032. #define MC_CMD_CSR_READ32_OUT_BUFFER_MAXNUM 63
  2033. /***********************************/
  2034. /* MC_CMD_CSR_WRITE32
  2035. * Write 32bit dwords to the indirect memory map.
  2036. */
  2037. #define MC_CMD_CSR_WRITE32 0xd
  2038. #define MC_CMD_0xd_PRIVILEGE_CTG SRIOV_CTG_INSECURE
  2039. /* MC_CMD_CSR_WRITE32_IN msgrequest */
  2040. #define MC_CMD_CSR_WRITE32_IN_LENMIN 12
  2041. #define MC_CMD_CSR_WRITE32_IN_LENMAX 252
  2042. #define MC_CMD_CSR_WRITE32_IN_LEN(num) (8+4*(num))
  2043. /* Address */
  2044. #define MC_CMD_CSR_WRITE32_IN_ADDR_OFST 0
  2045. #define MC_CMD_CSR_WRITE32_IN_ADDR_LEN 4
  2046. #define MC_CMD_CSR_WRITE32_IN_STEP_OFST 4
  2047. #define MC_CMD_CSR_WRITE32_IN_STEP_LEN 4
  2048. #define MC_CMD_CSR_WRITE32_IN_BUFFER_OFST 8
  2049. #define MC_CMD_CSR_WRITE32_IN_BUFFER_LEN 4
  2050. #define MC_CMD_CSR_WRITE32_IN_BUFFER_MINNUM 1
  2051. #define MC_CMD_CSR_WRITE32_IN_BUFFER_MAXNUM 61
  2052. /* MC_CMD_CSR_WRITE32_OUT msgresponse */
  2053. #define MC_CMD_CSR_WRITE32_OUT_LEN 4
  2054. #define MC_CMD_CSR_WRITE32_OUT_STATUS_OFST 0
  2055. #define MC_CMD_CSR_WRITE32_OUT_STATUS_LEN 4
  2056. /***********************************/
  2057. /* MC_CMD_HP
  2058. * These commands are used for HP related features. They are grouped under one
  2059. * MCDI command to avoid creating too many MCDI commands.
  2060. */
  2061. #define MC_CMD_HP 0x54
  2062. #define MC_CMD_0x54_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  2063. /* MC_CMD_HP_IN msgrequest */
  2064. #define MC_CMD_HP_IN_LEN 16
  2065. /* HP OCSD sub-command. When address is not NULL, request activation of OCSD at
  2066. * the specified address with the specified interval.When address is NULL,
  2067. * INTERVAL is interpreted as a command: 0: stop OCSD / 1: Report OCSD current
  2068. * state / 2: (debug) Show temperature reported by one of the supported
  2069. * sensors.
  2070. */
  2071. #define MC_CMD_HP_IN_SUBCMD_OFST 0
  2072. #define MC_CMD_HP_IN_SUBCMD_LEN 4
  2073. /* enum: OCSD (Option Card Sensor Data) sub-command. */
  2074. #define MC_CMD_HP_IN_OCSD_SUBCMD 0x0
  2075. /* enum: Last known valid HP sub-command. */
  2076. #define MC_CMD_HP_IN_LAST_SUBCMD 0x0
  2077. /* The address to the array of sensor fields. (Or NULL to use a sub-command.)
  2078. */
  2079. #define MC_CMD_HP_IN_OCSD_ADDR_OFST 4
  2080. #define MC_CMD_HP_IN_OCSD_ADDR_LEN 8
  2081. #define MC_CMD_HP_IN_OCSD_ADDR_LO_OFST 4
  2082. #define MC_CMD_HP_IN_OCSD_ADDR_HI_OFST 8
  2083. /* The requested update interval, in seconds. (Or the sub-command if ADDR is
  2084. * NULL.)
  2085. */
  2086. #define MC_CMD_HP_IN_OCSD_INTERVAL_OFST 12
  2087. #define MC_CMD_HP_IN_OCSD_INTERVAL_LEN 4
  2088. /* MC_CMD_HP_OUT msgresponse */
  2089. #define MC_CMD_HP_OUT_LEN 4
  2090. #define MC_CMD_HP_OUT_OCSD_STATUS_OFST 0
  2091. #define MC_CMD_HP_OUT_OCSD_STATUS_LEN 4
  2092. /* enum: OCSD stopped for this card. */
  2093. #define MC_CMD_HP_OUT_OCSD_STOPPED 0x1
  2094. /* enum: OCSD was successfully started with the address provided. */
  2095. #define MC_CMD_HP_OUT_OCSD_STARTED 0x2
  2096. /* enum: OCSD was already started for this card. */
  2097. #define MC_CMD_HP_OUT_OCSD_ALREADY_STARTED 0x3
  2098. /***********************************/
  2099. /* MC_CMD_STACKINFO
  2100. * Get stack information.
  2101. */
  2102. #define MC_CMD_STACKINFO 0xf
  2103. #define MC_CMD_0xf_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  2104. /* MC_CMD_STACKINFO_IN msgrequest */
  2105. #define MC_CMD_STACKINFO_IN_LEN 0
  2106. /* MC_CMD_STACKINFO_OUT msgresponse */
  2107. #define MC_CMD_STACKINFO_OUT_LENMIN 12
  2108. #define MC_CMD_STACKINFO_OUT_LENMAX 252
  2109. #define MC_CMD_STACKINFO_OUT_LEN(num) (0+12*(num))
  2110. /* (thread ptr, stack size, free space) for each thread in system */
  2111. #define MC_CMD_STACKINFO_OUT_THREAD_INFO_OFST 0
  2112. #define MC_CMD_STACKINFO_OUT_THREAD_INFO_LEN 12
  2113. #define MC_CMD_STACKINFO_OUT_THREAD_INFO_MINNUM 1
  2114. #define MC_CMD_STACKINFO_OUT_THREAD_INFO_MAXNUM 21
  2115. /***********************************/
  2116. /* MC_CMD_MDIO_READ
  2117. * MDIO register read.
  2118. */
  2119. #define MC_CMD_MDIO_READ 0x10
  2120. #define MC_CMD_0x10_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  2121. /* MC_CMD_MDIO_READ_IN msgrequest */
  2122. #define MC_CMD_MDIO_READ_IN_LEN 16
  2123. /* Bus number; there are two MDIO buses: one for the internal PHY, and one for
  2124. * external devices.
  2125. */
  2126. #define MC_CMD_MDIO_READ_IN_BUS_OFST 0
  2127. #define MC_CMD_MDIO_READ_IN_BUS_LEN 4
  2128. /* enum: Internal. */
  2129. #define MC_CMD_MDIO_BUS_INTERNAL 0x0
  2130. /* enum: External. */
  2131. #define MC_CMD_MDIO_BUS_EXTERNAL 0x1
  2132. /* Port address */
  2133. #define MC_CMD_MDIO_READ_IN_PRTAD_OFST 4
  2134. #define MC_CMD_MDIO_READ_IN_PRTAD_LEN 4
  2135. /* Device Address or clause 22. */
  2136. #define MC_CMD_MDIO_READ_IN_DEVAD_OFST 8
  2137. #define MC_CMD_MDIO_READ_IN_DEVAD_LEN 4
  2138. /* enum: By default all the MCDI MDIO operations perform clause45 mode. If you
  2139. * want to use clause22 then set DEVAD = MC_CMD_MDIO_CLAUSE22.
  2140. */
  2141. #define MC_CMD_MDIO_CLAUSE22 0x20
  2142. /* Address */
  2143. #define MC_CMD_MDIO_READ_IN_ADDR_OFST 12
  2144. #define MC_CMD_MDIO_READ_IN_ADDR_LEN 4
  2145. /* MC_CMD_MDIO_READ_OUT msgresponse */
  2146. #define MC_CMD_MDIO_READ_OUT_LEN 8
  2147. /* Value */
  2148. #define MC_CMD_MDIO_READ_OUT_VALUE_OFST 0
  2149. #define MC_CMD_MDIO_READ_OUT_VALUE_LEN 4
  2150. /* Status the MDIO commands return the raw status bits from the MDIO block. A
  2151. * "good" transaction should have the DONE bit set and all other bits clear.
  2152. */
  2153. #define MC_CMD_MDIO_READ_OUT_STATUS_OFST 4
  2154. #define MC_CMD_MDIO_READ_OUT_STATUS_LEN 4
  2155. /* enum: Good. */
  2156. #define MC_CMD_MDIO_STATUS_GOOD 0x8
  2157. /***********************************/
  2158. /* MC_CMD_MDIO_WRITE
  2159. * MDIO register write.
  2160. */
  2161. #define MC_CMD_MDIO_WRITE 0x11
  2162. #define MC_CMD_0x11_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  2163. /* MC_CMD_MDIO_WRITE_IN msgrequest */
  2164. #define MC_CMD_MDIO_WRITE_IN_LEN 20
  2165. /* Bus number; there are two MDIO buses: one for the internal PHY, and one for
  2166. * external devices.
  2167. */
  2168. #define MC_CMD_MDIO_WRITE_IN_BUS_OFST 0
  2169. #define MC_CMD_MDIO_WRITE_IN_BUS_LEN 4
  2170. /* enum: Internal. */
  2171. /* MC_CMD_MDIO_BUS_INTERNAL 0x0 */
  2172. /* enum: External. */
  2173. /* MC_CMD_MDIO_BUS_EXTERNAL 0x1 */
  2174. /* Port address */
  2175. #define MC_CMD_MDIO_WRITE_IN_PRTAD_OFST 4
  2176. #define MC_CMD_MDIO_WRITE_IN_PRTAD_LEN 4
  2177. /* Device Address or clause 22. */
  2178. #define MC_CMD_MDIO_WRITE_IN_DEVAD_OFST 8
  2179. #define MC_CMD_MDIO_WRITE_IN_DEVAD_LEN 4
  2180. /* enum: By default all the MCDI MDIO operations perform clause45 mode. If you
  2181. * want to use clause22 then set DEVAD = MC_CMD_MDIO_CLAUSE22.
  2182. */
  2183. /* MC_CMD_MDIO_CLAUSE22 0x20 */
  2184. /* Address */
  2185. #define MC_CMD_MDIO_WRITE_IN_ADDR_OFST 12
  2186. #define MC_CMD_MDIO_WRITE_IN_ADDR_LEN 4
  2187. /* Value */
  2188. #define MC_CMD_MDIO_WRITE_IN_VALUE_OFST 16
  2189. #define MC_CMD_MDIO_WRITE_IN_VALUE_LEN 4
  2190. /* MC_CMD_MDIO_WRITE_OUT msgresponse */
  2191. #define MC_CMD_MDIO_WRITE_OUT_LEN 4
  2192. /* Status; the MDIO commands return the raw status bits from the MDIO block. A
  2193. * "good" transaction should have the DONE bit set and all other bits clear.
  2194. */
  2195. #define MC_CMD_MDIO_WRITE_OUT_STATUS_OFST 0
  2196. #define MC_CMD_MDIO_WRITE_OUT_STATUS_LEN 4
  2197. /* enum: Good. */
  2198. /* MC_CMD_MDIO_STATUS_GOOD 0x8 */
  2199. /***********************************/
  2200. /* MC_CMD_DBI_WRITE
  2201. * Write DBI register(s).
  2202. */
  2203. #define MC_CMD_DBI_WRITE 0x12
  2204. #define MC_CMD_0x12_PRIVILEGE_CTG SRIOV_CTG_INSECURE
  2205. /* MC_CMD_DBI_WRITE_IN msgrequest */
  2206. #define MC_CMD_DBI_WRITE_IN_LENMIN 12
  2207. #define MC_CMD_DBI_WRITE_IN_LENMAX 252
  2208. #define MC_CMD_DBI_WRITE_IN_LEN(num) (0+12*(num))
  2209. /* Each write op consists of an address (offset 0), byte enable/VF/CS2 (offset
  2210. * 32) and value (offset 64). See MC_CMD_DBIWROP_TYPEDEF.
  2211. */
  2212. #define MC_CMD_DBI_WRITE_IN_DBIWROP_OFST 0
  2213. #define MC_CMD_DBI_WRITE_IN_DBIWROP_LEN 12
  2214. #define MC_CMD_DBI_WRITE_IN_DBIWROP_MINNUM 1
  2215. #define MC_CMD_DBI_WRITE_IN_DBIWROP_MAXNUM 21
  2216. /* MC_CMD_DBI_WRITE_OUT msgresponse */
  2217. #define MC_CMD_DBI_WRITE_OUT_LEN 0
  2218. /* MC_CMD_DBIWROP_TYPEDEF structuredef */
  2219. #define MC_CMD_DBIWROP_TYPEDEF_LEN 12
  2220. #define MC_CMD_DBIWROP_TYPEDEF_ADDRESS_OFST 0
  2221. #define MC_CMD_DBIWROP_TYPEDEF_ADDRESS_LEN 4
  2222. #define MC_CMD_DBIWROP_TYPEDEF_ADDRESS_LBN 0
  2223. #define MC_CMD_DBIWROP_TYPEDEF_ADDRESS_WIDTH 32
  2224. #define MC_CMD_DBIWROP_TYPEDEF_PARMS_OFST 4
  2225. #define MC_CMD_DBIWROP_TYPEDEF_PARMS_LEN 4
  2226. #define MC_CMD_DBIWROP_TYPEDEF_VF_NUM_LBN 16
  2227. #define MC_CMD_DBIWROP_TYPEDEF_VF_NUM_WIDTH 16
  2228. #define MC_CMD_DBIWROP_TYPEDEF_VF_ACTIVE_LBN 15
  2229. #define MC_CMD_DBIWROP_TYPEDEF_VF_ACTIVE_WIDTH 1
  2230. #define MC_CMD_DBIWROP_TYPEDEF_CS2_LBN 14
  2231. #define MC_CMD_DBIWROP_TYPEDEF_CS2_WIDTH 1
  2232. #define MC_CMD_DBIWROP_TYPEDEF_PARMS_LBN 32
  2233. #define MC_CMD_DBIWROP_TYPEDEF_PARMS_WIDTH 32
  2234. #define MC_CMD_DBIWROP_TYPEDEF_VALUE_OFST 8
  2235. #define MC_CMD_DBIWROP_TYPEDEF_VALUE_LEN 4
  2236. #define MC_CMD_DBIWROP_TYPEDEF_VALUE_LBN 64
  2237. #define MC_CMD_DBIWROP_TYPEDEF_VALUE_WIDTH 32
  2238. /***********************************/
  2239. /* MC_CMD_PORT_READ32
  2240. * Read a 32-bit register from the indirect port register map. The port to
  2241. * access is implied by the Shared memory channel used.
  2242. */
  2243. #define MC_CMD_PORT_READ32 0x14
  2244. /* MC_CMD_PORT_READ32_IN msgrequest */
  2245. #define MC_CMD_PORT_READ32_IN_LEN 4
  2246. /* Address */
  2247. #define MC_CMD_PORT_READ32_IN_ADDR_OFST 0
  2248. #define MC_CMD_PORT_READ32_IN_ADDR_LEN 4
  2249. /* MC_CMD_PORT_READ32_OUT msgresponse */
  2250. #define MC_CMD_PORT_READ32_OUT_LEN 8
  2251. /* Value */
  2252. #define MC_CMD_PORT_READ32_OUT_VALUE_OFST 0
  2253. #define MC_CMD_PORT_READ32_OUT_VALUE_LEN 4
  2254. /* Status */
  2255. #define MC_CMD_PORT_READ32_OUT_STATUS_OFST 4
  2256. #define MC_CMD_PORT_READ32_OUT_STATUS_LEN 4
  2257. /***********************************/
  2258. /* MC_CMD_PORT_WRITE32
  2259. * Write a 32-bit register to the indirect port register map. The port to
  2260. * access is implied by the Shared memory channel used.
  2261. */
  2262. #define MC_CMD_PORT_WRITE32 0x15
  2263. /* MC_CMD_PORT_WRITE32_IN msgrequest */
  2264. #define MC_CMD_PORT_WRITE32_IN_LEN 8
  2265. /* Address */
  2266. #define MC_CMD_PORT_WRITE32_IN_ADDR_OFST 0
  2267. #define MC_CMD_PORT_WRITE32_IN_ADDR_LEN 4
  2268. /* Value */
  2269. #define MC_CMD_PORT_WRITE32_IN_VALUE_OFST 4
  2270. #define MC_CMD_PORT_WRITE32_IN_VALUE_LEN 4
  2271. /* MC_CMD_PORT_WRITE32_OUT msgresponse */
  2272. #define MC_CMD_PORT_WRITE32_OUT_LEN 4
  2273. /* Status */
  2274. #define MC_CMD_PORT_WRITE32_OUT_STATUS_OFST 0
  2275. #define MC_CMD_PORT_WRITE32_OUT_STATUS_LEN 4
  2276. /***********************************/
  2277. /* MC_CMD_PORT_READ128
  2278. * Read a 128-bit register from the indirect port register map. The port to
  2279. * access is implied by the Shared memory channel used.
  2280. */
  2281. #define MC_CMD_PORT_READ128 0x16
  2282. /* MC_CMD_PORT_READ128_IN msgrequest */
  2283. #define MC_CMD_PORT_READ128_IN_LEN 4
  2284. /* Address */
  2285. #define MC_CMD_PORT_READ128_IN_ADDR_OFST 0
  2286. #define MC_CMD_PORT_READ128_IN_ADDR_LEN 4
  2287. /* MC_CMD_PORT_READ128_OUT msgresponse */
  2288. #define MC_CMD_PORT_READ128_OUT_LEN 20
  2289. /* Value */
  2290. #define MC_CMD_PORT_READ128_OUT_VALUE_OFST 0
  2291. #define MC_CMD_PORT_READ128_OUT_VALUE_LEN 16
  2292. /* Status */
  2293. #define MC_CMD_PORT_READ128_OUT_STATUS_OFST 16
  2294. #define MC_CMD_PORT_READ128_OUT_STATUS_LEN 4
  2295. /***********************************/
  2296. /* MC_CMD_PORT_WRITE128
  2297. * Write a 128-bit register to the indirect port register map. The port to
  2298. * access is implied by the Shared memory channel used.
  2299. */
  2300. #define MC_CMD_PORT_WRITE128 0x17
  2301. /* MC_CMD_PORT_WRITE128_IN msgrequest */
  2302. #define MC_CMD_PORT_WRITE128_IN_LEN 20
  2303. /* Address */
  2304. #define MC_CMD_PORT_WRITE128_IN_ADDR_OFST 0
  2305. #define MC_CMD_PORT_WRITE128_IN_ADDR_LEN 4
  2306. /* Value */
  2307. #define MC_CMD_PORT_WRITE128_IN_VALUE_OFST 4
  2308. #define MC_CMD_PORT_WRITE128_IN_VALUE_LEN 16
  2309. /* MC_CMD_PORT_WRITE128_OUT msgresponse */
  2310. #define MC_CMD_PORT_WRITE128_OUT_LEN 4
  2311. /* Status */
  2312. #define MC_CMD_PORT_WRITE128_OUT_STATUS_OFST 0
  2313. #define MC_CMD_PORT_WRITE128_OUT_STATUS_LEN 4
  2314. /* MC_CMD_CAPABILITIES structuredef */
  2315. #define MC_CMD_CAPABILITIES_LEN 4
  2316. /* Small buf table. */
  2317. #define MC_CMD_CAPABILITIES_SMALL_BUF_TBL_LBN 0
  2318. #define MC_CMD_CAPABILITIES_SMALL_BUF_TBL_WIDTH 1
  2319. /* Turbo mode (for Maranello). */
  2320. #define MC_CMD_CAPABILITIES_TURBO_LBN 1
  2321. #define MC_CMD_CAPABILITIES_TURBO_WIDTH 1
  2322. /* Turbo mode active (for Maranello). */
  2323. #define MC_CMD_CAPABILITIES_TURBO_ACTIVE_LBN 2
  2324. #define MC_CMD_CAPABILITIES_TURBO_ACTIVE_WIDTH 1
  2325. /* PTP offload. */
  2326. #define MC_CMD_CAPABILITIES_PTP_LBN 3
  2327. #define MC_CMD_CAPABILITIES_PTP_WIDTH 1
  2328. /* AOE mode. */
  2329. #define MC_CMD_CAPABILITIES_AOE_LBN 4
  2330. #define MC_CMD_CAPABILITIES_AOE_WIDTH 1
  2331. /* AOE mode active. */
  2332. #define MC_CMD_CAPABILITIES_AOE_ACTIVE_LBN 5
  2333. #define MC_CMD_CAPABILITIES_AOE_ACTIVE_WIDTH 1
  2334. /* AOE mode active. */
  2335. #define MC_CMD_CAPABILITIES_FC_ACTIVE_LBN 6
  2336. #define MC_CMD_CAPABILITIES_FC_ACTIVE_WIDTH 1
  2337. #define MC_CMD_CAPABILITIES_RESERVED_LBN 7
  2338. #define MC_CMD_CAPABILITIES_RESERVED_WIDTH 25
  2339. /***********************************/
  2340. /* MC_CMD_GET_BOARD_CFG
  2341. * Returns the MC firmware configuration structure.
  2342. */
  2343. #define MC_CMD_GET_BOARD_CFG 0x18
  2344. #define MC_CMD_0x18_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  2345. /* MC_CMD_GET_BOARD_CFG_IN msgrequest */
  2346. #define MC_CMD_GET_BOARD_CFG_IN_LEN 0
  2347. /* MC_CMD_GET_BOARD_CFG_OUT msgresponse */
  2348. #define MC_CMD_GET_BOARD_CFG_OUT_LENMIN 96
  2349. #define MC_CMD_GET_BOARD_CFG_OUT_LENMAX 136
  2350. #define MC_CMD_GET_BOARD_CFG_OUT_LEN(num) (72+2*(num))
  2351. #define MC_CMD_GET_BOARD_CFG_OUT_BOARD_TYPE_OFST 0
  2352. #define MC_CMD_GET_BOARD_CFG_OUT_BOARD_TYPE_LEN 4
  2353. #define MC_CMD_GET_BOARD_CFG_OUT_BOARD_NAME_OFST 4
  2354. #define MC_CMD_GET_BOARD_CFG_OUT_BOARD_NAME_LEN 32
  2355. /* Capabilities for Siena Port0 (see struct MC_CMD_CAPABILITIES). Unused on
  2356. * EF10 and later (use MC_CMD_GET_CAPABILITIES).
  2357. */
  2358. #define MC_CMD_GET_BOARD_CFG_OUT_CAPABILITIES_PORT0_OFST 36
  2359. #define MC_CMD_GET_BOARD_CFG_OUT_CAPABILITIES_PORT0_LEN 4
  2360. /* Capabilities for Siena Port1 (see struct MC_CMD_CAPABILITIES). Unused on
  2361. * EF10 and later (use MC_CMD_GET_CAPABILITIES).
  2362. */
  2363. #define MC_CMD_GET_BOARD_CFG_OUT_CAPABILITIES_PORT1_OFST 40
  2364. #define MC_CMD_GET_BOARD_CFG_OUT_CAPABILITIES_PORT1_LEN 4
  2365. /* Base MAC address for Siena Port0. Unused on EF10 and later (use
  2366. * MC_CMD_GET_MAC_ADDRESSES).
  2367. */
  2368. #define MC_CMD_GET_BOARD_CFG_OUT_MAC_ADDR_BASE_PORT0_OFST 44
  2369. #define MC_CMD_GET_BOARD_CFG_OUT_MAC_ADDR_BASE_PORT0_LEN 6
  2370. /* Base MAC address for Siena Port1. Unused on EF10 and later (use
  2371. * MC_CMD_GET_MAC_ADDRESSES).
  2372. */
  2373. #define MC_CMD_GET_BOARD_CFG_OUT_MAC_ADDR_BASE_PORT1_OFST 50
  2374. #define MC_CMD_GET_BOARD_CFG_OUT_MAC_ADDR_BASE_PORT1_LEN 6
  2375. /* Size of MAC address pool for Siena Port0. Unused on EF10 and later (use
  2376. * MC_CMD_GET_MAC_ADDRESSES).
  2377. */
  2378. #define MC_CMD_GET_BOARD_CFG_OUT_MAC_COUNT_PORT0_OFST 56
  2379. #define MC_CMD_GET_BOARD_CFG_OUT_MAC_COUNT_PORT0_LEN 4
  2380. /* Size of MAC address pool for Siena Port1. Unused on EF10 and later (use
  2381. * MC_CMD_GET_MAC_ADDRESSES).
  2382. */
  2383. #define MC_CMD_GET_BOARD_CFG_OUT_MAC_COUNT_PORT1_OFST 60
  2384. #define MC_CMD_GET_BOARD_CFG_OUT_MAC_COUNT_PORT1_LEN 4
  2385. /* Increment between addresses in MAC address pool for Siena Port0. Unused on
  2386. * EF10 and later (use MC_CMD_GET_MAC_ADDRESSES).
  2387. */
  2388. #define MC_CMD_GET_BOARD_CFG_OUT_MAC_STRIDE_PORT0_OFST 64
  2389. #define MC_CMD_GET_BOARD_CFG_OUT_MAC_STRIDE_PORT0_LEN 4
  2390. /* Increment between addresses in MAC address pool for Siena Port1. Unused on
  2391. * EF10 and later (use MC_CMD_GET_MAC_ADDRESSES).
  2392. */
  2393. #define MC_CMD_GET_BOARD_CFG_OUT_MAC_STRIDE_PORT1_OFST 68
  2394. #define MC_CMD_GET_BOARD_CFG_OUT_MAC_STRIDE_PORT1_LEN 4
  2395. /* Siena only. This field contains a 16-bit value for each of the types of
  2396. * NVRAM area. The values are defined in the firmware/mc/platform/.c file for a
  2397. * specific board type, but otherwise have no meaning to the MC; they are used
  2398. * by the driver to manage selection of appropriate firmware updates. Unused on
  2399. * EF10 and later (use MC_CMD_NVRAM_METADATA).
  2400. */
  2401. #define MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_OFST 72
  2402. #define MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_LEN 2
  2403. #define MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_MINNUM 12
  2404. #define MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_MAXNUM 32
  2405. /***********************************/
  2406. /* MC_CMD_DBI_READX
  2407. * Read DBI register(s) -- extended functionality
  2408. */
  2409. #define MC_CMD_DBI_READX 0x19
  2410. #define MC_CMD_0x19_PRIVILEGE_CTG SRIOV_CTG_INSECURE
  2411. /* MC_CMD_DBI_READX_IN msgrequest */
  2412. #define MC_CMD_DBI_READX_IN_LENMIN 8
  2413. #define MC_CMD_DBI_READX_IN_LENMAX 248
  2414. #define MC_CMD_DBI_READX_IN_LEN(num) (0+8*(num))
  2415. /* Each Read op consists of an address (offset 0), VF/CS2) */
  2416. #define MC_CMD_DBI_READX_IN_DBIRDOP_OFST 0
  2417. #define MC_CMD_DBI_READX_IN_DBIRDOP_LEN 8
  2418. #define MC_CMD_DBI_READX_IN_DBIRDOP_LO_OFST 0
  2419. #define MC_CMD_DBI_READX_IN_DBIRDOP_HI_OFST 4
  2420. #define MC_CMD_DBI_READX_IN_DBIRDOP_MINNUM 1
  2421. #define MC_CMD_DBI_READX_IN_DBIRDOP_MAXNUM 31
  2422. /* MC_CMD_DBI_READX_OUT msgresponse */
  2423. #define MC_CMD_DBI_READX_OUT_LENMIN 4
  2424. #define MC_CMD_DBI_READX_OUT_LENMAX 252
  2425. #define MC_CMD_DBI_READX_OUT_LEN(num) (0+4*(num))
  2426. /* Value */
  2427. #define MC_CMD_DBI_READX_OUT_VALUE_OFST 0
  2428. #define MC_CMD_DBI_READX_OUT_VALUE_LEN 4
  2429. #define MC_CMD_DBI_READX_OUT_VALUE_MINNUM 1
  2430. #define MC_CMD_DBI_READX_OUT_VALUE_MAXNUM 63
  2431. /* MC_CMD_DBIRDOP_TYPEDEF structuredef */
  2432. #define MC_CMD_DBIRDOP_TYPEDEF_LEN 8
  2433. #define MC_CMD_DBIRDOP_TYPEDEF_ADDRESS_OFST 0
  2434. #define MC_CMD_DBIRDOP_TYPEDEF_ADDRESS_LEN 4
  2435. #define MC_CMD_DBIRDOP_TYPEDEF_ADDRESS_LBN 0
  2436. #define MC_CMD_DBIRDOP_TYPEDEF_ADDRESS_WIDTH 32
  2437. #define MC_CMD_DBIRDOP_TYPEDEF_PARMS_OFST 4
  2438. #define MC_CMD_DBIRDOP_TYPEDEF_PARMS_LEN 4
  2439. #define MC_CMD_DBIRDOP_TYPEDEF_VF_NUM_LBN 16
  2440. #define MC_CMD_DBIRDOP_TYPEDEF_VF_NUM_WIDTH 16
  2441. #define MC_CMD_DBIRDOP_TYPEDEF_VF_ACTIVE_LBN 15
  2442. #define MC_CMD_DBIRDOP_TYPEDEF_VF_ACTIVE_WIDTH 1
  2443. #define MC_CMD_DBIRDOP_TYPEDEF_CS2_LBN 14
  2444. #define MC_CMD_DBIRDOP_TYPEDEF_CS2_WIDTH 1
  2445. #define MC_CMD_DBIRDOP_TYPEDEF_PARMS_LBN 32
  2446. #define MC_CMD_DBIRDOP_TYPEDEF_PARMS_WIDTH 32
  2447. /***********************************/
  2448. /* MC_CMD_SET_RAND_SEED
  2449. * Set the 16byte seed for the MC pseudo-random generator.
  2450. */
  2451. #define MC_CMD_SET_RAND_SEED 0x1a
  2452. #define MC_CMD_0x1a_PRIVILEGE_CTG SRIOV_CTG_INSECURE
  2453. /* MC_CMD_SET_RAND_SEED_IN msgrequest */
  2454. #define MC_CMD_SET_RAND_SEED_IN_LEN 16
  2455. /* Seed value. */
  2456. #define MC_CMD_SET_RAND_SEED_IN_SEED_OFST 0
  2457. #define MC_CMD_SET_RAND_SEED_IN_SEED_LEN 16
  2458. /* MC_CMD_SET_RAND_SEED_OUT msgresponse */
  2459. #define MC_CMD_SET_RAND_SEED_OUT_LEN 0
  2460. /***********************************/
  2461. /* MC_CMD_LTSSM_HIST
  2462. * Retrieve the history of the LTSSM, if the build supports it.
  2463. */
  2464. #define MC_CMD_LTSSM_HIST 0x1b
  2465. /* MC_CMD_LTSSM_HIST_IN msgrequest */
  2466. #define MC_CMD_LTSSM_HIST_IN_LEN 0
  2467. /* MC_CMD_LTSSM_HIST_OUT msgresponse */
  2468. #define MC_CMD_LTSSM_HIST_OUT_LENMIN 0
  2469. #define MC_CMD_LTSSM_HIST_OUT_LENMAX 252
  2470. #define MC_CMD_LTSSM_HIST_OUT_LEN(num) (0+4*(num))
  2471. /* variable number of LTSSM values, as bytes. The history is read-to-clear. */
  2472. #define MC_CMD_LTSSM_HIST_OUT_DATA_OFST 0
  2473. #define MC_CMD_LTSSM_HIST_OUT_DATA_LEN 4
  2474. #define MC_CMD_LTSSM_HIST_OUT_DATA_MINNUM 0
  2475. #define MC_CMD_LTSSM_HIST_OUT_DATA_MAXNUM 63
  2476. /***********************************/
  2477. /* MC_CMD_DRV_ATTACH
  2478. * Inform MCPU that this port is managed on the host (i.e. driver active). For
  2479. * Huntington, also request the preferred datapath firmware to use if possible
  2480. * (it may not be possible for this request to be fulfilled; the driver must
  2481. * issue a subsequent MC_CMD_GET_CAPABILITIES command to determine which
  2482. * features are actually available). The FIRMWARE_ID field is ignored by older
  2483. * platforms.
  2484. */
  2485. #define MC_CMD_DRV_ATTACH 0x1c
  2486. #define MC_CMD_0x1c_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  2487. /* MC_CMD_DRV_ATTACH_IN msgrequest */
  2488. #define MC_CMD_DRV_ATTACH_IN_LEN 12
  2489. /* new state to set if UPDATE=1 */
  2490. #define MC_CMD_DRV_ATTACH_IN_NEW_STATE_OFST 0
  2491. #define MC_CMD_DRV_ATTACH_IN_NEW_STATE_LEN 4
  2492. #define MC_CMD_DRV_ATTACH_LBN 0
  2493. #define MC_CMD_DRV_ATTACH_WIDTH 1
  2494. #define MC_CMD_DRV_ATTACH_IN_ATTACH_LBN 0
  2495. #define MC_CMD_DRV_ATTACH_IN_ATTACH_WIDTH 1
  2496. #define MC_CMD_DRV_PREBOOT_LBN 1
  2497. #define MC_CMD_DRV_PREBOOT_WIDTH 1
  2498. #define MC_CMD_DRV_ATTACH_IN_PREBOOT_LBN 1
  2499. #define MC_CMD_DRV_ATTACH_IN_PREBOOT_WIDTH 1
  2500. #define MC_CMD_DRV_ATTACH_IN_SUBVARIANT_AWARE_LBN 2
  2501. #define MC_CMD_DRV_ATTACH_IN_SUBVARIANT_AWARE_WIDTH 1
  2502. #define MC_CMD_DRV_ATTACH_IN_WANT_VI_SPREADING_LBN 3
  2503. #define MC_CMD_DRV_ATTACH_IN_WANT_VI_SPREADING_WIDTH 1
  2504. /* 1 to set new state, or 0 to just report the existing state */
  2505. #define MC_CMD_DRV_ATTACH_IN_UPDATE_OFST 4
  2506. #define MC_CMD_DRV_ATTACH_IN_UPDATE_LEN 4
  2507. /* preferred datapath firmware (for Huntington; ignored for Siena) */
  2508. #define MC_CMD_DRV_ATTACH_IN_FIRMWARE_ID_OFST 8
  2509. #define MC_CMD_DRV_ATTACH_IN_FIRMWARE_ID_LEN 4
  2510. /* enum: Prefer to use full featured firmware */
  2511. #define MC_CMD_FW_FULL_FEATURED 0x0
  2512. /* enum: Prefer to use firmware with fewer features but lower latency */
  2513. #define MC_CMD_FW_LOW_LATENCY 0x1
  2514. /* enum: Prefer to use firmware for SolarCapture packed stream mode */
  2515. #define MC_CMD_FW_PACKED_STREAM 0x2
  2516. /* enum: Prefer to use firmware with fewer features and simpler TX event
  2517. * batching but higher TX packet rate
  2518. */
  2519. #define MC_CMD_FW_HIGH_TX_RATE 0x3
  2520. /* enum: Reserved value */
  2521. #define MC_CMD_FW_PACKED_STREAM_HASH_MODE_1 0x4
  2522. /* enum: Prefer to use firmware with additional "rules engine" filtering
  2523. * support
  2524. */
  2525. #define MC_CMD_FW_RULES_ENGINE 0x5
  2526. /* enum: Prefer to use firmware with additional DPDK support */
  2527. #define MC_CMD_FW_DPDK 0x6
  2528. /* enum: Prefer to use "l3xudp" custom datapath firmware (see SF-119495-PD and
  2529. * bug69716)
  2530. */
  2531. #define MC_CMD_FW_L3XUDP 0x7
  2532. /* enum: Only this option is allowed for non-admin functions */
  2533. #define MC_CMD_FW_DONT_CARE 0xffffffff
  2534. /* MC_CMD_DRV_ATTACH_OUT msgresponse */
  2535. #define MC_CMD_DRV_ATTACH_OUT_LEN 4
  2536. /* previous or existing state, see the bitmask at NEW_STATE */
  2537. #define MC_CMD_DRV_ATTACH_OUT_OLD_STATE_OFST 0
  2538. #define MC_CMD_DRV_ATTACH_OUT_OLD_STATE_LEN 4
  2539. /* MC_CMD_DRV_ATTACH_EXT_OUT msgresponse */
  2540. #define MC_CMD_DRV_ATTACH_EXT_OUT_LEN 8
  2541. /* previous or existing state, see the bitmask at NEW_STATE */
  2542. #define MC_CMD_DRV_ATTACH_EXT_OUT_OLD_STATE_OFST 0
  2543. #define MC_CMD_DRV_ATTACH_EXT_OUT_OLD_STATE_LEN 4
  2544. /* Flags associated with this function */
  2545. #define MC_CMD_DRV_ATTACH_EXT_OUT_FUNC_FLAGS_OFST 4
  2546. #define MC_CMD_DRV_ATTACH_EXT_OUT_FUNC_FLAGS_LEN 4
  2547. /* enum: Labels the lowest-numbered function visible to the OS */
  2548. #define MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_PRIMARY 0x0
  2549. /* enum: The function can control the link state of the physical port it is
  2550. * bound to.
  2551. */
  2552. #define MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_LINKCTRL 0x1
  2553. /* enum: The function can perform privileged operations */
  2554. #define MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_TRUSTED 0x2
  2555. /* enum: The function does not have an active port associated with it. The port
  2556. * refers to the Sorrento external FPGA port.
  2557. */
  2558. #define MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_NO_ACTIVE_PORT 0x3
  2559. /* enum: If set, indicates that VI spreading is currently enabled. Will always
  2560. * indicate the current state, regardless of the value in the WANT_VI_SPREADING
  2561. * input.
  2562. */
  2563. #define MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_VI_SPREADING_ENABLED 0x4
  2564. /***********************************/
  2565. /* MC_CMD_SHMUART
  2566. * Route UART output to circular buffer in shared memory instead.
  2567. */
  2568. #define MC_CMD_SHMUART 0x1f
  2569. /* MC_CMD_SHMUART_IN msgrequest */
  2570. #define MC_CMD_SHMUART_IN_LEN 4
  2571. /* ??? */
  2572. #define MC_CMD_SHMUART_IN_FLAG_OFST 0
  2573. #define MC_CMD_SHMUART_IN_FLAG_LEN 4
  2574. /* MC_CMD_SHMUART_OUT msgresponse */
  2575. #define MC_CMD_SHMUART_OUT_LEN 0
  2576. /***********************************/
  2577. /* MC_CMD_PORT_RESET
  2578. * Generic per-port reset. There is no equivalent for per-board reset. Locks
  2579. * required: None; Return code: 0, ETIME. NOTE: This command is deprecated -
  2580. * use MC_CMD_ENTITY_RESET instead.
  2581. */
  2582. #define MC_CMD_PORT_RESET 0x20
  2583. #define MC_CMD_0x20_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  2584. /* MC_CMD_PORT_RESET_IN msgrequest */
  2585. #define MC_CMD_PORT_RESET_IN_LEN 0
  2586. /* MC_CMD_PORT_RESET_OUT msgresponse */
  2587. #define MC_CMD_PORT_RESET_OUT_LEN 0
  2588. /***********************************/
  2589. /* MC_CMD_ENTITY_RESET
  2590. * Generic per-resource reset. There is no equivalent for per-board reset.
  2591. * Locks required: None; Return code: 0, ETIME. NOTE: This command is an
  2592. * extended version of the deprecated MC_CMD_PORT_RESET with added fields.
  2593. */
  2594. #define MC_CMD_ENTITY_RESET 0x20
  2595. /* MC_CMD_0x20_PRIVILEGE_CTG SRIOV_CTG_GENERAL */
  2596. /* MC_CMD_ENTITY_RESET_IN msgrequest */
  2597. #define MC_CMD_ENTITY_RESET_IN_LEN 4
  2598. /* Optional flags field. Omitting this will perform a "legacy" reset action
  2599. * (TBD).
  2600. */
  2601. #define MC_CMD_ENTITY_RESET_IN_FLAG_OFST 0
  2602. #define MC_CMD_ENTITY_RESET_IN_FLAG_LEN 4
  2603. #define MC_CMD_ENTITY_RESET_IN_FUNCTION_RESOURCE_RESET_LBN 0
  2604. #define MC_CMD_ENTITY_RESET_IN_FUNCTION_RESOURCE_RESET_WIDTH 1
  2605. /* MC_CMD_ENTITY_RESET_OUT msgresponse */
  2606. #define MC_CMD_ENTITY_RESET_OUT_LEN 0
  2607. /***********************************/
  2608. /* MC_CMD_PCIE_CREDITS
  2609. * Read instantaneous and minimum flow control thresholds.
  2610. */
  2611. #define MC_CMD_PCIE_CREDITS 0x21
  2612. /* MC_CMD_PCIE_CREDITS_IN msgrequest */
  2613. #define MC_CMD_PCIE_CREDITS_IN_LEN 8
  2614. /* poll period. 0 is disabled */
  2615. #define MC_CMD_PCIE_CREDITS_IN_POLL_PERIOD_OFST 0
  2616. #define MC_CMD_PCIE_CREDITS_IN_POLL_PERIOD_LEN 4
  2617. /* wipe statistics */
  2618. #define MC_CMD_PCIE_CREDITS_IN_WIPE_OFST 4
  2619. #define MC_CMD_PCIE_CREDITS_IN_WIPE_LEN 4
  2620. /* MC_CMD_PCIE_CREDITS_OUT msgresponse */
  2621. #define MC_CMD_PCIE_CREDITS_OUT_LEN 16
  2622. #define MC_CMD_PCIE_CREDITS_OUT_CURRENT_P_HDR_OFST 0
  2623. #define MC_CMD_PCIE_CREDITS_OUT_CURRENT_P_HDR_LEN 2
  2624. #define MC_CMD_PCIE_CREDITS_OUT_CURRENT_P_DATA_OFST 2
  2625. #define MC_CMD_PCIE_CREDITS_OUT_CURRENT_P_DATA_LEN 2
  2626. #define MC_CMD_PCIE_CREDITS_OUT_CURRENT_NP_HDR_OFST 4
  2627. #define MC_CMD_PCIE_CREDITS_OUT_CURRENT_NP_HDR_LEN 2
  2628. #define MC_CMD_PCIE_CREDITS_OUT_CURRENT_NP_DATA_OFST 6
  2629. #define MC_CMD_PCIE_CREDITS_OUT_CURRENT_NP_DATA_LEN 2
  2630. #define MC_CMD_PCIE_CREDITS_OUT_MINIMUM_P_HDR_OFST 8
  2631. #define MC_CMD_PCIE_CREDITS_OUT_MINIMUM_P_HDR_LEN 2
  2632. #define MC_CMD_PCIE_CREDITS_OUT_MINIMUM_P_DATA_OFST 10
  2633. #define MC_CMD_PCIE_CREDITS_OUT_MINIMUM_P_DATA_LEN 2
  2634. #define MC_CMD_PCIE_CREDITS_OUT_MINIMUM_NP_HDR_OFST 12
  2635. #define MC_CMD_PCIE_CREDITS_OUT_MINIMUM_NP_HDR_LEN 2
  2636. #define MC_CMD_PCIE_CREDITS_OUT_MINIMUM_NP_DATA_OFST 14
  2637. #define MC_CMD_PCIE_CREDITS_OUT_MINIMUM_NP_DATA_LEN 2
  2638. /***********************************/
  2639. /* MC_CMD_RXD_MONITOR
  2640. * Get histogram of RX queue fill level.
  2641. */
  2642. #define MC_CMD_RXD_MONITOR 0x22
  2643. /* MC_CMD_RXD_MONITOR_IN msgrequest */
  2644. #define MC_CMD_RXD_MONITOR_IN_LEN 12
  2645. #define MC_CMD_RXD_MONITOR_IN_QID_OFST 0
  2646. #define MC_CMD_RXD_MONITOR_IN_QID_LEN 4
  2647. #define MC_CMD_RXD_MONITOR_IN_POLL_PERIOD_OFST 4
  2648. #define MC_CMD_RXD_MONITOR_IN_POLL_PERIOD_LEN 4
  2649. #define MC_CMD_RXD_MONITOR_IN_WIPE_OFST 8
  2650. #define MC_CMD_RXD_MONITOR_IN_WIPE_LEN 4
  2651. /* MC_CMD_RXD_MONITOR_OUT msgresponse */
  2652. #define MC_CMD_RXD_MONITOR_OUT_LEN 80
  2653. #define MC_CMD_RXD_MONITOR_OUT_QID_OFST 0
  2654. #define MC_CMD_RXD_MONITOR_OUT_QID_LEN 4
  2655. #define MC_CMD_RXD_MONITOR_OUT_RING_FILL_OFST 4
  2656. #define MC_CMD_RXD_MONITOR_OUT_RING_FILL_LEN 4
  2657. #define MC_CMD_RXD_MONITOR_OUT_CACHE_FILL_OFST 8
  2658. #define MC_CMD_RXD_MONITOR_OUT_CACHE_FILL_LEN 4
  2659. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_1_OFST 12
  2660. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_1_LEN 4
  2661. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_2_OFST 16
  2662. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_2_LEN 4
  2663. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_4_OFST 20
  2664. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_4_LEN 4
  2665. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_8_OFST 24
  2666. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_8_LEN 4
  2667. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_16_OFST 28
  2668. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_16_LEN 4
  2669. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_32_OFST 32
  2670. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_32_LEN 4
  2671. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_64_OFST 36
  2672. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_64_LEN 4
  2673. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_128_OFST 40
  2674. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_128_LEN 4
  2675. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_256_OFST 44
  2676. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_256_LEN 4
  2677. #define MC_CMD_RXD_MONITOR_OUT_RING_GE_256_OFST 48
  2678. #define MC_CMD_RXD_MONITOR_OUT_RING_GE_256_LEN 4
  2679. #define MC_CMD_RXD_MONITOR_OUT_CACHE_LT_1_OFST 52
  2680. #define MC_CMD_RXD_MONITOR_OUT_CACHE_LT_1_LEN 4
  2681. #define MC_CMD_RXD_MONITOR_OUT_CACHE_LT_2_OFST 56
  2682. #define MC_CMD_RXD_MONITOR_OUT_CACHE_LT_2_LEN 4
  2683. #define MC_CMD_RXD_MONITOR_OUT_CACHE_LT_4_OFST 60
  2684. #define MC_CMD_RXD_MONITOR_OUT_CACHE_LT_4_LEN 4
  2685. #define MC_CMD_RXD_MONITOR_OUT_CACHE_LT_8_OFST 64
  2686. #define MC_CMD_RXD_MONITOR_OUT_CACHE_LT_8_LEN 4
  2687. #define MC_CMD_RXD_MONITOR_OUT_CACHE_LT_16_OFST 68
  2688. #define MC_CMD_RXD_MONITOR_OUT_CACHE_LT_16_LEN 4
  2689. #define MC_CMD_RXD_MONITOR_OUT_CACHE_LT_32_OFST 72
  2690. #define MC_CMD_RXD_MONITOR_OUT_CACHE_LT_32_LEN 4
  2691. #define MC_CMD_RXD_MONITOR_OUT_CACHE_GE_32_OFST 76
  2692. #define MC_CMD_RXD_MONITOR_OUT_CACHE_GE_32_LEN 4
  2693. /***********************************/
  2694. /* MC_CMD_PUTS
  2695. * Copy the given ASCII string out onto UART and/or out of the network port.
  2696. */
  2697. #define MC_CMD_PUTS 0x23
  2698. #define MC_CMD_0x23_PRIVILEGE_CTG SRIOV_CTG_INSECURE
  2699. /* MC_CMD_PUTS_IN msgrequest */
  2700. #define MC_CMD_PUTS_IN_LENMIN 13
  2701. #define MC_CMD_PUTS_IN_LENMAX 252
  2702. #define MC_CMD_PUTS_IN_LEN(num) (12+1*(num))
  2703. #define MC_CMD_PUTS_IN_DEST_OFST 0
  2704. #define MC_CMD_PUTS_IN_DEST_LEN 4
  2705. #define MC_CMD_PUTS_IN_UART_LBN 0
  2706. #define MC_CMD_PUTS_IN_UART_WIDTH 1
  2707. #define MC_CMD_PUTS_IN_PORT_LBN 1
  2708. #define MC_CMD_PUTS_IN_PORT_WIDTH 1
  2709. #define MC_CMD_PUTS_IN_DHOST_OFST 4
  2710. #define MC_CMD_PUTS_IN_DHOST_LEN 6
  2711. #define MC_CMD_PUTS_IN_STRING_OFST 12
  2712. #define MC_CMD_PUTS_IN_STRING_LEN 1
  2713. #define MC_CMD_PUTS_IN_STRING_MINNUM 1
  2714. #define MC_CMD_PUTS_IN_STRING_MAXNUM 240
  2715. /* MC_CMD_PUTS_OUT msgresponse */
  2716. #define MC_CMD_PUTS_OUT_LEN 0
  2717. /***********************************/
  2718. /* MC_CMD_GET_PHY_CFG
  2719. * Report PHY configuration. This guarantees to succeed even if the PHY is in a
  2720. * 'zombie' state. Locks required: None
  2721. */
  2722. #define MC_CMD_GET_PHY_CFG 0x24
  2723. #define MC_CMD_0x24_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  2724. /* MC_CMD_GET_PHY_CFG_IN msgrequest */
  2725. #define MC_CMD_GET_PHY_CFG_IN_LEN 0
  2726. /* MC_CMD_GET_PHY_CFG_OUT msgresponse */
  2727. #define MC_CMD_GET_PHY_CFG_OUT_LEN 72
  2728. /* flags */
  2729. #define MC_CMD_GET_PHY_CFG_OUT_FLAGS_OFST 0
  2730. #define MC_CMD_GET_PHY_CFG_OUT_FLAGS_LEN 4
  2731. #define MC_CMD_GET_PHY_CFG_OUT_PRESENT_LBN 0
  2732. #define MC_CMD_GET_PHY_CFG_OUT_PRESENT_WIDTH 1
  2733. #define MC_CMD_GET_PHY_CFG_OUT_BIST_CABLE_SHORT_LBN 1
  2734. #define MC_CMD_GET_PHY_CFG_OUT_BIST_CABLE_SHORT_WIDTH 1
  2735. #define MC_CMD_GET_PHY_CFG_OUT_BIST_CABLE_LONG_LBN 2
  2736. #define MC_CMD_GET_PHY_CFG_OUT_BIST_CABLE_LONG_WIDTH 1
  2737. #define MC_CMD_GET_PHY_CFG_OUT_LOWPOWER_LBN 3
  2738. #define MC_CMD_GET_PHY_CFG_OUT_LOWPOWER_WIDTH 1
  2739. #define MC_CMD_GET_PHY_CFG_OUT_POWEROFF_LBN 4
  2740. #define MC_CMD_GET_PHY_CFG_OUT_POWEROFF_WIDTH 1
  2741. #define MC_CMD_GET_PHY_CFG_OUT_TXDIS_LBN 5
  2742. #define MC_CMD_GET_PHY_CFG_OUT_TXDIS_WIDTH 1
  2743. #define MC_CMD_GET_PHY_CFG_OUT_BIST_LBN 6
  2744. #define MC_CMD_GET_PHY_CFG_OUT_BIST_WIDTH 1
  2745. /* ?? */
  2746. #define MC_CMD_GET_PHY_CFG_OUT_TYPE_OFST 4
  2747. #define MC_CMD_GET_PHY_CFG_OUT_TYPE_LEN 4
  2748. /* Bitmask of supported capabilities */
  2749. #define MC_CMD_GET_PHY_CFG_OUT_SUPPORTED_CAP_OFST 8
  2750. #define MC_CMD_GET_PHY_CFG_OUT_SUPPORTED_CAP_LEN 4
  2751. #define MC_CMD_PHY_CAP_10HDX_LBN 1
  2752. #define MC_CMD_PHY_CAP_10HDX_WIDTH 1
  2753. #define MC_CMD_PHY_CAP_10FDX_LBN 2
  2754. #define MC_CMD_PHY_CAP_10FDX_WIDTH 1
  2755. #define MC_CMD_PHY_CAP_100HDX_LBN 3
  2756. #define MC_CMD_PHY_CAP_100HDX_WIDTH 1
  2757. #define MC_CMD_PHY_CAP_100FDX_LBN 4
  2758. #define MC_CMD_PHY_CAP_100FDX_WIDTH 1
  2759. #define MC_CMD_PHY_CAP_1000HDX_LBN 5
  2760. #define MC_CMD_PHY_CAP_1000HDX_WIDTH 1
  2761. #define MC_CMD_PHY_CAP_1000FDX_LBN 6
  2762. #define MC_CMD_PHY_CAP_1000FDX_WIDTH 1
  2763. #define MC_CMD_PHY_CAP_10000FDX_LBN 7
  2764. #define MC_CMD_PHY_CAP_10000FDX_WIDTH 1
  2765. #define MC_CMD_PHY_CAP_PAUSE_LBN 8
  2766. #define MC_CMD_PHY_CAP_PAUSE_WIDTH 1
  2767. #define MC_CMD_PHY_CAP_ASYM_LBN 9
  2768. #define MC_CMD_PHY_CAP_ASYM_WIDTH 1
  2769. #define MC_CMD_PHY_CAP_AN_LBN 10
  2770. #define MC_CMD_PHY_CAP_AN_WIDTH 1
  2771. #define MC_CMD_PHY_CAP_40000FDX_LBN 11
  2772. #define MC_CMD_PHY_CAP_40000FDX_WIDTH 1
  2773. #define MC_CMD_PHY_CAP_DDM_LBN 12
  2774. #define MC_CMD_PHY_CAP_DDM_WIDTH 1
  2775. #define MC_CMD_PHY_CAP_100000FDX_LBN 13
  2776. #define MC_CMD_PHY_CAP_100000FDX_WIDTH 1
  2777. #define MC_CMD_PHY_CAP_25000FDX_LBN 14
  2778. #define MC_CMD_PHY_CAP_25000FDX_WIDTH 1
  2779. #define MC_CMD_PHY_CAP_50000FDX_LBN 15
  2780. #define MC_CMD_PHY_CAP_50000FDX_WIDTH 1
  2781. #define MC_CMD_PHY_CAP_BASER_FEC_LBN 16
  2782. #define MC_CMD_PHY_CAP_BASER_FEC_WIDTH 1
  2783. #define MC_CMD_PHY_CAP_BASER_FEC_REQUESTED_LBN 17
  2784. #define MC_CMD_PHY_CAP_BASER_FEC_REQUESTED_WIDTH 1
  2785. #define MC_CMD_PHY_CAP_RS_FEC_LBN 18
  2786. #define MC_CMD_PHY_CAP_RS_FEC_WIDTH 1
  2787. #define MC_CMD_PHY_CAP_RS_FEC_REQUESTED_LBN 19
  2788. #define MC_CMD_PHY_CAP_RS_FEC_REQUESTED_WIDTH 1
  2789. #define MC_CMD_PHY_CAP_25G_BASER_FEC_LBN 20
  2790. #define MC_CMD_PHY_CAP_25G_BASER_FEC_WIDTH 1
  2791. #define MC_CMD_PHY_CAP_25G_BASER_FEC_REQUESTED_LBN 21
  2792. #define MC_CMD_PHY_CAP_25G_BASER_FEC_REQUESTED_WIDTH 1
  2793. /* ?? */
  2794. #define MC_CMD_GET_PHY_CFG_OUT_CHANNEL_OFST 12
  2795. #define MC_CMD_GET_PHY_CFG_OUT_CHANNEL_LEN 4
  2796. /* ?? */
  2797. #define MC_CMD_GET_PHY_CFG_OUT_PRT_OFST 16
  2798. #define MC_CMD_GET_PHY_CFG_OUT_PRT_LEN 4
  2799. /* ?? */
  2800. #define MC_CMD_GET_PHY_CFG_OUT_STATS_MASK_OFST 20
  2801. #define MC_CMD_GET_PHY_CFG_OUT_STATS_MASK_LEN 4
  2802. /* ?? */
  2803. #define MC_CMD_GET_PHY_CFG_OUT_NAME_OFST 24
  2804. #define MC_CMD_GET_PHY_CFG_OUT_NAME_LEN 20
  2805. /* ?? */
  2806. #define MC_CMD_GET_PHY_CFG_OUT_MEDIA_TYPE_OFST 44
  2807. #define MC_CMD_GET_PHY_CFG_OUT_MEDIA_TYPE_LEN 4
  2808. /* enum: Xaui. */
  2809. #define MC_CMD_MEDIA_XAUI 0x1
  2810. /* enum: CX4. */
  2811. #define MC_CMD_MEDIA_CX4 0x2
  2812. /* enum: KX4. */
  2813. #define MC_CMD_MEDIA_KX4 0x3
  2814. /* enum: XFP Far. */
  2815. #define MC_CMD_MEDIA_XFP 0x4
  2816. /* enum: SFP+. */
  2817. #define MC_CMD_MEDIA_SFP_PLUS 0x5
  2818. /* enum: 10GBaseT. */
  2819. #define MC_CMD_MEDIA_BASE_T 0x6
  2820. /* enum: QSFP+. */
  2821. #define MC_CMD_MEDIA_QSFP_PLUS 0x7
  2822. #define MC_CMD_GET_PHY_CFG_OUT_MMD_MASK_OFST 48
  2823. #define MC_CMD_GET_PHY_CFG_OUT_MMD_MASK_LEN 4
  2824. /* enum: Native clause 22 */
  2825. #define MC_CMD_MMD_CLAUSE22 0x0
  2826. #define MC_CMD_MMD_CLAUSE45_PMAPMD 0x1 /* enum */
  2827. #define MC_CMD_MMD_CLAUSE45_WIS 0x2 /* enum */
  2828. #define MC_CMD_MMD_CLAUSE45_PCS 0x3 /* enum */
  2829. #define MC_CMD_MMD_CLAUSE45_PHYXS 0x4 /* enum */
  2830. #define MC_CMD_MMD_CLAUSE45_DTEXS 0x5 /* enum */
  2831. #define MC_CMD_MMD_CLAUSE45_TC 0x6 /* enum */
  2832. #define MC_CMD_MMD_CLAUSE45_AN 0x7 /* enum */
  2833. /* enum: Clause22 proxied over clause45 by PHY. */
  2834. #define MC_CMD_MMD_CLAUSE45_C22EXT 0x1d
  2835. #define MC_CMD_MMD_CLAUSE45_VEND1 0x1e /* enum */
  2836. #define MC_CMD_MMD_CLAUSE45_VEND2 0x1f /* enum */
  2837. #define MC_CMD_GET_PHY_CFG_OUT_REVISION_OFST 52
  2838. #define MC_CMD_GET_PHY_CFG_OUT_REVISION_LEN 20
  2839. /***********************************/
  2840. /* MC_CMD_START_BIST
  2841. * Start a BIST test on the PHY. Locks required: PHY_LOCK if doing a PHY BIST
  2842. * Return code: 0, EINVAL, EACCES (if PHY_LOCK is not held)
  2843. */
  2844. #define MC_CMD_START_BIST 0x25
  2845. #define MC_CMD_0x25_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  2846. /* MC_CMD_START_BIST_IN msgrequest */
  2847. #define MC_CMD_START_BIST_IN_LEN 4
  2848. /* Type of test. */
  2849. #define MC_CMD_START_BIST_IN_TYPE_OFST 0
  2850. #define MC_CMD_START_BIST_IN_TYPE_LEN 4
  2851. /* enum: Run the PHY's short cable BIST. */
  2852. #define MC_CMD_PHY_BIST_CABLE_SHORT 0x1
  2853. /* enum: Run the PHY's long cable BIST. */
  2854. #define MC_CMD_PHY_BIST_CABLE_LONG 0x2
  2855. /* enum: Run BIST on the currently selected BPX Serdes (XAUI or XFI) . */
  2856. #define MC_CMD_BPX_SERDES_BIST 0x3
  2857. /* enum: Run the MC loopback tests. */
  2858. #define MC_CMD_MC_LOOPBACK_BIST 0x4
  2859. /* enum: Run the PHY's standard BIST. */
  2860. #define MC_CMD_PHY_BIST 0x5
  2861. /* enum: Run MC RAM test. */
  2862. #define MC_CMD_MC_MEM_BIST 0x6
  2863. /* enum: Run Port RAM test. */
  2864. #define MC_CMD_PORT_MEM_BIST 0x7
  2865. /* enum: Run register test. */
  2866. #define MC_CMD_REG_BIST 0x8
  2867. /* MC_CMD_START_BIST_OUT msgresponse */
  2868. #define MC_CMD_START_BIST_OUT_LEN 0
  2869. /***********************************/
  2870. /* MC_CMD_POLL_BIST
  2871. * Poll for BIST completion. Returns a single status code, and optionally some
  2872. * PHY specific bist output. The driver should only consume the BIST output
  2873. * after validating OUTLEN and MC_CMD_GET_PHY_CFG.TYPE. If a driver can't
  2874. * successfully parse the BIST output, it should still respect the pass/Fail in
  2875. * OUT.RESULT. Locks required: PHY_LOCK if doing a PHY BIST. Return code: 0,
  2876. * EACCES (if PHY_LOCK is not held).
  2877. */
  2878. #define MC_CMD_POLL_BIST 0x26
  2879. #define MC_CMD_0x26_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  2880. /* MC_CMD_POLL_BIST_IN msgrequest */
  2881. #define MC_CMD_POLL_BIST_IN_LEN 0
  2882. /* MC_CMD_POLL_BIST_OUT msgresponse */
  2883. #define MC_CMD_POLL_BIST_OUT_LEN 8
  2884. /* result */
  2885. #define MC_CMD_POLL_BIST_OUT_RESULT_OFST 0
  2886. #define MC_CMD_POLL_BIST_OUT_RESULT_LEN 4
  2887. /* enum: Running. */
  2888. #define MC_CMD_POLL_BIST_RUNNING 0x1
  2889. /* enum: Passed. */
  2890. #define MC_CMD_POLL_BIST_PASSED 0x2
  2891. /* enum: Failed. */
  2892. #define MC_CMD_POLL_BIST_FAILED 0x3
  2893. /* enum: Timed-out. */
  2894. #define MC_CMD_POLL_BIST_TIMEOUT 0x4
  2895. #define MC_CMD_POLL_BIST_OUT_PRIVATE_OFST 4
  2896. #define MC_CMD_POLL_BIST_OUT_PRIVATE_LEN 4
  2897. /* MC_CMD_POLL_BIST_OUT_SFT9001 msgresponse */
  2898. #define MC_CMD_POLL_BIST_OUT_SFT9001_LEN 36
  2899. /* result */
  2900. /* MC_CMD_POLL_BIST_OUT_RESULT_OFST 0 */
  2901. /* MC_CMD_POLL_BIST_OUT_RESULT_LEN 4 */
  2902. /* Enum values, see field(s): */
  2903. /* MC_CMD_POLL_BIST_OUT/MC_CMD_POLL_BIST_OUT_RESULT */
  2904. #define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_LENGTH_A_OFST 4
  2905. #define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_LENGTH_A_LEN 4
  2906. #define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_LENGTH_B_OFST 8
  2907. #define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_LENGTH_B_LEN 4
  2908. #define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_LENGTH_C_OFST 12
  2909. #define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_LENGTH_C_LEN 4
  2910. #define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_LENGTH_D_OFST 16
  2911. #define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_LENGTH_D_LEN 4
  2912. /* Status of each channel A */
  2913. #define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_STATUS_A_OFST 20
  2914. #define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_STATUS_A_LEN 4
  2915. /* enum: Ok. */
  2916. #define MC_CMD_POLL_BIST_SFT9001_PAIR_OK 0x1
  2917. /* enum: Open. */
  2918. #define MC_CMD_POLL_BIST_SFT9001_PAIR_OPEN 0x2
  2919. /* enum: Intra-pair short. */
  2920. #define MC_CMD_POLL_BIST_SFT9001_INTRA_PAIR_SHORT 0x3
  2921. /* enum: Inter-pair short. */
  2922. #define MC_CMD_POLL_BIST_SFT9001_INTER_PAIR_SHORT 0x4
  2923. /* enum: Busy. */
  2924. #define MC_CMD_POLL_BIST_SFT9001_PAIR_BUSY 0x9
  2925. /* Status of each channel B */
  2926. #define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_STATUS_B_OFST 24
  2927. #define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_STATUS_B_LEN 4
  2928. /* Enum values, see field(s): */
  2929. /* CABLE_STATUS_A */
  2930. /* Status of each channel C */
  2931. #define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_STATUS_C_OFST 28
  2932. #define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_STATUS_C_LEN 4
  2933. /* Enum values, see field(s): */
  2934. /* CABLE_STATUS_A */
  2935. /* Status of each channel D */
  2936. #define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_STATUS_D_OFST 32
  2937. #define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_STATUS_D_LEN 4
  2938. /* Enum values, see field(s): */
  2939. /* CABLE_STATUS_A */
  2940. /* MC_CMD_POLL_BIST_OUT_MRSFP msgresponse */
  2941. #define MC_CMD_POLL_BIST_OUT_MRSFP_LEN 8
  2942. /* result */
  2943. /* MC_CMD_POLL_BIST_OUT_RESULT_OFST 0 */
  2944. /* MC_CMD_POLL_BIST_OUT_RESULT_LEN 4 */
  2945. /* Enum values, see field(s): */
  2946. /* MC_CMD_POLL_BIST_OUT/MC_CMD_POLL_BIST_OUT_RESULT */
  2947. #define MC_CMD_POLL_BIST_OUT_MRSFP_TEST_OFST 4
  2948. #define MC_CMD_POLL_BIST_OUT_MRSFP_TEST_LEN 4
  2949. /* enum: Complete. */
  2950. #define MC_CMD_POLL_BIST_MRSFP_TEST_COMPLETE 0x0
  2951. /* enum: Bus switch off I2C write. */
  2952. #define MC_CMD_POLL_BIST_MRSFP_TEST_BUS_SWITCH_OFF_I2C_WRITE 0x1
  2953. /* enum: Bus switch off I2C no access IO exp. */
  2954. #define MC_CMD_POLL_BIST_MRSFP_TEST_BUS_SWITCH_OFF_I2C_NO_ACCESS_IO_EXP 0x2
  2955. /* enum: Bus switch off I2C no access module. */
  2956. #define MC_CMD_POLL_BIST_MRSFP_TEST_BUS_SWITCH_OFF_I2C_NO_ACCESS_MODULE 0x3
  2957. /* enum: IO exp I2C configure. */
  2958. #define MC_CMD_POLL_BIST_MRSFP_TEST_IO_EXP_I2C_CONFIGURE 0x4
  2959. /* enum: Bus switch I2C no cross talk. */
  2960. #define MC_CMD_POLL_BIST_MRSFP_TEST_BUS_SWITCH_I2C_NO_CROSSTALK 0x5
  2961. /* enum: Module presence. */
  2962. #define MC_CMD_POLL_BIST_MRSFP_TEST_MODULE_PRESENCE 0x6
  2963. /* enum: Module ID I2C access. */
  2964. #define MC_CMD_POLL_BIST_MRSFP_TEST_MODULE_ID_I2C_ACCESS 0x7
  2965. /* enum: Module ID sane value. */
  2966. #define MC_CMD_POLL_BIST_MRSFP_TEST_MODULE_ID_SANE_VALUE 0x8
  2967. /* MC_CMD_POLL_BIST_OUT_MEM msgresponse */
  2968. #define MC_CMD_POLL_BIST_OUT_MEM_LEN 36
  2969. /* result */
  2970. /* MC_CMD_POLL_BIST_OUT_RESULT_OFST 0 */
  2971. /* MC_CMD_POLL_BIST_OUT_RESULT_LEN 4 */
  2972. /* Enum values, see field(s): */
  2973. /* MC_CMD_POLL_BIST_OUT/MC_CMD_POLL_BIST_OUT_RESULT */
  2974. #define MC_CMD_POLL_BIST_OUT_MEM_TEST_OFST 4
  2975. #define MC_CMD_POLL_BIST_OUT_MEM_TEST_LEN 4
  2976. /* enum: Test has completed. */
  2977. #define MC_CMD_POLL_BIST_MEM_COMPLETE 0x0
  2978. /* enum: RAM test - walk ones. */
  2979. #define MC_CMD_POLL_BIST_MEM_MEM_WALK_ONES 0x1
  2980. /* enum: RAM test - walk zeros. */
  2981. #define MC_CMD_POLL_BIST_MEM_MEM_WALK_ZEROS 0x2
  2982. /* enum: RAM test - walking inversions zeros/ones. */
  2983. #define MC_CMD_POLL_BIST_MEM_MEM_INV_ZERO_ONE 0x3
  2984. /* enum: RAM test - walking inversions checkerboard. */
  2985. #define MC_CMD_POLL_BIST_MEM_MEM_INV_CHKBOARD 0x4
  2986. /* enum: Register test - set / clear individual bits. */
  2987. #define MC_CMD_POLL_BIST_MEM_REG 0x5
  2988. /* enum: ECC error detected. */
  2989. #define MC_CMD_POLL_BIST_MEM_ECC 0x6
  2990. /* Failure address, only valid if result is POLL_BIST_FAILED */
  2991. #define MC_CMD_POLL_BIST_OUT_MEM_ADDR_OFST 8
  2992. #define MC_CMD_POLL_BIST_OUT_MEM_ADDR_LEN 4
  2993. /* Bus or address space to which the failure address corresponds */
  2994. #define MC_CMD_POLL_BIST_OUT_MEM_BUS_OFST 12
  2995. #define MC_CMD_POLL_BIST_OUT_MEM_BUS_LEN 4
  2996. /* enum: MC MIPS bus. */
  2997. #define MC_CMD_POLL_BIST_MEM_BUS_MC 0x0
  2998. /* enum: CSR IREG bus. */
  2999. #define MC_CMD_POLL_BIST_MEM_BUS_CSR 0x1
  3000. /* enum: RX0 DPCPU bus. */
  3001. #define MC_CMD_POLL_BIST_MEM_BUS_DPCPU_RX 0x2
  3002. /* enum: TX0 DPCPU bus. */
  3003. #define MC_CMD_POLL_BIST_MEM_BUS_DPCPU_TX0 0x3
  3004. /* enum: TX1 DPCPU bus. */
  3005. #define MC_CMD_POLL_BIST_MEM_BUS_DPCPU_TX1 0x4
  3006. /* enum: RX0 DICPU bus. */
  3007. #define MC_CMD_POLL_BIST_MEM_BUS_DICPU_RX 0x5
  3008. /* enum: TX DICPU bus. */
  3009. #define MC_CMD_POLL_BIST_MEM_BUS_DICPU_TX 0x6
  3010. /* enum: RX1 DPCPU bus. */
  3011. #define MC_CMD_POLL_BIST_MEM_BUS_DPCPU_RX1 0x7
  3012. /* enum: RX1 DICPU bus. */
  3013. #define MC_CMD_POLL_BIST_MEM_BUS_DICPU_RX1 0x8
  3014. /* Pattern written to RAM / register */
  3015. #define MC_CMD_POLL_BIST_OUT_MEM_EXPECT_OFST 16
  3016. #define MC_CMD_POLL_BIST_OUT_MEM_EXPECT_LEN 4
  3017. /* Actual value read from RAM / register */
  3018. #define MC_CMD_POLL_BIST_OUT_MEM_ACTUAL_OFST 20
  3019. #define MC_CMD_POLL_BIST_OUT_MEM_ACTUAL_LEN 4
  3020. /* ECC error mask */
  3021. #define MC_CMD_POLL_BIST_OUT_MEM_ECC_OFST 24
  3022. #define MC_CMD_POLL_BIST_OUT_MEM_ECC_LEN 4
  3023. /* ECC parity error mask */
  3024. #define MC_CMD_POLL_BIST_OUT_MEM_ECC_PARITY_OFST 28
  3025. #define MC_CMD_POLL_BIST_OUT_MEM_ECC_PARITY_LEN 4
  3026. /* ECC fatal error mask */
  3027. #define MC_CMD_POLL_BIST_OUT_MEM_ECC_FATAL_OFST 32
  3028. #define MC_CMD_POLL_BIST_OUT_MEM_ECC_FATAL_LEN 4
  3029. /***********************************/
  3030. /* MC_CMD_FLUSH_RX_QUEUES
  3031. * Flush receive queue(s). If SRIOV is enabled (via MC_CMD_SRIOV), then RXQ
  3032. * flushes should be initiated via this MCDI operation, rather than via
  3033. * directly writing FLUSH_CMD.
  3034. *
  3035. * The flush is completed (either done/fail) asynchronously (after this command
  3036. * returns). The driver must still wait for flush done/failure events as usual.
  3037. */
  3038. #define MC_CMD_FLUSH_RX_QUEUES 0x27
  3039. /* MC_CMD_FLUSH_RX_QUEUES_IN msgrequest */
  3040. #define MC_CMD_FLUSH_RX_QUEUES_IN_LENMIN 4
  3041. #define MC_CMD_FLUSH_RX_QUEUES_IN_LENMAX 252
  3042. #define MC_CMD_FLUSH_RX_QUEUES_IN_LEN(num) (0+4*(num))
  3043. #define MC_CMD_FLUSH_RX_QUEUES_IN_QID_OFST_OFST 0
  3044. #define MC_CMD_FLUSH_RX_QUEUES_IN_QID_OFST_LEN 4
  3045. #define MC_CMD_FLUSH_RX_QUEUES_IN_QID_OFST_MINNUM 1
  3046. #define MC_CMD_FLUSH_RX_QUEUES_IN_QID_OFST_MAXNUM 63
  3047. /* MC_CMD_FLUSH_RX_QUEUES_OUT msgresponse */
  3048. #define MC_CMD_FLUSH_RX_QUEUES_OUT_LEN 0
  3049. /***********************************/
  3050. /* MC_CMD_GET_LOOPBACK_MODES
  3051. * Returns a bitmask of loopback modes available at each speed.
  3052. */
  3053. #define MC_CMD_GET_LOOPBACK_MODES 0x28
  3054. #define MC_CMD_0x28_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  3055. /* MC_CMD_GET_LOOPBACK_MODES_IN msgrequest */
  3056. #define MC_CMD_GET_LOOPBACK_MODES_IN_LEN 0
  3057. /* MC_CMD_GET_LOOPBACK_MODES_OUT msgresponse */
  3058. #define MC_CMD_GET_LOOPBACK_MODES_OUT_LEN 40
  3059. /* Supported loopbacks. */
  3060. #define MC_CMD_GET_LOOPBACK_MODES_OUT_100M_OFST 0
  3061. #define MC_CMD_GET_LOOPBACK_MODES_OUT_100M_LEN 8
  3062. #define MC_CMD_GET_LOOPBACK_MODES_OUT_100M_LO_OFST 0
  3063. #define MC_CMD_GET_LOOPBACK_MODES_OUT_100M_HI_OFST 4
  3064. /* enum: None. */
  3065. #define MC_CMD_LOOPBACK_NONE 0x0
  3066. /* enum: Data. */
  3067. #define MC_CMD_LOOPBACK_DATA 0x1
  3068. /* enum: GMAC. */
  3069. #define MC_CMD_LOOPBACK_GMAC 0x2
  3070. /* enum: XGMII. */
  3071. #define MC_CMD_LOOPBACK_XGMII 0x3
  3072. /* enum: XGXS. */
  3073. #define MC_CMD_LOOPBACK_XGXS 0x4
  3074. /* enum: XAUI. */
  3075. #define MC_CMD_LOOPBACK_XAUI 0x5
  3076. /* enum: GMII. */
  3077. #define MC_CMD_LOOPBACK_GMII 0x6
  3078. /* enum: SGMII. */
  3079. #define MC_CMD_LOOPBACK_SGMII 0x7
  3080. /* enum: XGBR. */
  3081. #define MC_CMD_LOOPBACK_XGBR 0x8
  3082. /* enum: XFI. */
  3083. #define MC_CMD_LOOPBACK_XFI 0x9
  3084. /* enum: XAUI Far. */
  3085. #define MC_CMD_LOOPBACK_XAUI_FAR 0xa
  3086. /* enum: GMII Far. */
  3087. #define MC_CMD_LOOPBACK_GMII_FAR 0xb
  3088. /* enum: SGMII Far. */
  3089. #define MC_CMD_LOOPBACK_SGMII_FAR 0xc
  3090. /* enum: XFI Far. */
  3091. #define MC_CMD_LOOPBACK_XFI_FAR 0xd
  3092. /* enum: GPhy. */
  3093. #define MC_CMD_LOOPBACK_GPHY 0xe
  3094. /* enum: PhyXS. */
  3095. #define MC_CMD_LOOPBACK_PHYXS 0xf
  3096. /* enum: PCS. */
  3097. #define MC_CMD_LOOPBACK_PCS 0x10
  3098. /* enum: PMA-PMD. */
  3099. #define MC_CMD_LOOPBACK_PMAPMD 0x11
  3100. /* enum: Cross-Port. */
  3101. #define MC_CMD_LOOPBACK_XPORT 0x12
  3102. /* enum: XGMII-Wireside. */
  3103. #define MC_CMD_LOOPBACK_XGMII_WS 0x13
  3104. /* enum: XAUI Wireside. */
  3105. #define MC_CMD_LOOPBACK_XAUI_WS 0x14
  3106. /* enum: XAUI Wireside Far. */
  3107. #define MC_CMD_LOOPBACK_XAUI_WS_FAR 0x15
  3108. /* enum: XAUI Wireside near. */
  3109. #define MC_CMD_LOOPBACK_XAUI_WS_NEAR 0x16
  3110. /* enum: GMII Wireside. */
  3111. #define MC_CMD_LOOPBACK_GMII_WS 0x17
  3112. /* enum: XFI Wireside. */
  3113. #define MC_CMD_LOOPBACK_XFI_WS 0x18
  3114. /* enum: XFI Wireside Far. */
  3115. #define MC_CMD_LOOPBACK_XFI_WS_FAR 0x19
  3116. /* enum: PhyXS Wireside. */
  3117. #define MC_CMD_LOOPBACK_PHYXS_WS 0x1a
  3118. /* enum: PMA lanes MAC-Serdes. */
  3119. #define MC_CMD_LOOPBACK_PMA_INT 0x1b
  3120. /* enum: KR Serdes Parallel (Encoder). */
  3121. #define MC_CMD_LOOPBACK_SD_NEAR 0x1c
  3122. /* enum: KR Serdes Serial. */
  3123. #define MC_CMD_LOOPBACK_SD_FAR 0x1d
  3124. /* enum: PMA lanes MAC-Serdes Wireside. */
  3125. #define MC_CMD_LOOPBACK_PMA_INT_WS 0x1e
  3126. /* enum: KR Serdes Parallel Wireside (Full PCS). */
  3127. #define MC_CMD_LOOPBACK_SD_FEP2_WS 0x1f
  3128. /* enum: KR Serdes Parallel Wireside (Sym Aligner to TX). */
  3129. #define MC_CMD_LOOPBACK_SD_FEP1_5_WS 0x20
  3130. /* enum: KR Serdes Parallel Wireside (Deserializer to Serializer). */
  3131. #define MC_CMD_LOOPBACK_SD_FEP_WS 0x21
  3132. /* enum: KR Serdes Serial Wireside. */
  3133. #define MC_CMD_LOOPBACK_SD_FES_WS 0x22
  3134. /* enum: Near side of AOE Siena side port */
  3135. #define MC_CMD_LOOPBACK_AOE_INT_NEAR 0x23
  3136. /* enum: Medford Wireside datapath loopback */
  3137. #define MC_CMD_LOOPBACK_DATA_WS 0x24
  3138. /* enum: Force link up without setting up any physical loopback (snapper use
  3139. * only)
  3140. */
  3141. #define MC_CMD_LOOPBACK_FORCE_EXT_LINK 0x25
  3142. /* Supported loopbacks. */
  3143. #define MC_CMD_GET_LOOPBACK_MODES_OUT_1G_OFST 8
  3144. #define MC_CMD_GET_LOOPBACK_MODES_OUT_1G_LEN 8
  3145. #define MC_CMD_GET_LOOPBACK_MODES_OUT_1G_LO_OFST 8
  3146. #define MC_CMD_GET_LOOPBACK_MODES_OUT_1G_HI_OFST 12
  3147. /* Enum values, see field(s): */
  3148. /* 100M */
  3149. /* Supported loopbacks. */
  3150. #define MC_CMD_GET_LOOPBACK_MODES_OUT_10G_OFST 16
  3151. #define MC_CMD_GET_LOOPBACK_MODES_OUT_10G_LEN 8
  3152. #define MC_CMD_GET_LOOPBACK_MODES_OUT_10G_LO_OFST 16
  3153. #define MC_CMD_GET_LOOPBACK_MODES_OUT_10G_HI_OFST 20
  3154. /* Enum values, see field(s): */
  3155. /* 100M */
  3156. /* Supported loopbacks. */
  3157. #define MC_CMD_GET_LOOPBACK_MODES_OUT_SUGGESTED_OFST 24
  3158. #define MC_CMD_GET_LOOPBACK_MODES_OUT_SUGGESTED_LEN 8
  3159. #define MC_CMD_GET_LOOPBACK_MODES_OUT_SUGGESTED_LO_OFST 24
  3160. #define MC_CMD_GET_LOOPBACK_MODES_OUT_SUGGESTED_HI_OFST 28
  3161. /* Enum values, see field(s): */
  3162. /* 100M */
  3163. /* Supported loopbacks. */
  3164. #define MC_CMD_GET_LOOPBACK_MODES_OUT_40G_OFST 32
  3165. #define MC_CMD_GET_LOOPBACK_MODES_OUT_40G_LEN 8
  3166. #define MC_CMD_GET_LOOPBACK_MODES_OUT_40G_LO_OFST 32
  3167. #define MC_CMD_GET_LOOPBACK_MODES_OUT_40G_HI_OFST 36
  3168. /* Enum values, see field(s): */
  3169. /* 100M */
  3170. /* MC_CMD_GET_LOOPBACK_MODES_OUT_V2 msgresponse: Supported loopback modes for
  3171. * newer NICs with 25G/50G/100G support
  3172. */
  3173. #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_LEN 64
  3174. /* Supported loopbacks. */
  3175. #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_100M_OFST 0
  3176. #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_100M_LEN 8
  3177. #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_100M_LO_OFST 0
  3178. #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_100M_HI_OFST 4
  3179. /* enum: None. */
  3180. /* MC_CMD_LOOPBACK_NONE 0x0 */
  3181. /* enum: Data. */
  3182. /* MC_CMD_LOOPBACK_DATA 0x1 */
  3183. /* enum: GMAC. */
  3184. /* MC_CMD_LOOPBACK_GMAC 0x2 */
  3185. /* enum: XGMII. */
  3186. /* MC_CMD_LOOPBACK_XGMII 0x3 */
  3187. /* enum: XGXS. */
  3188. /* MC_CMD_LOOPBACK_XGXS 0x4 */
  3189. /* enum: XAUI. */
  3190. /* MC_CMD_LOOPBACK_XAUI 0x5 */
  3191. /* enum: GMII. */
  3192. /* MC_CMD_LOOPBACK_GMII 0x6 */
  3193. /* enum: SGMII. */
  3194. /* MC_CMD_LOOPBACK_SGMII 0x7 */
  3195. /* enum: XGBR. */
  3196. /* MC_CMD_LOOPBACK_XGBR 0x8 */
  3197. /* enum: XFI. */
  3198. /* MC_CMD_LOOPBACK_XFI 0x9 */
  3199. /* enum: XAUI Far. */
  3200. /* MC_CMD_LOOPBACK_XAUI_FAR 0xa */
  3201. /* enum: GMII Far. */
  3202. /* MC_CMD_LOOPBACK_GMII_FAR 0xb */
  3203. /* enum: SGMII Far. */
  3204. /* MC_CMD_LOOPBACK_SGMII_FAR 0xc */
  3205. /* enum: XFI Far. */
  3206. /* MC_CMD_LOOPBACK_XFI_FAR 0xd */
  3207. /* enum: GPhy. */
  3208. /* MC_CMD_LOOPBACK_GPHY 0xe */
  3209. /* enum: PhyXS. */
  3210. /* MC_CMD_LOOPBACK_PHYXS 0xf */
  3211. /* enum: PCS. */
  3212. /* MC_CMD_LOOPBACK_PCS 0x10 */
  3213. /* enum: PMA-PMD. */
  3214. /* MC_CMD_LOOPBACK_PMAPMD 0x11 */
  3215. /* enum: Cross-Port. */
  3216. /* MC_CMD_LOOPBACK_XPORT 0x12 */
  3217. /* enum: XGMII-Wireside. */
  3218. /* MC_CMD_LOOPBACK_XGMII_WS 0x13 */
  3219. /* enum: XAUI Wireside. */
  3220. /* MC_CMD_LOOPBACK_XAUI_WS 0x14 */
  3221. /* enum: XAUI Wireside Far. */
  3222. /* MC_CMD_LOOPBACK_XAUI_WS_FAR 0x15 */
  3223. /* enum: XAUI Wireside near. */
  3224. /* MC_CMD_LOOPBACK_XAUI_WS_NEAR 0x16 */
  3225. /* enum: GMII Wireside. */
  3226. /* MC_CMD_LOOPBACK_GMII_WS 0x17 */
  3227. /* enum: XFI Wireside. */
  3228. /* MC_CMD_LOOPBACK_XFI_WS 0x18 */
  3229. /* enum: XFI Wireside Far. */
  3230. /* MC_CMD_LOOPBACK_XFI_WS_FAR 0x19 */
  3231. /* enum: PhyXS Wireside. */
  3232. /* MC_CMD_LOOPBACK_PHYXS_WS 0x1a */
  3233. /* enum: PMA lanes MAC-Serdes. */
  3234. /* MC_CMD_LOOPBACK_PMA_INT 0x1b */
  3235. /* enum: KR Serdes Parallel (Encoder). */
  3236. /* MC_CMD_LOOPBACK_SD_NEAR 0x1c */
  3237. /* enum: KR Serdes Serial. */
  3238. /* MC_CMD_LOOPBACK_SD_FAR 0x1d */
  3239. /* enum: PMA lanes MAC-Serdes Wireside. */
  3240. /* MC_CMD_LOOPBACK_PMA_INT_WS 0x1e */
  3241. /* enum: KR Serdes Parallel Wireside (Full PCS). */
  3242. /* MC_CMD_LOOPBACK_SD_FEP2_WS 0x1f */
  3243. /* enum: KR Serdes Parallel Wireside (Sym Aligner to TX). */
  3244. /* MC_CMD_LOOPBACK_SD_FEP1_5_WS 0x20 */
  3245. /* enum: KR Serdes Parallel Wireside (Deserializer to Serializer). */
  3246. /* MC_CMD_LOOPBACK_SD_FEP_WS 0x21 */
  3247. /* enum: KR Serdes Serial Wireside. */
  3248. /* MC_CMD_LOOPBACK_SD_FES_WS 0x22 */
  3249. /* enum: Near side of AOE Siena side port */
  3250. /* MC_CMD_LOOPBACK_AOE_INT_NEAR 0x23 */
  3251. /* enum: Medford Wireside datapath loopback */
  3252. /* MC_CMD_LOOPBACK_DATA_WS 0x24 */
  3253. /* enum: Force link up without setting up any physical loopback (snapper use
  3254. * only)
  3255. */
  3256. /* MC_CMD_LOOPBACK_FORCE_EXT_LINK 0x25 */
  3257. /* Supported loopbacks. */
  3258. #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_1G_OFST 8
  3259. #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_1G_LEN 8
  3260. #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_1G_LO_OFST 8
  3261. #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_1G_HI_OFST 12
  3262. /* Enum values, see field(s): */
  3263. /* 100M */
  3264. /* Supported loopbacks. */
  3265. #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_10G_OFST 16
  3266. #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_10G_LEN 8
  3267. #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_10G_LO_OFST 16
  3268. #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_10G_HI_OFST 20
  3269. /* Enum values, see field(s): */
  3270. /* 100M */
  3271. /* Supported loopbacks. */
  3272. #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_SUGGESTED_OFST 24
  3273. #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_SUGGESTED_LEN 8
  3274. #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_SUGGESTED_LO_OFST 24
  3275. #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_SUGGESTED_HI_OFST 28
  3276. /* Enum values, see field(s): */
  3277. /* 100M */
  3278. /* Supported loopbacks. */
  3279. #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_40G_OFST 32
  3280. #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_40G_LEN 8
  3281. #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_40G_LO_OFST 32
  3282. #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_40G_HI_OFST 36
  3283. /* Enum values, see field(s): */
  3284. /* 100M */
  3285. /* Supported 25G loopbacks. */
  3286. #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_25G_OFST 40
  3287. #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_25G_LEN 8
  3288. #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_25G_LO_OFST 40
  3289. #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_25G_HI_OFST 44
  3290. /* Enum values, see field(s): */
  3291. /* 100M */
  3292. /* Supported 50 loopbacks. */
  3293. #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_50G_OFST 48
  3294. #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_50G_LEN 8
  3295. #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_50G_LO_OFST 48
  3296. #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_50G_HI_OFST 52
  3297. /* Enum values, see field(s): */
  3298. /* 100M */
  3299. /* Supported 100G loopbacks. */
  3300. #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_100G_OFST 56
  3301. #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_100G_LEN 8
  3302. #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_100G_LO_OFST 56
  3303. #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_100G_HI_OFST 60
  3304. /* Enum values, see field(s): */
  3305. /* 100M */
  3306. /* AN_TYPE structuredef: Auto-negotiation types defined in IEEE802.3 */
  3307. #define AN_TYPE_LEN 4
  3308. #define AN_TYPE_TYPE_OFST 0
  3309. #define AN_TYPE_TYPE_LEN 4
  3310. /* enum: None, AN disabled or not supported */
  3311. #define MC_CMD_AN_NONE 0x0
  3312. /* enum: Clause 28 - BASE-T */
  3313. #define MC_CMD_AN_CLAUSE28 0x1
  3314. /* enum: Clause 37 - BASE-X */
  3315. #define MC_CMD_AN_CLAUSE37 0x2
  3316. /* enum: Clause 73 - BASE-R startup protocol for backplane and copper cable
  3317. * assemblies. Includes Clause 72/Clause 92 link-training.
  3318. */
  3319. #define MC_CMD_AN_CLAUSE73 0x3
  3320. #define AN_TYPE_TYPE_LBN 0
  3321. #define AN_TYPE_TYPE_WIDTH 32
  3322. /* FEC_TYPE structuredef: Forward error correction types defined in IEEE802.3
  3323. */
  3324. #define FEC_TYPE_LEN 4
  3325. #define FEC_TYPE_TYPE_OFST 0
  3326. #define FEC_TYPE_TYPE_LEN 4
  3327. /* enum: No FEC */
  3328. #define MC_CMD_FEC_NONE 0x0
  3329. /* enum: Clause 74 BASE-R FEC (a.k.a Firecode) */
  3330. #define MC_CMD_FEC_BASER 0x1
  3331. /* enum: Clause 91/Clause 108 Reed-Solomon FEC */
  3332. #define MC_CMD_FEC_RS 0x2
  3333. #define FEC_TYPE_TYPE_LBN 0
  3334. #define FEC_TYPE_TYPE_WIDTH 32
  3335. /***********************************/
  3336. /* MC_CMD_GET_LINK
  3337. * Read the unified MAC/PHY link state. Locks required: None Return code: 0,
  3338. * ETIME.
  3339. */
  3340. #define MC_CMD_GET_LINK 0x29
  3341. #define MC_CMD_0x29_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  3342. /* MC_CMD_GET_LINK_IN msgrequest */
  3343. #define MC_CMD_GET_LINK_IN_LEN 0
  3344. /* MC_CMD_GET_LINK_OUT msgresponse */
  3345. #define MC_CMD_GET_LINK_OUT_LEN 28
  3346. /* Near-side advertised capabilities. Refer to
  3347. * MC_CMD_GET_PHY_CFG_OUT/SUPPORTED_CAP for bit definitions.
  3348. */
  3349. #define MC_CMD_GET_LINK_OUT_CAP_OFST 0
  3350. #define MC_CMD_GET_LINK_OUT_CAP_LEN 4
  3351. /* Link-partner advertised capabilities. Refer to
  3352. * MC_CMD_GET_PHY_CFG_OUT/SUPPORTED_CAP for bit definitions.
  3353. */
  3354. #define MC_CMD_GET_LINK_OUT_LP_CAP_OFST 4
  3355. #define MC_CMD_GET_LINK_OUT_LP_CAP_LEN 4
  3356. /* Autonegotiated speed in mbit/s. The link may still be down even if this
  3357. * reads non-zero.
  3358. */
  3359. #define MC_CMD_GET_LINK_OUT_LINK_SPEED_OFST 8
  3360. #define MC_CMD_GET_LINK_OUT_LINK_SPEED_LEN 4
  3361. /* Current loopback setting. */
  3362. #define MC_CMD_GET_LINK_OUT_LOOPBACK_MODE_OFST 12
  3363. #define MC_CMD_GET_LINK_OUT_LOOPBACK_MODE_LEN 4
  3364. /* Enum values, see field(s): */
  3365. /* MC_CMD_GET_LOOPBACK_MODES/MC_CMD_GET_LOOPBACK_MODES_OUT/100M */
  3366. #define MC_CMD_GET_LINK_OUT_FLAGS_OFST 16
  3367. #define MC_CMD_GET_LINK_OUT_FLAGS_LEN 4
  3368. #define MC_CMD_GET_LINK_OUT_LINK_UP_LBN 0
  3369. #define MC_CMD_GET_LINK_OUT_LINK_UP_WIDTH 1
  3370. #define MC_CMD_GET_LINK_OUT_FULL_DUPLEX_LBN 1
  3371. #define MC_CMD_GET_LINK_OUT_FULL_DUPLEX_WIDTH 1
  3372. #define MC_CMD_GET_LINK_OUT_BPX_LINK_LBN 2
  3373. #define MC_CMD_GET_LINK_OUT_BPX_LINK_WIDTH 1
  3374. #define MC_CMD_GET_LINK_OUT_PHY_LINK_LBN 3
  3375. #define MC_CMD_GET_LINK_OUT_PHY_LINK_WIDTH 1
  3376. #define MC_CMD_GET_LINK_OUT_LINK_FAULT_RX_LBN 6
  3377. #define MC_CMD_GET_LINK_OUT_LINK_FAULT_RX_WIDTH 1
  3378. #define MC_CMD_GET_LINK_OUT_LINK_FAULT_TX_LBN 7
  3379. #define MC_CMD_GET_LINK_OUT_LINK_FAULT_TX_WIDTH 1
  3380. /* This returns the negotiated flow control value. */
  3381. #define MC_CMD_GET_LINK_OUT_FCNTL_OFST 20
  3382. #define MC_CMD_GET_LINK_OUT_FCNTL_LEN 4
  3383. /* Enum values, see field(s): */
  3384. /* MC_CMD_SET_MAC/MC_CMD_SET_MAC_IN/FCNTL */
  3385. #define MC_CMD_GET_LINK_OUT_MAC_FAULT_OFST 24
  3386. #define MC_CMD_GET_LINK_OUT_MAC_FAULT_LEN 4
  3387. #define MC_CMD_MAC_FAULT_XGMII_LOCAL_LBN 0
  3388. #define MC_CMD_MAC_FAULT_XGMII_LOCAL_WIDTH 1
  3389. #define MC_CMD_MAC_FAULT_XGMII_REMOTE_LBN 1
  3390. #define MC_CMD_MAC_FAULT_XGMII_REMOTE_WIDTH 1
  3391. #define MC_CMD_MAC_FAULT_SGMII_REMOTE_LBN 2
  3392. #define MC_CMD_MAC_FAULT_SGMII_REMOTE_WIDTH 1
  3393. #define MC_CMD_MAC_FAULT_PENDING_RECONFIG_LBN 3
  3394. #define MC_CMD_MAC_FAULT_PENDING_RECONFIG_WIDTH 1
  3395. /* MC_CMD_GET_LINK_OUT_V2 msgresponse: Extended link state information */
  3396. #define MC_CMD_GET_LINK_OUT_V2_LEN 44
  3397. /* Near-side advertised capabilities. Refer to
  3398. * MC_CMD_GET_PHY_CFG_OUT/SUPPORTED_CAP for bit definitions.
  3399. */
  3400. #define MC_CMD_GET_LINK_OUT_V2_CAP_OFST 0
  3401. #define MC_CMD_GET_LINK_OUT_V2_CAP_LEN 4
  3402. /* Link-partner advertised capabilities. Refer to
  3403. * MC_CMD_GET_PHY_CFG_OUT/SUPPORTED_CAP for bit definitions.
  3404. */
  3405. #define MC_CMD_GET_LINK_OUT_V2_LP_CAP_OFST 4
  3406. #define MC_CMD_GET_LINK_OUT_V2_LP_CAP_LEN 4
  3407. /* Autonegotiated speed in mbit/s. The link may still be down even if this
  3408. * reads non-zero.
  3409. */
  3410. #define MC_CMD_GET_LINK_OUT_V2_LINK_SPEED_OFST 8
  3411. #define MC_CMD_GET_LINK_OUT_V2_LINK_SPEED_LEN 4
  3412. /* Current loopback setting. */
  3413. #define MC_CMD_GET_LINK_OUT_V2_LOOPBACK_MODE_OFST 12
  3414. #define MC_CMD_GET_LINK_OUT_V2_LOOPBACK_MODE_LEN 4
  3415. /* Enum values, see field(s): */
  3416. /* MC_CMD_GET_LOOPBACK_MODES/MC_CMD_GET_LOOPBACK_MODES_OUT/100M */
  3417. #define MC_CMD_GET_LINK_OUT_V2_FLAGS_OFST 16
  3418. #define MC_CMD_GET_LINK_OUT_V2_FLAGS_LEN 4
  3419. #define MC_CMD_GET_LINK_OUT_V2_LINK_UP_LBN 0
  3420. #define MC_CMD_GET_LINK_OUT_V2_LINK_UP_WIDTH 1
  3421. #define MC_CMD_GET_LINK_OUT_V2_FULL_DUPLEX_LBN 1
  3422. #define MC_CMD_GET_LINK_OUT_V2_FULL_DUPLEX_WIDTH 1
  3423. #define MC_CMD_GET_LINK_OUT_V2_BPX_LINK_LBN 2
  3424. #define MC_CMD_GET_LINK_OUT_V2_BPX_LINK_WIDTH 1
  3425. #define MC_CMD_GET_LINK_OUT_V2_PHY_LINK_LBN 3
  3426. #define MC_CMD_GET_LINK_OUT_V2_PHY_LINK_WIDTH 1
  3427. #define MC_CMD_GET_LINK_OUT_V2_LINK_FAULT_RX_LBN 6
  3428. #define MC_CMD_GET_LINK_OUT_V2_LINK_FAULT_RX_WIDTH 1
  3429. #define MC_CMD_GET_LINK_OUT_V2_LINK_FAULT_TX_LBN 7
  3430. #define MC_CMD_GET_LINK_OUT_V2_LINK_FAULT_TX_WIDTH 1
  3431. /* This returns the negotiated flow control value. */
  3432. #define MC_CMD_GET_LINK_OUT_V2_FCNTL_OFST 20
  3433. #define MC_CMD_GET_LINK_OUT_V2_FCNTL_LEN 4
  3434. /* Enum values, see field(s): */
  3435. /* MC_CMD_SET_MAC/MC_CMD_SET_MAC_IN/FCNTL */
  3436. #define MC_CMD_GET_LINK_OUT_V2_MAC_FAULT_OFST 24
  3437. #define MC_CMD_GET_LINK_OUT_V2_MAC_FAULT_LEN 4
  3438. /* MC_CMD_MAC_FAULT_XGMII_LOCAL_LBN 0 */
  3439. /* MC_CMD_MAC_FAULT_XGMII_LOCAL_WIDTH 1 */
  3440. /* MC_CMD_MAC_FAULT_XGMII_REMOTE_LBN 1 */
  3441. /* MC_CMD_MAC_FAULT_XGMII_REMOTE_WIDTH 1 */
  3442. /* MC_CMD_MAC_FAULT_SGMII_REMOTE_LBN 2 */
  3443. /* MC_CMD_MAC_FAULT_SGMII_REMOTE_WIDTH 1 */
  3444. /* MC_CMD_MAC_FAULT_PENDING_RECONFIG_LBN 3 */
  3445. /* MC_CMD_MAC_FAULT_PENDING_RECONFIG_WIDTH 1 */
  3446. /* True local device capabilities (taking into account currently used PMD/MDI,
  3447. * e.g. plugged-in module). In general, subset of
  3448. * MC_CMD_GET_PHY_CFG_OUT/SUPPORTED_CAP, but may include extra _FEC_REQUEST
  3449. * bits, if the PMD requires FEC. 0 if unknown (e.g. module unplugged). Equal
  3450. * to SUPPORTED_CAP for non-pluggable PMDs. Refer to
  3451. * MC_CMD_GET_PHY_CFG_OUT/SUPPORTED_CAP for bit definitions.
  3452. */
  3453. #define MC_CMD_GET_LINK_OUT_V2_LD_CAP_OFST 28
  3454. #define MC_CMD_GET_LINK_OUT_V2_LD_CAP_LEN 4
  3455. /* Auto-negotiation type used on the link */
  3456. #define MC_CMD_GET_LINK_OUT_V2_AN_TYPE_OFST 32
  3457. #define MC_CMD_GET_LINK_OUT_V2_AN_TYPE_LEN 4
  3458. /* Enum values, see field(s): */
  3459. /* AN_TYPE/TYPE */
  3460. /* Forward error correction used on the link */
  3461. #define MC_CMD_GET_LINK_OUT_V2_FEC_TYPE_OFST 36
  3462. #define MC_CMD_GET_LINK_OUT_V2_FEC_TYPE_LEN 4
  3463. /* Enum values, see field(s): */
  3464. /* FEC_TYPE/TYPE */
  3465. #define MC_CMD_GET_LINK_OUT_V2_EXT_FLAGS_OFST 40
  3466. #define MC_CMD_GET_LINK_OUT_V2_EXT_FLAGS_LEN 4
  3467. #define MC_CMD_GET_LINK_OUT_V2_PMD_MDI_CONNECTED_LBN 0
  3468. #define MC_CMD_GET_LINK_OUT_V2_PMD_MDI_CONNECTED_WIDTH 1
  3469. #define MC_CMD_GET_LINK_OUT_V2_PMD_READY_LBN 1
  3470. #define MC_CMD_GET_LINK_OUT_V2_PMD_READY_WIDTH 1
  3471. #define MC_CMD_GET_LINK_OUT_V2_PMD_LINK_UP_LBN 2
  3472. #define MC_CMD_GET_LINK_OUT_V2_PMD_LINK_UP_WIDTH 1
  3473. #define MC_CMD_GET_LINK_OUT_V2_PMA_LINK_UP_LBN 3
  3474. #define MC_CMD_GET_LINK_OUT_V2_PMA_LINK_UP_WIDTH 1
  3475. #define MC_CMD_GET_LINK_OUT_V2_PCS_LOCK_LBN 4
  3476. #define MC_CMD_GET_LINK_OUT_V2_PCS_LOCK_WIDTH 1
  3477. #define MC_CMD_GET_LINK_OUT_V2_ALIGN_LOCK_LBN 5
  3478. #define MC_CMD_GET_LINK_OUT_V2_ALIGN_LOCK_WIDTH 1
  3479. #define MC_CMD_GET_LINK_OUT_V2_HI_BER_LBN 6
  3480. #define MC_CMD_GET_LINK_OUT_V2_HI_BER_WIDTH 1
  3481. #define MC_CMD_GET_LINK_OUT_V2_FEC_LOCK_LBN 7
  3482. #define MC_CMD_GET_LINK_OUT_V2_FEC_LOCK_WIDTH 1
  3483. #define MC_CMD_GET_LINK_OUT_V2_AN_DONE_LBN 8
  3484. #define MC_CMD_GET_LINK_OUT_V2_AN_DONE_WIDTH 1
  3485. /***********************************/
  3486. /* MC_CMD_SET_LINK
  3487. * Write the unified MAC/PHY link configuration. Locks required: None. Return
  3488. * code: 0, EINVAL, ETIME
  3489. */
  3490. #define MC_CMD_SET_LINK 0x2a
  3491. #define MC_CMD_0x2a_PRIVILEGE_CTG SRIOV_CTG_LINK
  3492. /* MC_CMD_SET_LINK_IN msgrequest */
  3493. #define MC_CMD_SET_LINK_IN_LEN 16
  3494. /* Near-side advertised capabilities. Refer to
  3495. * MC_CMD_GET_PHY_CFG_OUT/SUPPORTED_CAP for bit definitions.
  3496. */
  3497. #define MC_CMD_SET_LINK_IN_CAP_OFST 0
  3498. #define MC_CMD_SET_LINK_IN_CAP_LEN 4
  3499. /* Flags */
  3500. #define MC_CMD_SET_LINK_IN_FLAGS_OFST 4
  3501. #define MC_CMD_SET_LINK_IN_FLAGS_LEN 4
  3502. #define MC_CMD_SET_LINK_IN_LOWPOWER_LBN 0
  3503. #define MC_CMD_SET_LINK_IN_LOWPOWER_WIDTH 1
  3504. #define MC_CMD_SET_LINK_IN_POWEROFF_LBN 1
  3505. #define MC_CMD_SET_LINK_IN_POWEROFF_WIDTH 1
  3506. #define MC_CMD_SET_LINK_IN_TXDIS_LBN 2
  3507. #define MC_CMD_SET_LINK_IN_TXDIS_WIDTH 1
  3508. /* Loopback mode. */
  3509. #define MC_CMD_SET_LINK_IN_LOOPBACK_MODE_OFST 8
  3510. #define MC_CMD_SET_LINK_IN_LOOPBACK_MODE_LEN 4
  3511. /* Enum values, see field(s): */
  3512. /* MC_CMD_GET_LOOPBACK_MODES/MC_CMD_GET_LOOPBACK_MODES_OUT/100M */
  3513. /* A loopback speed of "0" is supported, and means (choose any available
  3514. * speed).
  3515. */
  3516. #define MC_CMD_SET_LINK_IN_LOOPBACK_SPEED_OFST 12
  3517. #define MC_CMD_SET_LINK_IN_LOOPBACK_SPEED_LEN 4
  3518. /* MC_CMD_SET_LINK_OUT msgresponse */
  3519. #define MC_CMD_SET_LINK_OUT_LEN 0
  3520. /***********************************/
  3521. /* MC_CMD_SET_ID_LED
  3522. * Set identification LED state. Locks required: None. Return code: 0, EINVAL
  3523. */
  3524. #define MC_CMD_SET_ID_LED 0x2b
  3525. #define MC_CMD_0x2b_PRIVILEGE_CTG SRIOV_CTG_LINK
  3526. /* MC_CMD_SET_ID_LED_IN msgrequest */
  3527. #define MC_CMD_SET_ID_LED_IN_LEN 4
  3528. /* Set LED state. */
  3529. #define MC_CMD_SET_ID_LED_IN_STATE_OFST 0
  3530. #define MC_CMD_SET_ID_LED_IN_STATE_LEN 4
  3531. #define MC_CMD_LED_OFF 0x0 /* enum */
  3532. #define MC_CMD_LED_ON 0x1 /* enum */
  3533. #define MC_CMD_LED_DEFAULT 0x2 /* enum */
  3534. /* MC_CMD_SET_ID_LED_OUT msgresponse */
  3535. #define MC_CMD_SET_ID_LED_OUT_LEN 0
  3536. /***********************************/
  3537. /* MC_CMD_SET_MAC
  3538. * Set MAC configuration. Locks required: None. Return code: 0, EINVAL
  3539. */
  3540. #define MC_CMD_SET_MAC 0x2c
  3541. #define MC_CMD_0x2c_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  3542. /* MC_CMD_SET_MAC_IN msgrequest */
  3543. #define MC_CMD_SET_MAC_IN_LEN 28
  3544. /* The MTU is the MTU programmed directly into the XMAC/GMAC (inclusive of
  3545. * EtherII, VLAN, bug16011 padding).
  3546. */
  3547. #define MC_CMD_SET_MAC_IN_MTU_OFST 0
  3548. #define MC_CMD_SET_MAC_IN_MTU_LEN 4
  3549. #define MC_CMD_SET_MAC_IN_DRAIN_OFST 4
  3550. #define MC_CMD_SET_MAC_IN_DRAIN_LEN 4
  3551. #define MC_CMD_SET_MAC_IN_ADDR_OFST 8
  3552. #define MC_CMD_SET_MAC_IN_ADDR_LEN 8
  3553. #define MC_CMD_SET_MAC_IN_ADDR_LO_OFST 8
  3554. #define MC_CMD_SET_MAC_IN_ADDR_HI_OFST 12
  3555. #define MC_CMD_SET_MAC_IN_REJECT_OFST 16
  3556. #define MC_CMD_SET_MAC_IN_REJECT_LEN 4
  3557. #define MC_CMD_SET_MAC_IN_REJECT_UNCST_LBN 0
  3558. #define MC_CMD_SET_MAC_IN_REJECT_UNCST_WIDTH 1
  3559. #define MC_CMD_SET_MAC_IN_REJECT_BRDCST_LBN 1
  3560. #define MC_CMD_SET_MAC_IN_REJECT_BRDCST_WIDTH 1
  3561. #define MC_CMD_SET_MAC_IN_FCNTL_OFST 20
  3562. #define MC_CMD_SET_MAC_IN_FCNTL_LEN 4
  3563. /* enum: Flow control is off. */
  3564. #define MC_CMD_FCNTL_OFF 0x0
  3565. /* enum: Respond to flow control. */
  3566. #define MC_CMD_FCNTL_RESPOND 0x1
  3567. /* enum: Respond to and Issue flow control. */
  3568. #define MC_CMD_FCNTL_BIDIR 0x2
  3569. /* enum: Auto neg flow control. */
  3570. #define MC_CMD_FCNTL_AUTO 0x3
  3571. /* enum: Priority flow control (eftest builds only). */
  3572. #define MC_CMD_FCNTL_QBB 0x4
  3573. /* enum: Issue flow control. */
  3574. #define MC_CMD_FCNTL_GENERATE 0x5
  3575. #define MC_CMD_SET_MAC_IN_FLAGS_OFST 24
  3576. #define MC_CMD_SET_MAC_IN_FLAGS_LEN 4
  3577. #define MC_CMD_SET_MAC_IN_FLAG_INCLUDE_FCS_LBN 0
  3578. #define MC_CMD_SET_MAC_IN_FLAG_INCLUDE_FCS_WIDTH 1
  3579. /* MC_CMD_SET_MAC_EXT_IN msgrequest */
  3580. #define MC_CMD_SET_MAC_EXT_IN_LEN 32
  3581. /* The MTU is the MTU programmed directly into the XMAC/GMAC (inclusive of
  3582. * EtherII, VLAN, bug16011 padding).
  3583. */
  3584. #define MC_CMD_SET_MAC_EXT_IN_MTU_OFST 0
  3585. #define MC_CMD_SET_MAC_EXT_IN_MTU_LEN 4
  3586. #define MC_CMD_SET_MAC_EXT_IN_DRAIN_OFST 4
  3587. #define MC_CMD_SET_MAC_EXT_IN_DRAIN_LEN 4
  3588. #define MC_CMD_SET_MAC_EXT_IN_ADDR_OFST 8
  3589. #define MC_CMD_SET_MAC_EXT_IN_ADDR_LEN 8
  3590. #define MC_CMD_SET_MAC_EXT_IN_ADDR_LO_OFST 8
  3591. #define MC_CMD_SET_MAC_EXT_IN_ADDR_HI_OFST 12
  3592. #define MC_CMD_SET_MAC_EXT_IN_REJECT_OFST 16
  3593. #define MC_CMD_SET_MAC_EXT_IN_REJECT_LEN 4
  3594. #define MC_CMD_SET_MAC_EXT_IN_REJECT_UNCST_LBN 0
  3595. #define MC_CMD_SET_MAC_EXT_IN_REJECT_UNCST_WIDTH 1
  3596. #define MC_CMD_SET_MAC_EXT_IN_REJECT_BRDCST_LBN 1
  3597. #define MC_CMD_SET_MAC_EXT_IN_REJECT_BRDCST_WIDTH 1
  3598. #define MC_CMD_SET_MAC_EXT_IN_FCNTL_OFST 20
  3599. #define MC_CMD_SET_MAC_EXT_IN_FCNTL_LEN 4
  3600. /* enum: Flow control is off. */
  3601. /* MC_CMD_FCNTL_OFF 0x0 */
  3602. /* enum: Respond to flow control. */
  3603. /* MC_CMD_FCNTL_RESPOND 0x1 */
  3604. /* enum: Respond to and Issue flow control. */
  3605. /* MC_CMD_FCNTL_BIDIR 0x2 */
  3606. /* enum: Auto neg flow control. */
  3607. /* MC_CMD_FCNTL_AUTO 0x3 */
  3608. /* enum: Priority flow control (eftest builds only). */
  3609. /* MC_CMD_FCNTL_QBB 0x4 */
  3610. /* enum: Issue flow control. */
  3611. /* MC_CMD_FCNTL_GENERATE 0x5 */
  3612. #define MC_CMD_SET_MAC_EXT_IN_FLAGS_OFST 24
  3613. #define MC_CMD_SET_MAC_EXT_IN_FLAGS_LEN 4
  3614. #define MC_CMD_SET_MAC_EXT_IN_FLAG_INCLUDE_FCS_LBN 0
  3615. #define MC_CMD_SET_MAC_EXT_IN_FLAG_INCLUDE_FCS_WIDTH 1
  3616. /* Select which parameters to configure. A parameter will only be modified if
  3617. * the corresponding control flag is set. If SET_MAC_ENHANCED is not set in
  3618. * capabilities then this field is ignored (and all flags are assumed to be
  3619. * set).
  3620. */
  3621. #define MC_CMD_SET_MAC_EXT_IN_CONTROL_OFST 28
  3622. #define MC_CMD_SET_MAC_EXT_IN_CONTROL_LEN 4
  3623. #define MC_CMD_SET_MAC_EXT_IN_CFG_MTU_LBN 0
  3624. #define MC_CMD_SET_MAC_EXT_IN_CFG_MTU_WIDTH 1
  3625. #define MC_CMD_SET_MAC_EXT_IN_CFG_DRAIN_LBN 1
  3626. #define MC_CMD_SET_MAC_EXT_IN_CFG_DRAIN_WIDTH 1
  3627. #define MC_CMD_SET_MAC_EXT_IN_CFG_REJECT_LBN 2
  3628. #define MC_CMD_SET_MAC_EXT_IN_CFG_REJECT_WIDTH 1
  3629. #define MC_CMD_SET_MAC_EXT_IN_CFG_FCNTL_LBN 3
  3630. #define MC_CMD_SET_MAC_EXT_IN_CFG_FCNTL_WIDTH 1
  3631. #define MC_CMD_SET_MAC_EXT_IN_CFG_FCS_LBN 4
  3632. #define MC_CMD_SET_MAC_EXT_IN_CFG_FCS_WIDTH 1
  3633. /* MC_CMD_SET_MAC_OUT msgresponse */
  3634. #define MC_CMD_SET_MAC_OUT_LEN 0
  3635. /* MC_CMD_SET_MAC_V2_OUT msgresponse */
  3636. #define MC_CMD_SET_MAC_V2_OUT_LEN 4
  3637. /* MTU as configured after processing the request. See comment at
  3638. * MC_CMD_SET_MAC_IN/MTU. To query MTU without doing any changes, set CONTROL
  3639. * to 0.
  3640. */
  3641. #define MC_CMD_SET_MAC_V2_OUT_MTU_OFST 0
  3642. #define MC_CMD_SET_MAC_V2_OUT_MTU_LEN 4
  3643. /***********************************/
  3644. /* MC_CMD_PHY_STATS
  3645. * Get generic PHY statistics. This call returns the statistics for a generic
  3646. * PHY in a sparse array (indexed by the enumerate). Each value is represented
  3647. * by a 32bit number. If the DMA_ADDR is 0, then no DMA is performed, and the
  3648. * statistics may be read from the message response. If DMA_ADDR != 0, then the
  3649. * statistics are dmad to that (page-aligned location). Locks required: None.
  3650. * Returns: 0, ETIME
  3651. */
  3652. #define MC_CMD_PHY_STATS 0x2d
  3653. #define MC_CMD_0x2d_PRIVILEGE_CTG SRIOV_CTG_LINK
  3654. /* MC_CMD_PHY_STATS_IN msgrequest */
  3655. #define MC_CMD_PHY_STATS_IN_LEN 8
  3656. /* ??? */
  3657. #define MC_CMD_PHY_STATS_IN_DMA_ADDR_OFST 0
  3658. #define MC_CMD_PHY_STATS_IN_DMA_ADDR_LEN 8
  3659. #define MC_CMD_PHY_STATS_IN_DMA_ADDR_LO_OFST 0
  3660. #define MC_CMD_PHY_STATS_IN_DMA_ADDR_HI_OFST 4
  3661. /* MC_CMD_PHY_STATS_OUT_DMA msgresponse */
  3662. #define MC_CMD_PHY_STATS_OUT_DMA_LEN 0
  3663. /* MC_CMD_PHY_STATS_OUT_NO_DMA msgresponse */
  3664. #define MC_CMD_PHY_STATS_OUT_NO_DMA_LEN (((MC_CMD_PHY_NSTATS*32))>>3)
  3665. #define MC_CMD_PHY_STATS_OUT_NO_DMA_STATISTICS_OFST 0
  3666. #define MC_CMD_PHY_STATS_OUT_NO_DMA_STATISTICS_LEN 4
  3667. #define MC_CMD_PHY_STATS_OUT_NO_DMA_STATISTICS_NUM MC_CMD_PHY_NSTATS
  3668. /* enum: OUI. */
  3669. #define MC_CMD_OUI 0x0
  3670. /* enum: PMA-PMD Link Up. */
  3671. #define MC_CMD_PMA_PMD_LINK_UP 0x1
  3672. /* enum: PMA-PMD RX Fault. */
  3673. #define MC_CMD_PMA_PMD_RX_FAULT 0x2
  3674. /* enum: PMA-PMD TX Fault. */
  3675. #define MC_CMD_PMA_PMD_TX_FAULT 0x3
  3676. /* enum: PMA-PMD Signal */
  3677. #define MC_CMD_PMA_PMD_SIGNAL 0x4
  3678. /* enum: PMA-PMD SNR A. */
  3679. #define MC_CMD_PMA_PMD_SNR_A 0x5
  3680. /* enum: PMA-PMD SNR B. */
  3681. #define MC_CMD_PMA_PMD_SNR_B 0x6
  3682. /* enum: PMA-PMD SNR C. */
  3683. #define MC_CMD_PMA_PMD_SNR_C 0x7
  3684. /* enum: PMA-PMD SNR D. */
  3685. #define MC_CMD_PMA_PMD_SNR_D 0x8
  3686. /* enum: PCS Link Up. */
  3687. #define MC_CMD_PCS_LINK_UP 0x9
  3688. /* enum: PCS RX Fault. */
  3689. #define MC_CMD_PCS_RX_FAULT 0xa
  3690. /* enum: PCS TX Fault. */
  3691. #define MC_CMD_PCS_TX_FAULT 0xb
  3692. /* enum: PCS BER. */
  3693. #define MC_CMD_PCS_BER 0xc
  3694. /* enum: PCS Block Errors. */
  3695. #define MC_CMD_PCS_BLOCK_ERRORS 0xd
  3696. /* enum: PhyXS Link Up. */
  3697. #define MC_CMD_PHYXS_LINK_UP 0xe
  3698. /* enum: PhyXS RX Fault. */
  3699. #define MC_CMD_PHYXS_RX_FAULT 0xf
  3700. /* enum: PhyXS TX Fault. */
  3701. #define MC_CMD_PHYXS_TX_FAULT 0x10
  3702. /* enum: PhyXS Align. */
  3703. #define MC_CMD_PHYXS_ALIGN 0x11
  3704. /* enum: PhyXS Sync. */
  3705. #define MC_CMD_PHYXS_SYNC 0x12
  3706. /* enum: AN link-up. */
  3707. #define MC_CMD_AN_LINK_UP 0x13
  3708. /* enum: AN Complete. */
  3709. #define MC_CMD_AN_COMPLETE 0x14
  3710. /* enum: AN 10GBaseT Status. */
  3711. #define MC_CMD_AN_10GBT_STATUS 0x15
  3712. /* enum: Clause 22 Link-Up. */
  3713. #define MC_CMD_CL22_LINK_UP 0x16
  3714. /* enum: (Last entry) */
  3715. #define MC_CMD_PHY_NSTATS 0x17
  3716. /***********************************/
  3717. /* MC_CMD_MAC_STATS
  3718. * Get generic MAC statistics. This call returns unified statistics maintained
  3719. * by the MC as it switches between the GMAC and XMAC. The MC will write out
  3720. * all supported stats. The driver should zero initialise the buffer to
  3721. * guarantee consistent results. If the DMA_ADDR is 0, then no DMA is
  3722. * performed, and the statistics may be read from the message response. If
  3723. * DMA_ADDR != 0, then the statistics are dmad to that (page-aligned location).
  3724. * Locks required: None. The PERIODIC_CLEAR option is not used and now has no
  3725. * effect. Returns: 0, ETIME
  3726. */
  3727. #define MC_CMD_MAC_STATS 0x2e
  3728. #define MC_CMD_0x2e_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  3729. /* MC_CMD_MAC_STATS_IN msgrequest */
  3730. #define MC_CMD_MAC_STATS_IN_LEN 20
  3731. /* ??? */
  3732. #define MC_CMD_MAC_STATS_IN_DMA_ADDR_OFST 0
  3733. #define MC_CMD_MAC_STATS_IN_DMA_ADDR_LEN 8
  3734. #define MC_CMD_MAC_STATS_IN_DMA_ADDR_LO_OFST 0
  3735. #define MC_CMD_MAC_STATS_IN_DMA_ADDR_HI_OFST 4
  3736. #define MC_CMD_MAC_STATS_IN_CMD_OFST 8
  3737. #define MC_CMD_MAC_STATS_IN_CMD_LEN 4
  3738. #define MC_CMD_MAC_STATS_IN_DMA_LBN 0
  3739. #define MC_CMD_MAC_STATS_IN_DMA_WIDTH 1
  3740. #define MC_CMD_MAC_STATS_IN_CLEAR_LBN 1
  3741. #define MC_CMD_MAC_STATS_IN_CLEAR_WIDTH 1
  3742. #define MC_CMD_MAC_STATS_IN_PERIODIC_CHANGE_LBN 2
  3743. #define MC_CMD_MAC_STATS_IN_PERIODIC_CHANGE_WIDTH 1
  3744. #define MC_CMD_MAC_STATS_IN_PERIODIC_ENABLE_LBN 3
  3745. #define MC_CMD_MAC_STATS_IN_PERIODIC_ENABLE_WIDTH 1
  3746. #define MC_CMD_MAC_STATS_IN_PERIODIC_CLEAR_LBN 4
  3747. #define MC_CMD_MAC_STATS_IN_PERIODIC_CLEAR_WIDTH 1
  3748. #define MC_CMD_MAC_STATS_IN_PERIODIC_NOEVENT_LBN 5
  3749. #define MC_CMD_MAC_STATS_IN_PERIODIC_NOEVENT_WIDTH 1
  3750. #define MC_CMD_MAC_STATS_IN_PERIOD_MS_LBN 16
  3751. #define MC_CMD_MAC_STATS_IN_PERIOD_MS_WIDTH 16
  3752. /* DMA length. Should be set to MAC_STATS_NUM_STATS * sizeof(uint64_t), as
  3753. * returned by MC_CMD_GET_CAPABILITIES_V4_OUT. For legacy firmware not
  3754. * supporting MC_CMD_GET_CAPABILITIES_V4_OUT, DMA_LEN should be set to
  3755. * MC_CMD_MAC_NSTATS * sizeof(uint64_t)
  3756. */
  3757. #define MC_CMD_MAC_STATS_IN_DMA_LEN_OFST 12
  3758. #define MC_CMD_MAC_STATS_IN_DMA_LEN_LEN 4
  3759. /* port id so vadapter stats can be provided */
  3760. #define MC_CMD_MAC_STATS_IN_PORT_ID_OFST 16
  3761. #define MC_CMD_MAC_STATS_IN_PORT_ID_LEN 4
  3762. /* MC_CMD_MAC_STATS_OUT_DMA msgresponse */
  3763. #define MC_CMD_MAC_STATS_OUT_DMA_LEN 0
  3764. /* MC_CMD_MAC_STATS_OUT_NO_DMA msgresponse */
  3765. #define MC_CMD_MAC_STATS_OUT_NO_DMA_LEN (((MC_CMD_MAC_NSTATS*64))>>3)
  3766. #define MC_CMD_MAC_STATS_OUT_NO_DMA_STATISTICS_OFST 0
  3767. #define MC_CMD_MAC_STATS_OUT_NO_DMA_STATISTICS_LEN 8
  3768. #define MC_CMD_MAC_STATS_OUT_NO_DMA_STATISTICS_LO_OFST 0
  3769. #define MC_CMD_MAC_STATS_OUT_NO_DMA_STATISTICS_HI_OFST 4
  3770. #define MC_CMD_MAC_STATS_OUT_NO_DMA_STATISTICS_NUM MC_CMD_MAC_NSTATS
  3771. #define MC_CMD_MAC_GENERATION_START 0x0 /* enum */
  3772. #define MC_CMD_MAC_DMABUF_START 0x1 /* enum */
  3773. #define MC_CMD_MAC_TX_PKTS 0x1 /* enum */
  3774. #define MC_CMD_MAC_TX_PAUSE_PKTS 0x2 /* enum */
  3775. #define MC_CMD_MAC_TX_CONTROL_PKTS 0x3 /* enum */
  3776. #define MC_CMD_MAC_TX_UNICAST_PKTS 0x4 /* enum */
  3777. #define MC_CMD_MAC_TX_MULTICAST_PKTS 0x5 /* enum */
  3778. #define MC_CMD_MAC_TX_BROADCAST_PKTS 0x6 /* enum */
  3779. #define MC_CMD_MAC_TX_BYTES 0x7 /* enum */
  3780. #define MC_CMD_MAC_TX_BAD_BYTES 0x8 /* enum */
  3781. #define MC_CMD_MAC_TX_LT64_PKTS 0x9 /* enum */
  3782. #define MC_CMD_MAC_TX_64_PKTS 0xa /* enum */
  3783. #define MC_CMD_MAC_TX_65_TO_127_PKTS 0xb /* enum */
  3784. #define MC_CMD_MAC_TX_128_TO_255_PKTS 0xc /* enum */
  3785. #define MC_CMD_MAC_TX_256_TO_511_PKTS 0xd /* enum */
  3786. #define MC_CMD_MAC_TX_512_TO_1023_PKTS 0xe /* enum */
  3787. #define MC_CMD_MAC_TX_1024_TO_15XX_PKTS 0xf /* enum */
  3788. #define MC_CMD_MAC_TX_15XX_TO_JUMBO_PKTS 0x10 /* enum */
  3789. #define MC_CMD_MAC_TX_GTJUMBO_PKTS 0x11 /* enum */
  3790. #define MC_CMD_MAC_TX_BAD_FCS_PKTS 0x12 /* enum */
  3791. #define MC_CMD_MAC_TX_SINGLE_COLLISION_PKTS 0x13 /* enum */
  3792. #define MC_CMD_MAC_TX_MULTIPLE_COLLISION_PKTS 0x14 /* enum */
  3793. #define MC_CMD_MAC_TX_EXCESSIVE_COLLISION_PKTS 0x15 /* enum */
  3794. #define MC_CMD_MAC_TX_LATE_COLLISION_PKTS 0x16 /* enum */
  3795. #define MC_CMD_MAC_TX_DEFERRED_PKTS 0x17 /* enum */
  3796. #define MC_CMD_MAC_TX_EXCESSIVE_DEFERRED_PKTS 0x18 /* enum */
  3797. #define MC_CMD_MAC_TX_NON_TCPUDP_PKTS 0x19 /* enum */
  3798. #define MC_CMD_MAC_TX_MAC_SRC_ERR_PKTS 0x1a /* enum */
  3799. #define MC_CMD_MAC_TX_IP_SRC_ERR_PKTS 0x1b /* enum */
  3800. #define MC_CMD_MAC_RX_PKTS 0x1c /* enum */
  3801. #define MC_CMD_MAC_RX_PAUSE_PKTS 0x1d /* enum */
  3802. #define MC_CMD_MAC_RX_GOOD_PKTS 0x1e /* enum */
  3803. #define MC_CMD_MAC_RX_CONTROL_PKTS 0x1f /* enum */
  3804. #define MC_CMD_MAC_RX_UNICAST_PKTS 0x20 /* enum */
  3805. #define MC_CMD_MAC_RX_MULTICAST_PKTS 0x21 /* enum */
  3806. #define MC_CMD_MAC_RX_BROADCAST_PKTS 0x22 /* enum */
  3807. #define MC_CMD_MAC_RX_BYTES 0x23 /* enum */
  3808. #define MC_CMD_MAC_RX_BAD_BYTES 0x24 /* enum */
  3809. #define MC_CMD_MAC_RX_64_PKTS 0x25 /* enum */
  3810. #define MC_CMD_MAC_RX_65_TO_127_PKTS 0x26 /* enum */
  3811. #define MC_CMD_MAC_RX_128_TO_255_PKTS 0x27 /* enum */
  3812. #define MC_CMD_MAC_RX_256_TO_511_PKTS 0x28 /* enum */
  3813. #define MC_CMD_MAC_RX_512_TO_1023_PKTS 0x29 /* enum */
  3814. #define MC_CMD_MAC_RX_1024_TO_15XX_PKTS 0x2a /* enum */
  3815. #define MC_CMD_MAC_RX_15XX_TO_JUMBO_PKTS 0x2b /* enum */
  3816. #define MC_CMD_MAC_RX_GTJUMBO_PKTS 0x2c /* enum */
  3817. #define MC_CMD_MAC_RX_UNDERSIZE_PKTS 0x2d /* enum */
  3818. #define MC_CMD_MAC_RX_BAD_FCS_PKTS 0x2e /* enum */
  3819. #define MC_CMD_MAC_RX_OVERFLOW_PKTS 0x2f /* enum */
  3820. #define MC_CMD_MAC_RX_FALSE_CARRIER_PKTS 0x30 /* enum */
  3821. #define MC_CMD_MAC_RX_SYMBOL_ERROR_PKTS 0x31 /* enum */
  3822. #define MC_CMD_MAC_RX_ALIGN_ERROR_PKTS 0x32 /* enum */
  3823. #define MC_CMD_MAC_RX_LENGTH_ERROR_PKTS 0x33 /* enum */
  3824. #define MC_CMD_MAC_RX_INTERNAL_ERROR_PKTS 0x34 /* enum */
  3825. #define MC_CMD_MAC_RX_JABBER_PKTS 0x35 /* enum */
  3826. #define MC_CMD_MAC_RX_NODESC_DROPS 0x36 /* enum */
  3827. #define MC_CMD_MAC_RX_LANES01_CHAR_ERR 0x37 /* enum */
  3828. #define MC_CMD_MAC_RX_LANES23_CHAR_ERR 0x38 /* enum */
  3829. #define MC_CMD_MAC_RX_LANES01_DISP_ERR 0x39 /* enum */
  3830. #define MC_CMD_MAC_RX_LANES23_DISP_ERR 0x3a /* enum */
  3831. #define MC_CMD_MAC_RX_MATCH_FAULT 0x3b /* enum */
  3832. /* enum: PM trunc_bb_overflow counter. Valid for EF10 with PM_AND_RXDP_COUNTERS
  3833. * capability only.
  3834. */
  3835. #define MC_CMD_MAC_PM_TRUNC_BB_OVERFLOW 0x3c
  3836. /* enum: PM discard_bb_overflow counter. Valid for EF10 with
  3837. * PM_AND_RXDP_COUNTERS capability only.
  3838. */
  3839. #define MC_CMD_MAC_PM_DISCARD_BB_OVERFLOW 0x3d
  3840. /* enum: PM trunc_vfifo_full counter. Valid for EF10 with PM_AND_RXDP_COUNTERS
  3841. * capability only.
  3842. */
  3843. #define MC_CMD_MAC_PM_TRUNC_VFIFO_FULL 0x3e
  3844. /* enum: PM discard_vfifo_full counter. Valid for EF10 with
  3845. * PM_AND_RXDP_COUNTERS capability only.
  3846. */
  3847. #define MC_CMD_MAC_PM_DISCARD_VFIFO_FULL 0x3f
  3848. /* enum: PM trunc_qbb counter. Valid for EF10 with PM_AND_RXDP_COUNTERS
  3849. * capability only.
  3850. */
  3851. #define MC_CMD_MAC_PM_TRUNC_QBB 0x40
  3852. /* enum: PM discard_qbb counter. Valid for EF10 with PM_AND_RXDP_COUNTERS
  3853. * capability only.
  3854. */
  3855. #define MC_CMD_MAC_PM_DISCARD_QBB 0x41
  3856. /* enum: PM discard_mapping counter. Valid for EF10 with PM_AND_RXDP_COUNTERS
  3857. * capability only.
  3858. */
  3859. #define MC_CMD_MAC_PM_DISCARD_MAPPING 0x42
  3860. /* enum: RXDP counter: Number of packets dropped due to the queue being
  3861. * disabled. Valid for EF10 with PM_AND_RXDP_COUNTERS capability only.
  3862. */
  3863. #define MC_CMD_MAC_RXDP_Q_DISABLED_PKTS 0x43
  3864. /* enum: RXDP counter: Number of packets dropped by the DICPU. Valid for EF10
  3865. * with PM_AND_RXDP_COUNTERS capability only.
  3866. */
  3867. #define MC_CMD_MAC_RXDP_DI_DROPPED_PKTS 0x45
  3868. /* enum: RXDP counter: Number of non-host packets. Valid for EF10 with
  3869. * PM_AND_RXDP_COUNTERS capability only.
  3870. */
  3871. #define MC_CMD_MAC_RXDP_STREAMING_PKTS 0x46
  3872. /* enum: RXDP counter: Number of times an hlb descriptor fetch was performed.
  3873. * Valid for EF10 with PM_AND_RXDP_COUNTERS capability only.
  3874. */
  3875. #define MC_CMD_MAC_RXDP_HLB_FETCH_CONDITIONS 0x47
  3876. /* enum: RXDP counter: Number of times the DPCPU waited for an existing
  3877. * descriptor fetch. Valid for EF10 with PM_AND_RXDP_COUNTERS capability only.
  3878. */
  3879. #define MC_CMD_MAC_RXDP_HLB_WAIT_CONDITIONS 0x48
  3880. #define MC_CMD_MAC_VADAPTER_RX_DMABUF_START 0x4c /* enum */
  3881. #define MC_CMD_MAC_VADAPTER_RX_UNICAST_PACKETS 0x4c /* enum */
  3882. #define MC_CMD_MAC_VADAPTER_RX_UNICAST_BYTES 0x4d /* enum */
  3883. #define MC_CMD_MAC_VADAPTER_RX_MULTICAST_PACKETS 0x4e /* enum */
  3884. #define MC_CMD_MAC_VADAPTER_RX_MULTICAST_BYTES 0x4f /* enum */
  3885. #define MC_CMD_MAC_VADAPTER_RX_BROADCAST_PACKETS 0x50 /* enum */
  3886. #define MC_CMD_MAC_VADAPTER_RX_BROADCAST_BYTES 0x51 /* enum */
  3887. #define MC_CMD_MAC_VADAPTER_RX_BAD_PACKETS 0x52 /* enum */
  3888. #define MC_CMD_MAC_VADAPTER_RX_BAD_BYTES 0x53 /* enum */
  3889. #define MC_CMD_MAC_VADAPTER_RX_OVERFLOW 0x54 /* enum */
  3890. #define MC_CMD_MAC_VADAPTER_TX_DMABUF_START 0x57 /* enum */
  3891. #define MC_CMD_MAC_VADAPTER_TX_UNICAST_PACKETS 0x57 /* enum */
  3892. #define MC_CMD_MAC_VADAPTER_TX_UNICAST_BYTES 0x58 /* enum */
  3893. #define MC_CMD_MAC_VADAPTER_TX_MULTICAST_PACKETS 0x59 /* enum */
  3894. #define MC_CMD_MAC_VADAPTER_TX_MULTICAST_BYTES 0x5a /* enum */
  3895. #define MC_CMD_MAC_VADAPTER_TX_BROADCAST_PACKETS 0x5b /* enum */
  3896. #define MC_CMD_MAC_VADAPTER_TX_BROADCAST_BYTES 0x5c /* enum */
  3897. #define MC_CMD_MAC_VADAPTER_TX_BAD_PACKETS 0x5d /* enum */
  3898. #define MC_CMD_MAC_VADAPTER_TX_BAD_BYTES 0x5e /* enum */
  3899. #define MC_CMD_MAC_VADAPTER_TX_OVERFLOW 0x5f /* enum */
  3900. /* enum: Start of GMAC stats buffer space, for Siena only. */
  3901. #define MC_CMD_GMAC_DMABUF_START 0x40
  3902. /* enum: End of GMAC stats buffer space, for Siena only. */
  3903. #define MC_CMD_GMAC_DMABUF_END 0x5f
  3904. /* enum: GENERATION_END value, used together with GENERATION_START to verify
  3905. * consistency of DMAd data. For legacy firmware / drivers without extended
  3906. * stats (more precisely, when DMA_LEN == MC_CMD_MAC_NSTATS *
  3907. * sizeof(uint64_t)), this entry holds the GENERATION_END value. Otherwise,
  3908. * this value is invalid/ reserved and GENERATION_END is written as the last
  3909. * 64-bit word of the DMA buffer (at DMA_LEN - sizeof(uint64_t)). Note that
  3910. * this is consistent with the legacy behaviour, in the sense that entry 96 is
  3911. * the last 64-bit word in the buffer when DMA_LEN == MC_CMD_MAC_NSTATS *
  3912. * sizeof(uint64_t). See SF-109306-TC, Section 9.2 for details.
  3913. */
  3914. #define MC_CMD_MAC_GENERATION_END 0x60
  3915. #define MC_CMD_MAC_NSTATS 0x61 /* enum */
  3916. /* MC_CMD_MAC_STATS_V2_OUT_DMA msgresponse */
  3917. #define MC_CMD_MAC_STATS_V2_OUT_DMA_LEN 0
  3918. /* MC_CMD_MAC_STATS_V2_OUT_NO_DMA msgresponse */
  3919. #define MC_CMD_MAC_STATS_V2_OUT_NO_DMA_LEN (((MC_CMD_MAC_NSTATS_V2*64))>>3)
  3920. #define MC_CMD_MAC_STATS_V2_OUT_NO_DMA_STATISTICS_OFST 0
  3921. #define MC_CMD_MAC_STATS_V2_OUT_NO_DMA_STATISTICS_LEN 8
  3922. #define MC_CMD_MAC_STATS_V2_OUT_NO_DMA_STATISTICS_LO_OFST 0
  3923. #define MC_CMD_MAC_STATS_V2_OUT_NO_DMA_STATISTICS_HI_OFST 4
  3924. #define MC_CMD_MAC_STATS_V2_OUT_NO_DMA_STATISTICS_NUM MC_CMD_MAC_NSTATS_V2
  3925. /* enum: Start of FEC stats buffer space, Medford2 and up */
  3926. #define MC_CMD_MAC_FEC_DMABUF_START 0x61
  3927. /* enum: Number of uncorrected FEC codewords on link (RS-FEC only for Medford2)
  3928. */
  3929. #define MC_CMD_MAC_FEC_UNCORRECTED_ERRORS 0x61
  3930. /* enum: Number of corrected FEC codewords on link (RS-FEC only for Medford2)
  3931. */
  3932. #define MC_CMD_MAC_FEC_CORRECTED_ERRORS 0x62
  3933. /* enum: Number of corrected 10-bit symbol errors, lane 0 (RS-FEC only) */
  3934. #define MC_CMD_MAC_FEC_CORRECTED_SYMBOLS_LANE0 0x63
  3935. /* enum: Number of corrected 10-bit symbol errors, lane 1 (RS-FEC only) */
  3936. #define MC_CMD_MAC_FEC_CORRECTED_SYMBOLS_LANE1 0x64
  3937. /* enum: Number of corrected 10-bit symbol errors, lane 2 (RS-FEC only) */
  3938. #define MC_CMD_MAC_FEC_CORRECTED_SYMBOLS_LANE2 0x65
  3939. /* enum: Number of corrected 10-bit symbol errors, lane 3 (RS-FEC only) */
  3940. #define MC_CMD_MAC_FEC_CORRECTED_SYMBOLS_LANE3 0x66
  3941. /* enum: This includes the space at offset 103 which is the final
  3942. * GENERATION_END in a MAC_STATS_V2 response and otherwise unused.
  3943. */
  3944. #define MC_CMD_MAC_NSTATS_V2 0x68
  3945. /* Other enum values, see field(s): */
  3946. /* MC_CMD_MAC_STATS_OUT_NO_DMA/STATISTICS */
  3947. /* MC_CMD_MAC_STATS_V3_OUT_DMA msgresponse */
  3948. #define MC_CMD_MAC_STATS_V3_OUT_DMA_LEN 0
  3949. /* MC_CMD_MAC_STATS_V3_OUT_NO_DMA msgresponse */
  3950. #define MC_CMD_MAC_STATS_V3_OUT_NO_DMA_LEN (((MC_CMD_MAC_NSTATS_V3*64))>>3)
  3951. #define MC_CMD_MAC_STATS_V3_OUT_NO_DMA_STATISTICS_OFST 0
  3952. #define MC_CMD_MAC_STATS_V3_OUT_NO_DMA_STATISTICS_LEN 8
  3953. #define MC_CMD_MAC_STATS_V3_OUT_NO_DMA_STATISTICS_LO_OFST 0
  3954. #define MC_CMD_MAC_STATS_V3_OUT_NO_DMA_STATISTICS_HI_OFST 4
  3955. #define MC_CMD_MAC_STATS_V3_OUT_NO_DMA_STATISTICS_NUM MC_CMD_MAC_NSTATS_V3
  3956. /* enum: Start of CTPIO stats buffer space, Medford2 and up */
  3957. #define MC_CMD_MAC_CTPIO_DMABUF_START 0x68
  3958. /* enum: Number of CTPIO fallbacks because a DMA packet was in progress on the
  3959. * target VI
  3960. */
  3961. #define MC_CMD_MAC_CTPIO_VI_BUSY_FALLBACK 0x68
  3962. /* enum: Number of times a CTPIO send wrote beyond frame end (informational
  3963. * only)
  3964. */
  3965. #define MC_CMD_MAC_CTPIO_LONG_WRITE_SUCCESS 0x69
  3966. /* enum: Number of CTPIO failures because the TX doorbell was written before
  3967. * the end of the frame data
  3968. */
  3969. #define MC_CMD_MAC_CTPIO_MISSING_DBELL_FAIL 0x6a
  3970. /* enum: Number of CTPIO failures because the internal FIFO overflowed */
  3971. #define MC_CMD_MAC_CTPIO_OVERFLOW_FAIL 0x6b
  3972. /* enum: Number of CTPIO failures because the host did not deliver data fast
  3973. * enough to avoid MAC underflow
  3974. */
  3975. #define MC_CMD_MAC_CTPIO_UNDERFLOW_FAIL 0x6c
  3976. /* enum: Number of CTPIO failures because the host did not deliver all the
  3977. * frame data within the timeout
  3978. */
  3979. #define MC_CMD_MAC_CTPIO_TIMEOUT_FAIL 0x6d
  3980. /* enum: Number of CTPIO failures because the frame data arrived out of order
  3981. * or with gaps
  3982. */
  3983. #define MC_CMD_MAC_CTPIO_NONCONTIG_WR_FAIL 0x6e
  3984. /* enum: Number of CTPIO failures because the host started a new frame before
  3985. * completing the previous one
  3986. */
  3987. #define MC_CMD_MAC_CTPIO_FRM_CLOBBER_FAIL 0x6f
  3988. /* enum: Number of CTPIO failures because a write was not a multiple of 32 bits
  3989. * or not 32-bit aligned
  3990. */
  3991. #define MC_CMD_MAC_CTPIO_INVALID_WR_FAIL 0x70
  3992. /* enum: Number of CTPIO fallbacks because another VI on the same port was
  3993. * sending a CTPIO frame
  3994. */
  3995. #define MC_CMD_MAC_CTPIO_VI_CLOBBER_FALLBACK 0x71
  3996. /* enum: Number of CTPIO fallbacks because target VI did not have CTPIO enabled
  3997. */
  3998. #define MC_CMD_MAC_CTPIO_UNQUALIFIED_FALLBACK 0x72
  3999. /* enum: Number of CTPIO fallbacks because length in header was less than 29
  4000. * bytes
  4001. */
  4002. #define MC_CMD_MAC_CTPIO_RUNT_FALLBACK 0x73
  4003. /* enum: Total number of successful CTPIO sends on this port */
  4004. #define MC_CMD_MAC_CTPIO_SUCCESS 0x74
  4005. /* enum: Total number of CTPIO fallbacks on this port */
  4006. #define MC_CMD_MAC_CTPIO_FALLBACK 0x75
  4007. /* enum: Total number of CTPIO poisoned frames on this port, whether erased or
  4008. * not
  4009. */
  4010. #define MC_CMD_MAC_CTPIO_POISON 0x76
  4011. /* enum: Total number of CTPIO erased frames on this port */
  4012. #define MC_CMD_MAC_CTPIO_ERASE 0x77
  4013. /* enum: This includes the space at offset 120 which is the final
  4014. * GENERATION_END in a MAC_STATS_V3 response and otherwise unused.
  4015. */
  4016. #define MC_CMD_MAC_NSTATS_V3 0x79
  4017. /* Other enum values, see field(s): */
  4018. /* MC_CMD_MAC_STATS_V2_OUT_NO_DMA/STATISTICS */
  4019. /***********************************/
  4020. /* MC_CMD_SRIOV
  4021. * to be documented
  4022. */
  4023. #define MC_CMD_SRIOV 0x30
  4024. /* MC_CMD_SRIOV_IN msgrequest */
  4025. #define MC_CMD_SRIOV_IN_LEN 12
  4026. #define MC_CMD_SRIOV_IN_ENABLE_OFST 0
  4027. #define MC_CMD_SRIOV_IN_ENABLE_LEN 4
  4028. #define MC_CMD_SRIOV_IN_VI_BASE_OFST 4
  4029. #define MC_CMD_SRIOV_IN_VI_BASE_LEN 4
  4030. #define MC_CMD_SRIOV_IN_VF_COUNT_OFST 8
  4031. #define MC_CMD_SRIOV_IN_VF_COUNT_LEN 4
  4032. /* MC_CMD_SRIOV_OUT msgresponse */
  4033. #define MC_CMD_SRIOV_OUT_LEN 8
  4034. #define MC_CMD_SRIOV_OUT_VI_SCALE_OFST 0
  4035. #define MC_CMD_SRIOV_OUT_VI_SCALE_LEN 4
  4036. #define MC_CMD_SRIOV_OUT_VF_TOTAL_OFST 4
  4037. #define MC_CMD_SRIOV_OUT_VF_TOTAL_LEN 4
  4038. /* MC_CMD_MEMCPY_RECORD_TYPEDEF structuredef */
  4039. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_LEN 32
  4040. /* this is only used for the first record */
  4041. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_NUM_RECORDS_OFST 0
  4042. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_NUM_RECORDS_LEN 4
  4043. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_NUM_RECORDS_LBN 0
  4044. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_NUM_RECORDS_WIDTH 32
  4045. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_TO_RID_OFST 4
  4046. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_TO_RID_LEN 4
  4047. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_TO_RID_LBN 32
  4048. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_TO_RID_WIDTH 32
  4049. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_TO_ADDR_OFST 8
  4050. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_TO_ADDR_LEN 8
  4051. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_TO_ADDR_LO_OFST 8
  4052. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_TO_ADDR_HI_OFST 12
  4053. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_TO_ADDR_LBN 64
  4054. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_TO_ADDR_WIDTH 64
  4055. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_FROM_RID_OFST 16
  4056. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_FROM_RID_LEN 4
  4057. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_RID_INLINE 0x100 /* enum */
  4058. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_FROM_RID_LBN 128
  4059. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_FROM_RID_WIDTH 32
  4060. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_FROM_ADDR_OFST 20
  4061. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_FROM_ADDR_LEN 8
  4062. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_FROM_ADDR_LO_OFST 20
  4063. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_FROM_ADDR_HI_OFST 24
  4064. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_FROM_ADDR_LBN 160
  4065. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_FROM_ADDR_WIDTH 64
  4066. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_LENGTH_OFST 28
  4067. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_LENGTH_LEN 4
  4068. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_LENGTH_LBN 224
  4069. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_LENGTH_WIDTH 32
  4070. /***********************************/
  4071. /* MC_CMD_MEMCPY
  4072. * DMA write data into (Rid,Addr), either by dma reading (Rid,Addr), or by data
  4073. * embedded directly in the command.
  4074. *
  4075. * A common pattern is for a client to use generation counts to signal a dma
  4076. * update of a datastructure. To facilitate this, this MCDI operation can
  4077. * contain multiple requests which are executed in strict order. Requests take
  4078. * the form of duplicating the entire MCDI request continuously (including the
  4079. * requests record, which is ignored in all but the first structure)
  4080. *
  4081. * The source data can either come from a DMA from the host, or it can be
  4082. * embedded within the request directly, thereby eliminating a DMA read. To
  4083. * indicate this, the client sets FROM_RID=%RID_INLINE, ADDR_HI=0, and
  4084. * ADDR_LO=offset, and inserts the data at %offset from the start of the
  4085. * payload. It's the callers responsibility to ensure that the embedded data
  4086. * doesn't overlap the records.
  4087. *
  4088. * Returns: 0, EINVAL (invalid RID)
  4089. */
  4090. #define MC_CMD_MEMCPY 0x31
  4091. /* MC_CMD_MEMCPY_IN msgrequest */
  4092. #define MC_CMD_MEMCPY_IN_LENMIN 32
  4093. #define MC_CMD_MEMCPY_IN_LENMAX 224
  4094. #define MC_CMD_MEMCPY_IN_LEN(num) (0+32*(num))
  4095. /* see MC_CMD_MEMCPY_RECORD_TYPEDEF */
  4096. #define MC_CMD_MEMCPY_IN_RECORD_OFST 0
  4097. #define MC_CMD_MEMCPY_IN_RECORD_LEN 32
  4098. #define MC_CMD_MEMCPY_IN_RECORD_MINNUM 1
  4099. #define MC_CMD_MEMCPY_IN_RECORD_MAXNUM 7
  4100. /* MC_CMD_MEMCPY_OUT msgresponse */
  4101. #define MC_CMD_MEMCPY_OUT_LEN 0
  4102. /***********************************/
  4103. /* MC_CMD_WOL_FILTER_SET
  4104. * Set a WoL filter.
  4105. */
  4106. #define MC_CMD_WOL_FILTER_SET 0x32
  4107. #define MC_CMD_0x32_PRIVILEGE_CTG SRIOV_CTG_LINK
  4108. /* MC_CMD_WOL_FILTER_SET_IN msgrequest */
  4109. #define MC_CMD_WOL_FILTER_SET_IN_LEN 192
  4110. #define MC_CMD_WOL_FILTER_SET_IN_FILTER_MODE_OFST 0
  4111. #define MC_CMD_WOL_FILTER_SET_IN_FILTER_MODE_LEN 4
  4112. #define MC_CMD_FILTER_MODE_SIMPLE 0x0 /* enum */
  4113. #define MC_CMD_FILTER_MODE_STRUCTURED 0xffffffff /* enum */
  4114. /* A type value of 1 is unused. */
  4115. #define MC_CMD_WOL_FILTER_SET_IN_WOL_TYPE_OFST 4
  4116. #define MC_CMD_WOL_FILTER_SET_IN_WOL_TYPE_LEN 4
  4117. /* enum: Magic */
  4118. #define MC_CMD_WOL_TYPE_MAGIC 0x0
  4119. /* enum: MS Windows Magic */
  4120. #define MC_CMD_WOL_TYPE_WIN_MAGIC 0x2
  4121. /* enum: IPv4 Syn */
  4122. #define MC_CMD_WOL_TYPE_IPV4_SYN 0x3
  4123. /* enum: IPv6 Syn */
  4124. #define MC_CMD_WOL_TYPE_IPV6_SYN 0x4
  4125. /* enum: Bitmap */
  4126. #define MC_CMD_WOL_TYPE_BITMAP 0x5
  4127. /* enum: Link */
  4128. #define MC_CMD_WOL_TYPE_LINK 0x6
  4129. /* enum: (Above this for future use) */
  4130. #define MC_CMD_WOL_TYPE_MAX 0x7
  4131. #define MC_CMD_WOL_FILTER_SET_IN_DATA_OFST 8
  4132. #define MC_CMD_WOL_FILTER_SET_IN_DATA_LEN 4
  4133. #define MC_CMD_WOL_FILTER_SET_IN_DATA_NUM 46
  4134. /* MC_CMD_WOL_FILTER_SET_IN_MAGIC msgrequest */
  4135. #define MC_CMD_WOL_FILTER_SET_IN_MAGIC_LEN 16
  4136. /* MC_CMD_WOL_FILTER_SET_IN_FILTER_MODE_OFST 0 */
  4137. /* MC_CMD_WOL_FILTER_SET_IN_FILTER_MODE_LEN 4 */
  4138. /* MC_CMD_WOL_FILTER_SET_IN_WOL_TYPE_OFST 4 */
  4139. /* MC_CMD_WOL_FILTER_SET_IN_WOL_TYPE_LEN 4 */
  4140. #define MC_CMD_WOL_FILTER_SET_IN_MAGIC_MAC_OFST 8
  4141. #define MC_CMD_WOL_FILTER_SET_IN_MAGIC_MAC_LEN 8
  4142. #define MC_CMD_WOL_FILTER_SET_IN_MAGIC_MAC_LO_OFST 8
  4143. #define MC_CMD_WOL_FILTER_SET_IN_MAGIC_MAC_HI_OFST 12
  4144. /* MC_CMD_WOL_FILTER_SET_IN_IPV4_SYN msgrequest */
  4145. #define MC_CMD_WOL_FILTER_SET_IN_IPV4_SYN_LEN 20
  4146. /* MC_CMD_WOL_FILTER_SET_IN_FILTER_MODE_OFST 0 */
  4147. /* MC_CMD_WOL_FILTER_SET_IN_FILTER_MODE_LEN 4 */
  4148. /* MC_CMD_WOL_FILTER_SET_IN_WOL_TYPE_OFST 4 */
  4149. /* MC_CMD_WOL_FILTER_SET_IN_WOL_TYPE_LEN 4 */
  4150. #define MC_CMD_WOL_FILTER_SET_IN_IPV4_SYN_SRC_IP_OFST 8
  4151. #define MC_CMD_WOL_FILTER_SET_IN_IPV4_SYN_SRC_IP_LEN 4
  4152. #define MC_CMD_WOL_FILTER_SET_IN_IPV4_SYN_DST_IP_OFST 12
  4153. #define MC_CMD_WOL_FILTER_SET_IN_IPV4_SYN_DST_IP_LEN 4
  4154. #define MC_CMD_WOL_FILTER_SET_IN_IPV4_SYN_SRC_PORT_OFST 16
  4155. #define MC_CMD_WOL_FILTER_SET_IN_IPV4_SYN_SRC_PORT_LEN 2
  4156. #define MC_CMD_WOL_FILTER_SET_IN_IPV4_SYN_DST_PORT_OFST 18
  4157. #define MC_CMD_WOL_FILTER_SET_IN_IPV4_SYN_DST_PORT_LEN 2
  4158. /* MC_CMD_WOL_FILTER_SET_IN_IPV6_SYN msgrequest */
  4159. #define MC_CMD_WOL_FILTER_SET_IN_IPV6_SYN_LEN 44
  4160. /* MC_CMD_WOL_FILTER_SET_IN_FILTER_MODE_OFST 0 */
  4161. /* MC_CMD_WOL_FILTER_SET_IN_FILTER_MODE_LEN 4 */
  4162. /* MC_CMD_WOL_FILTER_SET_IN_WOL_TYPE_OFST 4 */
  4163. /* MC_CMD_WOL_FILTER_SET_IN_WOL_TYPE_LEN 4 */
  4164. #define MC_CMD_WOL_FILTER_SET_IN_IPV6_SYN_SRC_IP_OFST 8
  4165. #define MC_CMD_WOL_FILTER_SET_IN_IPV6_SYN_SRC_IP_LEN 16
  4166. #define MC_CMD_WOL_FILTER_SET_IN_IPV6_SYN_DST_IP_OFST 24
  4167. #define MC_CMD_WOL_FILTER_SET_IN_IPV6_SYN_DST_IP_LEN 16
  4168. #define MC_CMD_WOL_FILTER_SET_IN_IPV6_SYN_SRC_PORT_OFST 40
  4169. #define MC_CMD_WOL_FILTER_SET_IN_IPV6_SYN_SRC_PORT_LEN 2
  4170. #define MC_CMD_WOL_FILTER_SET_IN_IPV6_SYN_DST_PORT_OFST 42
  4171. #define MC_CMD_WOL_FILTER_SET_IN_IPV6_SYN_DST_PORT_LEN 2
  4172. /* MC_CMD_WOL_FILTER_SET_IN_BITMAP msgrequest */
  4173. #define MC_CMD_WOL_FILTER_SET_IN_BITMAP_LEN 187
  4174. /* MC_CMD_WOL_FILTER_SET_IN_FILTER_MODE_OFST 0 */
  4175. /* MC_CMD_WOL_FILTER_SET_IN_FILTER_MODE_LEN 4 */
  4176. /* MC_CMD_WOL_FILTER_SET_IN_WOL_TYPE_OFST 4 */
  4177. /* MC_CMD_WOL_FILTER_SET_IN_WOL_TYPE_LEN 4 */
  4178. #define MC_CMD_WOL_FILTER_SET_IN_BITMAP_MASK_OFST 8
  4179. #define MC_CMD_WOL_FILTER_SET_IN_BITMAP_MASK_LEN 48
  4180. #define MC_CMD_WOL_FILTER_SET_IN_BITMAP_BITMAP_OFST 56
  4181. #define MC_CMD_WOL_FILTER_SET_IN_BITMAP_BITMAP_LEN 128
  4182. #define MC_CMD_WOL_FILTER_SET_IN_BITMAP_LEN_OFST 184
  4183. #define MC_CMD_WOL_FILTER_SET_IN_BITMAP_LEN_LEN 1
  4184. #define MC_CMD_WOL_FILTER_SET_IN_BITMAP_LAYER3_OFST 185
  4185. #define MC_CMD_WOL_FILTER_SET_IN_BITMAP_LAYER3_LEN 1
  4186. #define MC_CMD_WOL_FILTER_SET_IN_BITMAP_LAYER4_OFST 186
  4187. #define MC_CMD_WOL_FILTER_SET_IN_BITMAP_LAYER4_LEN 1
  4188. /* MC_CMD_WOL_FILTER_SET_IN_LINK msgrequest */
  4189. #define MC_CMD_WOL_FILTER_SET_IN_LINK_LEN 12
  4190. /* MC_CMD_WOL_FILTER_SET_IN_FILTER_MODE_OFST 0 */
  4191. /* MC_CMD_WOL_FILTER_SET_IN_FILTER_MODE_LEN 4 */
  4192. /* MC_CMD_WOL_FILTER_SET_IN_WOL_TYPE_OFST 4 */
  4193. /* MC_CMD_WOL_FILTER_SET_IN_WOL_TYPE_LEN 4 */
  4194. #define MC_CMD_WOL_FILTER_SET_IN_LINK_MASK_OFST 8
  4195. #define MC_CMD_WOL_FILTER_SET_IN_LINK_MASK_LEN 4
  4196. #define MC_CMD_WOL_FILTER_SET_IN_LINK_UP_LBN 0
  4197. #define MC_CMD_WOL_FILTER_SET_IN_LINK_UP_WIDTH 1
  4198. #define MC_CMD_WOL_FILTER_SET_IN_LINK_DOWN_LBN 1
  4199. #define MC_CMD_WOL_FILTER_SET_IN_LINK_DOWN_WIDTH 1
  4200. /* MC_CMD_WOL_FILTER_SET_OUT msgresponse */
  4201. #define MC_CMD_WOL_FILTER_SET_OUT_LEN 4
  4202. #define MC_CMD_WOL_FILTER_SET_OUT_FILTER_ID_OFST 0
  4203. #define MC_CMD_WOL_FILTER_SET_OUT_FILTER_ID_LEN 4
  4204. /***********************************/
  4205. /* MC_CMD_WOL_FILTER_REMOVE
  4206. * Remove a WoL filter. Locks required: None. Returns: 0, EINVAL, ENOSYS
  4207. */
  4208. #define MC_CMD_WOL_FILTER_REMOVE 0x33
  4209. #define MC_CMD_0x33_PRIVILEGE_CTG SRIOV_CTG_LINK
  4210. /* MC_CMD_WOL_FILTER_REMOVE_IN msgrequest */
  4211. #define MC_CMD_WOL_FILTER_REMOVE_IN_LEN 4
  4212. #define MC_CMD_WOL_FILTER_REMOVE_IN_FILTER_ID_OFST 0
  4213. #define MC_CMD_WOL_FILTER_REMOVE_IN_FILTER_ID_LEN 4
  4214. /* MC_CMD_WOL_FILTER_REMOVE_OUT msgresponse */
  4215. #define MC_CMD_WOL_FILTER_REMOVE_OUT_LEN 0
  4216. /***********************************/
  4217. /* MC_CMD_WOL_FILTER_RESET
  4218. * Reset (i.e. remove all) WoL filters. Locks required: None. Returns: 0,
  4219. * ENOSYS
  4220. */
  4221. #define MC_CMD_WOL_FILTER_RESET 0x34
  4222. #define MC_CMD_0x34_PRIVILEGE_CTG SRIOV_CTG_LINK
  4223. /* MC_CMD_WOL_FILTER_RESET_IN msgrequest */
  4224. #define MC_CMD_WOL_FILTER_RESET_IN_LEN 4
  4225. #define MC_CMD_WOL_FILTER_RESET_IN_MASK_OFST 0
  4226. #define MC_CMD_WOL_FILTER_RESET_IN_MASK_LEN 4
  4227. #define MC_CMD_WOL_FILTER_RESET_IN_WAKE_FILTERS 0x1 /* enum */
  4228. #define MC_CMD_WOL_FILTER_RESET_IN_LIGHTSOUT_OFFLOADS 0x2 /* enum */
  4229. /* MC_CMD_WOL_FILTER_RESET_OUT msgresponse */
  4230. #define MC_CMD_WOL_FILTER_RESET_OUT_LEN 0
  4231. /***********************************/
  4232. /* MC_CMD_SET_MCAST_HASH
  4233. * Set the MCAST hash value without otherwise reconfiguring the MAC
  4234. */
  4235. #define MC_CMD_SET_MCAST_HASH 0x35
  4236. /* MC_CMD_SET_MCAST_HASH_IN msgrequest */
  4237. #define MC_CMD_SET_MCAST_HASH_IN_LEN 32
  4238. #define MC_CMD_SET_MCAST_HASH_IN_HASH0_OFST 0
  4239. #define MC_CMD_SET_MCAST_HASH_IN_HASH0_LEN 16
  4240. #define MC_CMD_SET_MCAST_HASH_IN_HASH1_OFST 16
  4241. #define MC_CMD_SET_MCAST_HASH_IN_HASH1_LEN 16
  4242. /* MC_CMD_SET_MCAST_HASH_OUT msgresponse */
  4243. #define MC_CMD_SET_MCAST_HASH_OUT_LEN 0
  4244. /***********************************/
  4245. /* MC_CMD_NVRAM_TYPES
  4246. * Return bitfield indicating available types of virtual NVRAM partitions.
  4247. * Locks required: none. Returns: 0
  4248. */
  4249. #define MC_CMD_NVRAM_TYPES 0x36
  4250. #define MC_CMD_0x36_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  4251. /* MC_CMD_NVRAM_TYPES_IN msgrequest */
  4252. #define MC_CMD_NVRAM_TYPES_IN_LEN 0
  4253. /* MC_CMD_NVRAM_TYPES_OUT msgresponse */
  4254. #define MC_CMD_NVRAM_TYPES_OUT_LEN 4
  4255. /* Bit mask of supported types. */
  4256. #define MC_CMD_NVRAM_TYPES_OUT_TYPES_OFST 0
  4257. #define MC_CMD_NVRAM_TYPES_OUT_TYPES_LEN 4
  4258. /* enum: Disabled callisto. */
  4259. #define MC_CMD_NVRAM_TYPE_DISABLED_CALLISTO 0x0
  4260. /* enum: MC firmware. */
  4261. #define MC_CMD_NVRAM_TYPE_MC_FW 0x1
  4262. /* enum: MC backup firmware. */
  4263. #define MC_CMD_NVRAM_TYPE_MC_FW_BACKUP 0x2
  4264. /* enum: Static configuration Port0. */
  4265. #define MC_CMD_NVRAM_TYPE_STATIC_CFG_PORT0 0x3
  4266. /* enum: Static configuration Port1. */
  4267. #define MC_CMD_NVRAM_TYPE_STATIC_CFG_PORT1 0x4
  4268. /* enum: Dynamic configuration Port0. */
  4269. #define MC_CMD_NVRAM_TYPE_DYNAMIC_CFG_PORT0 0x5
  4270. /* enum: Dynamic configuration Port1. */
  4271. #define MC_CMD_NVRAM_TYPE_DYNAMIC_CFG_PORT1 0x6
  4272. /* enum: Expansion Rom. */
  4273. #define MC_CMD_NVRAM_TYPE_EXP_ROM 0x7
  4274. /* enum: Expansion Rom Configuration Port0. */
  4275. #define MC_CMD_NVRAM_TYPE_EXP_ROM_CFG_PORT0 0x8
  4276. /* enum: Expansion Rom Configuration Port1. */
  4277. #define MC_CMD_NVRAM_TYPE_EXP_ROM_CFG_PORT1 0x9
  4278. /* enum: Phy Configuration Port0. */
  4279. #define MC_CMD_NVRAM_TYPE_PHY_PORT0 0xa
  4280. /* enum: Phy Configuration Port1. */
  4281. #define MC_CMD_NVRAM_TYPE_PHY_PORT1 0xb
  4282. /* enum: Log. */
  4283. #define MC_CMD_NVRAM_TYPE_LOG 0xc
  4284. /* enum: FPGA image. */
  4285. #define MC_CMD_NVRAM_TYPE_FPGA 0xd
  4286. /* enum: FPGA backup image */
  4287. #define MC_CMD_NVRAM_TYPE_FPGA_BACKUP 0xe
  4288. /* enum: FC firmware. */
  4289. #define MC_CMD_NVRAM_TYPE_FC_FW 0xf
  4290. /* enum: FC backup firmware. */
  4291. #define MC_CMD_NVRAM_TYPE_FC_FW_BACKUP 0x10
  4292. /* enum: CPLD image. */
  4293. #define MC_CMD_NVRAM_TYPE_CPLD 0x11
  4294. /* enum: Licensing information. */
  4295. #define MC_CMD_NVRAM_TYPE_LICENSE 0x12
  4296. /* enum: FC Log. */
  4297. #define MC_CMD_NVRAM_TYPE_FC_LOG 0x13
  4298. /* enum: Additional flash on FPGA. */
  4299. #define MC_CMD_NVRAM_TYPE_FC_EXTRA 0x14
  4300. /***********************************/
  4301. /* MC_CMD_NVRAM_INFO
  4302. * Read info about a virtual NVRAM partition. Locks required: none. Returns: 0,
  4303. * EINVAL (bad type).
  4304. */
  4305. #define MC_CMD_NVRAM_INFO 0x37
  4306. #define MC_CMD_0x37_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  4307. /* MC_CMD_NVRAM_INFO_IN msgrequest */
  4308. #define MC_CMD_NVRAM_INFO_IN_LEN 4
  4309. #define MC_CMD_NVRAM_INFO_IN_TYPE_OFST 0
  4310. #define MC_CMD_NVRAM_INFO_IN_TYPE_LEN 4
  4311. /* Enum values, see field(s): */
  4312. /* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */
  4313. /* MC_CMD_NVRAM_INFO_OUT msgresponse */
  4314. #define MC_CMD_NVRAM_INFO_OUT_LEN 24
  4315. #define MC_CMD_NVRAM_INFO_OUT_TYPE_OFST 0
  4316. #define MC_CMD_NVRAM_INFO_OUT_TYPE_LEN 4
  4317. /* Enum values, see field(s): */
  4318. /* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */
  4319. #define MC_CMD_NVRAM_INFO_OUT_SIZE_OFST 4
  4320. #define MC_CMD_NVRAM_INFO_OUT_SIZE_LEN 4
  4321. #define MC_CMD_NVRAM_INFO_OUT_ERASESIZE_OFST 8
  4322. #define MC_CMD_NVRAM_INFO_OUT_ERASESIZE_LEN 4
  4323. #define MC_CMD_NVRAM_INFO_OUT_FLAGS_OFST 12
  4324. #define MC_CMD_NVRAM_INFO_OUT_FLAGS_LEN 4
  4325. #define MC_CMD_NVRAM_INFO_OUT_PROTECTED_LBN 0
  4326. #define MC_CMD_NVRAM_INFO_OUT_PROTECTED_WIDTH 1
  4327. #define MC_CMD_NVRAM_INFO_OUT_TLV_LBN 1
  4328. #define MC_CMD_NVRAM_INFO_OUT_TLV_WIDTH 1
  4329. #define MC_CMD_NVRAM_INFO_OUT_READ_ONLY_IF_TSA_BOUND_LBN 2
  4330. #define MC_CMD_NVRAM_INFO_OUT_READ_ONLY_IF_TSA_BOUND_WIDTH 1
  4331. #define MC_CMD_NVRAM_INFO_OUT_READ_ONLY_LBN 5
  4332. #define MC_CMD_NVRAM_INFO_OUT_READ_ONLY_WIDTH 1
  4333. #define MC_CMD_NVRAM_INFO_OUT_CMAC_LBN 6
  4334. #define MC_CMD_NVRAM_INFO_OUT_CMAC_WIDTH 1
  4335. #define MC_CMD_NVRAM_INFO_OUT_A_B_LBN 7
  4336. #define MC_CMD_NVRAM_INFO_OUT_A_B_WIDTH 1
  4337. #define MC_CMD_NVRAM_INFO_OUT_PHYSDEV_OFST 16
  4338. #define MC_CMD_NVRAM_INFO_OUT_PHYSDEV_LEN 4
  4339. #define MC_CMD_NVRAM_INFO_OUT_PHYSADDR_OFST 20
  4340. #define MC_CMD_NVRAM_INFO_OUT_PHYSADDR_LEN 4
  4341. /* MC_CMD_NVRAM_INFO_V2_OUT msgresponse */
  4342. #define MC_CMD_NVRAM_INFO_V2_OUT_LEN 28
  4343. #define MC_CMD_NVRAM_INFO_V2_OUT_TYPE_OFST 0
  4344. #define MC_CMD_NVRAM_INFO_V2_OUT_TYPE_LEN 4
  4345. /* Enum values, see field(s): */
  4346. /* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */
  4347. #define MC_CMD_NVRAM_INFO_V2_OUT_SIZE_OFST 4
  4348. #define MC_CMD_NVRAM_INFO_V2_OUT_SIZE_LEN 4
  4349. #define MC_CMD_NVRAM_INFO_V2_OUT_ERASESIZE_OFST 8
  4350. #define MC_CMD_NVRAM_INFO_V2_OUT_ERASESIZE_LEN 4
  4351. #define MC_CMD_NVRAM_INFO_V2_OUT_FLAGS_OFST 12
  4352. #define MC_CMD_NVRAM_INFO_V2_OUT_FLAGS_LEN 4
  4353. #define MC_CMD_NVRAM_INFO_V2_OUT_PROTECTED_LBN 0
  4354. #define MC_CMD_NVRAM_INFO_V2_OUT_PROTECTED_WIDTH 1
  4355. #define MC_CMD_NVRAM_INFO_V2_OUT_TLV_LBN 1
  4356. #define MC_CMD_NVRAM_INFO_V2_OUT_TLV_WIDTH 1
  4357. #define MC_CMD_NVRAM_INFO_V2_OUT_READ_ONLY_IF_TSA_BOUND_LBN 2
  4358. #define MC_CMD_NVRAM_INFO_V2_OUT_READ_ONLY_IF_TSA_BOUND_WIDTH 1
  4359. #define MC_CMD_NVRAM_INFO_V2_OUT_READ_ONLY_LBN 5
  4360. #define MC_CMD_NVRAM_INFO_V2_OUT_READ_ONLY_WIDTH 1
  4361. #define MC_CMD_NVRAM_INFO_V2_OUT_A_B_LBN 7
  4362. #define MC_CMD_NVRAM_INFO_V2_OUT_A_B_WIDTH 1
  4363. #define MC_CMD_NVRAM_INFO_V2_OUT_PHYSDEV_OFST 16
  4364. #define MC_CMD_NVRAM_INFO_V2_OUT_PHYSDEV_LEN 4
  4365. #define MC_CMD_NVRAM_INFO_V2_OUT_PHYSADDR_OFST 20
  4366. #define MC_CMD_NVRAM_INFO_V2_OUT_PHYSADDR_LEN 4
  4367. /* Writes must be multiples of this size. Added to support the MUM on Sorrento.
  4368. */
  4369. #define MC_CMD_NVRAM_INFO_V2_OUT_WRITESIZE_OFST 24
  4370. #define MC_CMD_NVRAM_INFO_V2_OUT_WRITESIZE_LEN 4
  4371. /***********************************/
  4372. /* MC_CMD_NVRAM_UPDATE_START
  4373. * Start a group of update operations on a virtual NVRAM partition. Locks
  4374. * required: PHY_LOCK if type==*PHY*. Returns: 0, EINVAL (bad type), EACCES (if
  4375. * PHY_LOCK required and not held). In an adapter bound to a TSA controller,
  4376. * MC_CMD_NVRAM_UPDATE_START can only be used on a subset of partition types
  4377. * i.e. static config, dynamic config and expansion ROM config. Attempting to
  4378. * perform this operation on a restricted partition will return the error
  4379. * EPERM.
  4380. */
  4381. #define MC_CMD_NVRAM_UPDATE_START 0x38
  4382. #define MC_CMD_0x38_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  4383. /* MC_CMD_NVRAM_UPDATE_START_IN msgrequest: Legacy NVRAM_UPDATE_START request.
  4384. * Use NVRAM_UPDATE_START_V2_IN in new code
  4385. */
  4386. #define MC_CMD_NVRAM_UPDATE_START_IN_LEN 4
  4387. #define MC_CMD_NVRAM_UPDATE_START_IN_TYPE_OFST 0
  4388. #define MC_CMD_NVRAM_UPDATE_START_IN_TYPE_LEN 4
  4389. /* Enum values, see field(s): */
  4390. /* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */
  4391. /* MC_CMD_NVRAM_UPDATE_START_V2_IN msgrequest: Extended NVRAM_UPDATE_START
  4392. * request with additional flags indicating version of command in use. See
  4393. * MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT for details of extended functionality. Use
  4394. * paired up with NVRAM_UPDATE_FINISH_V2_IN.
  4395. */
  4396. #define MC_CMD_NVRAM_UPDATE_START_V2_IN_LEN 8
  4397. #define MC_CMD_NVRAM_UPDATE_START_V2_IN_TYPE_OFST 0
  4398. #define MC_CMD_NVRAM_UPDATE_START_V2_IN_TYPE_LEN 4
  4399. /* Enum values, see field(s): */
  4400. /* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */
  4401. #define MC_CMD_NVRAM_UPDATE_START_V2_IN_FLAGS_OFST 4
  4402. #define MC_CMD_NVRAM_UPDATE_START_V2_IN_FLAGS_LEN 4
  4403. #define MC_CMD_NVRAM_UPDATE_START_V2_IN_FLAG_REPORT_VERIFY_RESULT_LBN 0
  4404. #define MC_CMD_NVRAM_UPDATE_START_V2_IN_FLAG_REPORT_VERIFY_RESULT_WIDTH 1
  4405. /* MC_CMD_NVRAM_UPDATE_START_OUT msgresponse */
  4406. #define MC_CMD_NVRAM_UPDATE_START_OUT_LEN 0
  4407. /***********************************/
  4408. /* MC_CMD_NVRAM_READ
  4409. * Read data from a virtual NVRAM partition. Locks required: PHY_LOCK if
  4410. * type==*PHY*. Returns: 0, EINVAL (bad type/offset/length), EACCES (if
  4411. * PHY_LOCK required and not held)
  4412. */
  4413. #define MC_CMD_NVRAM_READ 0x39
  4414. #define MC_CMD_0x39_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  4415. /* MC_CMD_NVRAM_READ_IN msgrequest */
  4416. #define MC_CMD_NVRAM_READ_IN_LEN 12
  4417. #define MC_CMD_NVRAM_READ_IN_TYPE_OFST 0
  4418. #define MC_CMD_NVRAM_READ_IN_TYPE_LEN 4
  4419. /* Enum values, see field(s): */
  4420. /* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */
  4421. #define MC_CMD_NVRAM_READ_IN_OFFSET_OFST 4
  4422. #define MC_CMD_NVRAM_READ_IN_OFFSET_LEN 4
  4423. /* amount to read in bytes */
  4424. #define MC_CMD_NVRAM_READ_IN_LENGTH_OFST 8
  4425. #define MC_CMD_NVRAM_READ_IN_LENGTH_LEN 4
  4426. /* MC_CMD_NVRAM_READ_IN_V2 msgrequest */
  4427. #define MC_CMD_NVRAM_READ_IN_V2_LEN 16
  4428. #define MC_CMD_NVRAM_READ_IN_V2_TYPE_OFST 0
  4429. #define MC_CMD_NVRAM_READ_IN_V2_TYPE_LEN 4
  4430. /* Enum values, see field(s): */
  4431. /* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */
  4432. #define MC_CMD_NVRAM_READ_IN_V2_OFFSET_OFST 4
  4433. #define MC_CMD_NVRAM_READ_IN_V2_OFFSET_LEN 4
  4434. /* amount to read in bytes */
  4435. #define MC_CMD_NVRAM_READ_IN_V2_LENGTH_OFST 8
  4436. #define MC_CMD_NVRAM_READ_IN_V2_LENGTH_LEN 4
  4437. /* Optional control info. If a partition is stored with an A/B versioning
  4438. * scheme (i.e. in more than one physical partition in NVRAM) the host can set
  4439. * this to control which underlying physical partition is used to read data
  4440. * from. This allows it to perform a read-modify-write-verify with the write
  4441. * lock continuously held by calling NVRAM_UPDATE_START, reading the old
  4442. * contents using MODE=TARGET_CURRENT, overwriting the old partition and then
  4443. * verifying by reading with MODE=TARGET_BACKUP.
  4444. */
  4445. #define MC_CMD_NVRAM_READ_IN_V2_MODE_OFST 12
  4446. #define MC_CMD_NVRAM_READ_IN_V2_MODE_LEN 4
  4447. /* enum: Same as omitting MODE: caller sees data in current partition unless it
  4448. * holds the write lock in which case it sees data in the partition it is
  4449. * updating.
  4450. */
  4451. #define MC_CMD_NVRAM_READ_IN_V2_DEFAULT 0x0
  4452. /* enum: Read from the current partition of an A/B pair, even if holding the
  4453. * write lock.
  4454. */
  4455. #define MC_CMD_NVRAM_READ_IN_V2_TARGET_CURRENT 0x1
  4456. /* enum: Read from the non-current (i.e. to be updated) partition of an A/B
  4457. * pair
  4458. */
  4459. #define MC_CMD_NVRAM_READ_IN_V2_TARGET_BACKUP 0x2
  4460. /* MC_CMD_NVRAM_READ_OUT msgresponse */
  4461. #define MC_CMD_NVRAM_READ_OUT_LENMIN 1
  4462. #define MC_CMD_NVRAM_READ_OUT_LENMAX 252
  4463. #define MC_CMD_NVRAM_READ_OUT_LEN(num) (0+1*(num))
  4464. #define MC_CMD_NVRAM_READ_OUT_READ_BUFFER_OFST 0
  4465. #define MC_CMD_NVRAM_READ_OUT_READ_BUFFER_LEN 1
  4466. #define MC_CMD_NVRAM_READ_OUT_READ_BUFFER_MINNUM 1
  4467. #define MC_CMD_NVRAM_READ_OUT_READ_BUFFER_MAXNUM 252
  4468. /***********************************/
  4469. /* MC_CMD_NVRAM_WRITE
  4470. * Write data to a virtual NVRAM partition. Locks required: PHY_LOCK if
  4471. * type==*PHY*. Returns: 0, EINVAL (bad type/offset/length), EACCES (if
  4472. * PHY_LOCK required and not held)
  4473. */
  4474. #define MC_CMD_NVRAM_WRITE 0x3a
  4475. #define MC_CMD_0x3a_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  4476. /* MC_CMD_NVRAM_WRITE_IN msgrequest */
  4477. #define MC_CMD_NVRAM_WRITE_IN_LENMIN 13
  4478. #define MC_CMD_NVRAM_WRITE_IN_LENMAX 252
  4479. #define MC_CMD_NVRAM_WRITE_IN_LEN(num) (12+1*(num))
  4480. #define MC_CMD_NVRAM_WRITE_IN_TYPE_OFST 0
  4481. #define MC_CMD_NVRAM_WRITE_IN_TYPE_LEN 4
  4482. /* Enum values, see field(s): */
  4483. /* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */
  4484. #define MC_CMD_NVRAM_WRITE_IN_OFFSET_OFST 4
  4485. #define MC_CMD_NVRAM_WRITE_IN_OFFSET_LEN 4
  4486. #define MC_CMD_NVRAM_WRITE_IN_LENGTH_OFST 8
  4487. #define MC_CMD_NVRAM_WRITE_IN_LENGTH_LEN 4
  4488. #define MC_CMD_NVRAM_WRITE_IN_WRITE_BUFFER_OFST 12
  4489. #define MC_CMD_NVRAM_WRITE_IN_WRITE_BUFFER_LEN 1
  4490. #define MC_CMD_NVRAM_WRITE_IN_WRITE_BUFFER_MINNUM 1
  4491. #define MC_CMD_NVRAM_WRITE_IN_WRITE_BUFFER_MAXNUM 240
  4492. /* MC_CMD_NVRAM_WRITE_OUT msgresponse */
  4493. #define MC_CMD_NVRAM_WRITE_OUT_LEN 0
  4494. /***********************************/
  4495. /* MC_CMD_NVRAM_ERASE
  4496. * Erase sector(s) from a virtual NVRAM partition. Locks required: PHY_LOCK if
  4497. * type==*PHY*. Returns: 0, EINVAL (bad type/offset/length), EACCES (if
  4498. * PHY_LOCK required and not held)
  4499. */
  4500. #define MC_CMD_NVRAM_ERASE 0x3b
  4501. #define MC_CMD_0x3b_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  4502. /* MC_CMD_NVRAM_ERASE_IN msgrequest */
  4503. #define MC_CMD_NVRAM_ERASE_IN_LEN 12
  4504. #define MC_CMD_NVRAM_ERASE_IN_TYPE_OFST 0
  4505. #define MC_CMD_NVRAM_ERASE_IN_TYPE_LEN 4
  4506. /* Enum values, see field(s): */
  4507. /* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */
  4508. #define MC_CMD_NVRAM_ERASE_IN_OFFSET_OFST 4
  4509. #define MC_CMD_NVRAM_ERASE_IN_OFFSET_LEN 4
  4510. #define MC_CMD_NVRAM_ERASE_IN_LENGTH_OFST 8
  4511. #define MC_CMD_NVRAM_ERASE_IN_LENGTH_LEN 4
  4512. /* MC_CMD_NVRAM_ERASE_OUT msgresponse */
  4513. #define MC_CMD_NVRAM_ERASE_OUT_LEN 0
  4514. /***********************************/
  4515. /* MC_CMD_NVRAM_UPDATE_FINISH
  4516. * Finish a group of update operations on a virtual NVRAM partition. Locks
  4517. * required: PHY_LOCK if type==*PHY*. Returns: 0, EINVAL (bad type/offset/
  4518. * length), EACCES (if PHY_LOCK required and not held). In an adapter bound to
  4519. * a TSA controller, MC_CMD_NVRAM_UPDATE_FINISH can only be used on a subset of
  4520. * partition types i.e. static config, dynamic config and expansion ROM config.
  4521. * Attempting to perform this operation on a restricted partition will return
  4522. * the error EPERM.
  4523. */
  4524. #define MC_CMD_NVRAM_UPDATE_FINISH 0x3c
  4525. #define MC_CMD_0x3c_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  4526. /* MC_CMD_NVRAM_UPDATE_FINISH_IN msgrequest: Legacy NVRAM_UPDATE_FINISH
  4527. * request. Use NVRAM_UPDATE_FINISH_V2_IN in new code
  4528. */
  4529. #define MC_CMD_NVRAM_UPDATE_FINISH_IN_LEN 8
  4530. #define MC_CMD_NVRAM_UPDATE_FINISH_IN_TYPE_OFST 0
  4531. #define MC_CMD_NVRAM_UPDATE_FINISH_IN_TYPE_LEN 4
  4532. /* Enum values, see field(s): */
  4533. /* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */
  4534. #define MC_CMD_NVRAM_UPDATE_FINISH_IN_REBOOT_OFST 4
  4535. #define MC_CMD_NVRAM_UPDATE_FINISH_IN_REBOOT_LEN 4
  4536. /* MC_CMD_NVRAM_UPDATE_FINISH_V2_IN msgrequest: Extended NVRAM_UPDATE_FINISH
  4537. * request with additional flags indicating version of NVRAM_UPDATE commands in
  4538. * use. See MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT for details of extended
  4539. * functionality. Use paired up with NVRAM_UPDATE_START_V2_IN.
  4540. */
  4541. #define MC_CMD_NVRAM_UPDATE_FINISH_V2_IN_LEN 12
  4542. #define MC_CMD_NVRAM_UPDATE_FINISH_V2_IN_TYPE_OFST 0
  4543. #define MC_CMD_NVRAM_UPDATE_FINISH_V2_IN_TYPE_LEN 4
  4544. /* Enum values, see field(s): */
  4545. /* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */
  4546. #define MC_CMD_NVRAM_UPDATE_FINISH_V2_IN_REBOOT_OFST 4
  4547. #define MC_CMD_NVRAM_UPDATE_FINISH_V2_IN_REBOOT_LEN 4
  4548. #define MC_CMD_NVRAM_UPDATE_FINISH_V2_IN_FLAGS_OFST 8
  4549. #define MC_CMD_NVRAM_UPDATE_FINISH_V2_IN_FLAGS_LEN 4
  4550. #define MC_CMD_NVRAM_UPDATE_FINISH_V2_IN_FLAG_REPORT_VERIFY_RESULT_LBN 0
  4551. #define MC_CMD_NVRAM_UPDATE_FINISH_V2_IN_FLAG_REPORT_VERIFY_RESULT_WIDTH 1
  4552. /* MC_CMD_NVRAM_UPDATE_FINISH_OUT msgresponse: Legacy NVRAM_UPDATE_FINISH
  4553. * response. Use NVRAM_UPDATE_FINISH_V2_OUT in new code
  4554. */
  4555. #define MC_CMD_NVRAM_UPDATE_FINISH_OUT_LEN 0
  4556. /* MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT msgresponse:
  4557. *
  4558. * Extended NVRAM_UPDATE_FINISH response that communicates the result of secure
  4559. * firmware validation where applicable back to the host.
  4560. *
  4561. * Medford only: For signed firmware images, such as those for medford, the MC
  4562. * firmware verifies the signature before marking the firmware image as valid.
  4563. * This process takes a few seconds to complete. So is likely to take more than
  4564. * the MCDI timeout. Hence signature verification is initiated when
  4565. * MC_CMD_NVRAM_UPDATE_FINISH_V2_IN is received by the firmware, however, the
  4566. * MCDI command is run in a background MCDI processing thread. This response
  4567. * payload includes the results of the signature verification. Note that the
  4568. * per-partition nvram lock in firmware is only released after the verification
  4569. * has completed.
  4570. */
  4571. #define MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT_LEN 4
  4572. /* Result of nvram update completion processing */
  4573. #define MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT_RESULT_CODE_OFST 0
  4574. #define MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT_RESULT_CODE_LEN 4
  4575. /* enum: Invalid return code; only non-zero values are defined. Defined as
  4576. * unknown for backwards compatibility with NVRAM_UPDATE_FINISH_OUT.
  4577. */
  4578. #define MC_CMD_NVRAM_VERIFY_RC_UNKNOWN 0x0
  4579. /* enum: Verify succeeded without any errors. */
  4580. #define MC_CMD_NVRAM_VERIFY_RC_SUCCESS 0x1
  4581. /* enum: CMS format verification failed due to an internal error. */
  4582. #define MC_CMD_NVRAM_VERIFY_RC_CMS_CHECK_FAILED 0x2
  4583. /* enum: Invalid CMS format in image metadata. */
  4584. #define MC_CMD_NVRAM_VERIFY_RC_INVALID_CMS_FORMAT 0x3
  4585. /* enum: Message digest verification failed due to an internal error. */
  4586. #define MC_CMD_NVRAM_VERIFY_RC_MESSAGE_DIGEST_CHECK_FAILED 0x4
  4587. /* enum: Error in message digest calculated over the reflash-header, payload
  4588. * and reflash-trailer.
  4589. */
  4590. #define MC_CMD_NVRAM_VERIFY_RC_BAD_MESSAGE_DIGEST 0x5
  4591. /* enum: Signature verification failed due to an internal error. */
  4592. #define MC_CMD_NVRAM_VERIFY_RC_SIGNATURE_CHECK_FAILED 0x6
  4593. /* enum: There are no valid signatures in the image. */
  4594. #define MC_CMD_NVRAM_VERIFY_RC_NO_VALID_SIGNATURES 0x7
  4595. /* enum: Trusted approvers verification failed due to an internal error. */
  4596. #define MC_CMD_NVRAM_VERIFY_RC_TRUSTED_APPROVERS_CHECK_FAILED 0x8
  4597. /* enum: The Trusted approver's list is empty. */
  4598. #define MC_CMD_NVRAM_VERIFY_RC_NO_TRUSTED_APPROVERS 0x9
  4599. /* enum: Signature chain verification failed due to an internal error. */
  4600. #define MC_CMD_NVRAM_VERIFY_RC_SIGNATURE_CHAIN_CHECK_FAILED 0xa
  4601. /* enum: The signers of the signatures in the image are not listed in the
  4602. * Trusted approver's list.
  4603. */
  4604. #define MC_CMD_NVRAM_VERIFY_RC_NO_SIGNATURE_MATCH 0xb
  4605. /* enum: The image contains a test-signed certificate, but the adapter accepts
  4606. * only production signed images.
  4607. */
  4608. #define MC_CMD_NVRAM_VERIFY_RC_REJECT_TEST_SIGNED 0xc
  4609. /* enum: The image has a lower security level than the current firmware. */
  4610. #define MC_CMD_NVRAM_VERIFY_RC_SECURITY_LEVEL_DOWNGRADE 0xd
  4611. /***********************************/
  4612. /* MC_CMD_REBOOT
  4613. * Reboot the MC.
  4614. *
  4615. * The AFTER_ASSERTION flag is intended to be used when the driver notices an
  4616. * assertion failure (at which point it is expected to perform a complete tear
  4617. * down and reinitialise), to allow both ports to reset the MC once in an
  4618. * atomic fashion.
  4619. *
  4620. * Production mc firmwares are generally compiled with REBOOT_ON_ASSERT=1,
  4621. * which means that they will automatically reboot out of the assertion
  4622. * handler, so this is in practise an optional operation. It is still
  4623. * recommended that drivers execute this to support custom firmwares with
  4624. * REBOOT_ON_ASSERT=0.
  4625. *
  4626. * Locks required: NONE Returns: Nothing. You get back a response with ERR=1,
  4627. * DATALEN=0
  4628. */
  4629. #define MC_CMD_REBOOT 0x3d
  4630. #define MC_CMD_0x3d_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  4631. /* MC_CMD_REBOOT_IN msgrequest */
  4632. #define MC_CMD_REBOOT_IN_LEN 4
  4633. #define MC_CMD_REBOOT_IN_FLAGS_OFST 0
  4634. #define MC_CMD_REBOOT_IN_FLAGS_LEN 4
  4635. #define MC_CMD_REBOOT_FLAGS_AFTER_ASSERTION 0x1 /* enum */
  4636. /* MC_CMD_REBOOT_OUT msgresponse */
  4637. #define MC_CMD_REBOOT_OUT_LEN 0
  4638. /***********************************/
  4639. /* MC_CMD_SCHEDINFO
  4640. * Request scheduler info. Locks required: NONE. Returns: An array of
  4641. * (timeslice,maximum overrun), one for each thread, in ascending order of
  4642. * thread address.
  4643. */
  4644. #define MC_CMD_SCHEDINFO 0x3e
  4645. #define MC_CMD_0x3e_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  4646. /* MC_CMD_SCHEDINFO_IN msgrequest */
  4647. #define MC_CMD_SCHEDINFO_IN_LEN 0
  4648. /* MC_CMD_SCHEDINFO_OUT msgresponse */
  4649. #define MC_CMD_SCHEDINFO_OUT_LENMIN 4
  4650. #define MC_CMD_SCHEDINFO_OUT_LENMAX 252
  4651. #define MC_CMD_SCHEDINFO_OUT_LEN(num) (0+4*(num))
  4652. #define MC_CMD_SCHEDINFO_OUT_DATA_OFST 0
  4653. #define MC_CMD_SCHEDINFO_OUT_DATA_LEN 4
  4654. #define MC_CMD_SCHEDINFO_OUT_DATA_MINNUM 1
  4655. #define MC_CMD_SCHEDINFO_OUT_DATA_MAXNUM 63
  4656. /***********************************/
  4657. /* MC_CMD_REBOOT_MODE
  4658. * Set the mode for the next MC reboot. Locks required: NONE. Sets the reboot
  4659. * mode to the specified value. Returns the old mode.
  4660. */
  4661. #define MC_CMD_REBOOT_MODE 0x3f
  4662. #define MC_CMD_0x3f_PRIVILEGE_CTG SRIOV_CTG_INSECURE
  4663. /* MC_CMD_REBOOT_MODE_IN msgrequest */
  4664. #define MC_CMD_REBOOT_MODE_IN_LEN 4
  4665. #define MC_CMD_REBOOT_MODE_IN_VALUE_OFST 0
  4666. #define MC_CMD_REBOOT_MODE_IN_VALUE_LEN 4
  4667. /* enum: Normal. */
  4668. #define MC_CMD_REBOOT_MODE_NORMAL 0x0
  4669. /* enum: Power-on Reset. */
  4670. #define MC_CMD_REBOOT_MODE_POR 0x2
  4671. /* enum: Snapper. */
  4672. #define MC_CMD_REBOOT_MODE_SNAPPER 0x3
  4673. /* enum: snapper fake POR */
  4674. #define MC_CMD_REBOOT_MODE_SNAPPER_POR 0x4
  4675. #define MC_CMD_REBOOT_MODE_IN_FAKE_LBN 7
  4676. #define MC_CMD_REBOOT_MODE_IN_FAKE_WIDTH 1
  4677. /* MC_CMD_REBOOT_MODE_OUT msgresponse */
  4678. #define MC_CMD_REBOOT_MODE_OUT_LEN 4
  4679. #define MC_CMD_REBOOT_MODE_OUT_VALUE_OFST 0
  4680. #define MC_CMD_REBOOT_MODE_OUT_VALUE_LEN 4
  4681. /***********************************/
  4682. /* MC_CMD_SENSOR_INFO
  4683. * Returns information about every available sensor.
  4684. *
  4685. * Each sensor has a single (16bit) value, and a corresponding state. The
  4686. * mapping between value and state is nominally determined by the MC, but may
  4687. * be implemented using up to 2 ranges per sensor.
  4688. *
  4689. * This call returns a mask (32bit) of the sensors that are supported by this
  4690. * platform, then an array of sensor information structures, in order of sensor
  4691. * type (but without gaps for unimplemented sensors). Each structure defines
  4692. * the ranges for the corresponding sensor. An unused range is indicated by
  4693. * equal limit values. If one range is used, a value outside that range results
  4694. * in STATE_FATAL. If two ranges are used, a value outside the second range
  4695. * results in STATE_FATAL while a value outside the first and inside the second
  4696. * range results in STATE_WARNING.
  4697. *
  4698. * Sensor masks and sensor information arrays are organised into pages. For
  4699. * backward compatibility, older host software can only use sensors in page 0.
  4700. * Bit 32 in the sensor mask was previously unused, and is no reserved for use
  4701. * as the next page flag.
  4702. *
  4703. * If the request does not contain a PAGE value then firmware will only return
  4704. * page 0 of sensor information, with bit 31 in the sensor mask cleared.
  4705. *
  4706. * If the request contains a PAGE value then firmware responds with the sensor
  4707. * mask and sensor information array for that page of sensors. In this case bit
  4708. * 31 in the mask is set if another page exists.
  4709. *
  4710. * Locks required: None Returns: 0
  4711. */
  4712. #define MC_CMD_SENSOR_INFO 0x41
  4713. #define MC_CMD_0x41_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  4714. /* MC_CMD_SENSOR_INFO_IN msgrequest */
  4715. #define MC_CMD_SENSOR_INFO_IN_LEN 0
  4716. /* MC_CMD_SENSOR_INFO_EXT_IN msgrequest */
  4717. #define MC_CMD_SENSOR_INFO_EXT_IN_LEN 4
  4718. /* Which page of sensors to report.
  4719. *
  4720. * Page 0 contains sensors 0 to 30 (sensor 31 is the next page bit).
  4721. *
  4722. * Page 1 contains sensors 32 to 62 (sensor 63 is the next page bit). etc.
  4723. */
  4724. #define MC_CMD_SENSOR_INFO_EXT_IN_PAGE_OFST 0
  4725. #define MC_CMD_SENSOR_INFO_EXT_IN_PAGE_LEN 4
  4726. /* MC_CMD_SENSOR_INFO_OUT msgresponse */
  4727. #define MC_CMD_SENSOR_INFO_OUT_LENMIN 4
  4728. #define MC_CMD_SENSOR_INFO_OUT_LENMAX 252
  4729. #define MC_CMD_SENSOR_INFO_OUT_LEN(num) (4+8*(num))
  4730. #define MC_CMD_SENSOR_INFO_OUT_MASK_OFST 0
  4731. #define MC_CMD_SENSOR_INFO_OUT_MASK_LEN 4
  4732. /* enum: Controller temperature: degC */
  4733. #define MC_CMD_SENSOR_CONTROLLER_TEMP 0x0
  4734. /* enum: Phy common temperature: degC */
  4735. #define MC_CMD_SENSOR_PHY_COMMON_TEMP 0x1
  4736. /* enum: Controller cooling: bool */
  4737. #define MC_CMD_SENSOR_CONTROLLER_COOLING 0x2
  4738. /* enum: Phy 0 temperature: degC */
  4739. #define MC_CMD_SENSOR_PHY0_TEMP 0x3
  4740. /* enum: Phy 0 cooling: bool */
  4741. #define MC_CMD_SENSOR_PHY0_COOLING 0x4
  4742. /* enum: Phy 1 temperature: degC */
  4743. #define MC_CMD_SENSOR_PHY1_TEMP 0x5
  4744. /* enum: Phy 1 cooling: bool */
  4745. #define MC_CMD_SENSOR_PHY1_COOLING 0x6
  4746. /* enum: 1.0v power: mV */
  4747. #define MC_CMD_SENSOR_IN_1V0 0x7
  4748. /* enum: 1.2v power: mV */
  4749. #define MC_CMD_SENSOR_IN_1V2 0x8
  4750. /* enum: 1.8v power: mV */
  4751. #define MC_CMD_SENSOR_IN_1V8 0x9
  4752. /* enum: 2.5v power: mV */
  4753. #define MC_CMD_SENSOR_IN_2V5 0xa
  4754. /* enum: 3.3v power: mV */
  4755. #define MC_CMD_SENSOR_IN_3V3 0xb
  4756. /* enum: 12v power: mV */
  4757. #define MC_CMD_SENSOR_IN_12V0 0xc
  4758. /* enum: 1.2v analogue power: mV */
  4759. #define MC_CMD_SENSOR_IN_1V2A 0xd
  4760. /* enum: reference voltage: mV */
  4761. #define MC_CMD_SENSOR_IN_VREF 0xe
  4762. /* enum: AOE FPGA power: mV */
  4763. #define MC_CMD_SENSOR_OUT_VAOE 0xf
  4764. /* enum: AOE FPGA temperature: degC */
  4765. #define MC_CMD_SENSOR_AOE_TEMP 0x10
  4766. /* enum: AOE FPGA PSU temperature: degC */
  4767. #define MC_CMD_SENSOR_PSU_AOE_TEMP 0x11
  4768. /* enum: AOE PSU temperature: degC */
  4769. #define MC_CMD_SENSOR_PSU_TEMP 0x12
  4770. /* enum: Fan 0 speed: RPM */
  4771. #define MC_CMD_SENSOR_FAN_0 0x13
  4772. /* enum: Fan 1 speed: RPM */
  4773. #define MC_CMD_SENSOR_FAN_1 0x14
  4774. /* enum: Fan 2 speed: RPM */
  4775. #define MC_CMD_SENSOR_FAN_2 0x15
  4776. /* enum: Fan 3 speed: RPM */
  4777. #define MC_CMD_SENSOR_FAN_3 0x16
  4778. /* enum: Fan 4 speed: RPM */
  4779. #define MC_CMD_SENSOR_FAN_4 0x17
  4780. /* enum: AOE FPGA input power: mV */
  4781. #define MC_CMD_SENSOR_IN_VAOE 0x18
  4782. /* enum: AOE FPGA current: mA */
  4783. #define MC_CMD_SENSOR_OUT_IAOE 0x19
  4784. /* enum: AOE FPGA input current: mA */
  4785. #define MC_CMD_SENSOR_IN_IAOE 0x1a
  4786. /* enum: NIC power consumption: W */
  4787. #define MC_CMD_SENSOR_NIC_POWER 0x1b
  4788. /* enum: 0.9v power voltage: mV */
  4789. #define MC_CMD_SENSOR_IN_0V9 0x1c
  4790. /* enum: 0.9v power current: mA */
  4791. #define MC_CMD_SENSOR_IN_I0V9 0x1d
  4792. /* enum: 1.2v power current: mA */
  4793. #define MC_CMD_SENSOR_IN_I1V2 0x1e
  4794. /* enum: Not a sensor: reserved for the next page flag */
  4795. #define MC_CMD_SENSOR_PAGE0_NEXT 0x1f
  4796. /* enum: 0.9v power voltage (at ADC): mV */
  4797. #define MC_CMD_SENSOR_IN_0V9_ADC 0x20
  4798. /* enum: Controller temperature 2: degC */
  4799. #define MC_CMD_SENSOR_CONTROLLER_2_TEMP 0x21
  4800. /* enum: Voltage regulator internal temperature: degC */
  4801. #define MC_CMD_SENSOR_VREG_INTERNAL_TEMP 0x22
  4802. /* enum: 0.9V voltage regulator temperature: degC */
  4803. #define MC_CMD_SENSOR_VREG_0V9_TEMP 0x23
  4804. /* enum: 1.2V voltage regulator temperature: degC */
  4805. #define MC_CMD_SENSOR_VREG_1V2_TEMP 0x24
  4806. /* enum: controller internal temperature sensor voltage (internal ADC): mV */
  4807. #define MC_CMD_SENSOR_CONTROLLER_VPTAT 0x25
  4808. /* enum: controller internal temperature (internal ADC): degC */
  4809. #define MC_CMD_SENSOR_CONTROLLER_INTERNAL_TEMP 0x26
  4810. /* enum: controller internal temperature sensor voltage (external ADC): mV */
  4811. #define MC_CMD_SENSOR_CONTROLLER_VPTAT_EXTADC 0x27
  4812. /* enum: controller internal temperature (external ADC): degC */
  4813. #define MC_CMD_SENSOR_CONTROLLER_INTERNAL_TEMP_EXTADC 0x28
  4814. /* enum: ambient temperature: degC */
  4815. #define MC_CMD_SENSOR_AMBIENT_TEMP 0x29
  4816. /* enum: air flow: bool */
  4817. #define MC_CMD_SENSOR_AIRFLOW 0x2a
  4818. /* enum: voltage between VSS08D and VSS08D at CSR: mV */
  4819. #define MC_CMD_SENSOR_VDD08D_VSS08D_CSR 0x2b
  4820. /* enum: voltage between VSS08D and VSS08D at CSR (external ADC): mV */
  4821. #define MC_CMD_SENSOR_VDD08D_VSS08D_CSR_EXTADC 0x2c
  4822. /* enum: Hotpoint temperature: degC */
  4823. #define MC_CMD_SENSOR_HOTPOINT_TEMP 0x2d
  4824. /* enum: Port 0 PHY power switch over-current: bool */
  4825. #define MC_CMD_SENSOR_PHY_POWER_PORT0 0x2e
  4826. /* enum: Port 1 PHY power switch over-current: bool */
  4827. #define MC_CMD_SENSOR_PHY_POWER_PORT1 0x2f
  4828. /* enum: Mop-up microcontroller reference voltage: mV */
  4829. #define MC_CMD_SENSOR_MUM_VCC 0x30
  4830. /* enum: 0.9v power phase A voltage: mV */
  4831. #define MC_CMD_SENSOR_IN_0V9_A 0x31
  4832. /* enum: 0.9v power phase A current: mA */
  4833. #define MC_CMD_SENSOR_IN_I0V9_A 0x32
  4834. /* enum: 0.9V voltage regulator phase A temperature: degC */
  4835. #define MC_CMD_SENSOR_VREG_0V9_A_TEMP 0x33
  4836. /* enum: 0.9v power phase B voltage: mV */
  4837. #define MC_CMD_SENSOR_IN_0V9_B 0x34
  4838. /* enum: 0.9v power phase B current: mA */
  4839. #define MC_CMD_SENSOR_IN_I0V9_B 0x35
  4840. /* enum: 0.9V voltage regulator phase B temperature: degC */
  4841. #define MC_CMD_SENSOR_VREG_0V9_B_TEMP 0x36
  4842. /* enum: CCOM AVREG 1v2 supply (interval ADC): mV */
  4843. #define MC_CMD_SENSOR_CCOM_AVREG_1V2_SUPPLY 0x37
  4844. /* enum: CCOM AVREG 1v2 supply (external ADC): mV */
  4845. #define MC_CMD_SENSOR_CCOM_AVREG_1V2_SUPPLY_EXTADC 0x38
  4846. /* enum: CCOM AVREG 1v8 supply (interval ADC): mV */
  4847. #define MC_CMD_SENSOR_CCOM_AVREG_1V8_SUPPLY 0x39
  4848. /* enum: CCOM AVREG 1v8 supply (external ADC): mV */
  4849. #define MC_CMD_SENSOR_CCOM_AVREG_1V8_SUPPLY_EXTADC 0x3a
  4850. /* enum: CCOM RTS temperature: degC */
  4851. #define MC_CMD_SENSOR_CONTROLLER_RTS 0x3b
  4852. /* enum: Not a sensor: reserved for the next page flag */
  4853. #define MC_CMD_SENSOR_PAGE1_NEXT 0x3f
  4854. /* enum: controller internal temperature sensor voltage on master core
  4855. * (internal ADC): mV
  4856. */
  4857. #define MC_CMD_SENSOR_CONTROLLER_MASTER_VPTAT 0x40
  4858. /* enum: controller internal temperature on master core (internal ADC): degC */
  4859. #define MC_CMD_SENSOR_CONTROLLER_MASTER_INTERNAL_TEMP 0x41
  4860. /* enum: controller internal temperature sensor voltage on master core
  4861. * (external ADC): mV
  4862. */
  4863. #define MC_CMD_SENSOR_CONTROLLER_MASTER_VPTAT_EXTADC 0x42
  4864. /* enum: controller internal temperature on master core (external ADC): degC */
  4865. #define MC_CMD_SENSOR_CONTROLLER_MASTER_INTERNAL_TEMP_EXTADC 0x43
  4866. /* enum: controller internal temperature on slave core sensor voltage (internal
  4867. * ADC): mV
  4868. */
  4869. #define MC_CMD_SENSOR_CONTROLLER_SLAVE_VPTAT 0x44
  4870. /* enum: controller internal temperature on slave core (internal ADC): degC */
  4871. #define MC_CMD_SENSOR_CONTROLLER_SLAVE_INTERNAL_TEMP 0x45
  4872. /* enum: controller internal temperature on slave core sensor voltage (external
  4873. * ADC): mV
  4874. */
  4875. #define MC_CMD_SENSOR_CONTROLLER_SLAVE_VPTAT_EXTADC 0x46
  4876. /* enum: controller internal temperature on slave core (external ADC): degC */
  4877. #define MC_CMD_SENSOR_CONTROLLER_SLAVE_INTERNAL_TEMP_EXTADC 0x47
  4878. /* enum: Voltage supplied to the SODIMMs from their power supply: mV */
  4879. #define MC_CMD_SENSOR_SODIMM_VOUT 0x49
  4880. /* enum: Temperature of SODIMM 0 (if installed): degC */
  4881. #define MC_CMD_SENSOR_SODIMM_0_TEMP 0x4a
  4882. /* enum: Temperature of SODIMM 1 (if installed): degC */
  4883. #define MC_CMD_SENSOR_SODIMM_1_TEMP 0x4b
  4884. /* enum: Voltage supplied to the QSFP #0 from their power supply: mV */
  4885. #define MC_CMD_SENSOR_PHY0_VCC 0x4c
  4886. /* enum: Voltage supplied to the QSFP #1 from their power supply: mV */
  4887. #define MC_CMD_SENSOR_PHY1_VCC 0x4d
  4888. /* enum: Controller die temperature (TDIODE): degC */
  4889. #define MC_CMD_SENSOR_CONTROLLER_TDIODE_TEMP 0x4e
  4890. /* enum: Board temperature (front): degC */
  4891. #define MC_CMD_SENSOR_BOARD_FRONT_TEMP 0x4f
  4892. /* enum: Board temperature (back): degC */
  4893. #define MC_CMD_SENSOR_BOARD_BACK_TEMP 0x50
  4894. /* enum: 1.8v power current: mA */
  4895. #define MC_CMD_SENSOR_IN_I1V8 0x51
  4896. /* enum: 2.5v power current: mA */
  4897. #define MC_CMD_SENSOR_IN_I2V5 0x52
  4898. /* enum: 3.3v power current: mA */
  4899. #define MC_CMD_SENSOR_IN_I3V3 0x53
  4900. /* enum: 12v power current: mA */
  4901. #define MC_CMD_SENSOR_IN_I12V0 0x54
  4902. /* enum: 1.3v power: mV */
  4903. #define MC_CMD_SENSOR_IN_1V3 0x55
  4904. /* enum: 1.3v power current: mA */
  4905. #define MC_CMD_SENSOR_IN_I1V3 0x56
  4906. /* enum: Not a sensor: reserved for the next page flag */
  4907. #define MC_CMD_SENSOR_PAGE2_NEXT 0x5f
  4908. /* MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF */
  4909. #define MC_CMD_SENSOR_ENTRY_OFST 4
  4910. #define MC_CMD_SENSOR_ENTRY_LEN 8
  4911. #define MC_CMD_SENSOR_ENTRY_LO_OFST 4
  4912. #define MC_CMD_SENSOR_ENTRY_HI_OFST 8
  4913. #define MC_CMD_SENSOR_ENTRY_MINNUM 0
  4914. #define MC_CMD_SENSOR_ENTRY_MAXNUM 31
  4915. /* MC_CMD_SENSOR_INFO_EXT_OUT msgresponse */
  4916. #define MC_CMD_SENSOR_INFO_EXT_OUT_LENMIN 4
  4917. #define MC_CMD_SENSOR_INFO_EXT_OUT_LENMAX 252
  4918. #define MC_CMD_SENSOR_INFO_EXT_OUT_LEN(num) (4+8*(num))
  4919. #define MC_CMD_SENSOR_INFO_EXT_OUT_MASK_OFST 0
  4920. #define MC_CMD_SENSOR_INFO_EXT_OUT_MASK_LEN 4
  4921. /* Enum values, see field(s): */
  4922. /* MC_CMD_SENSOR_INFO_OUT */
  4923. #define MC_CMD_SENSOR_INFO_EXT_OUT_NEXT_PAGE_LBN 31
  4924. #define MC_CMD_SENSOR_INFO_EXT_OUT_NEXT_PAGE_WIDTH 1
  4925. /* MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF */
  4926. /* MC_CMD_SENSOR_ENTRY_OFST 4 */
  4927. /* MC_CMD_SENSOR_ENTRY_LEN 8 */
  4928. /* MC_CMD_SENSOR_ENTRY_LO_OFST 4 */
  4929. /* MC_CMD_SENSOR_ENTRY_HI_OFST 8 */
  4930. /* MC_CMD_SENSOR_ENTRY_MINNUM 0 */
  4931. /* MC_CMD_SENSOR_ENTRY_MAXNUM 31 */
  4932. /* MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF structuredef */
  4933. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_LEN 8
  4934. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MIN1_OFST 0
  4935. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MIN1_LEN 2
  4936. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MIN1_LBN 0
  4937. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MIN1_WIDTH 16
  4938. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MAX1_OFST 2
  4939. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MAX1_LEN 2
  4940. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MAX1_LBN 16
  4941. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MAX1_WIDTH 16
  4942. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MIN2_OFST 4
  4943. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MIN2_LEN 2
  4944. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MIN2_LBN 32
  4945. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MIN2_WIDTH 16
  4946. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MAX2_OFST 6
  4947. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MAX2_LEN 2
  4948. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MAX2_LBN 48
  4949. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MAX2_WIDTH 16
  4950. /***********************************/
  4951. /* MC_CMD_READ_SENSORS
  4952. * Returns the current reading from each sensor. DMAs an array of sensor
  4953. * readings, in order of sensor type (but without gaps for unimplemented
  4954. * sensors), into host memory. Each array element is a
  4955. * MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF dword.
  4956. *
  4957. * If the request does not contain the LENGTH field then only sensors 0 to 30
  4958. * are reported, to avoid DMA buffer overflow in older host software. If the
  4959. * sensor reading require more space than the LENGTH allows, then return
  4960. * EINVAL.
  4961. *
  4962. * The MC will send a SENSOREVT event every time any sensor changes state. The
  4963. * driver is responsible for ensuring that it doesn't miss any events. The
  4964. * board will function normally if all sensors are in STATE_OK or
  4965. * STATE_WARNING. Otherwise the board should not be expected to function.
  4966. */
  4967. #define MC_CMD_READ_SENSORS 0x42
  4968. #define MC_CMD_0x42_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  4969. /* MC_CMD_READ_SENSORS_IN msgrequest */
  4970. #define MC_CMD_READ_SENSORS_IN_LEN 8
  4971. /* DMA address of host buffer for sensor readings (must be 4Kbyte aligned). */
  4972. #define MC_CMD_READ_SENSORS_IN_DMA_ADDR_OFST 0
  4973. #define MC_CMD_READ_SENSORS_IN_DMA_ADDR_LEN 8
  4974. #define MC_CMD_READ_SENSORS_IN_DMA_ADDR_LO_OFST 0
  4975. #define MC_CMD_READ_SENSORS_IN_DMA_ADDR_HI_OFST 4
  4976. /* MC_CMD_READ_SENSORS_EXT_IN msgrequest */
  4977. #define MC_CMD_READ_SENSORS_EXT_IN_LEN 12
  4978. /* DMA address of host buffer for sensor readings (must be 4Kbyte aligned). */
  4979. #define MC_CMD_READ_SENSORS_EXT_IN_DMA_ADDR_OFST 0
  4980. #define MC_CMD_READ_SENSORS_EXT_IN_DMA_ADDR_LEN 8
  4981. #define MC_CMD_READ_SENSORS_EXT_IN_DMA_ADDR_LO_OFST 0
  4982. #define MC_CMD_READ_SENSORS_EXT_IN_DMA_ADDR_HI_OFST 4
  4983. /* Size in bytes of host buffer. */
  4984. #define MC_CMD_READ_SENSORS_EXT_IN_LENGTH_OFST 8
  4985. #define MC_CMD_READ_SENSORS_EXT_IN_LENGTH_LEN 4
  4986. /* MC_CMD_READ_SENSORS_OUT msgresponse */
  4987. #define MC_CMD_READ_SENSORS_OUT_LEN 0
  4988. /* MC_CMD_READ_SENSORS_EXT_OUT msgresponse */
  4989. #define MC_CMD_READ_SENSORS_EXT_OUT_LEN 0
  4990. /* MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF structuredef */
  4991. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_LEN 4
  4992. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_VALUE_OFST 0
  4993. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_VALUE_LEN 2
  4994. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_VALUE_LBN 0
  4995. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_VALUE_WIDTH 16
  4996. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_STATE_OFST 2
  4997. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_STATE_LEN 1
  4998. /* enum: Ok. */
  4999. #define MC_CMD_SENSOR_STATE_OK 0x0
  5000. /* enum: Breached warning threshold. */
  5001. #define MC_CMD_SENSOR_STATE_WARNING 0x1
  5002. /* enum: Breached fatal threshold. */
  5003. #define MC_CMD_SENSOR_STATE_FATAL 0x2
  5004. /* enum: Fault with sensor. */
  5005. #define MC_CMD_SENSOR_STATE_BROKEN 0x3
  5006. /* enum: Sensor is working but does not currently have a reading. */
  5007. #define MC_CMD_SENSOR_STATE_NO_READING 0x4
  5008. /* enum: Sensor initialisation failed. */
  5009. #define MC_CMD_SENSOR_STATE_INIT_FAILED 0x5
  5010. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_STATE_LBN 16
  5011. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_STATE_WIDTH 8
  5012. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_TYPE_OFST 3
  5013. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_TYPE_LEN 1
  5014. /* Enum values, see field(s): */
  5015. /* MC_CMD_SENSOR_INFO/MC_CMD_SENSOR_INFO_OUT/MASK */
  5016. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_TYPE_LBN 24
  5017. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_TYPE_WIDTH 8
  5018. /***********************************/
  5019. /* MC_CMD_GET_PHY_STATE
  5020. * Report current state of PHY. A 'zombie' PHY is a PHY that has failed to boot
  5021. * (e.g. due to missing or corrupted firmware). Locks required: None. Return
  5022. * code: 0
  5023. */
  5024. #define MC_CMD_GET_PHY_STATE 0x43
  5025. #define MC_CMD_0x43_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5026. /* MC_CMD_GET_PHY_STATE_IN msgrequest */
  5027. #define MC_CMD_GET_PHY_STATE_IN_LEN 0
  5028. /* MC_CMD_GET_PHY_STATE_OUT msgresponse */
  5029. #define MC_CMD_GET_PHY_STATE_OUT_LEN 4
  5030. #define MC_CMD_GET_PHY_STATE_OUT_STATE_OFST 0
  5031. #define MC_CMD_GET_PHY_STATE_OUT_STATE_LEN 4
  5032. /* enum: Ok. */
  5033. #define MC_CMD_PHY_STATE_OK 0x1
  5034. /* enum: Faulty. */
  5035. #define MC_CMD_PHY_STATE_ZOMBIE 0x2
  5036. /***********************************/
  5037. /* MC_CMD_SETUP_8021QBB
  5038. * 802.1Qbb control. 8 Tx queues that map to priorities 0 - 7. Use all 1s to
  5039. * disable 802.Qbb for a given priority.
  5040. */
  5041. #define MC_CMD_SETUP_8021QBB 0x44
  5042. /* MC_CMD_SETUP_8021QBB_IN msgrequest */
  5043. #define MC_CMD_SETUP_8021QBB_IN_LEN 32
  5044. #define MC_CMD_SETUP_8021QBB_IN_TXQS_OFST 0
  5045. #define MC_CMD_SETUP_8021QBB_IN_TXQS_LEN 32
  5046. /* MC_CMD_SETUP_8021QBB_OUT msgresponse */
  5047. #define MC_CMD_SETUP_8021QBB_OUT_LEN 0
  5048. /***********************************/
  5049. /* MC_CMD_WOL_FILTER_GET
  5050. * Retrieve ID of any WoL filters. Locks required: None. Returns: 0, ENOSYS
  5051. */
  5052. #define MC_CMD_WOL_FILTER_GET 0x45
  5053. #define MC_CMD_0x45_PRIVILEGE_CTG SRIOV_CTG_LINK
  5054. /* MC_CMD_WOL_FILTER_GET_IN msgrequest */
  5055. #define MC_CMD_WOL_FILTER_GET_IN_LEN 0
  5056. /* MC_CMD_WOL_FILTER_GET_OUT msgresponse */
  5057. #define MC_CMD_WOL_FILTER_GET_OUT_LEN 4
  5058. #define MC_CMD_WOL_FILTER_GET_OUT_FILTER_ID_OFST 0
  5059. #define MC_CMD_WOL_FILTER_GET_OUT_FILTER_ID_LEN 4
  5060. /***********************************/
  5061. /* MC_CMD_ADD_LIGHTSOUT_OFFLOAD
  5062. * Add a protocol offload to NIC for lights-out state. Locks required: None.
  5063. * Returns: 0, ENOSYS
  5064. */
  5065. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD 0x46
  5066. #define MC_CMD_0x46_PRIVILEGE_CTG SRIOV_CTG_LINK
  5067. /* MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN msgrequest */
  5068. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_LENMIN 8
  5069. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_LENMAX 252
  5070. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_LEN(num) (4+4*(num))
  5071. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_PROTOCOL_OFST 0
  5072. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_PROTOCOL_LEN 4
  5073. #define MC_CMD_LIGHTSOUT_OFFLOAD_PROTOCOL_ARP 0x1 /* enum */
  5074. #define MC_CMD_LIGHTSOUT_OFFLOAD_PROTOCOL_NS 0x2 /* enum */
  5075. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_DATA_OFST 4
  5076. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_DATA_LEN 4
  5077. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_DATA_MINNUM 1
  5078. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_DATA_MAXNUM 62
  5079. /* MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_ARP msgrequest */
  5080. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_ARP_LEN 14
  5081. /* MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_PROTOCOL_OFST 0 */
  5082. /* MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_PROTOCOL_LEN 4 */
  5083. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_ARP_MAC_OFST 4
  5084. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_ARP_MAC_LEN 6
  5085. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_ARP_IP_OFST 10
  5086. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_ARP_IP_LEN 4
  5087. /* MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_NS msgrequest */
  5088. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_NS_LEN 42
  5089. /* MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_PROTOCOL_OFST 0 */
  5090. /* MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_PROTOCOL_LEN 4 */
  5091. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_NS_MAC_OFST 4
  5092. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_NS_MAC_LEN 6
  5093. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_NS_SNIPV6_OFST 10
  5094. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_NS_SNIPV6_LEN 16
  5095. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_NS_IPV6_OFST 26
  5096. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_NS_IPV6_LEN 16
  5097. /* MC_CMD_ADD_LIGHTSOUT_OFFLOAD_OUT msgresponse */
  5098. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_OUT_LEN 4
  5099. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_OUT_FILTER_ID_OFST 0
  5100. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_OUT_FILTER_ID_LEN 4
  5101. /***********************************/
  5102. /* MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD
  5103. * Remove a protocol offload from NIC for lights-out state. Locks required:
  5104. * None. Returns: 0, ENOSYS
  5105. */
  5106. #define MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD 0x47
  5107. #define MC_CMD_0x47_PRIVILEGE_CTG SRIOV_CTG_LINK
  5108. /* MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD_IN msgrequest */
  5109. #define MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD_IN_LEN 8
  5110. #define MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD_IN_PROTOCOL_OFST 0
  5111. #define MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD_IN_PROTOCOL_LEN 4
  5112. #define MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD_IN_FILTER_ID_OFST 4
  5113. #define MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD_IN_FILTER_ID_LEN 4
  5114. /* MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD_OUT msgresponse */
  5115. #define MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD_OUT_LEN 0
  5116. /***********************************/
  5117. /* MC_CMD_MAC_RESET_RESTORE
  5118. * Restore MAC after block reset. Locks required: None. Returns: 0.
  5119. */
  5120. #define MC_CMD_MAC_RESET_RESTORE 0x48
  5121. /* MC_CMD_MAC_RESET_RESTORE_IN msgrequest */
  5122. #define MC_CMD_MAC_RESET_RESTORE_IN_LEN 0
  5123. /* MC_CMD_MAC_RESET_RESTORE_OUT msgresponse */
  5124. #define MC_CMD_MAC_RESET_RESTORE_OUT_LEN 0
  5125. /***********************************/
  5126. /* MC_CMD_TESTASSERT
  5127. * Deliberately trigger an assert-detonation in the firmware for testing
  5128. * purposes (i.e. to allow tests that the driver copes gracefully). Locks
  5129. * required: None Returns: 0
  5130. */
  5131. #define MC_CMD_TESTASSERT 0x49
  5132. #define MC_CMD_0x49_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  5133. /* MC_CMD_TESTASSERT_IN msgrequest */
  5134. #define MC_CMD_TESTASSERT_IN_LEN 0
  5135. /* MC_CMD_TESTASSERT_OUT msgresponse */
  5136. #define MC_CMD_TESTASSERT_OUT_LEN 0
  5137. /* MC_CMD_TESTASSERT_V2_IN msgrequest */
  5138. #define MC_CMD_TESTASSERT_V2_IN_LEN 4
  5139. /* How to provoke the assertion */
  5140. #define MC_CMD_TESTASSERT_V2_IN_TYPE_OFST 0
  5141. #define MC_CMD_TESTASSERT_V2_IN_TYPE_LEN 4
  5142. /* enum: Assert using the FAIL_ASSERTION_WITH_USEFUL_VALUES macro. Unless
  5143. * you're testing firmware, this is what you want.
  5144. */
  5145. #define MC_CMD_TESTASSERT_V2_IN_FAIL_ASSERTION_WITH_USEFUL_VALUES 0x0
  5146. /* enum: Assert using assert(0); */
  5147. #define MC_CMD_TESTASSERT_V2_IN_ASSERT_FALSE 0x1
  5148. /* enum: Deliberately trigger a watchdog */
  5149. #define MC_CMD_TESTASSERT_V2_IN_WATCHDOG 0x2
  5150. /* enum: Deliberately trigger a trap by loading from an invalid address */
  5151. #define MC_CMD_TESTASSERT_V2_IN_LOAD_TRAP 0x3
  5152. /* enum: Deliberately trigger a trap by storing to an invalid address */
  5153. #define MC_CMD_TESTASSERT_V2_IN_STORE_TRAP 0x4
  5154. /* enum: Jump to an invalid address */
  5155. #define MC_CMD_TESTASSERT_V2_IN_JUMP_TRAP 0x5
  5156. /* MC_CMD_TESTASSERT_V2_OUT msgresponse */
  5157. #define MC_CMD_TESTASSERT_V2_OUT_LEN 0
  5158. /***********************************/
  5159. /* MC_CMD_WORKAROUND
  5160. * Enable/Disable a given workaround. The mcfw will return EINVAL if it doesn't
  5161. * understand the given workaround number - which should not be treated as a
  5162. * hard error by client code. This op does not imply any semantics about each
  5163. * workaround, that's between the driver and the mcfw on a per-workaround
  5164. * basis. Locks required: None. Returns: 0, EINVAL .
  5165. */
  5166. #define MC_CMD_WORKAROUND 0x4a
  5167. #define MC_CMD_0x4a_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  5168. /* MC_CMD_WORKAROUND_IN msgrequest */
  5169. #define MC_CMD_WORKAROUND_IN_LEN 8
  5170. /* The enums here must correspond with those in MC_CMD_GET_WORKAROUND. */
  5171. #define MC_CMD_WORKAROUND_IN_TYPE_OFST 0
  5172. #define MC_CMD_WORKAROUND_IN_TYPE_LEN 4
  5173. /* enum: Bug 17230 work around. */
  5174. #define MC_CMD_WORKAROUND_BUG17230 0x1
  5175. /* enum: Bug 35388 work around (unsafe EVQ writes). */
  5176. #define MC_CMD_WORKAROUND_BUG35388 0x2
  5177. /* enum: Bug35017 workaround (A64 tables must be identity map) */
  5178. #define MC_CMD_WORKAROUND_BUG35017 0x3
  5179. /* enum: Bug 41750 present (MC_CMD_TRIGGER_INTERRUPT won't work) */
  5180. #define MC_CMD_WORKAROUND_BUG41750 0x4
  5181. /* enum: Bug 42008 present (Interrupts can overtake associated events). Caution
  5182. * - before adding code that queries this workaround, remember that there's
  5183. * released Monza firmware that doesn't understand MC_CMD_WORKAROUND_BUG42008,
  5184. * and will hence (incorrectly) report that the bug doesn't exist.
  5185. */
  5186. #define MC_CMD_WORKAROUND_BUG42008 0x5
  5187. /* enum: Bug 26807 features present in firmware (multicast filter chaining)
  5188. * This feature cannot be turned on/off while there are any filters already
  5189. * present. The behaviour in such case depends on the acting client's privilege
  5190. * level. If the client has the admin privilege, then all functions that have
  5191. * filters installed will be FLRed and the FLR_DONE flag will be set. Otherwise
  5192. * the command will fail with MC_CMD_ERR_FILTERS_PRESENT.
  5193. */
  5194. #define MC_CMD_WORKAROUND_BUG26807 0x6
  5195. /* enum: Bug 61265 work around (broken EVQ TMR writes). */
  5196. #define MC_CMD_WORKAROUND_BUG61265 0x7
  5197. /* 0 = disable the workaround indicated by TYPE; any non-zero value = enable
  5198. * the workaround
  5199. */
  5200. #define MC_CMD_WORKAROUND_IN_ENABLED_OFST 4
  5201. #define MC_CMD_WORKAROUND_IN_ENABLED_LEN 4
  5202. /* MC_CMD_WORKAROUND_OUT msgresponse */
  5203. #define MC_CMD_WORKAROUND_OUT_LEN 0
  5204. /* MC_CMD_WORKAROUND_EXT_OUT msgresponse: This response format will be used
  5205. * when (TYPE == MC_CMD_WORKAROUND_BUG26807)
  5206. */
  5207. #define MC_CMD_WORKAROUND_EXT_OUT_LEN 4
  5208. #define MC_CMD_WORKAROUND_EXT_OUT_FLAGS_OFST 0
  5209. #define MC_CMD_WORKAROUND_EXT_OUT_FLAGS_LEN 4
  5210. #define MC_CMD_WORKAROUND_EXT_OUT_FLR_DONE_LBN 0
  5211. #define MC_CMD_WORKAROUND_EXT_OUT_FLR_DONE_WIDTH 1
  5212. /***********************************/
  5213. /* MC_CMD_GET_PHY_MEDIA_INFO
  5214. * Read media-specific data from PHY (e.g. SFP/SFP+ module ID information for
  5215. * SFP+ PHYs). The 'media type' can be found via GET_PHY_CFG
  5216. * (GET_PHY_CFG_OUT_MEDIA_TYPE); the valid 'page number' input values, and the
  5217. * output data, are interpreted on a per-type basis. For SFP+: PAGE=0 or 1
  5218. * returns a 128-byte block read from module I2C address 0xA0 offset 0 or 0x80.
  5219. * Anything else: currently undefined. Locks required: None. Return code: 0.
  5220. */
  5221. #define MC_CMD_GET_PHY_MEDIA_INFO 0x4b
  5222. #define MC_CMD_0x4b_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  5223. /* MC_CMD_GET_PHY_MEDIA_INFO_IN msgrequest */
  5224. #define MC_CMD_GET_PHY_MEDIA_INFO_IN_LEN 4
  5225. #define MC_CMD_GET_PHY_MEDIA_INFO_IN_PAGE_OFST 0
  5226. #define MC_CMD_GET_PHY_MEDIA_INFO_IN_PAGE_LEN 4
  5227. /* MC_CMD_GET_PHY_MEDIA_INFO_OUT msgresponse */
  5228. #define MC_CMD_GET_PHY_MEDIA_INFO_OUT_LENMIN 5
  5229. #define MC_CMD_GET_PHY_MEDIA_INFO_OUT_LENMAX 252
  5230. #define MC_CMD_GET_PHY_MEDIA_INFO_OUT_LEN(num) (4+1*(num))
  5231. /* in bytes */
  5232. #define MC_CMD_GET_PHY_MEDIA_INFO_OUT_DATALEN_OFST 0
  5233. #define MC_CMD_GET_PHY_MEDIA_INFO_OUT_DATALEN_LEN 4
  5234. #define MC_CMD_GET_PHY_MEDIA_INFO_OUT_DATA_OFST 4
  5235. #define MC_CMD_GET_PHY_MEDIA_INFO_OUT_DATA_LEN 1
  5236. #define MC_CMD_GET_PHY_MEDIA_INFO_OUT_DATA_MINNUM 1
  5237. #define MC_CMD_GET_PHY_MEDIA_INFO_OUT_DATA_MAXNUM 248
  5238. /***********************************/
  5239. /* MC_CMD_NVRAM_TEST
  5240. * Test a particular NVRAM partition for valid contents (where "valid" depends
  5241. * on the type of partition).
  5242. */
  5243. #define MC_CMD_NVRAM_TEST 0x4c
  5244. #define MC_CMD_0x4c_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  5245. /* MC_CMD_NVRAM_TEST_IN msgrequest */
  5246. #define MC_CMD_NVRAM_TEST_IN_LEN 4
  5247. #define MC_CMD_NVRAM_TEST_IN_TYPE_OFST 0
  5248. #define MC_CMD_NVRAM_TEST_IN_TYPE_LEN 4
  5249. /* Enum values, see field(s): */
  5250. /* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */
  5251. /* MC_CMD_NVRAM_TEST_OUT msgresponse */
  5252. #define MC_CMD_NVRAM_TEST_OUT_LEN 4
  5253. #define MC_CMD_NVRAM_TEST_OUT_RESULT_OFST 0
  5254. #define MC_CMD_NVRAM_TEST_OUT_RESULT_LEN 4
  5255. /* enum: Passed. */
  5256. #define MC_CMD_NVRAM_TEST_PASS 0x0
  5257. /* enum: Failed. */
  5258. #define MC_CMD_NVRAM_TEST_FAIL 0x1
  5259. /* enum: Not supported. */
  5260. #define MC_CMD_NVRAM_TEST_NOTSUPP 0x2
  5261. /***********************************/
  5262. /* MC_CMD_MRSFP_TWEAK
  5263. * Read status and/or set parameters for the 'mrsfp' driver in mr_rusty builds.
  5264. * I2C I/O expander bits are always read; if equaliser parameters are supplied,
  5265. * they are configured first. Locks required: None. Return code: 0, EINVAL.
  5266. */
  5267. #define MC_CMD_MRSFP_TWEAK 0x4d
  5268. /* MC_CMD_MRSFP_TWEAK_IN_EQ_CONFIG msgrequest */
  5269. #define MC_CMD_MRSFP_TWEAK_IN_EQ_CONFIG_LEN 16
  5270. /* 0-6 low->high de-emph. */
  5271. #define MC_CMD_MRSFP_TWEAK_IN_EQ_CONFIG_TXEQ_LEVEL_OFST 0
  5272. #define MC_CMD_MRSFP_TWEAK_IN_EQ_CONFIG_TXEQ_LEVEL_LEN 4
  5273. /* 0-8 low->high ref.V */
  5274. #define MC_CMD_MRSFP_TWEAK_IN_EQ_CONFIG_TXEQ_DT_CFG_OFST 4
  5275. #define MC_CMD_MRSFP_TWEAK_IN_EQ_CONFIG_TXEQ_DT_CFG_LEN 4
  5276. /* 0-8 0-8 low->high boost */
  5277. #define MC_CMD_MRSFP_TWEAK_IN_EQ_CONFIG_RXEQ_BOOST_OFST 8
  5278. #define MC_CMD_MRSFP_TWEAK_IN_EQ_CONFIG_RXEQ_BOOST_LEN 4
  5279. /* 0-8 low->high ref.V */
  5280. #define MC_CMD_MRSFP_TWEAK_IN_EQ_CONFIG_RXEQ_DT_CFG_OFST 12
  5281. #define MC_CMD_MRSFP_TWEAK_IN_EQ_CONFIG_RXEQ_DT_CFG_LEN 4
  5282. /* MC_CMD_MRSFP_TWEAK_IN_READ_ONLY msgrequest */
  5283. #define MC_CMD_MRSFP_TWEAK_IN_READ_ONLY_LEN 0
  5284. /* MC_CMD_MRSFP_TWEAK_OUT msgresponse */
  5285. #define MC_CMD_MRSFP_TWEAK_OUT_LEN 12
  5286. /* input bits */
  5287. #define MC_CMD_MRSFP_TWEAK_OUT_IOEXP_INPUTS_OFST 0
  5288. #define MC_CMD_MRSFP_TWEAK_OUT_IOEXP_INPUTS_LEN 4
  5289. /* output bits */
  5290. #define MC_CMD_MRSFP_TWEAK_OUT_IOEXP_OUTPUTS_OFST 4
  5291. #define MC_CMD_MRSFP_TWEAK_OUT_IOEXP_OUTPUTS_LEN 4
  5292. /* direction */
  5293. #define MC_CMD_MRSFP_TWEAK_OUT_IOEXP_DIRECTION_OFST 8
  5294. #define MC_CMD_MRSFP_TWEAK_OUT_IOEXP_DIRECTION_LEN 4
  5295. /* enum: Out. */
  5296. #define MC_CMD_MRSFP_TWEAK_OUT_IOEXP_DIRECTION_OUT 0x0
  5297. /* enum: In. */
  5298. #define MC_CMD_MRSFP_TWEAK_OUT_IOEXP_DIRECTION_IN 0x1
  5299. /***********************************/
  5300. /* MC_CMD_SENSOR_SET_LIMS
  5301. * Adjusts the sensor limits. This is a warranty-voiding operation. Returns:
  5302. * ENOENT if the sensor specified does not exist, EINVAL if the limits are out
  5303. * of range.
  5304. */
  5305. #define MC_CMD_SENSOR_SET_LIMS 0x4e
  5306. #define MC_CMD_0x4e_PRIVILEGE_CTG SRIOV_CTG_INSECURE
  5307. /* MC_CMD_SENSOR_SET_LIMS_IN msgrequest */
  5308. #define MC_CMD_SENSOR_SET_LIMS_IN_LEN 20
  5309. #define MC_CMD_SENSOR_SET_LIMS_IN_SENSOR_OFST 0
  5310. #define MC_CMD_SENSOR_SET_LIMS_IN_SENSOR_LEN 4
  5311. /* Enum values, see field(s): */
  5312. /* MC_CMD_SENSOR_INFO/MC_CMD_SENSOR_INFO_OUT/MASK */
  5313. /* interpretation is is sensor-specific. */
  5314. #define MC_CMD_SENSOR_SET_LIMS_IN_LOW0_OFST 4
  5315. #define MC_CMD_SENSOR_SET_LIMS_IN_LOW0_LEN 4
  5316. /* interpretation is is sensor-specific. */
  5317. #define MC_CMD_SENSOR_SET_LIMS_IN_HI0_OFST 8
  5318. #define MC_CMD_SENSOR_SET_LIMS_IN_HI0_LEN 4
  5319. /* interpretation is is sensor-specific. */
  5320. #define MC_CMD_SENSOR_SET_LIMS_IN_LOW1_OFST 12
  5321. #define MC_CMD_SENSOR_SET_LIMS_IN_LOW1_LEN 4
  5322. /* interpretation is is sensor-specific. */
  5323. #define MC_CMD_SENSOR_SET_LIMS_IN_HI1_OFST 16
  5324. #define MC_CMD_SENSOR_SET_LIMS_IN_HI1_LEN 4
  5325. /* MC_CMD_SENSOR_SET_LIMS_OUT msgresponse */
  5326. #define MC_CMD_SENSOR_SET_LIMS_OUT_LEN 0
  5327. /***********************************/
  5328. /* MC_CMD_GET_RESOURCE_LIMITS
  5329. */
  5330. #define MC_CMD_GET_RESOURCE_LIMITS 0x4f
  5331. /* MC_CMD_GET_RESOURCE_LIMITS_IN msgrequest */
  5332. #define MC_CMD_GET_RESOURCE_LIMITS_IN_LEN 0
  5333. /* MC_CMD_GET_RESOURCE_LIMITS_OUT msgresponse */
  5334. #define MC_CMD_GET_RESOURCE_LIMITS_OUT_LEN 16
  5335. #define MC_CMD_GET_RESOURCE_LIMITS_OUT_BUFTBL_OFST 0
  5336. #define MC_CMD_GET_RESOURCE_LIMITS_OUT_BUFTBL_LEN 4
  5337. #define MC_CMD_GET_RESOURCE_LIMITS_OUT_EVQ_OFST 4
  5338. #define MC_CMD_GET_RESOURCE_LIMITS_OUT_EVQ_LEN 4
  5339. #define MC_CMD_GET_RESOURCE_LIMITS_OUT_RXQ_OFST 8
  5340. #define MC_CMD_GET_RESOURCE_LIMITS_OUT_RXQ_LEN 4
  5341. #define MC_CMD_GET_RESOURCE_LIMITS_OUT_TXQ_OFST 12
  5342. #define MC_CMD_GET_RESOURCE_LIMITS_OUT_TXQ_LEN 4
  5343. /***********************************/
  5344. /* MC_CMD_NVRAM_PARTITIONS
  5345. * Reads the list of available virtual NVRAM partition types. Locks required:
  5346. * none. Returns: 0, EINVAL (bad type).
  5347. */
  5348. #define MC_CMD_NVRAM_PARTITIONS 0x51
  5349. #define MC_CMD_0x51_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  5350. /* MC_CMD_NVRAM_PARTITIONS_IN msgrequest */
  5351. #define MC_CMD_NVRAM_PARTITIONS_IN_LEN 0
  5352. /* MC_CMD_NVRAM_PARTITIONS_OUT msgresponse */
  5353. #define MC_CMD_NVRAM_PARTITIONS_OUT_LENMIN 4
  5354. #define MC_CMD_NVRAM_PARTITIONS_OUT_LENMAX 252
  5355. #define MC_CMD_NVRAM_PARTITIONS_OUT_LEN(num) (4+4*(num))
  5356. /* total number of partitions */
  5357. #define MC_CMD_NVRAM_PARTITIONS_OUT_NUM_PARTITIONS_OFST 0
  5358. #define MC_CMD_NVRAM_PARTITIONS_OUT_NUM_PARTITIONS_LEN 4
  5359. /* type ID code for each of NUM_PARTITIONS partitions */
  5360. #define MC_CMD_NVRAM_PARTITIONS_OUT_TYPE_ID_OFST 4
  5361. #define MC_CMD_NVRAM_PARTITIONS_OUT_TYPE_ID_LEN 4
  5362. #define MC_CMD_NVRAM_PARTITIONS_OUT_TYPE_ID_MINNUM 0
  5363. #define MC_CMD_NVRAM_PARTITIONS_OUT_TYPE_ID_MAXNUM 62
  5364. /***********************************/
  5365. /* MC_CMD_NVRAM_METADATA
  5366. * Reads soft metadata for a virtual NVRAM partition type. Locks required:
  5367. * none. Returns: 0, EINVAL (bad type).
  5368. */
  5369. #define MC_CMD_NVRAM_METADATA 0x52
  5370. #define MC_CMD_0x52_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  5371. /* MC_CMD_NVRAM_METADATA_IN msgrequest */
  5372. #define MC_CMD_NVRAM_METADATA_IN_LEN 4
  5373. /* Partition type ID code */
  5374. #define MC_CMD_NVRAM_METADATA_IN_TYPE_OFST 0
  5375. #define MC_CMD_NVRAM_METADATA_IN_TYPE_LEN 4
  5376. /* MC_CMD_NVRAM_METADATA_OUT msgresponse */
  5377. #define MC_CMD_NVRAM_METADATA_OUT_LENMIN 20
  5378. #define MC_CMD_NVRAM_METADATA_OUT_LENMAX 252
  5379. #define MC_CMD_NVRAM_METADATA_OUT_LEN(num) (20+1*(num))
  5380. /* Partition type ID code */
  5381. #define MC_CMD_NVRAM_METADATA_OUT_TYPE_OFST 0
  5382. #define MC_CMD_NVRAM_METADATA_OUT_TYPE_LEN 4
  5383. #define MC_CMD_NVRAM_METADATA_OUT_FLAGS_OFST 4
  5384. #define MC_CMD_NVRAM_METADATA_OUT_FLAGS_LEN 4
  5385. #define MC_CMD_NVRAM_METADATA_OUT_SUBTYPE_VALID_LBN 0
  5386. #define MC_CMD_NVRAM_METADATA_OUT_SUBTYPE_VALID_WIDTH 1
  5387. #define MC_CMD_NVRAM_METADATA_OUT_VERSION_VALID_LBN 1
  5388. #define MC_CMD_NVRAM_METADATA_OUT_VERSION_VALID_WIDTH 1
  5389. #define MC_CMD_NVRAM_METADATA_OUT_DESCRIPTION_VALID_LBN 2
  5390. #define MC_CMD_NVRAM_METADATA_OUT_DESCRIPTION_VALID_WIDTH 1
  5391. /* Subtype ID code for content of this partition */
  5392. #define MC_CMD_NVRAM_METADATA_OUT_SUBTYPE_OFST 8
  5393. #define MC_CMD_NVRAM_METADATA_OUT_SUBTYPE_LEN 4
  5394. /* 1st component of W.X.Y.Z version number for content of this partition */
  5395. #define MC_CMD_NVRAM_METADATA_OUT_VERSION_W_OFST 12
  5396. #define MC_CMD_NVRAM_METADATA_OUT_VERSION_W_LEN 2
  5397. /* 2nd component of W.X.Y.Z version number for content of this partition */
  5398. #define MC_CMD_NVRAM_METADATA_OUT_VERSION_X_OFST 14
  5399. #define MC_CMD_NVRAM_METADATA_OUT_VERSION_X_LEN 2
  5400. /* 3rd component of W.X.Y.Z version number for content of this partition */
  5401. #define MC_CMD_NVRAM_METADATA_OUT_VERSION_Y_OFST 16
  5402. #define MC_CMD_NVRAM_METADATA_OUT_VERSION_Y_LEN 2
  5403. /* 4th component of W.X.Y.Z version number for content of this partition */
  5404. #define MC_CMD_NVRAM_METADATA_OUT_VERSION_Z_OFST 18
  5405. #define MC_CMD_NVRAM_METADATA_OUT_VERSION_Z_LEN 2
  5406. /* Zero-terminated string describing the content of this partition */
  5407. #define MC_CMD_NVRAM_METADATA_OUT_DESCRIPTION_OFST 20
  5408. #define MC_CMD_NVRAM_METADATA_OUT_DESCRIPTION_LEN 1
  5409. #define MC_CMD_NVRAM_METADATA_OUT_DESCRIPTION_MINNUM 0
  5410. #define MC_CMD_NVRAM_METADATA_OUT_DESCRIPTION_MAXNUM 232
  5411. /***********************************/
  5412. /* MC_CMD_GET_MAC_ADDRESSES
  5413. * Returns the base MAC, count and stride for the requesting function
  5414. */
  5415. #define MC_CMD_GET_MAC_ADDRESSES 0x55
  5416. #define MC_CMD_0x55_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5417. /* MC_CMD_GET_MAC_ADDRESSES_IN msgrequest */
  5418. #define MC_CMD_GET_MAC_ADDRESSES_IN_LEN 0
  5419. /* MC_CMD_GET_MAC_ADDRESSES_OUT msgresponse */
  5420. #define MC_CMD_GET_MAC_ADDRESSES_OUT_LEN 16
  5421. /* Base MAC address */
  5422. #define MC_CMD_GET_MAC_ADDRESSES_OUT_MAC_ADDR_BASE_OFST 0
  5423. #define MC_CMD_GET_MAC_ADDRESSES_OUT_MAC_ADDR_BASE_LEN 6
  5424. /* Padding */
  5425. #define MC_CMD_GET_MAC_ADDRESSES_OUT_RESERVED_OFST 6
  5426. #define MC_CMD_GET_MAC_ADDRESSES_OUT_RESERVED_LEN 2
  5427. /* Number of allocated MAC addresses */
  5428. #define MC_CMD_GET_MAC_ADDRESSES_OUT_MAC_COUNT_OFST 8
  5429. #define MC_CMD_GET_MAC_ADDRESSES_OUT_MAC_COUNT_LEN 4
  5430. /* Spacing of allocated MAC addresses */
  5431. #define MC_CMD_GET_MAC_ADDRESSES_OUT_MAC_STRIDE_OFST 12
  5432. #define MC_CMD_GET_MAC_ADDRESSES_OUT_MAC_STRIDE_LEN 4
  5433. /***********************************/
  5434. /* MC_CMD_CLP
  5435. * Perform a CLP related operation
  5436. */
  5437. #define MC_CMD_CLP 0x56
  5438. #define MC_CMD_0x56_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  5439. /* MC_CMD_CLP_IN msgrequest */
  5440. #define MC_CMD_CLP_IN_LEN 4
  5441. /* Sub operation */
  5442. #define MC_CMD_CLP_IN_OP_OFST 0
  5443. #define MC_CMD_CLP_IN_OP_LEN 4
  5444. /* enum: Return to factory default settings */
  5445. #define MC_CMD_CLP_OP_DEFAULT 0x1
  5446. /* enum: Set MAC address */
  5447. #define MC_CMD_CLP_OP_SET_MAC 0x2
  5448. /* enum: Get MAC address */
  5449. #define MC_CMD_CLP_OP_GET_MAC 0x3
  5450. /* enum: Set UEFI/GPXE boot mode */
  5451. #define MC_CMD_CLP_OP_SET_BOOT 0x4
  5452. /* enum: Get UEFI/GPXE boot mode */
  5453. #define MC_CMD_CLP_OP_GET_BOOT 0x5
  5454. /* MC_CMD_CLP_OUT msgresponse */
  5455. #define MC_CMD_CLP_OUT_LEN 0
  5456. /* MC_CMD_CLP_IN_DEFAULT msgrequest */
  5457. #define MC_CMD_CLP_IN_DEFAULT_LEN 4
  5458. /* MC_CMD_CLP_IN_OP_OFST 0 */
  5459. /* MC_CMD_CLP_IN_OP_LEN 4 */
  5460. /* MC_CMD_CLP_OUT_DEFAULT msgresponse */
  5461. #define MC_CMD_CLP_OUT_DEFAULT_LEN 0
  5462. /* MC_CMD_CLP_IN_SET_MAC msgrequest */
  5463. #define MC_CMD_CLP_IN_SET_MAC_LEN 12
  5464. /* MC_CMD_CLP_IN_OP_OFST 0 */
  5465. /* MC_CMD_CLP_IN_OP_LEN 4 */
  5466. /* MAC address assigned to port */
  5467. #define MC_CMD_CLP_IN_SET_MAC_ADDR_OFST 4
  5468. #define MC_CMD_CLP_IN_SET_MAC_ADDR_LEN 6
  5469. /* Padding */
  5470. #define MC_CMD_CLP_IN_SET_MAC_RESERVED_OFST 10
  5471. #define MC_CMD_CLP_IN_SET_MAC_RESERVED_LEN 2
  5472. /* MC_CMD_CLP_OUT_SET_MAC msgresponse */
  5473. #define MC_CMD_CLP_OUT_SET_MAC_LEN 0
  5474. /* MC_CMD_CLP_IN_GET_MAC msgrequest */
  5475. #define MC_CMD_CLP_IN_GET_MAC_LEN 4
  5476. /* MC_CMD_CLP_IN_OP_OFST 0 */
  5477. /* MC_CMD_CLP_IN_OP_LEN 4 */
  5478. /* MC_CMD_CLP_OUT_GET_MAC msgresponse */
  5479. #define MC_CMD_CLP_OUT_GET_MAC_LEN 8
  5480. /* MAC address assigned to port */
  5481. #define MC_CMD_CLP_OUT_GET_MAC_ADDR_OFST 0
  5482. #define MC_CMD_CLP_OUT_GET_MAC_ADDR_LEN 6
  5483. /* Padding */
  5484. #define MC_CMD_CLP_OUT_GET_MAC_RESERVED_OFST 6
  5485. #define MC_CMD_CLP_OUT_GET_MAC_RESERVED_LEN 2
  5486. /* MC_CMD_CLP_IN_SET_BOOT msgrequest */
  5487. #define MC_CMD_CLP_IN_SET_BOOT_LEN 5
  5488. /* MC_CMD_CLP_IN_OP_OFST 0 */
  5489. /* MC_CMD_CLP_IN_OP_LEN 4 */
  5490. /* Boot flag */
  5491. #define MC_CMD_CLP_IN_SET_BOOT_FLAG_OFST 4
  5492. #define MC_CMD_CLP_IN_SET_BOOT_FLAG_LEN 1
  5493. /* MC_CMD_CLP_OUT_SET_BOOT msgresponse */
  5494. #define MC_CMD_CLP_OUT_SET_BOOT_LEN 0
  5495. /* MC_CMD_CLP_IN_GET_BOOT msgrequest */
  5496. #define MC_CMD_CLP_IN_GET_BOOT_LEN 4
  5497. /* MC_CMD_CLP_IN_OP_OFST 0 */
  5498. /* MC_CMD_CLP_IN_OP_LEN 4 */
  5499. /* MC_CMD_CLP_OUT_GET_BOOT msgresponse */
  5500. #define MC_CMD_CLP_OUT_GET_BOOT_LEN 4
  5501. /* Boot flag */
  5502. #define MC_CMD_CLP_OUT_GET_BOOT_FLAG_OFST 0
  5503. #define MC_CMD_CLP_OUT_GET_BOOT_FLAG_LEN 1
  5504. /* Padding */
  5505. #define MC_CMD_CLP_OUT_GET_BOOT_RESERVED_OFST 1
  5506. #define MC_CMD_CLP_OUT_GET_BOOT_RESERVED_LEN 3
  5507. /***********************************/
  5508. /* MC_CMD_MUM
  5509. * Perform a MUM operation
  5510. */
  5511. #define MC_CMD_MUM 0x57
  5512. #define MC_CMD_0x57_PRIVILEGE_CTG SRIOV_CTG_INSECURE
  5513. /* MC_CMD_MUM_IN msgrequest */
  5514. #define MC_CMD_MUM_IN_LEN 4
  5515. #define MC_CMD_MUM_IN_OP_HDR_OFST 0
  5516. #define MC_CMD_MUM_IN_OP_HDR_LEN 4
  5517. #define MC_CMD_MUM_IN_OP_LBN 0
  5518. #define MC_CMD_MUM_IN_OP_WIDTH 8
  5519. /* enum: NULL MCDI command to MUM */
  5520. #define MC_CMD_MUM_OP_NULL 0x1
  5521. /* enum: Get MUM version */
  5522. #define MC_CMD_MUM_OP_GET_VERSION 0x2
  5523. /* enum: Issue raw I2C command to MUM */
  5524. #define MC_CMD_MUM_OP_RAW_CMD 0x3
  5525. /* enum: Read from registers on devices connected to MUM. */
  5526. #define MC_CMD_MUM_OP_READ 0x4
  5527. /* enum: Write to registers on devices connected to MUM. */
  5528. #define MC_CMD_MUM_OP_WRITE 0x5
  5529. /* enum: Control UART logging. */
  5530. #define MC_CMD_MUM_OP_LOG 0x6
  5531. /* enum: Operations on MUM GPIO lines */
  5532. #define MC_CMD_MUM_OP_GPIO 0x7
  5533. /* enum: Get sensor readings from MUM */
  5534. #define MC_CMD_MUM_OP_READ_SENSORS 0x8
  5535. /* enum: Initiate clock programming on the MUM */
  5536. #define MC_CMD_MUM_OP_PROGRAM_CLOCKS 0x9
  5537. /* enum: Initiate FPGA load from flash on the MUM */
  5538. #define MC_CMD_MUM_OP_FPGA_LOAD 0xa
  5539. /* enum: Request sensor reading from MUM ADC resulting from earlier request via
  5540. * MUM ATB
  5541. */
  5542. #define MC_CMD_MUM_OP_READ_ATB_SENSOR 0xb
  5543. /* enum: Send commands relating to the QSFP ports via the MUM for PHY
  5544. * operations
  5545. */
  5546. #define MC_CMD_MUM_OP_QSFP 0xc
  5547. /* enum: Request discrete and SODIMM DDR info (type, size, speed grade, voltage
  5548. * level) from MUM
  5549. */
  5550. #define MC_CMD_MUM_OP_READ_DDR_INFO 0xd
  5551. /* MC_CMD_MUM_IN_NULL msgrequest */
  5552. #define MC_CMD_MUM_IN_NULL_LEN 4
  5553. /* MUM cmd header */
  5554. #define MC_CMD_MUM_IN_CMD_OFST 0
  5555. #define MC_CMD_MUM_IN_CMD_LEN 4
  5556. /* MC_CMD_MUM_IN_GET_VERSION msgrequest */
  5557. #define MC_CMD_MUM_IN_GET_VERSION_LEN 4
  5558. /* MUM cmd header */
  5559. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  5560. /* MC_CMD_MUM_IN_CMD_LEN 4 */
  5561. /* MC_CMD_MUM_IN_READ msgrequest */
  5562. #define MC_CMD_MUM_IN_READ_LEN 16
  5563. /* MUM cmd header */
  5564. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  5565. /* MC_CMD_MUM_IN_CMD_LEN 4 */
  5566. /* ID of (device connected to MUM) to read from registers of */
  5567. #define MC_CMD_MUM_IN_READ_DEVICE_OFST 4
  5568. #define MC_CMD_MUM_IN_READ_DEVICE_LEN 4
  5569. /* enum: Hittite HMC1035 clock generator on Sorrento board */
  5570. #define MC_CMD_MUM_DEV_HITTITE 0x1
  5571. /* enum: Hittite HMC1035 clock generator for NIC-side on Sorrento board */
  5572. #define MC_CMD_MUM_DEV_HITTITE_NIC 0x2
  5573. /* 32-bit address to read from */
  5574. #define MC_CMD_MUM_IN_READ_ADDR_OFST 8
  5575. #define MC_CMD_MUM_IN_READ_ADDR_LEN 4
  5576. /* Number of words to read. */
  5577. #define MC_CMD_MUM_IN_READ_NUMWORDS_OFST 12
  5578. #define MC_CMD_MUM_IN_READ_NUMWORDS_LEN 4
  5579. /* MC_CMD_MUM_IN_WRITE msgrequest */
  5580. #define MC_CMD_MUM_IN_WRITE_LENMIN 16
  5581. #define MC_CMD_MUM_IN_WRITE_LENMAX 252
  5582. #define MC_CMD_MUM_IN_WRITE_LEN(num) (12+4*(num))
  5583. /* MUM cmd header */
  5584. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  5585. /* MC_CMD_MUM_IN_CMD_LEN 4 */
  5586. /* ID of (device connected to MUM) to write to registers of */
  5587. #define MC_CMD_MUM_IN_WRITE_DEVICE_OFST 4
  5588. #define MC_CMD_MUM_IN_WRITE_DEVICE_LEN 4
  5589. /* enum: Hittite HMC1035 clock generator on Sorrento board */
  5590. /* MC_CMD_MUM_DEV_HITTITE 0x1 */
  5591. /* 32-bit address to write to */
  5592. #define MC_CMD_MUM_IN_WRITE_ADDR_OFST 8
  5593. #define MC_CMD_MUM_IN_WRITE_ADDR_LEN 4
  5594. /* Words to write */
  5595. #define MC_CMD_MUM_IN_WRITE_BUFFER_OFST 12
  5596. #define MC_CMD_MUM_IN_WRITE_BUFFER_LEN 4
  5597. #define MC_CMD_MUM_IN_WRITE_BUFFER_MINNUM 1
  5598. #define MC_CMD_MUM_IN_WRITE_BUFFER_MAXNUM 60
  5599. /* MC_CMD_MUM_IN_RAW_CMD msgrequest */
  5600. #define MC_CMD_MUM_IN_RAW_CMD_LENMIN 17
  5601. #define MC_CMD_MUM_IN_RAW_CMD_LENMAX 252
  5602. #define MC_CMD_MUM_IN_RAW_CMD_LEN(num) (16+1*(num))
  5603. /* MUM cmd header */
  5604. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  5605. /* MC_CMD_MUM_IN_CMD_LEN 4 */
  5606. /* MUM I2C cmd code */
  5607. #define MC_CMD_MUM_IN_RAW_CMD_CMD_CODE_OFST 4
  5608. #define MC_CMD_MUM_IN_RAW_CMD_CMD_CODE_LEN 4
  5609. /* Number of bytes to write */
  5610. #define MC_CMD_MUM_IN_RAW_CMD_NUM_WRITE_OFST 8
  5611. #define MC_CMD_MUM_IN_RAW_CMD_NUM_WRITE_LEN 4
  5612. /* Number of bytes to read */
  5613. #define MC_CMD_MUM_IN_RAW_CMD_NUM_READ_OFST 12
  5614. #define MC_CMD_MUM_IN_RAW_CMD_NUM_READ_LEN 4
  5615. /* Bytes to write */
  5616. #define MC_CMD_MUM_IN_RAW_CMD_WRITE_DATA_OFST 16
  5617. #define MC_CMD_MUM_IN_RAW_CMD_WRITE_DATA_LEN 1
  5618. #define MC_CMD_MUM_IN_RAW_CMD_WRITE_DATA_MINNUM 1
  5619. #define MC_CMD_MUM_IN_RAW_CMD_WRITE_DATA_MAXNUM 236
  5620. /* MC_CMD_MUM_IN_LOG msgrequest */
  5621. #define MC_CMD_MUM_IN_LOG_LEN 8
  5622. /* MUM cmd header */
  5623. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  5624. /* MC_CMD_MUM_IN_CMD_LEN 4 */
  5625. #define MC_CMD_MUM_IN_LOG_OP_OFST 4
  5626. #define MC_CMD_MUM_IN_LOG_OP_LEN 4
  5627. #define MC_CMD_MUM_IN_LOG_OP_UART 0x1 /* enum */
  5628. /* MC_CMD_MUM_IN_LOG_OP_UART msgrequest */
  5629. #define MC_CMD_MUM_IN_LOG_OP_UART_LEN 12
  5630. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  5631. /* MC_CMD_MUM_IN_CMD_LEN 4 */
  5632. /* MC_CMD_MUM_IN_LOG_OP_OFST 4 */
  5633. /* MC_CMD_MUM_IN_LOG_OP_LEN 4 */
  5634. /* Enable/disable debug output to UART */
  5635. #define MC_CMD_MUM_IN_LOG_OP_UART_ENABLE_OFST 8
  5636. #define MC_CMD_MUM_IN_LOG_OP_UART_ENABLE_LEN 4
  5637. /* MC_CMD_MUM_IN_GPIO msgrequest */
  5638. #define MC_CMD_MUM_IN_GPIO_LEN 8
  5639. /* MUM cmd header */
  5640. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  5641. /* MC_CMD_MUM_IN_CMD_LEN 4 */
  5642. #define MC_CMD_MUM_IN_GPIO_HDR_OFST 4
  5643. #define MC_CMD_MUM_IN_GPIO_HDR_LEN 4
  5644. #define MC_CMD_MUM_IN_GPIO_OPCODE_LBN 0
  5645. #define MC_CMD_MUM_IN_GPIO_OPCODE_WIDTH 8
  5646. #define MC_CMD_MUM_IN_GPIO_IN_READ 0x0 /* enum */
  5647. #define MC_CMD_MUM_IN_GPIO_OUT_WRITE 0x1 /* enum */
  5648. #define MC_CMD_MUM_IN_GPIO_OUT_READ 0x2 /* enum */
  5649. #define MC_CMD_MUM_IN_GPIO_OUT_ENABLE_WRITE 0x3 /* enum */
  5650. #define MC_CMD_MUM_IN_GPIO_OUT_ENABLE_READ 0x4 /* enum */
  5651. #define MC_CMD_MUM_IN_GPIO_OP 0x5 /* enum */
  5652. /* MC_CMD_MUM_IN_GPIO_IN_READ msgrequest */
  5653. #define MC_CMD_MUM_IN_GPIO_IN_READ_LEN 8
  5654. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  5655. /* MC_CMD_MUM_IN_CMD_LEN 4 */
  5656. #define MC_CMD_MUM_IN_GPIO_IN_READ_HDR_OFST 4
  5657. #define MC_CMD_MUM_IN_GPIO_IN_READ_HDR_LEN 4
  5658. /* MC_CMD_MUM_IN_GPIO_OUT_WRITE msgrequest */
  5659. #define MC_CMD_MUM_IN_GPIO_OUT_WRITE_LEN 16
  5660. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  5661. /* MC_CMD_MUM_IN_CMD_LEN 4 */
  5662. #define MC_CMD_MUM_IN_GPIO_OUT_WRITE_HDR_OFST 4
  5663. #define MC_CMD_MUM_IN_GPIO_OUT_WRITE_HDR_LEN 4
  5664. /* The first 32-bit word to be written to the GPIO OUT register. */
  5665. #define MC_CMD_MUM_IN_GPIO_OUT_WRITE_GPIOMASK1_OFST 8
  5666. #define MC_CMD_MUM_IN_GPIO_OUT_WRITE_GPIOMASK1_LEN 4
  5667. /* The second 32-bit word to be written to the GPIO OUT register. */
  5668. #define MC_CMD_MUM_IN_GPIO_OUT_WRITE_GPIOMASK2_OFST 12
  5669. #define MC_CMD_MUM_IN_GPIO_OUT_WRITE_GPIOMASK2_LEN 4
  5670. /* MC_CMD_MUM_IN_GPIO_OUT_READ msgrequest */
  5671. #define MC_CMD_MUM_IN_GPIO_OUT_READ_LEN 8
  5672. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  5673. /* MC_CMD_MUM_IN_CMD_LEN 4 */
  5674. #define MC_CMD_MUM_IN_GPIO_OUT_READ_HDR_OFST 4
  5675. #define MC_CMD_MUM_IN_GPIO_OUT_READ_HDR_LEN 4
  5676. /* MC_CMD_MUM_IN_GPIO_OUT_ENABLE_WRITE msgrequest */
  5677. #define MC_CMD_MUM_IN_GPIO_OUT_ENABLE_WRITE_LEN 16
  5678. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  5679. /* MC_CMD_MUM_IN_CMD_LEN 4 */
  5680. #define MC_CMD_MUM_IN_GPIO_OUT_ENABLE_WRITE_HDR_OFST 4
  5681. #define MC_CMD_MUM_IN_GPIO_OUT_ENABLE_WRITE_HDR_LEN 4
  5682. /* The first 32-bit word to be written to the GPIO OUT ENABLE register. */
  5683. #define MC_CMD_MUM_IN_GPIO_OUT_ENABLE_WRITE_GPIOMASK1_OFST 8
  5684. #define MC_CMD_MUM_IN_GPIO_OUT_ENABLE_WRITE_GPIOMASK1_LEN 4
  5685. /* The second 32-bit word to be written to the GPIO OUT ENABLE register. */
  5686. #define MC_CMD_MUM_IN_GPIO_OUT_ENABLE_WRITE_GPIOMASK2_OFST 12
  5687. #define MC_CMD_MUM_IN_GPIO_OUT_ENABLE_WRITE_GPIOMASK2_LEN 4
  5688. /* MC_CMD_MUM_IN_GPIO_OUT_ENABLE_READ msgrequest */
  5689. #define MC_CMD_MUM_IN_GPIO_OUT_ENABLE_READ_LEN 8
  5690. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  5691. /* MC_CMD_MUM_IN_CMD_LEN 4 */
  5692. #define MC_CMD_MUM_IN_GPIO_OUT_ENABLE_READ_HDR_OFST 4
  5693. #define MC_CMD_MUM_IN_GPIO_OUT_ENABLE_READ_HDR_LEN 4
  5694. /* MC_CMD_MUM_IN_GPIO_OP msgrequest */
  5695. #define MC_CMD_MUM_IN_GPIO_OP_LEN 8
  5696. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  5697. /* MC_CMD_MUM_IN_CMD_LEN 4 */
  5698. #define MC_CMD_MUM_IN_GPIO_OP_HDR_OFST 4
  5699. #define MC_CMD_MUM_IN_GPIO_OP_HDR_LEN 4
  5700. #define MC_CMD_MUM_IN_GPIO_OP_BITWISE_OP_LBN 8
  5701. #define MC_CMD_MUM_IN_GPIO_OP_BITWISE_OP_WIDTH 8
  5702. #define MC_CMD_MUM_IN_GPIO_OP_OUT_READ 0x0 /* enum */
  5703. #define MC_CMD_MUM_IN_GPIO_OP_OUT_WRITE 0x1 /* enum */
  5704. #define MC_CMD_MUM_IN_GPIO_OP_OUT_CONFIG 0x2 /* enum */
  5705. #define MC_CMD_MUM_IN_GPIO_OP_OUT_ENABLE 0x3 /* enum */
  5706. #define MC_CMD_MUM_IN_GPIO_OP_GPIO_NUMBER_LBN 16
  5707. #define MC_CMD_MUM_IN_GPIO_OP_GPIO_NUMBER_WIDTH 8
  5708. /* MC_CMD_MUM_IN_GPIO_OP_OUT_READ msgrequest */
  5709. #define MC_CMD_MUM_IN_GPIO_OP_OUT_READ_LEN 8
  5710. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  5711. /* MC_CMD_MUM_IN_CMD_LEN 4 */
  5712. #define MC_CMD_MUM_IN_GPIO_OP_OUT_READ_HDR_OFST 4
  5713. #define MC_CMD_MUM_IN_GPIO_OP_OUT_READ_HDR_LEN 4
  5714. /* MC_CMD_MUM_IN_GPIO_OP_OUT_WRITE msgrequest */
  5715. #define MC_CMD_MUM_IN_GPIO_OP_OUT_WRITE_LEN 8
  5716. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  5717. /* MC_CMD_MUM_IN_CMD_LEN 4 */
  5718. #define MC_CMD_MUM_IN_GPIO_OP_OUT_WRITE_HDR_OFST 4
  5719. #define MC_CMD_MUM_IN_GPIO_OP_OUT_WRITE_HDR_LEN 4
  5720. #define MC_CMD_MUM_IN_GPIO_OP_OUT_WRITE_WRITEBIT_LBN 24
  5721. #define MC_CMD_MUM_IN_GPIO_OP_OUT_WRITE_WRITEBIT_WIDTH 8
  5722. /* MC_CMD_MUM_IN_GPIO_OP_OUT_CONFIG msgrequest */
  5723. #define MC_CMD_MUM_IN_GPIO_OP_OUT_CONFIG_LEN 8
  5724. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  5725. /* MC_CMD_MUM_IN_CMD_LEN 4 */
  5726. #define MC_CMD_MUM_IN_GPIO_OP_OUT_CONFIG_HDR_OFST 4
  5727. #define MC_CMD_MUM_IN_GPIO_OP_OUT_CONFIG_HDR_LEN 4
  5728. #define MC_CMD_MUM_IN_GPIO_OP_OUT_CONFIG_CFG_LBN 24
  5729. #define MC_CMD_MUM_IN_GPIO_OP_OUT_CONFIG_CFG_WIDTH 8
  5730. /* MC_CMD_MUM_IN_GPIO_OP_OUT_ENABLE msgrequest */
  5731. #define MC_CMD_MUM_IN_GPIO_OP_OUT_ENABLE_LEN 8
  5732. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  5733. /* MC_CMD_MUM_IN_CMD_LEN 4 */
  5734. #define MC_CMD_MUM_IN_GPIO_OP_OUT_ENABLE_HDR_OFST 4
  5735. #define MC_CMD_MUM_IN_GPIO_OP_OUT_ENABLE_HDR_LEN 4
  5736. #define MC_CMD_MUM_IN_GPIO_OP_OUT_ENABLE_ENABLEBIT_LBN 24
  5737. #define MC_CMD_MUM_IN_GPIO_OP_OUT_ENABLE_ENABLEBIT_WIDTH 8
  5738. /* MC_CMD_MUM_IN_READ_SENSORS msgrequest */
  5739. #define MC_CMD_MUM_IN_READ_SENSORS_LEN 8
  5740. /* MUM cmd header */
  5741. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  5742. /* MC_CMD_MUM_IN_CMD_LEN 4 */
  5743. #define MC_CMD_MUM_IN_READ_SENSORS_PARAMS_OFST 4
  5744. #define MC_CMD_MUM_IN_READ_SENSORS_PARAMS_LEN 4
  5745. #define MC_CMD_MUM_IN_READ_SENSORS_SENSOR_ID_LBN 0
  5746. #define MC_CMD_MUM_IN_READ_SENSORS_SENSOR_ID_WIDTH 8
  5747. #define MC_CMD_MUM_IN_READ_SENSORS_NUM_SENSORS_LBN 8
  5748. #define MC_CMD_MUM_IN_READ_SENSORS_NUM_SENSORS_WIDTH 8
  5749. /* MC_CMD_MUM_IN_PROGRAM_CLOCKS msgrequest */
  5750. #define MC_CMD_MUM_IN_PROGRAM_CLOCKS_LEN 12
  5751. /* MUM cmd header */
  5752. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  5753. /* MC_CMD_MUM_IN_CMD_LEN 4 */
  5754. /* Bit-mask of clocks to be programmed */
  5755. #define MC_CMD_MUM_IN_PROGRAM_CLOCKS_MASK_OFST 4
  5756. #define MC_CMD_MUM_IN_PROGRAM_CLOCKS_MASK_LEN 4
  5757. #define MC_CMD_MUM_CLOCK_ID_FPGA 0x0 /* enum */
  5758. #define MC_CMD_MUM_CLOCK_ID_DDR 0x1 /* enum */
  5759. #define MC_CMD_MUM_CLOCK_ID_NIC 0x2 /* enum */
  5760. /* Control flags for clock programming */
  5761. #define MC_CMD_MUM_IN_PROGRAM_CLOCKS_FLAGS_OFST 8
  5762. #define MC_CMD_MUM_IN_PROGRAM_CLOCKS_FLAGS_LEN 4
  5763. #define MC_CMD_MUM_IN_PROGRAM_CLOCKS_OVERCLOCK_110_LBN 0
  5764. #define MC_CMD_MUM_IN_PROGRAM_CLOCKS_OVERCLOCK_110_WIDTH 1
  5765. #define MC_CMD_MUM_IN_PROGRAM_CLOCKS_CLOCK_NIC_FROM_FPGA_LBN 1
  5766. #define MC_CMD_MUM_IN_PROGRAM_CLOCKS_CLOCK_NIC_FROM_FPGA_WIDTH 1
  5767. #define MC_CMD_MUM_IN_PROGRAM_CLOCKS_CLOCK_REF_FROM_XO_LBN 2
  5768. #define MC_CMD_MUM_IN_PROGRAM_CLOCKS_CLOCK_REF_FROM_XO_WIDTH 1
  5769. /* MC_CMD_MUM_IN_FPGA_LOAD msgrequest */
  5770. #define MC_CMD_MUM_IN_FPGA_LOAD_LEN 8
  5771. /* MUM cmd header */
  5772. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  5773. /* MC_CMD_MUM_IN_CMD_LEN 4 */
  5774. /* Enable/Disable FPGA config from flash */
  5775. #define MC_CMD_MUM_IN_FPGA_LOAD_ENABLE_OFST 4
  5776. #define MC_CMD_MUM_IN_FPGA_LOAD_ENABLE_LEN 4
  5777. /* MC_CMD_MUM_IN_READ_ATB_SENSOR msgrequest */
  5778. #define MC_CMD_MUM_IN_READ_ATB_SENSOR_LEN 4
  5779. /* MUM cmd header */
  5780. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  5781. /* MC_CMD_MUM_IN_CMD_LEN 4 */
  5782. /* MC_CMD_MUM_IN_QSFP msgrequest */
  5783. #define MC_CMD_MUM_IN_QSFP_LEN 12
  5784. /* MUM cmd header */
  5785. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  5786. /* MC_CMD_MUM_IN_CMD_LEN 4 */
  5787. #define MC_CMD_MUM_IN_QSFP_HDR_OFST 4
  5788. #define MC_CMD_MUM_IN_QSFP_HDR_LEN 4
  5789. #define MC_CMD_MUM_IN_QSFP_OPCODE_LBN 0
  5790. #define MC_CMD_MUM_IN_QSFP_OPCODE_WIDTH 4
  5791. #define MC_CMD_MUM_IN_QSFP_INIT 0x0 /* enum */
  5792. #define MC_CMD_MUM_IN_QSFP_RECONFIGURE 0x1 /* enum */
  5793. #define MC_CMD_MUM_IN_QSFP_GET_SUPPORTED_CAP 0x2 /* enum */
  5794. #define MC_CMD_MUM_IN_QSFP_GET_MEDIA_INFO 0x3 /* enum */
  5795. #define MC_CMD_MUM_IN_QSFP_FILL_STATS 0x4 /* enum */
  5796. #define MC_CMD_MUM_IN_QSFP_POLL_BIST 0x5 /* enum */
  5797. #define MC_CMD_MUM_IN_QSFP_IDX_OFST 8
  5798. #define MC_CMD_MUM_IN_QSFP_IDX_LEN 4
  5799. /* MC_CMD_MUM_IN_QSFP_INIT msgrequest */
  5800. #define MC_CMD_MUM_IN_QSFP_INIT_LEN 16
  5801. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  5802. /* MC_CMD_MUM_IN_CMD_LEN 4 */
  5803. #define MC_CMD_MUM_IN_QSFP_INIT_HDR_OFST 4
  5804. #define MC_CMD_MUM_IN_QSFP_INIT_HDR_LEN 4
  5805. #define MC_CMD_MUM_IN_QSFP_INIT_IDX_OFST 8
  5806. #define MC_CMD_MUM_IN_QSFP_INIT_IDX_LEN 4
  5807. #define MC_CMD_MUM_IN_QSFP_INIT_CAGE_OFST 12
  5808. #define MC_CMD_MUM_IN_QSFP_INIT_CAGE_LEN 4
  5809. /* MC_CMD_MUM_IN_QSFP_RECONFIGURE msgrequest */
  5810. #define MC_CMD_MUM_IN_QSFP_RECONFIGURE_LEN 24
  5811. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  5812. /* MC_CMD_MUM_IN_CMD_LEN 4 */
  5813. #define MC_CMD_MUM_IN_QSFP_RECONFIGURE_HDR_OFST 4
  5814. #define MC_CMD_MUM_IN_QSFP_RECONFIGURE_HDR_LEN 4
  5815. #define MC_CMD_MUM_IN_QSFP_RECONFIGURE_IDX_OFST 8
  5816. #define MC_CMD_MUM_IN_QSFP_RECONFIGURE_IDX_LEN 4
  5817. #define MC_CMD_MUM_IN_QSFP_RECONFIGURE_TX_DISABLE_OFST 12
  5818. #define MC_CMD_MUM_IN_QSFP_RECONFIGURE_TX_DISABLE_LEN 4
  5819. #define MC_CMD_MUM_IN_QSFP_RECONFIGURE_PORT_LANES_OFST 16
  5820. #define MC_CMD_MUM_IN_QSFP_RECONFIGURE_PORT_LANES_LEN 4
  5821. #define MC_CMD_MUM_IN_QSFP_RECONFIGURE_PORT_LINK_SPEED_OFST 20
  5822. #define MC_CMD_MUM_IN_QSFP_RECONFIGURE_PORT_LINK_SPEED_LEN 4
  5823. /* MC_CMD_MUM_IN_QSFP_GET_SUPPORTED_CAP msgrequest */
  5824. #define MC_CMD_MUM_IN_QSFP_GET_SUPPORTED_CAP_LEN 12
  5825. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  5826. /* MC_CMD_MUM_IN_CMD_LEN 4 */
  5827. #define MC_CMD_MUM_IN_QSFP_GET_SUPPORTED_CAP_HDR_OFST 4
  5828. #define MC_CMD_MUM_IN_QSFP_GET_SUPPORTED_CAP_HDR_LEN 4
  5829. #define MC_CMD_MUM_IN_QSFP_GET_SUPPORTED_CAP_IDX_OFST 8
  5830. #define MC_CMD_MUM_IN_QSFP_GET_SUPPORTED_CAP_IDX_LEN 4
  5831. /* MC_CMD_MUM_IN_QSFP_GET_MEDIA_INFO msgrequest */
  5832. #define MC_CMD_MUM_IN_QSFP_GET_MEDIA_INFO_LEN 16
  5833. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  5834. /* MC_CMD_MUM_IN_CMD_LEN 4 */
  5835. #define MC_CMD_MUM_IN_QSFP_GET_MEDIA_INFO_HDR_OFST 4
  5836. #define MC_CMD_MUM_IN_QSFP_GET_MEDIA_INFO_HDR_LEN 4
  5837. #define MC_CMD_MUM_IN_QSFP_GET_MEDIA_INFO_IDX_OFST 8
  5838. #define MC_CMD_MUM_IN_QSFP_GET_MEDIA_INFO_IDX_LEN 4
  5839. #define MC_CMD_MUM_IN_QSFP_GET_MEDIA_INFO_PAGE_OFST 12
  5840. #define MC_CMD_MUM_IN_QSFP_GET_MEDIA_INFO_PAGE_LEN 4
  5841. /* MC_CMD_MUM_IN_QSFP_FILL_STATS msgrequest */
  5842. #define MC_CMD_MUM_IN_QSFP_FILL_STATS_LEN 12
  5843. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  5844. /* MC_CMD_MUM_IN_CMD_LEN 4 */
  5845. #define MC_CMD_MUM_IN_QSFP_FILL_STATS_HDR_OFST 4
  5846. #define MC_CMD_MUM_IN_QSFP_FILL_STATS_HDR_LEN 4
  5847. #define MC_CMD_MUM_IN_QSFP_FILL_STATS_IDX_OFST 8
  5848. #define MC_CMD_MUM_IN_QSFP_FILL_STATS_IDX_LEN 4
  5849. /* MC_CMD_MUM_IN_QSFP_POLL_BIST msgrequest */
  5850. #define MC_CMD_MUM_IN_QSFP_POLL_BIST_LEN 12
  5851. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  5852. /* MC_CMD_MUM_IN_CMD_LEN 4 */
  5853. #define MC_CMD_MUM_IN_QSFP_POLL_BIST_HDR_OFST 4
  5854. #define MC_CMD_MUM_IN_QSFP_POLL_BIST_HDR_LEN 4
  5855. #define MC_CMD_MUM_IN_QSFP_POLL_BIST_IDX_OFST 8
  5856. #define MC_CMD_MUM_IN_QSFP_POLL_BIST_IDX_LEN 4
  5857. /* MC_CMD_MUM_IN_READ_DDR_INFO msgrequest */
  5858. #define MC_CMD_MUM_IN_READ_DDR_INFO_LEN 4
  5859. /* MUM cmd header */
  5860. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  5861. /* MC_CMD_MUM_IN_CMD_LEN 4 */
  5862. /* MC_CMD_MUM_OUT msgresponse */
  5863. #define MC_CMD_MUM_OUT_LEN 0
  5864. /* MC_CMD_MUM_OUT_NULL msgresponse */
  5865. #define MC_CMD_MUM_OUT_NULL_LEN 0
  5866. /* MC_CMD_MUM_OUT_GET_VERSION msgresponse */
  5867. #define MC_CMD_MUM_OUT_GET_VERSION_LEN 12
  5868. #define MC_CMD_MUM_OUT_GET_VERSION_FIRMWARE_OFST 0
  5869. #define MC_CMD_MUM_OUT_GET_VERSION_FIRMWARE_LEN 4
  5870. #define MC_CMD_MUM_OUT_GET_VERSION_VERSION_OFST 4
  5871. #define MC_CMD_MUM_OUT_GET_VERSION_VERSION_LEN 8
  5872. #define MC_CMD_MUM_OUT_GET_VERSION_VERSION_LO_OFST 4
  5873. #define MC_CMD_MUM_OUT_GET_VERSION_VERSION_HI_OFST 8
  5874. /* MC_CMD_MUM_OUT_RAW_CMD msgresponse */
  5875. #define MC_CMD_MUM_OUT_RAW_CMD_LENMIN 1
  5876. #define MC_CMD_MUM_OUT_RAW_CMD_LENMAX 252
  5877. #define MC_CMD_MUM_OUT_RAW_CMD_LEN(num) (0+1*(num))
  5878. /* returned data */
  5879. #define MC_CMD_MUM_OUT_RAW_CMD_DATA_OFST 0
  5880. #define MC_CMD_MUM_OUT_RAW_CMD_DATA_LEN 1
  5881. #define MC_CMD_MUM_OUT_RAW_CMD_DATA_MINNUM 1
  5882. #define MC_CMD_MUM_OUT_RAW_CMD_DATA_MAXNUM 252
  5883. /* MC_CMD_MUM_OUT_READ msgresponse */
  5884. #define MC_CMD_MUM_OUT_READ_LENMIN 4
  5885. #define MC_CMD_MUM_OUT_READ_LENMAX 252
  5886. #define MC_CMD_MUM_OUT_READ_LEN(num) (0+4*(num))
  5887. #define MC_CMD_MUM_OUT_READ_BUFFER_OFST 0
  5888. #define MC_CMD_MUM_OUT_READ_BUFFER_LEN 4
  5889. #define MC_CMD_MUM_OUT_READ_BUFFER_MINNUM 1
  5890. #define MC_CMD_MUM_OUT_READ_BUFFER_MAXNUM 63
  5891. /* MC_CMD_MUM_OUT_WRITE msgresponse */
  5892. #define MC_CMD_MUM_OUT_WRITE_LEN 0
  5893. /* MC_CMD_MUM_OUT_LOG msgresponse */
  5894. #define MC_CMD_MUM_OUT_LOG_LEN 0
  5895. /* MC_CMD_MUM_OUT_LOG_OP_UART msgresponse */
  5896. #define MC_CMD_MUM_OUT_LOG_OP_UART_LEN 0
  5897. /* MC_CMD_MUM_OUT_GPIO_IN_READ msgresponse */
  5898. #define MC_CMD_MUM_OUT_GPIO_IN_READ_LEN 8
  5899. /* The first 32-bit word read from the GPIO IN register. */
  5900. #define MC_CMD_MUM_OUT_GPIO_IN_READ_GPIOMASK1_OFST 0
  5901. #define MC_CMD_MUM_OUT_GPIO_IN_READ_GPIOMASK1_LEN 4
  5902. /* The second 32-bit word read from the GPIO IN register. */
  5903. #define MC_CMD_MUM_OUT_GPIO_IN_READ_GPIOMASK2_OFST 4
  5904. #define MC_CMD_MUM_OUT_GPIO_IN_READ_GPIOMASK2_LEN 4
  5905. /* MC_CMD_MUM_OUT_GPIO_OUT_WRITE msgresponse */
  5906. #define MC_CMD_MUM_OUT_GPIO_OUT_WRITE_LEN 0
  5907. /* MC_CMD_MUM_OUT_GPIO_OUT_READ msgresponse */
  5908. #define MC_CMD_MUM_OUT_GPIO_OUT_READ_LEN 8
  5909. /* The first 32-bit word read from the GPIO OUT register. */
  5910. #define MC_CMD_MUM_OUT_GPIO_OUT_READ_GPIOMASK1_OFST 0
  5911. #define MC_CMD_MUM_OUT_GPIO_OUT_READ_GPIOMASK1_LEN 4
  5912. /* The second 32-bit word read from the GPIO OUT register. */
  5913. #define MC_CMD_MUM_OUT_GPIO_OUT_READ_GPIOMASK2_OFST 4
  5914. #define MC_CMD_MUM_OUT_GPIO_OUT_READ_GPIOMASK2_LEN 4
  5915. /* MC_CMD_MUM_OUT_GPIO_OUT_ENABLE_WRITE msgresponse */
  5916. #define MC_CMD_MUM_OUT_GPIO_OUT_ENABLE_WRITE_LEN 0
  5917. /* MC_CMD_MUM_OUT_GPIO_OUT_ENABLE_READ msgresponse */
  5918. #define MC_CMD_MUM_OUT_GPIO_OUT_ENABLE_READ_LEN 8
  5919. #define MC_CMD_MUM_OUT_GPIO_OUT_ENABLE_READ_GPIOMASK1_OFST 0
  5920. #define MC_CMD_MUM_OUT_GPIO_OUT_ENABLE_READ_GPIOMASK1_LEN 4
  5921. #define MC_CMD_MUM_OUT_GPIO_OUT_ENABLE_READ_GPIOMASK2_OFST 4
  5922. #define MC_CMD_MUM_OUT_GPIO_OUT_ENABLE_READ_GPIOMASK2_LEN 4
  5923. /* MC_CMD_MUM_OUT_GPIO_OP_OUT_READ msgresponse */
  5924. #define MC_CMD_MUM_OUT_GPIO_OP_OUT_READ_LEN 4
  5925. #define MC_CMD_MUM_OUT_GPIO_OP_OUT_READ_BIT_READ_OFST 0
  5926. #define MC_CMD_MUM_OUT_GPIO_OP_OUT_READ_BIT_READ_LEN 4
  5927. /* MC_CMD_MUM_OUT_GPIO_OP_OUT_WRITE msgresponse */
  5928. #define MC_CMD_MUM_OUT_GPIO_OP_OUT_WRITE_LEN 0
  5929. /* MC_CMD_MUM_OUT_GPIO_OP_OUT_CONFIG msgresponse */
  5930. #define MC_CMD_MUM_OUT_GPIO_OP_OUT_CONFIG_LEN 0
  5931. /* MC_CMD_MUM_OUT_GPIO_OP_OUT_ENABLE msgresponse */
  5932. #define MC_CMD_MUM_OUT_GPIO_OP_OUT_ENABLE_LEN 0
  5933. /* MC_CMD_MUM_OUT_READ_SENSORS msgresponse */
  5934. #define MC_CMD_MUM_OUT_READ_SENSORS_LENMIN 4
  5935. #define MC_CMD_MUM_OUT_READ_SENSORS_LENMAX 252
  5936. #define MC_CMD_MUM_OUT_READ_SENSORS_LEN(num) (0+4*(num))
  5937. #define MC_CMD_MUM_OUT_READ_SENSORS_DATA_OFST 0
  5938. #define MC_CMD_MUM_OUT_READ_SENSORS_DATA_LEN 4
  5939. #define MC_CMD_MUM_OUT_READ_SENSORS_DATA_MINNUM 1
  5940. #define MC_CMD_MUM_OUT_READ_SENSORS_DATA_MAXNUM 63
  5941. #define MC_CMD_MUM_OUT_READ_SENSORS_READING_LBN 0
  5942. #define MC_CMD_MUM_OUT_READ_SENSORS_READING_WIDTH 16
  5943. #define MC_CMD_MUM_OUT_READ_SENSORS_STATE_LBN 16
  5944. #define MC_CMD_MUM_OUT_READ_SENSORS_STATE_WIDTH 8
  5945. #define MC_CMD_MUM_OUT_READ_SENSORS_TYPE_LBN 24
  5946. #define MC_CMD_MUM_OUT_READ_SENSORS_TYPE_WIDTH 8
  5947. /* MC_CMD_MUM_OUT_PROGRAM_CLOCKS msgresponse */
  5948. #define MC_CMD_MUM_OUT_PROGRAM_CLOCKS_LEN 4
  5949. #define MC_CMD_MUM_OUT_PROGRAM_CLOCKS_OK_MASK_OFST 0
  5950. #define MC_CMD_MUM_OUT_PROGRAM_CLOCKS_OK_MASK_LEN 4
  5951. /* MC_CMD_MUM_OUT_FPGA_LOAD msgresponse */
  5952. #define MC_CMD_MUM_OUT_FPGA_LOAD_LEN 0
  5953. /* MC_CMD_MUM_OUT_READ_ATB_SENSOR msgresponse */
  5954. #define MC_CMD_MUM_OUT_READ_ATB_SENSOR_LEN 4
  5955. #define MC_CMD_MUM_OUT_READ_ATB_SENSOR_RESULT_OFST 0
  5956. #define MC_CMD_MUM_OUT_READ_ATB_SENSOR_RESULT_LEN 4
  5957. /* MC_CMD_MUM_OUT_QSFP_INIT msgresponse */
  5958. #define MC_CMD_MUM_OUT_QSFP_INIT_LEN 0
  5959. /* MC_CMD_MUM_OUT_QSFP_RECONFIGURE msgresponse */
  5960. #define MC_CMD_MUM_OUT_QSFP_RECONFIGURE_LEN 8
  5961. #define MC_CMD_MUM_OUT_QSFP_RECONFIGURE_PORT_PHY_LP_CAP_OFST 0
  5962. #define MC_CMD_MUM_OUT_QSFP_RECONFIGURE_PORT_PHY_LP_CAP_LEN 4
  5963. #define MC_CMD_MUM_OUT_QSFP_RECONFIGURE_PORT_PHY_FLAGS_OFST 4
  5964. #define MC_CMD_MUM_OUT_QSFP_RECONFIGURE_PORT_PHY_FLAGS_LEN 4
  5965. #define MC_CMD_MUM_OUT_QSFP_RECONFIGURE_PORT_PHY_READY_LBN 0
  5966. #define MC_CMD_MUM_OUT_QSFP_RECONFIGURE_PORT_PHY_READY_WIDTH 1
  5967. #define MC_CMD_MUM_OUT_QSFP_RECONFIGURE_PORT_PHY_LINK_UP_LBN 1
  5968. #define MC_CMD_MUM_OUT_QSFP_RECONFIGURE_PORT_PHY_LINK_UP_WIDTH 1
  5969. /* MC_CMD_MUM_OUT_QSFP_GET_SUPPORTED_CAP msgresponse */
  5970. #define MC_CMD_MUM_OUT_QSFP_GET_SUPPORTED_CAP_LEN 4
  5971. #define MC_CMD_MUM_OUT_QSFP_GET_SUPPORTED_CAP_PORT_PHY_LP_CAP_OFST 0
  5972. #define MC_CMD_MUM_OUT_QSFP_GET_SUPPORTED_CAP_PORT_PHY_LP_CAP_LEN 4
  5973. /* MC_CMD_MUM_OUT_QSFP_GET_MEDIA_INFO msgresponse */
  5974. #define MC_CMD_MUM_OUT_QSFP_GET_MEDIA_INFO_LENMIN 5
  5975. #define MC_CMD_MUM_OUT_QSFP_GET_MEDIA_INFO_LENMAX 252
  5976. #define MC_CMD_MUM_OUT_QSFP_GET_MEDIA_INFO_LEN(num) (4+1*(num))
  5977. /* in bytes */
  5978. #define MC_CMD_MUM_OUT_QSFP_GET_MEDIA_INFO_DATALEN_OFST 0
  5979. #define MC_CMD_MUM_OUT_QSFP_GET_MEDIA_INFO_DATALEN_LEN 4
  5980. #define MC_CMD_MUM_OUT_QSFP_GET_MEDIA_INFO_DATA_OFST 4
  5981. #define MC_CMD_MUM_OUT_QSFP_GET_MEDIA_INFO_DATA_LEN 1
  5982. #define MC_CMD_MUM_OUT_QSFP_GET_MEDIA_INFO_DATA_MINNUM 1
  5983. #define MC_CMD_MUM_OUT_QSFP_GET_MEDIA_INFO_DATA_MAXNUM 248
  5984. /* MC_CMD_MUM_OUT_QSFP_FILL_STATS msgresponse */
  5985. #define MC_CMD_MUM_OUT_QSFP_FILL_STATS_LEN 8
  5986. #define MC_CMD_MUM_OUT_QSFP_FILL_STATS_PORT_PHY_STATS_PMA_PMD_LINK_UP_OFST 0
  5987. #define MC_CMD_MUM_OUT_QSFP_FILL_STATS_PORT_PHY_STATS_PMA_PMD_LINK_UP_LEN 4
  5988. #define MC_CMD_MUM_OUT_QSFP_FILL_STATS_PORT_PHY_STATS_PCS_LINK_UP_OFST 4
  5989. #define MC_CMD_MUM_OUT_QSFP_FILL_STATS_PORT_PHY_STATS_PCS_LINK_UP_LEN 4
  5990. /* MC_CMD_MUM_OUT_QSFP_POLL_BIST msgresponse */
  5991. #define MC_CMD_MUM_OUT_QSFP_POLL_BIST_LEN 4
  5992. #define MC_CMD_MUM_OUT_QSFP_POLL_BIST_TEST_OFST 0
  5993. #define MC_CMD_MUM_OUT_QSFP_POLL_BIST_TEST_LEN 4
  5994. /* MC_CMD_MUM_OUT_READ_DDR_INFO msgresponse */
  5995. #define MC_CMD_MUM_OUT_READ_DDR_INFO_LENMIN 24
  5996. #define MC_CMD_MUM_OUT_READ_DDR_INFO_LENMAX 248
  5997. #define MC_CMD_MUM_OUT_READ_DDR_INFO_LEN(num) (8+8*(num))
  5998. /* Discrete (soldered) DDR resistor strap info */
  5999. #define MC_CMD_MUM_OUT_READ_DDR_INFO_DISCRETE_DDR_INFO_OFST 0
  6000. #define MC_CMD_MUM_OUT_READ_DDR_INFO_DISCRETE_DDR_INFO_LEN 4
  6001. #define MC_CMD_MUM_OUT_READ_DDR_INFO_VRATIO_LBN 0
  6002. #define MC_CMD_MUM_OUT_READ_DDR_INFO_VRATIO_WIDTH 16
  6003. #define MC_CMD_MUM_OUT_READ_DDR_INFO_RESERVED1_LBN 16
  6004. #define MC_CMD_MUM_OUT_READ_DDR_INFO_RESERVED1_WIDTH 16
  6005. /* Number of SODIMM info records */
  6006. #define MC_CMD_MUM_OUT_READ_DDR_INFO_NUM_RECORDS_OFST 4
  6007. #define MC_CMD_MUM_OUT_READ_DDR_INFO_NUM_RECORDS_LEN 4
  6008. /* Array of SODIMM info records */
  6009. #define MC_CMD_MUM_OUT_READ_DDR_INFO_SODIMM_INFO_RECORD_OFST 8
  6010. #define MC_CMD_MUM_OUT_READ_DDR_INFO_SODIMM_INFO_RECORD_LEN 8
  6011. #define MC_CMD_MUM_OUT_READ_DDR_INFO_SODIMM_INFO_RECORD_LO_OFST 8
  6012. #define MC_CMD_MUM_OUT_READ_DDR_INFO_SODIMM_INFO_RECORD_HI_OFST 12
  6013. #define MC_CMD_MUM_OUT_READ_DDR_INFO_SODIMM_INFO_RECORD_MINNUM 2
  6014. #define MC_CMD_MUM_OUT_READ_DDR_INFO_SODIMM_INFO_RECORD_MAXNUM 30
  6015. #define MC_CMD_MUM_OUT_READ_DDR_INFO_BANK_ID_LBN 0
  6016. #define MC_CMD_MUM_OUT_READ_DDR_INFO_BANK_ID_WIDTH 8
  6017. /* enum: SODIMM bank 1 (Top SODIMM for Sorrento) */
  6018. #define MC_CMD_MUM_OUT_READ_DDR_INFO_BANK1 0x0
  6019. /* enum: SODIMM bank 2 (Bottom SODDIMM for Sorrento) */
  6020. #define MC_CMD_MUM_OUT_READ_DDR_INFO_BANK2 0x1
  6021. /* enum: Total number of SODIMM banks */
  6022. #define MC_CMD_MUM_OUT_READ_DDR_INFO_NUM_BANKS 0x2
  6023. #define MC_CMD_MUM_OUT_READ_DDR_INFO_TYPE_LBN 8
  6024. #define MC_CMD_MUM_OUT_READ_DDR_INFO_TYPE_WIDTH 8
  6025. #define MC_CMD_MUM_OUT_READ_DDR_INFO_RANK_LBN 16
  6026. #define MC_CMD_MUM_OUT_READ_DDR_INFO_RANK_WIDTH 4
  6027. #define MC_CMD_MUM_OUT_READ_DDR_INFO_VOLTAGE_LBN 20
  6028. #define MC_CMD_MUM_OUT_READ_DDR_INFO_VOLTAGE_WIDTH 4
  6029. #define MC_CMD_MUM_OUT_READ_DDR_INFO_NOT_POWERED 0x0 /* enum */
  6030. #define MC_CMD_MUM_OUT_READ_DDR_INFO_1V25 0x1 /* enum */
  6031. #define MC_CMD_MUM_OUT_READ_DDR_INFO_1V35 0x2 /* enum */
  6032. #define MC_CMD_MUM_OUT_READ_DDR_INFO_1V5 0x3 /* enum */
  6033. /* enum: Values 5-15 are reserved for future usage */
  6034. #define MC_CMD_MUM_OUT_READ_DDR_INFO_1V8 0x4
  6035. #define MC_CMD_MUM_OUT_READ_DDR_INFO_SIZE_LBN 24
  6036. #define MC_CMD_MUM_OUT_READ_DDR_INFO_SIZE_WIDTH 8
  6037. #define MC_CMD_MUM_OUT_READ_DDR_INFO_SPEED_LBN 32
  6038. #define MC_CMD_MUM_OUT_READ_DDR_INFO_SPEED_WIDTH 16
  6039. #define MC_CMD_MUM_OUT_READ_DDR_INFO_STATE_LBN 48
  6040. #define MC_CMD_MUM_OUT_READ_DDR_INFO_STATE_WIDTH 4
  6041. /* enum: No module present */
  6042. #define MC_CMD_MUM_OUT_READ_DDR_INFO_ABSENT 0x0
  6043. /* enum: Module present supported and powered on */
  6044. #define MC_CMD_MUM_OUT_READ_DDR_INFO_PRESENT_POWERED 0x1
  6045. /* enum: Module present but bad type */
  6046. #define MC_CMD_MUM_OUT_READ_DDR_INFO_PRESENT_BAD_TYPE 0x2
  6047. /* enum: Module present but incompatible voltage */
  6048. #define MC_CMD_MUM_OUT_READ_DDR_INFO_PRESENT_BAD_VOLTAGE 0x3
  6049. /* enum: Module present but unknown SPD */
  6050. #define MC_CMD_MUM_OUT_READ_DDR_INFO_PRESENT_BAD_SPD 0x4
  6051. /* enum: Module present but slot cannot support it */
  6052. #define MC_CMD_MUM_OUT_READ_DDR_INFO_PRESENT_BAD_SLOT 0x5
  6053. /* enum: Modules may or may not be present, but cannot establish contact by I2C
  6054. */
  6055. #define MC_CMD_MUM_OUT_READ_DDR_INFO_NOT_REACHABLE 0x6
  6056. #define MC_CMD_MUM_OUT_READ_DDR_INFO_RESERVED2_LBN 52
  6057. #define MC_CMD_MUM_OUT_READ_DDR_INFO_RESERVED2_WIDTH 12
  6058. /* MC_CMD_RESOURCE_SPECIFIER enum */
  6059. /* enum: Any */
  6060. #define MC_CMD_RESOURCE_INSTANCE_ANY 0xffffffff
  6061. /* enum: None */
  6062. #define MC_CMD_RESOURCE_INSTANCE_NONE 0xfffffffe
  6063. /* EVB_PORT_ID structuredef */
  6064. #define EVB_PORT_ID_LEN 4
  6065. #define EVB_PORT_ID_PORT_ID_OFST 0
  6066. #define EVB_PORT_ID_PORT_ID_LEN 4
  6067. /* enum: An invalid port handle. */
  6068. #define EVB_PORT_ID_NULL 0x0
  6069. /* enum: The port assigned to this function.. */
  6070. #define EVB_PORT_ID_ASSIGNED 0x1000000
  6071. /* enum: External network port 0 */
  6072. #define EVB_PORT_ID_MAC0 0x2000000
  6073. /* enum: External network port 1 */
  6074. #define EVB_PORT_ID_MAC1 0x2000001
  6075. /* enum: External network port 2 */
  6076. #define EVB_PORT_ID_MAC2 0x2000002
  6077. /* enum: External network port 3 */
  6078. #define EVB_PORT_ID_MAC3 0x2000003
  6079. #define EVB_PORT_ID_PORT_ID_LBN 0
  6080. #define EVB_PORT_ID_PORT_ID_WIDTH 32
  6081. /* EVB_VLAN_TAG structuredef */
  6082. #define EVB_VLAN_TAG_LEN 2
  6083. /* The VLAN tag value */
  6084. #define EVB_VLAN_TAG_VLAN_ID_LBN 0
  6085. #define EVB_VLAN_TAG_VLAN_ID_WIDTH 12
  6086. #define EVB_VLAN_TAG_MODE_LBN 12
  6087. #define EVB_VLAN_TAG_MODE_WIDTH 4
  6088. /* enum: Insert the VLAN. */
  6089. #define EVB_VLAN_TAG_INSERT 0x0
  6090. /* enum: Replace the VLAN if already present. */
  6091. #define EVB_VLAN_TAG_REPLACE 0x1
  6092. /* BUFTBL_ENTRY structuredef */
  6093. #define BUFTBL_ENTRY_LEN 12
  6094. /* the owner ID */
  6095. #define BUFTBL_ENTRY_OID_OFST 0
  6096. #define BUFTBL_ENTRY_OID_LEN 2
  6097. #define BUFTBL_ENTRY_OID_LBN 0
  6098. #define BUFTBL_ENTRY_OID_WIDTH 16
  6099. /* the page parameter as one of ESE_DZ_SMC_PAGE_SIZE_ */
  6100. #define BUFTBL_ENTRY_PGSZ_OFST 2
  6101. #define BUFTBL_ENTRY_PGSZ_LEN 2
  6102. #define BUFTBL_ENTRY_PGSZ_LBN 16
  6103. #define BUFTBL_ENTRY_PGSZ_WIDTH 16
  6104. /* the raw 64-bit address field from the SMC, not adjusted for page size */
  6105. #define BUFTBL_ENTRY_RAWADDR_OFST 4
  6106. #define BUFTBL_ENTRY_RAWADDR_LEN 8
  6107. #define BUFTBL_ENTRY_RAWADDR_LO_OFST 4
  6108. #define BUFTBL_ENTRY_RAWADDR_HI_OFST 8
  6109. #define BUFTBL_ENTRY_RAWADDR_LBN 32
  6110. #define BUFTBL_ENTRY_RAWADDR_WIDTH 64
  6111. /* NVRAM_PARTITION_TYPE structuredef */
  6112. #define NVRAM_PARTITION_TYPE_LEN 2
  6113. #define NVRAM_PARTITION_TYPE_ID_OFST 0
  6114. #define NVRAM_PARTITION_TYPE_ID_LEN 2
  6115. /* enum: Primary MC firmware partition */
  6116. #define NVRAM_PARTITION_TYPE_MC_FIRMWARE 0x100
  6117. /* enum: Secondary MC firmware partition */
  6118. #define NVRAM_PARTITION_TYPE_MC_FIRMWARE_BACKUP 0x200
  6119. /* enum: Expansion ROM partition */
  6120. #define NVRAM_PARTITION_TYPE_EXPANSION_ROM 0x300
  6121. /* enum: Static configuration TLV partition */
  6122. #define NVRAM_PARTITION_TYPE_STATIC_CONFIG 0x400
  6123. /* enum: Dynamic configuration TLV partition */
  6124. #define NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG 0x500
  6125. /* enum: Expansion ROM configuration data for port 0 */
  6126. #define NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT0 0x600
  6127. /* enum: Synonym for EXPROM_CONFIG_PORT0 as used in pmap files */
  6128. #define NVRAM_PARTITION_TYPE_EXPROM_CONFIG 0x600
  6129. /* enum: Expansion ROM configuration data for port 1 */
  6130. #define NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT1 0x601
  6131. /* enum: Expansion ROM configuration data for port 2 */
  6132. #define NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT2 0x602
  6133. /* enum: Expansion ROM configuration data for port 3 */
  6134. #define NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT3 0x603
  6135. /* enum: Non-volatile log output partition */
  6136. #define NVRAM_PARTITION_TYPE_LOG 0x700
  6137. /* enum: Non-volatile log output of second core on dual-core device */
  6138. #define NVRAM_PARTITION_TYPE_LOG_SLAVE 0x701
  6139. /* enum: Device state dump output partition */
  6140. #define NVRAM_PARTITION_TYPE_DUMP 0x800
  6141. /* enum: Application license key storage partition */
  6142. #define NVRAM_PARTITION_TYPE_LICENSE 0x900
  6143. /* enum: Start of range used for PHY partitions (low 8 bits are the PHY ID) */
  6144. #define NVRAM_PARTITION_TYPE_PHY_MIN 0xa00
  6145. /* enum: End of range used for PHY partitions (low 8 bits are the PHY ID) */
  6146. #define NVRAM_PARTITION_TYPE_PHY_MAX 0xaff
  6147. /* enum: Primary FPGA partition */
  6148. #define NVRAM_PARTITION_TYPE_FPGA 0xb00
  6149. /* enum: Secondary FPGA partition */
  6150. #define NVRAM_PARTITION_TYPE_FPGA_BACKUP 0xb01
  6151. /* enum: FC firmware partition */
  6152. #define NVRAM_PARTITION_TYPE_FC_FIRMWARE 0xb02
  6153. /* enum: FC License partition */
  6154. #define NVRAM_PARTITION_TYPE_FC_LICENSE 0xb03
  6155. /* enum: Non-volatile log output partition for FC */
  6156. #define NVRAM_PARTITION_TYPE_FC_LOG 0xb04
  6157. /* enum: MUM firmware partition */
  6158. #define NVRAM_PARTITION_TYPE_MUM_FIRMWARE 0xc00
  6159. /* enum: SUC firmware partition (this is intentionally an alias of
  6160. * MUM_FIRMWARE)
  6161. */
  6162. #define NVRAM_PARTITION_TYPE_SUC_FIRMWARE 0xc00
  6163. /* enum: MUM Non-volatile log output partition. */
  6164. #define NVRAM_PARTITION_TYPE_MUM_LOG 0xc01
  6165. /* enum: MUM Application table partition. */
  6166. #define NVRAM_PARTITION_TYPE_MUM_APPTABLE 0xc02
  6167. /* enum: MUM boot rom partition. */
  6168. #define NVRAM_PARTITION_TYPE_MUM_BOOT_ROM 0xc03
  6169. /* enum: MUM production signatures & calibration rom partition. */
  6170. #define NVRAM_PARTITION_TYPE_MUM_PROD_ROM 0xc04
  6171. /* enum: MUM user signatures & calibration rom partition. */
  6172. #define NVRAM_PARTITION_TYPE_MUM_USER_ROM 0xc05
  6173. /* enum: MUM fuses and lockbits partition. */
  6174. #define NVRAM_PARTITION_TYPE_MUM_FUSELOCK 0xc06
  6175. /* enum: UEFI expansion ROM if separate from PXE */
  6176. #define NVRAM_PARTITION_TYPE_EXPANSION_UEFI 0xd00
  6177. /* enum: Used by the expansion ROM for logging */
  6178. #define NVRAM_PARTITION_TYPE_PXE_LOG 0x1000
  6179. /* enum: Used for XIP code of shmbooted images */
  6180. #define NVRAM_PARTITION_TYPE_XIP_SCRATCH 0x1100
  6181. /* enum: Spare partition 2 */
  6182. #define NVRAM_PARTITION_TYPE_SPARE_2 0x1200
  6183. /* enum: Manufacturing partition. Used during manufacture to pass information
  6184. * between XJTAG and Manftest.
  6185. */
  6186. #define NVRAM_PARTITION_TYPE_MANUFACTURING 0x1300
  6187. /* enum: Spare partition 4 */
  6188. #define NVRAM_PARTITION_TYPE_SPARE_4 0x1400
  6189. /* enum: Spare partition 5 */
  6190. #define NVRAM_PARTITION_TYPE_SPARE_5 0x1500
  6191. /* enum: Partition for reporting MC status. See mc_flash_layout.h
  6192. * medford_mc_status_hdr_t for layout on Medford.
  6193. */
  6194. #define NVRAM_PARTITION_TYPE_STATUS 0x1600
  6195. /* enum: Spare partition 13 */
  6196. #define NVRAM_PARTITION_TYPE_SPARE_13 0x1700
  6197. /* enum: Spare partition 14 */
  6198. #define NVRAM_PARTITION_TYPE_SPARE_14 0x1800
  6199. /* enum: Spare partition 15 */
  6200. #define NVRAM_PARTITION_TYPE_SPARE_15 0x1900
  6201. /* enum: Spare partition 16 */
  6202. #define NVRAM_PARTITION_TYPE_SPARE_16 0x1a00
  6203. /* enum: Factory defaults for dynamic configuration */
  6204. #define NVRAM_PARTITION_TYPE_DYNCONFIG_DEFAULTS 0x1b00
  6205. /* enum: Factory defaults for expansion ROM configuration */
  6206. #define NVRAM_PARTITION_TYPE_ROMCONFIG_DEFAULTS 0x1c00
  6207. /* enum: Field Replaceable Unit inventory information for use on IPMI
  6208. * platforms. See SF-119124-PS. The STATIC_CONFIG partition may contain a
  6209. * subset of the information stored in this partition.
  6210. */
  6211. #define NVRAM_PARTITION_TYPE_FRU_INFORMATION 0x1d00
  6212. /* enum: Bundle image partition */
  6213. #define NVRAM_PARTITION_TYPE_BUNDLE 0x1e00
  6214. /* enum: Bundle metadata partition that holds additional information related to
  6215. * a bundle update in TLV format
  6216. */
  6217. #define NVRAM_PARTITION_TYPE_BUNDLE_METADATA 0x1e01
  6218. /* enum: Bundle update non-volatile log output partition */
  6219. #define NVRAM_PARTITION_TYPE_BUNDLE_LOG 0x1e02
  6220. /* enum: Start of reserved value range (firmware may use for any purpose) */
  6221. #define NVRAM_PARTITION_TYPE_RESERVED_VALUES_MIN 0xff00
  6222. /* enum: End of reserved value range (firmware may use for any purpose) */
  6223. #define NVRAM_PARTITION_TYPE_RESERVED_VALUES_MAX 0xfffd
  6224. /* enum: Recovery partition map (provided if real map is missing or corrupt) */
  6225. #define NVRAM_PARTITION_TYPE_RECOVERY_MAP 0xfffe
  6226. /* enum: Partition map (real map as stored in flash) */
  6227. #define NVRAM_PARTITION_TYPE_PARTITION_MAP 0xffff
  6228. #define NVRAM_PARTITION_TYPE_ID_LBN 0
  6229. #define NVRAM_PARTITION_TYPE_ID_WIDTH 16
  6230. /* LICENSED_APP_ID structuredef */
  6231. #define LICENSED_APP_ID_LEN 4
  6232. #define LICENSED_APP_ID_ID_OFST 0
  6233. #define LICENSED_APP_ID_ID_LEN 4
  6234. /* enum: OpenOnload */
  6235. #define LICENSED_APP_ID_ONLOAD 0x1
  6236. /* enum: PTP timestamping */
  6237. #define LICENSED_APP_ID_PTP 0x2
  6238. /* enum: SolarCapture Pro */
  6239. #define LICENSED_APP_ID_SOLARCAPTURE_PRO 0x4
  6240. /* enum: SolarSecure filter engine */
  6241. #define LICENSED_APP_ID_SOLARSECURE 0x8
  6242. /* enum: Performance monitor */
  6243. #define LICENSED_APP_ID_PERF_MONITOR 0x10
  6244. /* enum: SolarCapture Live */
  6245. #define LICENSED_APP_ID_SOLARCAPTURE_LIVE 0x20
  6246. /* enum: Capture SolarSystem */
  6247. #define LICENSED_APP_ID_CAPTURE_SOLARSYSTEM 0x40
  6248. /* enum: Network Access Control */
  6249. #define LICENSED_APP_ID_NETWORK_ACCESS_CONTROL 0x80
  6250. /* enum: TCP Direct */
  6251. #define LICENSED_APP_ID_TCP_DIRECT 0x100
  6252. /* enum: Low Latency */
  6253. #define LICENSED_APP_ID_LOW_LATENCY 0x200
  6254. /* enum: SolarCapture Tap */
  6255. #define LICENSED_APP_ID_SOLARCAPTURE_TAP 0x400
  6256. /* enum: Capture SolarSystem 40G */
  6257. #define LICENSED_APP_ID_CAPTURE_SOLARSYSTEM_40G 0x800
  6258. /* enum: Capture SolarSystem 1G */
  6259. #define LICENSED_APP_ID_CAPTURE_SOLARSYSTEM_1G 0x1000
  6260. /* enum: ScaleOut Onload */
  6261. #define LICENSED_APP_ID_SCALEOUT_ONLOAD 0x2000
  6262. /* enum: SCS Network Analytics Dashboard */
  6263. #define LICENSED_APP_ID_DSHBRD 0x4000
  6264. /* enum: SolarCapture Trading Analytics */
  6265. #define LICENSED_APP_ID_SCATRD 0x8000
  6266. #define LICENSED_APP_ID_ID_LBN 0
  6267. #define LICENSED_APP_ID_ID_WIDTH 32
  6268. /* LICENSED_FEATURES structuredef */
  6269. #define LICENSED_FEATURES_LEN 8
  6270. /* Bitmask of licensed firmware features */
  6271. #define LICENSED_FEATURES_MASK_OFST 0
  6272. #define LICENSED_FEATURES_MASK_LEN 8
  6273. #define LICENSED_FEATURES_MASK_LO_OFST 0
  6274. #define LICENSED_FEATURES_MASK_HI_OFST 4
  6275. #define LICENSED_FEATURES_RX_CUT_THROUGH_LBN 0
  6276. #define LICENSED_FEATURES_RX_CUT_THROUGH_WIDTH 1
  6277. #define LICENSED_FEATURES_PIO_LBN 1
  6278. #define LICENSED_FEATURES_PIO_WIDTH 1
  6279. #define LICENSED_FEATURES_EVQ_TIMER_LBN 2
  6280. #define LICENSED_FEATURES_EVQ_TIMER_WIDTH 1
  6281. #define LICENSED_FEATURES_CLOCK_LBN 3
  6282. #define LICENSED_FEATURES_CLOCK_WIDTH 1
  6283. #define LICENSED_FEATURES_RX_TIMESTAMPS_LBN 4
  6284. #define LICENSED_FEATURES_RX_TIMESTAMPS_WIDTH 1
  6285. #define LICENSED_FEATURES_TX_TIMESTAMPS_LBN 5
  6286. #define LICENSED_FEATURES_TX_TIMESTAMPS_WIDTH 1
  6287. #define LICENSED_FEATURES_RX_SNIFF_LBN 6
  6288. #define LICENSED_FEATURES_RX_SNIFF_WIDTH 1
  6289. #define LICENSED_FEATURES_TX_SNIFF_LBN 7
  6290. #define LICENSED_FEATURES_TX_SNIFF_WIDTH 1
  6291. #define LICENSED_FEATURES_PROXY_FILTER_OPS_LBN 8
  6292. #define LICENSED_FEATURES_PROXY_FILTER_OPS_WIDTH 1
  6293. #define LICENSED_FEATURES_EVENT_CUT_THROUGH_LBN 9
  6294. #define LICENSED_FEATURES_EVENT_CUT_THROUGH_WIDTH 1
  6295. #define LICENSED_FEATURES_MASK_LBN 0
  6296. #define LICENSED_FEATURES_MASK_WIDTH 64
  6297. /* LICENSED_V3_APPS structuredef */
  6298. #define LICENSED_V3_APPS_LEN 8
  6299. /* Bitmask of licensed applications */
  6300. #define LICENSED_V3_APPS_MASK_OFST 0
  6301. #define LICENSED_V3_APPS_MASK_LEN 8
  6302. #define LICENSED_V3_APPS_MASK_LO_OFST 0
  6303. #define LICENSED_V3_APPS_MASK_HI_OFST 4
  6304. #define LICENSED_V3_APPS_ONLOAD_LBN 0
  6305. #define LICENSED_V3_APPS_ONLOAD_WIDTH 1
  6306. #define LICENSED_V3_APPS_PTP_LBN 1
  6307. #define LICENSED_V3_APPS_PTP_WIDTH 1
  6308. #define LICENSED_V3_APPS_SOLARCAPTURE_PRO_LBN 2
  6309. #define LICENSED_V3_APPS_SOLARCAPTURE_PRO_WIDTH 1
  6310. #define LICENSED_V3_APPS_SOLARSECURE_LBN 3
  6311. #define LICENSED_V3_APPS_SOLARSECURE_WIDTH 1
  6312. #define LICENSED_V3_APPS_PERF_MONITOR_LBN 4
  6313. #define LICENSED_V3_APPS_PERF_MONITOR_WIDTH 1
  6314. #define LICENSED_V3_APPS_SOLARCAPTURE_LIVE_LBN 5
  6315. #define LICENSED_V3_APPS_SOLARCAPTURE_LIVE_WIDTH 1
  6316. #define LICENSED_V3_APPS_CAPTURE_SOLARSYSTEM_LBN 6
  6317. #define LICENSED_V3_APPS_CAPTURE_SOLARSYSTEM_WIDTH 1
  6318. #define LICENSED_V3_APPS_NETWORK_ACCESS_CONTROL_LBN 7
  6319. #define LICENSED_V3_APPS_NETWORK_ACCESS_CONTROL_WIDTH 1
  6320. #define LICENSED_V3_APPS_TCP_DIRECT_LBN 8
  6321. #define LICENSED_V3_APPS_TCP_DIRECT_WIDTH 1
  6322. #define LICENSED_V3_APPS_LOW_LATENCY_LBN 9
  6323. #define LICENSED_V3_APPS_LOW_LATENCY_WIDTH 1
  6324. #define LICENSED_V3_APPS_SOLARCAPTURE_TAP_LBN 10
  6325. #define LICENSED_V3_APPS_SOLARCAPTURE_TAP_WIDTH 1
  6326. #define LICENSED_V3_APPS_CAPTURE_SOLARSYSTEM_40G_LBN 11
  6327. #define LICENSED_V3_APPS_CAPTURE_SOLARSYSTEM_40G_WIDTH 1
  6328. #define LICENSED_V3_APPS_CAPTURE_SOLARSYSTEM_1G_LBN 12
  6329. #define LICENSED_V3_APPS_CAPTURE_SOLARSYSTEM_1G_WIDTH 1
  6330. #define LICENSED_V3_APPS_SCALEOUT_ONLOAD_LBN 13
  6331. #define LICENSED_V3_APPS_SCALEOUT_ONLOAD_WIDTH 1
  6332. #define LICENSED_V3_APPS_DSHBRD_LBN 14
  6333. #define LICENSED_V3_APPS_DSHBRD_WIDTH 1
  6334. #define LICENSED_V3_APPS_SCATRD_LBN 15
  6335. #define LICENSED_V3_APPS_SCATRD_WIDTH 1
  6336. #define LICENSED_V3_APPS_MASK_LBN 0
  6337. #define LICENSED_V3_APPS_MASK_WIDTH 64
  6338. /* LICENSED_V3_FEATURES structuredef */
  6339. #define LICENSED_V3_FEATURES_LEN 8
  6340. /* Bitmask of licensed firmware features */
  6341. #define LICENSED_V3_FEATURES_MASK_OFST 0
  6342. #define LICENSED_V3_FEATURES_MASK_LEN 8
  6343. #define LICENSED_V3_FEATURES_MASK_LO_OFST 0
  6344. #define LICENSED_V3_FEATURES_MASK_HI_OFST 4
  6345. #define LICENSED_V3_FEATURES_RX_CUT_THROUGH_LBN 0
  6346. #define LICENSED_V3_FEATURES_RX_CUT_THROUGH_WIDTH 1
  6347. #define LICENSED_V3_FEATURES_PIO_LBN 1
  6348. #define LICENSED_V3_FEATURES_PIO_WIDTH 1
  6349. #define LICENSED_V3_FEATURES_EVQ_TIMER_LBN 2
  6350. #define LICENSED_V3_FEATURES_EVQ_TIMER_WIDTH 1
  6351. #define LICENSED_V3_FEATURES_CLOCK_LBN 3
  6352. #define LICENSED_V3_FEATURES_CLOCK_WIDTH 1
  6353. #define LICENSED_V3_FEATURES_RX_TIMESTAMPS_LBN 4
  6354. #define LICENSED_V3_FEATURES_RX_TIMESTAMPS_WIDTH 1
  6355. #define LICENSED_V3_FEATURES_TX_TIMESTAMPS_LBN 5
  6356. #define LICENSED_V3_FEATURES_TX_TIMESTAMPS_WIDTH 1
  6357. #define LICENSED_V3_FEATURES_RX_SNIFF_LBN 6
  6358. #define LICENSED_V3_FEATURES_RX_SNIFF_WIDTH 1
  6359. #define LICENSED_V3_FEATURES_TX_SNIFF_LBN 7
  6360. #define LICENSED_V3_FEATURES_TX_SNIFF_WIDTH 1
  6361. #define LICENSED_V3_FEATURES_PROXY_FILTER_OPS_LBN 8
  6362. #define LICENSED_V3_FEATURES_PROXY_FILTER_OPS_WIDTH 1
  6363. #define LICENSED_V3_FEATURES_EVENT_CUT_THROUGH_LBN 9
  6364. #define LICENSED_V3_FEATURES_EVENT_CUT_THROUGH_WIDTH 1
  6365. #define LICENSED_V3_FEATURES_MASK_LBN 0
  6366. #define LICENSED_V3_FEATURES_MASK_WIDTH 64
  6367. /* TX_TIMESTAMP_EVENT structuredef */
  6368. #define TX_TIMESTAMP_EVENT_LEN 6
  6369. /* lower 16 bits of timestamp data */
  6370. #define TX_TIMESTAMP_EVENT_TSTAMP_DATA_LO_OFST 0
  6371. #define TX_TIMESTAMP_EVENT_TSTAMP_DATA_LO_LEN 2
  6372. #define TX_TIMESTAMP_EVENT_TSTAMP_DATA_LO_LBN 0
  6373. #define TX_TIMESTAMP_EVENT_TSTAMP_DATA_LO_WIDTH 16
  6374. /* Type of TX event, ordinary TX completion, low or high part of TX timestamp
  6375. */
  6376. #define TX_TIMESTAMP_EVENT_TX_EV_TYPE_OFST 3
  6377. #define TX_TIMESTAMP_EVENT_TX_EV_TYPE_LEN 1
  6378. /* enum: This is a TX completion event, not a timestamp */
  6379. #define TX_TIMESTAMP_EVENT_TX_EV_COMPLETION 0x0
  6380. /* enum: This is a TX completion event for a CTPIO transmit. The event format
  6381. * is the same as for TX_EV_COMPLETION.
  6382. */
  6383. #define TX_TIMESTAMP_EVENT_TX_EV_CTPIO_COMPLETION 0x11
  6384. /* enum: This is the low part of a TX timestamp for a CTPIO transmission. The
  6385. * event format is the same as for TX_EV_TSTAMP_LO
  6386. */
  6387. #define TX_TIMESTAMP_EVENT_TX_EV_CTPIO_TS_LO 0x12
  6388. /* enum: This is the high part of a TX timestamp for a CTPIO transmission. The
  6389. * event format is the same as for TX_EV_TSTAMP_HI
  6390. */
  6391. #define TX_TIMESTAMP_EVENT_TX_EV_CTPIO_TS_HI 0x13
  6392. /* enum: This is the low part of a TX timestamp event */
  6393. #define TX_TIMESTAMP_EVENT_TX_EV_TSTAMP_LO 0x51
  6394. /* enum: This is the high part of a TX timestamp event */
  6395. #define TX_TIMESTAMP_EVENT_TX_EV_TSTAMP_HI 0x52
  6396. #define TX_TIMESTAMP_EVENT_TX_EV_TYPE_LBN 24
  6397. #define TX_TIMESTAMP_EVENT_TX_EV_TYPE_WIDTH 8
  6398. /* upper 16 bits of timestamp data */
  6399. #define TX_TIMESTAMP_EVENT_TSTAMP_DATA_HI_OFST 4
  6400. #define TX_TIMESTAMP_EVENT_TSTAMP_DATA_HI_LEN 2
  6401. #define TX_TIMESTAMP_EVENT_TSTAMP_DATA_HI_LBN 32
  6402. #define TX_TIMESTAMP_EVENT_TSTAMP_DATA_HI_WIDTH 16
  6403. /* RSS_MODE structuredef */
  6404. #define RSS_MODE_LEN 1
  6405. /* The RSS mode for a particular packet type is a value from 0 - 15 which can
  6406. * be considered as 4 bits selecting which fields are included in the hash. (A
  6407. * value 0 effectively disables RSS spreading for the packet type.) The YAML
  6408. * generation tools require this structure to be a whole number of bytes wide,
  6409. * but only 4 bits are relevant.
  6410. */
  6411. #define RSS_MODE_HASH_SELECTOR_OFST 0
  6412. #define RSS_MODE_HASH_SELECTOR_LEN 1
  6413. #define RSS_MODE_HASH_SRC_ADDR_LBN 0
  6414. #define RSS_MODE_HASH_SRC_ADDR_WIDTH 1
  6415. #define RSS_MODE_HASH_DST_ADDR_LBN 1
  6416. #define RSS_MODE_HASH_DST_ADDR_WIDTH 1
  6417. #define RSS_MODE_HASH_SRC_PORT_LBN 2
  6418. #define RSS_MODE_HASH_SRC_PORT_WIDTH 1
  6419. #define RSS_MODE_HASH_DST_PORT_LBN 3
  6420. #define RSS_MODE_HASH_DST_PORT_WIDTH 1
  6421. #define RSS_MODE_HASH_SELECTOR_LBN 0
  6422. #define RSS_MODE_HASH_SELECTOR_WIDTH 8
  6423. /* CTPIO_STATS_MAP structuredef */
  6424. #define CTPIO_STATS_MAP_LEN 4
  6425. /* The (function relative) VI number */
  6426. #define CTPIO_STATS_MAP_VI_OFST 0
  6427. #define CTPIO_STATS_MAP_VI_LEN 2
  6428. #define CTPIO_STATS_MAP_VI_LBN 0
  6429. #define CTPIO_STATS_MAP_VI_WIDTH 16
  6430. /* The target bucket for the VI */
  6431. #define CTPIO_STATS_MAP_BUCKET_OFST 2
  6432. #define CTPIO_STATS_MAP_BUCKET_LEN 2
  6433. #define CTPIO_STATS_MAP_BUCKET_LBN 16
  6434. #define CTPIO_STATS_MAP_BUCKET_WIDTH 16
  6435. /***********************************/
  6436. /* MC_CMD_READ_REGS
  6437. * Get a dump of the MCPU registers
  6438. */
  6439. #define MC_CMD_READ_REGS 0x50
  6440. #define MC_CMD_0x50_PRIVILEGE_CTG SRIOV_CTG_INSECURE
  6441. /* MC_CMD_READ_REGS_IN msgrequest */
  6442. #define MC_CMD_READ_REGS_IN_LEN 0
  6443. /* MC_CMD_READ_REGS_OUT msgresponse */
  6444. #define MC_CMD_READ_REGS_OUT_LEN 308
  6445. /* Whether the corresponding register entry contains a valid value */
  6446. #define MC_CMD_READ_REGS_OUT_MASK_OFST 0
  6447. #define MC_CMD_READ_REGS_OUT_MASK_LEN 16
  6448. /* Same order as MIPS GDB (r0-r31, sr, lo, hi, bad, cause, 32 x float, fsr,
  6449. * fir, fp)
  6450. */
  6451. #define MC_CMD_READ_REGS_OUT_REGS_OFST 16
  6452. #define MC_CMD_READ_REGS_OUT_REGS_LEN 4
  6453. #define MC_CMD_READ_REGS_OUT_REGS_NUM 73
  6454. /***********************************/
  6455. /* MC_CMD_INIT_EVQ
  6456. * Set up an event queue according to the supplied parameters. The IN arguments
  6457. * end with an address for each 4k of host memory required to back the EVQ.
  6458. */
  6459. #define MC_CMD_INIT_EVQ 0x80
  6460. #define MC_CMD_0x80_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  6461. /* MC_CMD_INIT_EVQ_IN msgrequest */
  6462. #define MC_CMD_INIT_EVQ_IN_LENMIN 44
  6463. #define MC_CMD_INIT_EVQ_IN_LENMAX 548
  6464. #define MC_CMD_INIT_EVQ_IN_LEN(num) (36+8*(num))
  6465. /* Size, in entries */
  6466. #define MC_CMD_INIT_EVQ_IN_SIZE_OFST 0
  6467. #define MC_CMD_INIT_EVQ_IN_SIZE_LEN 4
  6468. /* Desired instance. Must be set to a specific instance, which is a function
  6469. * local queue index.
  6470. */
  6471. #define MC_CMD_INIT_EVQ_IN_INSTANCE_OFST 4
  6472. #define MC_CMD_INIT_EVQ_IN_INSTANCE_LEN 4
  6473. /* The initial timer value. The load value is ignored if the timer mode is DIS.
  6474. */
  6475. #define MC_CMD_INIT_EVQ_IN_TMR_LOAD_OFST 8
  6476. #define MC_CMD_INIT_EVQ_IN_TMR_LOAD_LEN 4
  6477. /* The reload value is ignored in one-shot modes */
  6478. #define MC_CMD_INIT_EVQ_IN_TMR_RELOAD_OFST 12
  6479. #define MC_CMD_INIT_EVQ_IN_TMR_RELOAD_LEN 4
  6480. /* tbd */
  6481. #define MC_CMD_INIT_EVQ_IN_FLAGS_OFST 16
  6482. #define MC_CMD_INIT_EVQ_IN_FLAGS_LEN 4
  6483. #define MC_CMD_INIT_EVQ_IN_FLAG_INTERRUPTING_LBN 0
  6484. #define MC_CMD_INIT_EVQ_IN_FLAG_INTERRUPTING_WIDTH 1
  6485. #define MC_CMD_INIT_EVQ_IN_FLAG_RPTR_DOS_LBN 1
  6486. #define MC_CMD_INIT_EVQ_IN_FLAG_RPTR_DOS_WIDTH 1
  6487. #define MC_CMD_INIT_EVQ_IN_FLAG_INT_ARMD_LBN 2
  6488. #define MC_CMD_INIT_EVQ_IN_FLAG_INT_ARMD_WIDTH 1
  6489. #define MC_CMD_INIT_EVQ_IN_FLAG_CUT_THRU_LBN 3
  6490. #define MC_CMD_INIT_EVQ_IN_FLAG_CUT_THRU_WIDTH 1
  6491. #define MC_CMD_INIT_EVQ_IN_FLAG_RX_MERGE_LBN 4
  6492. #define MC_CMD_INIT_EVQ_IN_FLAG_RX_MERGE_WIDTH 1
  6493. #define MC_CMD_INIT_EVQ_IN_FLAG_TX_MERGE_LBN 5
  6494. #define MC_CMD_INIT_EVQ_IN_FLAG_TX_MERGE_WIDTH 1
  6495. #define MC_CMD_INIT_EVQ_IN_FLAG_USE_TIMER_LBN 6
  6496. #define MC_CMD_INIT_EVQ_IN_FLAG_USE_TIMER_WIDTH 1
  6497. #define MC_CMD_INIT_EVQ_IN_TMR_MODE_OFST 20
  6498. #define MC_CMD_INIT_EVQ_IN_TMR_MODE_LEN 4
  6499. /* enum: Disabled */
  6500. #define MC_CMD_INIT_EVQ_IN_TMR_MODE_DIS 0x0
  6501. /* enum: Immediate */
  6502. #define MC_CMD_INIT_EVQ_IN_TMR_IMMED_START 0x1
  6503. /* enum: Triggered */
  6504. #define MC_CMD_INIT_EVQ_IN_TMR_TRIG_START 0x2
  6505. /* enum: Hold-off */
  6506. #define MC_CMD_INIT_EVQ_IN_TMR_INT_HLDOFF 0x3
  6507. /* Target EVQ for wakeups if in wakeup mode. */
  6508. #define MC_CMD_INIT_EVQ_IN_TARGET_EVQ_OFST 24
  6509. #define MC_CMD_INIT_EVQ_IN_TARGET_EVQ_LEN 4
  6510. /* Target interrupt if in interrupting mode (note union with target EVQ). Use
  6511. * MC_CMD_RESOURCE_INSTANCE_ANY unless a specific one required for test
  6512. * purposes.
  6513. */
  6514. #define MC_CMD_INIT_EVQ_IN_IRQ_NUM_OFST 24
  6515. #define MC_CMD_INIT_EVQ_IN_IRQ_NUM_LEN 4
  6516. /* Event Counter Mode. */
  6517. #define MC_CMD_INIT_EVQ_IN_COUNT_MODE_OFST 28
  6518. #define MC_CMD_INIT_EVQ_IN_COUNT_MODE_LEN 4
  6519. /* enum: Disabled */
  6520. #define MC_CMD_INIT_EVQ_IN_COUNT_MODE_DIS 0x0
  6521. /* enum: Disabled */
  6522. #define MC_CMD_INIT_EVQ_IN_COUNT_MODE_RX 0x1
  6523. /* enum: Disabled */
  6524. #define MC_CMD_INIT_EVQ_IN_COUNT_MODE_TX 0x2
  6525. /* enum: Disabled */
  6526. #define MC_CMD_INIT_EVQ_IN_COUNT_MODE_RXTX 0x3
  6527. /* Event queue packet count threshold. */
  6528. #define MC_CMD_INIT_EVQ_IN_COUNT_THRSHLD_OFST 32
  6529. #define MC_CMD_INIT_EVQ_IN_COUNT_THRSHLD_LEN 4
  6530. /* 64-bit address of 4k of 4k-aligned host memory buffer */
  6531. #define MC_CMD_INIT_EVQ_IN_DMA_ADDR_OFST 36
  6532. #define MC_CMD_INIT_EVQ_IN_DMA_ADDR_LEN 8
  6533. #define MC_CMD_INIT_EVQ_IN_DMA_ADDR_LO_OFST 36
  6534. #define MC_CMD_INIT_EVQ_IN_DMA_ADDR_HI_OFST 40
  6535. #define MC_CMD_INIT_EVQ_IN_DMA_ADDR_MINNUM 1
  6536. #define MC_CMD_INIT_EVQ_IN_DMA_ADDR_MAXNUM 64
  6537. /* MC_CMD_INIT_EVQ_OUT msgresponse */
  6538. #define MC_CMD_INIT_EVQ_OUT_LEN 4
  6539. /* Only valid if INTRFLAG was true */
  6540. #define MC_CMD_INIT_EVQ_OUT_IRQ_OFST 0
  6541. #define MC_CMD_INIT_EVQ_OUT_IRQ_LEN 4
  6542. /* MC_CMD_INIT_EVQ_V2_IN msgrequest */
  6543. #define MC_CMD_INIT_EVQ_V2_IN_LENMIN 44
  6544. #define MC_CMD_INIT_EVQ_V2_IN_LENMAX 548
  6545. #define MC_CMD_INIT_EVQ_V2_IN_LEN(num) (36+8*(num))
  6546. /* Size, in entries */
  6547. #define MC_CMD_INIT_EVQ_V2_IN_SIZE_OFST 0
  6548. #define MC_CMD_INIT_EVQ_V2_IN_SIZE_LEN 4
  6549. /* Desired instance. Must be set to a specific instance, which is a function
  6550. * local queue index.
  6551. */
  6552. #define MC_CMD_INIT_EVQ_V2_IN_INSTANCE_OFST 4
  6553. #define MC_CMD_INIT_EVQ_V2_IN_INSTANCE_LEN 4
  6554. /* The initial timer value. The load value is ignored if the timer mode is DIS.
  6555. */
  6556. #define MC_CMD_INIT_EVQ_V2_IN_TMR_LOAD_OFST 8
  6557. #define MC_CMD_INIT_EVQ_V2_IN_TMR_LOAD_LEN 4
  6558. /* The reload value is ignored in one-shot modes */
  6559. #define MC_CMD_INIT_EVQ_V2_IN_TMR_RELOAD_OFST 12
  6560. #define MC_CMD_INIT_EVQ_V2_IN_TMR_RELOAD_LEN 4
  6561. /* tbd */
  6562. #define MC_CMD_INIT_EVQ_V2_IN_FLAGS_OFST 16
  6563. #define MC_CMD_INIT_EVQ_V2_IN_FLAGS_LEN 4
  6564. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_INTERRUPTING_LBN 0
  6565. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_INTERRUPTING_WIDTH 1
  6566. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_RPTR_DOS_LBN 1
  6567. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_RPTR_DOS_WIDTH 1
  6568. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_INT_ARMD_LBN 2
  6569. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_INT_ARMD_WIDTH 1
  6570. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_CUT_THRU_LBN 3
  6571. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_CUT_THRU_WIDTH 1
  6572. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_RX_MERGE_LBN 4
  6573. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_RX_MERGE_WIDTH 1
  6574. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_TX_MERGE_LBN 5
  6575. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_TX_MERGE_WIDTH 1
  6576. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_USE_TIMER_LBN 6
  6577. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_USE_TIMER_WIDTH 1
  6578. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_LBN 7
  6579. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_WIDTH 4
  6580. /* enum: All initialisation flags specified by host. */
  6581. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_MANUAL 0x0
  6582. /* enum: MEDFORD only. Certain initialisation flags specified by host may be
  6583. * over-ridden by firmware based on licenses and firmware variant in order to
  6584. * provide the lowest latency achievable. See
  6585. * MC_CMD_INIT_EVQ_V2/MC_CMD_INIT_EVQ_V2_OUT/FLAGS for list of affected flags.
  6586. */
  6587. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_LOW_LATENCY 0x1
  6588. /* enum: MEDFORD only. Certain initialisation flags specified by host may be
  6589. * over-ridden by firmware based on licenses and firmware variant in order to
  6590. * provide the best throughput achievable. See
  6591. * MC_CMD_INIT_EVQ_V2/MC_CMD_INIT_EVQ_V2_OUT/FLAGS for list of affected flags.
  6592. */
  6593. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_THROUGHPUT 0x2
  6594. /* enum: MEDFORD only. Certain initialisation flags may be over-ridden by
  6595. * firmware based on licenses and firmware variant. See
  6596. * MC_CMD_INIT_EVQ_V2/MC_CMD_INIT_EVQ_V2_OUT/FLAGS for list of affected flags.
  6597. */
  6598. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_AUTO 0x3
  6599. #define MC_CMD_INIT_EVQ_V2_IN_TMR_MODE_OFST 20
  6600. #define MC_CMD_INIT_EVQ_V2_IN_TMR_MODE_LEN 4
  6601. /* enum: Disabled */
  6602. #define MC_CMD_INIT_EVQ_V2_IN_TMR_MODE_DIS 0x0
  6603. /* enum: Immediate */
  6604. #define MC_CMD_INIT_EVQ_V2_IN_TMR_IMMED_START 0x1
  6605. /* enum: Triggered */
  6606. #define MC_CMD_INIT_EVQ_V2_IN_TMR_TRIG_START 0x2
  6607. /* enum: Hold-off */
  6608. #define MC_CMD_INIT_EVQ_V2_IN_TMR_INT_HLDOFF 0x3
  6609. /* Target EVQ for wakeups if in wakeup mode. */
  6610. #define MC_CMD_INIT_EVQ_V2_IN_TARGET_EVQ_OFST 24
  6611. #define MC_CMD_INIT_EVQ_V2_IN_TARGET_EVQ_LEN 4
  6612. /* Target interrupt if in interrupting mode (note union with target EVQ). Use
  6613. * MC_CMD_RESOURCE_INSTANCE_ANY unless a specific one required for test
  6614. * purposes.
  6615. */
  6616. #define MC_CMD_INIT_EVQ_V2_IN_IRQ_NUM_OFST 24
  6617. #define MC_CMD_INIT_EVQ_V2_IN_IRQ_NUM_LEN 4
  6618. /* Event Counter Mode. */
  6619. #define MC_CMD_INIT_EVQ_V2_IN_COUNT_MODE_OFST 28
  6620. #define MC_CMD_INIT_EVQ_V2_IN_COUNT_MODE_LEN 4
  6621. /* enum: Disabled */
  6622. #define MC_CMD_INIT_EVQ_V2_IN_COUNT_MODE_DIS 0x0
  6623. /* enum: Disabled */
  6624. #define MC_CMD_INIT_EVQ_V2_IN_COUNT_MODE_RX 0x1
  6625. /* enum: Disabled */
  6626. #define MC_CMD_INIT_EVQ_V2_IN_COUNT_MODE_TX 0x2
  6627. /* enum: Disabled */
  6628. #define MC_CMD_INIT_EVQ_V2_IN_COUNT_MODE_RXTX 0x3
  6629. /* Event queue packet count threshold. */
  6630. #define MC_CMD_INIT_EVQ_V2_IN_COUNT_THRSHLD_OFST 32
  6631. #define MC_CMD_INIT_EVQ_V2_IN_COUNT_THRSHLD_LEN 4
  6632. /* 64-bit address of 4k of 4k-aligned host memory buffer */
  6633. #define MC_CMD_INIT_EVQ_V2_IN_DMA_ADDR_OFST 36
  6634. #define MC_CMD_INIT_EVQ_V2_IN_DMA_ADDR_LEN 8
  6635. #define MC_CMD_INIT_EVQ_V2_IN_DMA_ADDR_LO_OFST 36
  6636. #define MC_CMD_INIT_EVQ_V2_IN_DMA_ADDR_HI_OFST 40
  6637. #define MC_CMD_INIT_EVQ_V2_IN_DMA_ADDR_MINNUM 1
  6638. #define MC_CMD_INIT_EVQ_V2_IN_DMA_ADDR_MAXNUM 64
  6639. /* MC_CMD_INIT_EVQ_V2_OUT msgresponse */
  6640. #define MC_CMD_INIT_EVQ_V2_OUT_LEN 8
  6641. /* Only valid if INTRFLAG was true */
  6642. #define MC_CMD_INIT_EVQ_V2_OUT_IRQ_OFST 0
  6643. #define MC_CMD_INIT_EVQ_V2_OUT_IRQ_LEN 4
  6644. /* Actual configuration applied on the card */
  6645. #define MC_CMD_INIT_EVQ_V2_OUT_FLAGS_OFST 4
  6646. #define MC_CMD_INIT_EVQ_V2_OUT_FLAGS_LEN 4
  6647. #define MC_CMD_INIT_EVQ_V2_OUT_FLAG_CUT_THRU_LBN 0
  6648. #define MC_CMD_INIT_EVQ_V2_OUT_FLAG_CUT_THRU_WIDTH 1
  6649. #define MC_CMD_INIT_EVQ_V2_OUT_FLAG_RX_MERGE_LBN 1
  6650. #define MC_CMD_INIT_EVQ_V2_OUT_FLAG_RX_MERGE_WIDTH 1
  6651. #define MC_CMD_INIT_EVQ_V2_OUT_FLAG_TX_MERGE_LBN 2
  6652. #define MC_CMD_INIT_EVQ_V2_OUT_FLAG_TX_MERGE_WIDTH 1
  6653. #define MC_CMD_INIT_EVQ_V2_OUT_FLAG_RXQ_FORCE_EV_MERGING_LBN 3
  6654. #define MC_CMD_INIT_EVQ_V2_OUT_FLAG_RXQ_FORCE_EV_MERGING_WIDTH 1
  6655. /* QUEUE_CRC_MODE structuredef */
  6656. #define QUEUE_CRC_MODE_LEN 1
  6657. #define QUEUE_CRC_MODE_MODE_LBN 0
  6658. #define QUEUE_CRC_MODE_MODE_WIDTH 4
  6659. /* enum: No CRC. */
  6660. #define QUEUE_CRC_MODE_NONE 0x0
  6661. /* enum: CRC Fiber channel over ethernet. */
  6662. #define QUEUE_CRC_MODE_FCOE 0x1
  6663. /* enum: CRC (digest) iSCSI header only. */
  6664. #define QUEUE_CRC_MODE_ISCSI_HDR 0x2
  6665. /* enum: CRC (digest) iSCSI header and payload. */
  6666. #define QUEUE_CRC_MODE_ISCSI 0x3
  6667. /* enum: CRC Fiber channel over IP over ethernet. */
  6668. #define QUEUE_CRC_MODE_FCOIPOE 0x4
  6669. /* enum: CRC MPA. */
  6670. #define QUEUE_CRC_MODE_MPA 0x5
  6671. #define QUEUE_CRC_MODE_SPARE_LBN 4
  6672. #define QUEUE_CRC_MODE_SPARE_WIDTH 4
  6673. /***********************************/
  6674. /* MC_CMD_INIT_RXQ
  6675. * set up a receive queue according to the supplied parameters. The IN
  6676. * arguments end with an address for each 4k of host memory required to back
  6677. * the RXQ.
  6678. */
  6679. #define MC_CMD_INIT_RXQ 0x81
  6680. #define MC_CMD_0x81_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  6681. /* MC_CMD_INIT_RXQ_IN msgrequest: Legacy RXQ_INIT request. Use extended version
  6682. * in new code.
  6683. */
  6684. #define MC_CMD_INIT_RXQ_IN_LENMIN 36
  6685. #define MC_CMD_INIT_RXQ_IN_LENMAX 252
  6686. #define MC_CMD_INIT_RXQ_IN_LEN(num) (28+8*(num))
  6687. /* Size, in entries */
  6688. #define MC_CMD_INIT_RXQ_IN_SIZE_OFST 0
  6689. #define MC_CMD_INIT_RXQ_IN_SIZE_LEN 4
  6690. /* The EVQ to send events to. This is an index originally specified to INIT_EVQ
  6691. */
  6692. #define MC_CMD_INIT_RXQ_IN_TARGET_EVQ_OFST 4
  6693. #define MC_CMD_INIT_RXQ_IN_TARGET_EVQ_LEN 4
  6694. /* The value to put in the event data. Check hardware spec. for valid range. */
  6695. #define MC_CMD_INIT_RXQ_IN_LABEL_OFST 8
  6696. #define MC_CMD_INIT_RXQ_IN_LABEL_LEN 4
  6697. /* Desired instance. Must be set to a specific instance, which is a function
  6698. * local queue index.
  6699. */
  6700. #define MC_CMD_INIT_RXQ_IN_INSTANCE_OFST 12
  6701. #define MC_CMD_INIT_RXQ_IN_INSTANCE_LEN 4
  6702. /* There will be more flags here. */
  6703. #define MC_CMD_INIT_RXQ_IN_FLAGS_OFST 16
  6704. #define MC_CMD_INIT_RXQ_IN_FLAGS_LEN 4
  6705. #define MC_CMD_INIT_RXQ_IN_FLAG_BUFF_MODE_LBN 0
  6706. #define MC_CMD_INIT_RXQ_IN_FLAG_BUFF_MODE_WIDTH 1
  6707. #define MC_CMD_INIT_RXQ_IN_FLAG_HDR_SPLIT_LBN 1
  6708. #define MC_CMD_INIT_RXQ_IN_FLAG_HDR_SPLIT_WIDTH 1
  6709. #define MC_CMD_INIT_RXQ_IN_FLAG_TIMESTAMP_LBN 2
  6710. #define MC_CMD_INIT_RXQ_IN_FLAG_TIMESTAMP_WIDTH 1
  6711. #define MC_CMD_INIT_RXQ_IN_CRC_MODE_LBN 3
  6712. #define MC_CMD_INIT_RXQ_IN_CRC_MODE_WIDTH 4
  6713. #define MC_CMD_INIT_RXQ_IN_FLAG_CHAIN_LBN 7
  6714. #define MC_CMD_INIT_RXQ_IN_FLAG_CHAIN_WIDTH 1
  6715. #define MC_CMD_INIT_RXQ_IN_FLAG_PREFIX_LBN 8
  6716. #define MC_CMD_INIT_RXQ_IN_FLAG_PREFIX_WIDTH 1
  6717. #define MC_CMD_INIT_RXQ_IN_FLAG_DISABLE_SCATTER_LBN 9
  6718. #define MC_CMD_INIT_RXQ_IN_FLAG_DISABLE_SCATTER_WIDTH 1
  6719. #define MC_CMD_INIT_RXQ_IN_UNUSED_LBN 10
  6720. #define MC_CMD_INIT_RXQ_IN_UNUSED_WIDTH 1
  6721. /* Owner ID to use if in buffer mode (zero if physical) */
  6722. #define MC_CMD_INIT_RXQ_IN_OWNER_ID_OFST 20
  6723. #define MC_CMD_INIT_RXQ_IN_OWNER_ID_LEN 4
  6724. /* The port ID associated with the v-adaptor which should contain this DMAQ. */
  6725. #define MC_CMD_INIT_RXQ_IN_PORT_ID_OFST 24
  6726. #define MC_CMD_INIT_RXQ_IN_PORT_ID_LEN 4
  6727. /* 64-bit address of 4k of 4k-aligned host memory buffer */
  6728. #define MC_CMD_INIT_RXQ_IN_DMA_ADDR_OFST 28
  6729. #define MC_CMD_INIT_RXQ_IN_DMA_ADDR_LEN 8
  6730. #define MC_CMD_INIT_RXQ_IN_DMA_ADDR_LO_OFST 28
  6731. #define MC_CMD_INIT_RXQ_IN_DMA_ADDR_HI_OFST 32
  6732. #define MC_CMD_INIT_RXQ_IN_DMA_ADDR_MINNUM 1
  6733. #define MC_CMD_INIT_RXQ_IN_DMA_ADDR_MAXNUM 28
  6734. /* MC_CMD_INIT_RXQ_EXT_IN msgrequest: Extended RXQ_INIT with additional mode
  6735. * flags
  6736. */
  6737. #define MC_CMD_INIT_RXQ_EXT_IN_LEN 544
  6738. /* Size, in entries */
  6739. #define MC_CMD_INIT_RXQ_EXT_IN_SIZE_OFST 0
  6740. #define MC_CMD_INIT_RXQ_EXT_IN_SIZE_LEN 4
  6741. /* The EVQ to send events to. This is an index originally specified to
  6742. * INIT_EVQ. If DMA_MODE == PACKED_STREAM this must be equal to INSTANCE.
  6743. */
  6744. #define MC_CMD_INIT_RXQ_EXT_IN_TARGET_EVQ_OFST 4
  6745. #define MC_CMD_INIT_RXQ_EXT_IN_TARGET_EVQ_LEN 4
  6746. /* The value to put in the event data. Check hardware spec. for valid range.
  6747. * This field is ignored if DMA_MODE == EQUAL_STRIDE_PACKED_STREAM or DMA_MODE
  6748. * == PACKED_STREAM.
  6749. */
  6750. #define MC_CMD_INIT_RXQ_EXT_IN_LABEL_OFST 8
  6751. #define MC_CMD_INIT_RXQ_EXT_IN_LABEL_LEN 4
  6752. /* Desired instance. Must be set to a specific instance, which is a function
  6753. * local queue index.
  6754. */
  6755. #define MC_CMD_INIT_RXQ_EXT_IN_INSTANCE_OFST 12
  6756. #define MC_CMD_INIT_RXQ_EXT_IN_INSTANCE_LEN 4
  6757. /* There will be more flags here. */
  6758. #define MC_CMD_INIT_RXQ_EXT_IN_FLAGS_OFST 16
  6759. #define MC_CMD_INIT_RXQ_EXT_IN_FLAGS_LEN 4
  6760. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_BUFF_MODE_LBN 0
  6761. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_BUFF_MODE_WIDTH 1
  6762. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_HDR_SPLIT_LBN 1
  6763. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_HDR_SPLIT_WIDTH 1
  6764. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_TIMESTAMP_LBN 2
  6765. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_TIMESTAMP_WIDTH 1
  6766. #define MC_CMD_INIT_RXQ_EXT_IN_CRC_MODE_LBN 3
  6767. #define MC_CMD_INIT_RXQ_EXT_IN_CRC_MODE_WIDTH 4
  6768. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_CHAIN_LBN 7
  6769. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_CHAIN_WIDTH 1
  6770. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_PREFIX_LBN 8
  6771. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_PREFIX_WIDTH 1
  6772. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_DISABLE_SCATTER_LBN 9
  6773. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_DISABLE_SCATTER_WIDTH 1
  6774. #define MC_CMD_INIT_RXQ_EXT_IN_DMA_MODE_LBN 10
  6775. #define MC_CMD_INIT_RXQ_EXT_IN_DMA_MODE_WIDTH 4
  6776. /* enum: One packet per descriptor (for normal networking) */
  6777. #define MC_CMD_INIT_RXQ_EXT_IN_SINGLE_PACKET 0x0
  6778. /* enum: Pack multiple packets into large descriptors (for SolarCapture) */
  6779. #define MC_CMD_INIT_RXQ_EXT_IN_PACKED_STREAM 0x1
  6780. /* enum: Pack multiple packets into large descriptors using the format designed
  6781. * to maximise packet rate. This mode uses 1 "bucket" per descriptor with
  6782. * multiple fixed-size packet buffers within each bucket. For a full
  6783. * description see SF-119419-TC. This mode is only supported by "dpdk" datapath
  6784. * firmware.
  6785. */
  6786. #define MC_CMD_INIT_RXQ_EXT_IN_EQUAL_STRIDE_PACKED_STREAM 0x2
  6787. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_SNAPSHOT_MODE_LBN 14
  6788. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_SNAPSHOT_MODE_WIDTH 1
  6789. #define MC_CMD_INIT_RXQ_EXT_IN_PACKED_STREAM_BUFF_SIZE_LBN 15
  6790. #define MC_CMD_INIT_RXQ_EXT_IN_PACKED_STREAM_BUFF_SIZE_WIDTH 3
  6791. #define MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_1M 0x0 /* enum */
  6792. #define MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_512K 0x1 /* enum */
  6793. #define MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_256K 0x2 /* enum */
  6794. #define MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_128K 0x3 /* enum */
  6795. #define MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_64K 0x4 /* enum */
  6796. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_WANT_OUTER_CLASSES_LBN 18
  6797. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_WANT_OUTER_CLASSES_WIDTH 1
  6798. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_FORCE_EV_MERGING_LBN 19
  6799. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_FORCE_EV_MERGING_WIDTH 1
  6800. /* Owner ID to use if in buffer mode (zero if physical) */
  6801. #define MC_CMD_INIT_RXQ_EXT_IN_OWNER_ID_OFST 20
  6802. #define MC_CMD_INIT_RXQ_EXT_IN_OWNER_ID_LEN 4
  6803. /* The port ID associated with the v-adaptor which should contain this DMAQ. */
  6804. #define MC_CMD_INIT_RXQ_EXT_IN_PORT_ID_OFST 24
  6805. #define MC_CMD_INIT_RXQ_EXT_IN_PORT_ID_LEN 4
  6806. /* 64-bit address of 4k of 4k-aligned host memory buffer */
  6807. #define MC_CMD_INIT_RXQ_EXT_IN_DMA_ADDR_OFST 28
  6808. #define MC_CMD_INIT_RXQ_EXT_IN_DMA_ADDR_LEN 8
  6809. #define MC_CMD_INIT_RXQ_EXT_IN_DMA_ADDR_LO_OFST 28
  6810. #define MC_CMD_INIT_RXQ_EXT_IN_DMA_ADDR_HI_OFST 32
  6811. #define MC_CMD_INIT_RXQ_EXT_IN_DMA_ADDR_NUM 64
  6812. /* Maximum length of packet to receive, if SNAPSHOT_MODE flag is set */
  6813. #define MC_CMD_INIT_RXQ_EXT_IN_SNAPSHOT_LENGTH_OFST 540
  6814. #define MC_CMD_INIT_RXQ_EXT_IN_SNAPSHOT_LENGTH_LEN 4
  6815. /* MC_CMD_INIT_RXQ_V3_IN msgrequest */
  6816. #define MC_CMD_INIT_RXQ_V3_IN_LEN 560
  6817. /* Size, in entries */
  6818. #define MC_CMD_INIT_RXQ_V3_IN_SIZE_OFST 0
  6819. #define MC_CMD_INIT_RXQ_V3_IN_SIZE_LEN 4
  6820. /* The EVQ to send events to. This is an index originally specified to
  6821. * INIT_EVQ. If DMA_MODE == PACKED_STREAM this must be equal to INSTANCE.
  6822. */
  6823. #define MC_CMD_INIT_RXQ_V3_IN_TARGET_EVQ_OFST 4
  6824. #define MC_CMD_INIT_RXQ_V3_IN_TARGET_EVQ_LEN 4
  6825. /* The value to put in the event data. Check hardware spec. for valid range.
  6826. * This field is ignored if DMA_MODE == EQUAL_STRIDE_PACKED_STREAM or DMA_MODE
  6827. * == PACKED_STREAM.
  6828. */
  6829. #define MC_CMD_INIT_RXQ_V3_IN_LABEL_OFST 8
  6830. #define MC_CMD_INIT_RXQ_V3_IN_LABEL_LEN 4
  6831. /* Desired instance. Must be set to a specific instance, which is a function
  6832. * local queue index.
  6833. */
  6834. #define MC_CMD_INIT_RXQ_V3_IN_INSTANCE_OFST 12
  6835. #define MC_CMD_INIT_RXQ_V3_IN_INSTANCE_LEN 4
  6836. /* There will be more flags here. */
  6837. #define MC_CMD_INIT_RXQ_V3_IN_FLAGS_OFST 16
  6838. #define MC_CMD_INIT_RXQ_V3_IN_FLAGS_LEN 4
  6839. #define MC_CMD_INIT_RXQ_V3_IN_FLAG_BUFF_MODE_LBN 0
  6840. #define MC_CMD_INIT_RXQ_V3_IN_FLAG_BUFF_MODE_WIDTH 1
  6841. #define MC_CMD_INIT_RXQ_V3_IN_FLAG_HDR_SPLIT_LBN 1
  6842. #define MC_CMD_INIT_RXQ_V3_IN_FLAG_HDR_SPLIT_WIDTH 1
  6843. #define MC_CMD_INIT_RXQ_V3_IN_FLAG_TIMESTAMP_LBN 2
  6844. #define MC_CMD_INIT_RXQ_V3_IN_FLAG_TIMESTAMP_WIDTH 1
  6845. #define MC_CMD_INIT_RXQ_V3_IN_CRC_MODE_LBN 3
  6846. #define MC_CMD_INIT_RXQ_V3_IN_CRC_MODE_WIDTH 4
  6847. #define MC_CMD_INIT_RXQ_V3_IN_FLAG_CHAIN_LBN 7
  6848. #define MC_CMD_INIT_RXQ_V3_IN_FLAG_CHAIN_WIDTH 1
  6849. #define MC_CMD_INIT_RXQ_V3_IN_FLAG_PREFIX_LBN 8
  6850. #define MC_CMD_INIT_RXQ_V3_IN_FLAG_PREFIX_WIDTH 1
  6851. #define MC_CMD_INIT_RXQ_V3_IN_FLAG_DISABLE_SCATTER_LBN 9
  6852. #define MC_CMD_INIT_RXQ_V3_IN_FLAG_DISABLE_SCATTER_WIDTH 1
  6853. #define MC_CMD_INIT_RXQ_V3_IN_DMA_MODE_LBN 10
  6854. #define MC_CMD_INIT_RXQ_V3_IN_DMA_MODE_WIDTH 4
  6855. /* enum: One packet per descriptor (for normal networking) */
  6856. #define MC_CMD_INIT_RXQ_V3_IN_SINGLE_PACKET 0x0
  6857. /* enum: Pack multiple packets into large descriptors (for SolarCapture) */
  6858. #define MC_CMD_INIT_RXQ_V3_IN_PACKED_STREAM 0x1
  6859. /* enum: Pack multiple packets into large descriptors using the format designed
  6860. * to maximise packet rate. This mode uses 1 "bucket" per descriptor with
  6861. * multiple fixed-size packet buffers within each bucket. For a full
  6862. * description see SF-119419-TC. This mode is only supported by "dpdk" datapath
  6863. * firmware.
  6864. */
  6865. #define MC_CMD_INIT_RXQ_V3_IN_EQUAL_STRIDE_PACKED_STREAM 0x2
  6866. #define MC_CMD_INIT_RXQ_V3_IN_FLAG_SNAPSHOT_MODE_LBN 14
  6867. #define MC_CMD_INIT_RXQ_V3_IN_FLAG_SNAPSHOT_MODE_WIDTH 1
  6868. #define MC_CMD_INIT_RXQ_V3_IN_PACKED_STREAM_BUFF_SIZE_LBN 15
  6869. #define MC_CMD_INIT_RXQ_V3_IN_PACKED_STREAM_BUFF_SIZE_WIDTH 3
  6870. #define MC_CMD_INIT_RXQ_V3_IN_PS_BUFF_1M 0x0 /* enum */
  6871. #define MC_CMD_INIT_RXQ_V3_IN_PS_BUFF_512K 0x1 /* enum */
  6872. #define MC_CMD_INIT_RXQ_V3_IN_PS_BUFF_256K 0x2 /* enum */
  6873. #define MC_CMD_INIT_RXQ_V3_IN_PS_BUFF_128K 0x3 /* enum */
  6874. #define MC_CMD_INIT_RXQ_V3_IN_PS_BUFF_64K 0x4 /* enum */
  6875. #define MC_CMD_INIT_RXQ_V3_IN_FLAG_WANT_OUTER_CLASSES_LBN 18
  6876. #define MC_CMD_INIT_RXQ_V3_IN_FLAG_WANT_OUTER_CLASSES_WIDTH 1
  6877. #define MC_CMD_INIT_RXQ_V3_IN_FLAG_FORCE_EV_MERGING_LBN 19
  6878. #define MC_CMD_INIT_RXQ_V3_IN_FLAG_FORCE_EV_MERGING_WIDTH 1
  6879. /* Owner ID to use if in buffer mode (zero if physical) */
  6880. #define MC_CMD_INIT_RXQ_V3_IN_OWNER_ID_OFST 20
  6881. #define MC_CMD_INIT_RXQ_V3_IN_OWNER_ID_LEN 4
  6882. /* The port ID associated with the v-adaptor which should contain this DMAQ. */
  6883. #define MC_CMD_INIT_RXQ_V3_IN_PORT_ID_OFST 24
  6884. #define MC_CMD_INIT_RXQ_V3_IN_PORT_ID_LEN 4
  6885. /* 64-bit address of 4k of 4k-aligned host memory buffer */
  6886. #define MC_CMD_INIT_RXQ_V3_IN_DMA_ADDR_OFST 28
  6887. #define MC_CMD_INIT_RXQ_V3_IN_DMA_ADDR_LEN 8
  6888. #define MC_CMD_INIT_RXQ_V3_IN_DMA_ADDR_LO_OFST 28
  6889. #define MC_CMD_INIT_RXQ_V3_IN_DMA_ADDR_HI_OFST 32
  6890. #define MC_CMD_INIT_RXQ_V3_IN_DMA_ADDR_NUM 64
  6891. /* Maximum length of packet to receive, if SNAPSHOT_MODE flag is set */
  6892. #define MC_CMD_INIT_RXQ_V3_IN_SNAPSHOT_LENGTH_OFST 540
  6893. #define MC_CMD_INIT_RXQ_V3_IN_SNAPSHOT_LENGTH_LEN 4
  6894. /* The number of packet buffers that will be contained within each
  6895. * EQUAL_STRIDE_PACKED_STREAM format bucket supplied by the driver. This field
  6896. * is ignored unless DMA_MODE == EQUAL_STRIDE_PACKED_STREAM.
  6897. */
  6898. #define MC_CMD_INIT_RXQ_V3_IN_ES_PACKET_BUFFERS_PER_BUCKET_OFST 544
  6899. #define MC_CMD_INIT_RXQ_V3_IN_ES_PACKET_BUFFERS_PER_BUCKET_LEN 4
  6900. /* The length in bytes of the area in each packet buffer that can be written to
  6901. * by the adapter. This is used to store the packet prefix and the packet
  6902. * payload. This length does not include any end padding added by the driver.
  6903. * This field is ignored unless DMA_MODE == EQUAL_STRIDE_PACKED_STREAM.
  6904. */
  6905. #define MC_CMD_INIT_RXQ_V3_IN_ES_MAX_DMA_LEN_OFST 548
  6906. #define MC_CMD_INIT_RXQ_V3_IN_ES_MAX_DMA_LEN_LEN 4
  6907. /* The length in bytes of a single packet buffer within a
  6908. * EQUAL_STRIDE_PACKED_STREAM format bucket. This field is ignored unless
  6909. * DMA_MODE == EQUAL_STRIDE_PACKED_STREAM.
  6910. */
  6911. #define MC_CMD_INIT_RXQ_V3_IN_ES_PACKET_STRIDE_OFST 552
  6912. #define MC_CMD_INIT_RXQ_V3_IN_ES_PACKET_STRIDE_LEN 4
  6913. /* The maximum time in nanoseconds that the datapath will be backpressured if
  6914. * there are no RX descriptors available. If the timeout is reached and there
  6915. * are still no descriptors then the packet will be dropped. A timeout of 0
  6916. * means the datapath will never be blocked. This field is ignored unless
  6917. * DMA_MODE == EQUAL_STRIDE_PACKED_STREAM.
  6918. */
  6919. #define MC_CMD_INIT_RXQ_V3_IN_ES_HEAD_OF_LINE_BLOCK_TIMEOUT_OFST 556
  6920. #define MC_CMD_INIT_RXQ_V3_IN_ES_HEAD_OF_LINE_BLOCK_TIMEOUT_LEN 4
  6921. /* MC_CMD_INIT_RXQ_OUT msgresponse */
  6922. #define MC_CMD_INIT_RXQ_OUT_LEN 0
  6923. /* MC_CMD_INIT_RXQ_EXT_OUT msgresponse */
  6924. #define MC_CMD_INIT_RXQ_EXT_OUT_LEN 0
  6925. /* MC_CMD_INIT_RXQ_V3_OUT msgresponse */
  6926. #define MC_CMD_INIT_RXQ_V3_OUT_LEN 0
  6927. /***********************************/
  6928. /* MC_CMD_INIT_TXQ
  6929. */
  6930. #define MC_CMD_INIT_TXQ 0x82
  6931. #define MC_CMD_0x82_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  6932. /* MC_CMD_INIT_TXQ_IN msgrequest: Legacy INIT_TXQ request. Use extended version
  6933. * in new code.
  6934. */
  6935. #define MC_CMD_INIT_TXQ_IN_LENMIN 36
  6936. #define MC_CMD_INIT_TXQ_IN_LENMAX 252
  6937. #define MC_CMD_INIT_TXQ_IN_LEN(num) (28+8*(num))
  6938. /* Size, in entries */
  6939. #define MC_CMD_INIT_TXQ_IN_SIZE_OFST 0
  6940. #define MC_CMD_INIT_TXQ_IN_SIZE_LEN 4
  6941. /* The EVQ to send events to. This is an index originally specified to
  6942. * INIT_EVQ.
  6943. */
  6944. #define MC_CMD_INIT_TXQ_IN_TARGET_EVQ_OFST 4
  6945. #define MC_CMD_INIT_TXQ_IN_TARGET_EVQ_LEN 4
  6946. /* The value to put in the event data. Check hardware spec. for valid range. */
  6947. #define MC_CMD_INIT_TXQ_IN_LABEL_OFST 8
  6948. #define MC_CMD_INIT_TXQ_IN_LABEL_LEN 4
  6949. /* Desired instance. Must be set to a specific instance, which is a function
  6950. * local queue index.
  6951. */
  6952. #define MC_CMD_INIT_TXQ_IN_INSTANCE_OFST 12
  6953. #define MC_CMD_INIT_TXQ_IN_INSTANCE_LEN 4
  6954. /* There will be more flags here. */
  6955. #define MC_CMD_INIT_TXQ_IN_FLAGS_OFST 16
  6956. #define MC_CMD_INIT_TXQ_IN_FLAGS_LEN 4
  6957. #define MC_CMD_INIT_TXQ_IN_FLAG_BUFF_MODE_LBN 0
  6958. #define MC_CMD_INIT_TXQ_IN_FLAG_BUFF_MODE_WIDTH 1
  6959. #define MC_CMD_INIT_TXQ_IN_FLAG_IP_CSUM_DIS_LBN 1
  6960. #define MC_CMD_INIT_TXQ_IN_FLAG_IP_CSUM_DIS_WIDTH 1
  6961. #define MC_CMD_INIT_TXQ_IN_FLAG_TCP_CSUM_DIS_LBN 2
  6962. #define MC_CMD_INIT_TXQ_IN_FLAG_TCP_CSUM_DIS_WIDTH 1
  6963. #define MC_CMD_INIT_TXQ_IN_FLAG_TCP_UDP_ONLY_LBN 3
  6964. #define MC_CMD_INIT_TXQ_IN_FLAG_TCP_UDP_ONLY_WIDTH 1
  6965. #define MC_CMD_INIT_TXQ_IN_CRC_MODE_LBN 4
  6966. #define MC_CMD_INIT_TXQ_IN_CRC_MODE_WIDTH 4
  6967. #define MC_CMD_INIT_TXQ_IN_FLAG_TIMESTAMP_LBN 8
  6968. #define MC_CMD_INIT_TXQ_IN_FLAG_TIMESTAMP_WIDTH 1
  6969. #define MC_CMD_INIT_TXQ_IN_FLAG_PACER_BYPASS_LBN 9
  6970. #define MC_CMD_INIT_TXQ_IN_FLAG_PACER_BYPASS_WIDTH 1
  6971. #define MC_CMD_INIT_TXQ_IN_FLAG_INNER_IP_CSUM_EN_LBN 10
  6972. #define MC_CMD_INIT_TXQ_IN_FLAG_INNER_IP_CSUM_EN_WIDTH 1
  6973. #define MC_CMD_INIT_TXQ_IN_FLAG_INNER_TCP_CSUM_EN_LBN 11
  6974. #define MC_CMD_INIT_TXQ_IN_FLAG_INNER_TCP_CSUM_EN_WIDTH 1
  6975. /* Owner ID to use if in buffer mode (zero if physical) */
  6976. #define MC_CMD_INIT_TXQ_IN_OWNER_ID_OFST 20
  6977. #define MC_CMD_INIT_TXQ_IN_OWNER_ID_LEN 4
  6978. /* The port ID associated with the v-adaptor which should contain this DMAQ. */
  6979. #define MC_CMD_INIT_TXQ_IN_PORT_ID_OFST 24
  6980. #define MC_CMD_INIT_TXQ_IN_PORT_ID_LEN 4
  6981. /* 64-bit address of 4k of 4k-aligned host memory buffer */
  6982. #define MC_CMD_INIT_TXQ_IN_DMA_ADDR_OFST 28
  6983. #define MC_CMD_INIT_TXQ_IN_DMA_ADDR_LEN 8
  6984. #define MC_CMD_INIT_TXQ_IN_DMA_ADDR_LO_OFST 28
  6985. #define MC_CMD_INIT_TXQ_IN_DMA_ADDR_HI_OFST 32
  6986. #define MC_CMD_INIT_TXQ_IN_DMA_ADDR_MINNUM 1
  6987. #define MC_CMD_INIT_TXQ_IN_DMA_ADDR_MAXNUM 28
  6988. /* MC_CMD_INIT_TXQ_EXT_IN msgrequest: Extended INIT_TXQ with additional mode
  6989. * flags
  6990. */
  6991. #define MC_CMD_INIT_TXQ_EXT_IN_LEN 544
  6992. /* Size, in entries */
  6993. #define MC_CMD_INIT_TXQ_EXT_IN_SIZE_OFST 0
  6994. #define MC_CMD_INIT_TXQ_EXT_IN_SIZE_LEN 4
  6995. /* The EVQ to send events to. This is an index originally specified to
  6996. * INIT_EVQ.
  6997. */
  6998. #define MC_CMD_INIT_TXQ_EXT_IN_TARGET_EVQ_OFST 4
  6999. #define MC_CMD_INIT_TXQ_EXT_IN_TARGET_EVQ_LEN 4
  7000. /* The value to put in the event data. Check hardware spec. for valid range. */
  7001. #define MC_CMD_INIT_TXQ_EXT_IN_LABEL_OFST 8
  7002. #define MC_CMD_INIT_TXQ_EXT_IN_LABEL_LEN 4
  7003. /* Desired instance. Must be set to a specific instance, which is a function
  7004. * local queue index.
  7005. */
  7006. #define MC_CMD_INIT_TXQ_EXT_IN_INSTANCE_OFST 12
  7007. #define MC_CMD_INIT_TXQ_EXT_IN_INSTANCE_LEN 4
  7008. /* There will be more flags here. */
  7009. #define MC_CMD_INIT_TXQ_EXT_IN_FLAGS_OFST 16
  7010. #define MC_CMD_INIT_TXQ_EXT_IN_FLAGS_LEN 4
  7011. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_BUFF_MODE_LBN 0
  7012. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_BUFF_MODE_WIDTH 1
  7013. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_IP_CSUM_DIS_LBN 1
  7014. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_IP_CSUM_DIS_WIDTH 1
  7015. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_TCP_CSUM_DIS_LBN 2
  7016. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_TCP_CSUM_DIS_WIDTH 1
  7017. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_TCP_UDP_ONLY_LBN 3
  7018. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_TCP_UDP_ONLY_WIDTH 1
  7019. #define MC_CMD_INIT_TXQ_EXT_IN_CRC_MODE_LBN 4
  7020. #define MC_CMD_INIT_TXQ_EXT_IN_CRC_MODE_WIDTH 4
  7021. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_TIMESTAMP_LBN 8
  7022. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_TIMESTAMP_WIDTH 1
  7023. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_PACER_BYPASS_LBN 9
  7024. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_PACER_BYPASS_WIDTH 1
  7025. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_INNER_IP_CSUM_EN_LBN 10
  7026. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_INNER_IP_CSUM_EN_WIDTH 1
  7027. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_INNER_TCP_CSUM_EN_LBN 11
  7028. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_INNER_TCP_CSUM_EN_WIDTH 1
  7029. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_TSOV2_EN_LBN 12
  7030. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_TSOV2_EN_WIDTH 1
  7031. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_CTPIO_LBN 13
  7032. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_CTPIO_WIDTH 1
  7033. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_CTPIO_UTHRESH_LBN 14
  7034. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_CTPIO_UTHRESH_WIDTH 1
  7035. /* Owner ID to use if in buffer mode (zero if physical) */
  7036. #define MC_CMD_INIT_TXQ_EXT_IN_OWNER_ID_OFST 20
  7037. #define MC_CMD_INIT_TXQ_EXT_IN_OWNER_ID_LEN 4
  7038. /* The port ID associated with the v-adaptor which should contain this DMAQ. */
  7039. #define MC_CMD_INIT_TXQ_EXT_IN_PORT_ID_OFST 24
  7040. #define MC_CMD_INIT_TXQ_EXT_IN_PORT_ID_LEN 4
  7041. /* 64-bit address of 4k of 4k-aligned host memory buffer */
  7042. #define MC_CMD_INIT_TXQ_EXT_IN_DMA_ADDR_OFST 28
  7043. #define MC_CMD_INIT_TXQ_EXT_IN_DMA_ADDR_LEN 8
  7044. #define MC_CMD_INIT_TXQ_EXT_IN_DMA_ADDR_LO_OFST 28
  7045. #define MC_CMD_INIT_TXQ_EXT_IN_DMA_ADDR_HI_OFST 32
  7046. #define MC_CMD_INIT_TXQ_EXT_IN_DMA_ADDR_MINNUM 1
  7047. #define MC_CMD_INIT_TXQ_EXT_IN_DMA_ADDR_MAXNUM 64
  7048. /* Flags related to Qbb flow control mode. */
  7049. #define MC_CMD_INIT_TXQ_EXT_IN_QBB_FLAGS_OFST 540
  7050. #define MC_CMD_INIT_TXQ_EXT_IN_QBB_FLAGS_LEN 4
  7051. #define MC_CMD_INIT_TXQ_EXT_IN_QBB_ENABLE_LBN 0
  7052. #define MC_CMD_INIT_TXQ_EXT_IN_QBB_ENABLE_WIDTH 1
  7053. #define MC_CMD_INIT_TXQ_EXT_IN_QBB_PRIORITY_LBN 1
  7054. #define MC_CMD_INIT_TXQ_EXT_IN_QBB_PRIORITY_WIDTH 3
  7055. /* MC_CMD_INIT_TXQ_OUT msgresponse */
  7056. #define MC_CMD_INIT_TXQ_OUT_LEN 0
  7057. /***********************************/
  7058. /* MC_CMD_FINI_EVQ
  7059. * Teardown an EVQ.
  7060. *
  7061. * All DMAQs or EVQs that point to the EVQ to tear down must be torn down first
  7062. * or the operation will fail with EBUSY
  7063. */
  7064. #define MC_CMD_FINI_EVQ 0x83
  7065. #define MC_CMD_0x83_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  7066. /* MC_CMD_FINI_EVQ_IN msgrequest */
  7067. #define MC_CMD_FINI_EVQ_IN_LEN 4
  7068. /* Instance of EVQ to destroy. Should be the same instance as that previously
  7069. * passed to INIT_EVQ
  7070. */
  7071. #define MC_CMD_FINI_EVQ_IN_INSTANCE_OFST 0
  7072. #define MC_CMD_FINI_EVQ_IN_INSTANCE_LEN 4
  7073. /* MC_CMD_FINI_EVQ_OUT msgresponse */
  7074. #define MC_CMD_FINI_EVQ_OUT_LEN 0
  7075. /***********************************/
  7076. /* MC_CMD_FINI_RXQ
  7077. * Teardown a RXQ.
  7078. */
  7079. #define MC_CMD_FINI_RXQ 0x84
  7080. #define MC_CMD_0x84_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  7081. /* MC_CMD_FINI_RXQ_IN msgrequest */
  7082. #define MC_CMD_FINI_RXQ_IN_LEN 4
  7083. /* Instance of RXQ to destroy */
  7084. #define MC_CMD_FINI_RXQ_IN_INSTANCE_OFST 0
  7085. #define MC_CMD_FINI_RXQ_IN_INSTANCE_LEN 4
  7086. /* MC_CMD_FINI_RXQ_OUT msgresponse */
  7087. #define MC_CMD_FINI_RXQ_OUT_LEN 0
  7088. /***********************************/
  7089. /* MC_CMD_FINI_TXQ
  7090. * Teardown a TXQ.
  7091. */
  7092. #define MC_CMD_FINI_TXQ 0x85
  7093. #define MC_CMD_0x85_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  7094. /* MC_CMD_FINI_TXQ_IN msgrequest */
  7095. #define MC_CMD_FINI_TXQ_IN_LEN 4
  7096. /* Instance of TXQ to destroy */
  7097. #define MC_CMD_FINI_TXQ_IN_INSTANCE_OFST 0
  7098. #define MC_CMD_FINI_TXQ_IN_INSTANCE_LEN 4
  7099. /* MC_CMD_FINI_TXQ_OUT msgresponse */
  7100. #define MC_CMD_FINI_TXQ_OUT_LEN 0
  7101. /***********************************/
  7102. /* MC_CMD_DRIVER_EVENT
  7103. * Generate an event on an EVQ belonging to the function issuing the command.
  7104. */
  7105. #define MC_CMD_DRIVER_EVENT 0x86
  7106. #define MC_CMD_0x86_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  7107. /* MC_CMD_DRIVER_EVENT_IN msgrequest */
  7108. #define MC_CMD_DRIVER_EVENT_IN_LEN 12
  7109. /* Handle of target EVQ */
  7110. #define MC_CMD_DRIVER_EVENT_IN_EVQ_OFST 0
  7111. #define MC_CMD_DRIVER_EVENT_IN_EVQ_LEN 4
  7112. /* Bits 0 - 63 of event */
  7113. #define MC_CMD_DRIVER_EVENT_IN_DATA_OFST 4
  7114. #define MC_CMD_DRIVER_EVENT_IN_DATA_LEN 8
  7115. #define MC_CMD_DRIVER_EVENT_IN_DATA_LO_OFST 4
  7116. #define MC_CMD_DRIVER_EVENT_IN_DATA_HI_OFST 8
  7117. /* MC_CMD_DRIVER_EVENT_OUT msgresponse */
  7118. #define MC_CMD_DRIVER_EVENT_OUT_LEN 0
  7119. /***********************************/
  7120. /* MC_CMD_PROXY_CMD
  7121. * Execute an arbitrary MCDI command on behalf of a different function, subject
  7122. * to security restrictions. The command to be proxied follows immediately
  7123. * afterward in the host buffer (or on the UART). This command supercedes
  7124. * MC_CMD_SET_FUNC, which remains available for Siena but now deprecated.
  7125. */
  7126. #define MC_CMD_PROXY_CMD 0x5b
  7127. #define MC_CMD_0x5b_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  7128. /* MC_CMD_PROXY_CMD_IN msgrequest */
  7129. #define MC_CMD_PROXY_CMD_IN_LEN 4
  7130. /* The handle of the target function. */
  7131. #define MC_CMD_PROXY_CMD_IN_TARGET_OFST 0
  7132. #define MC_CMD_PROXY_CMD_IN_TARGET_LEN 4
  7133. #define MC_CMD_PROXY_CMD_IN_TARGET_PF_LBN 0
  7134. #define MC_CMD_PROXY_CMD_IN_TARGET_PF_WIDTH 16
  7135. #define MC_CMD_PROXY_CMD_IN_TARGET_VF_LBN 16
  7136. #define MC_CMD_PROXY_CMD_IN_TARGET_VF_WIDTH 16
  7137. #define MC_CMD_PROXY_CMD_IN_VF_NULL 0xffff /* enum */
  7138. /* MC_CMD_PROXY_CMD_OUT msgresponse */
  7139. #define MC_CMD_PROXY_CMD_OUT_LEN 0
  7140. /* MC_PROXY_STATUS_BUFFER structuredef: Host memory status buffer used to
  7141. * manage proxied requests
  7142. */
  7143. #define MC_PROXY_STATUS_BUFFER_LEN 16
  7144. /* Handle allocated by the firmware for this proxy transaction */
  7145. #define MC_PROXY_STATUS_BUFFER_HANDLE_OFST 0
  7146. #define MC_PROXY_STATUS_BUFFER_HANDLE_LEN 4
  7147. /* enum: An invalid handle. */
  7148. #define MC_PROXY_STATUS_BUFFER_HANDLE_INVALID 0x0
  7149. #define MC_PROXY_STATUS_BUFFER_HANDLE_LBN 0
  7150. #define MC_PROXY_STATUS_BUFFER_HANDLE_WIDTH 32
  7151. /* The requesting physical function number */
  7152. #define MC_PROXY_STATUS_BUFFER_PF_OFST 4
  7153. #define MC_PROXY_STATUS_BUFFER_PF_LEN 2
  7154. #define MC_PROXY_STATUS_BUFFER_PF_LBN 32
  7155. #define MC_PROXY_STATUS_BUFFER_PF_WIDTH 16
  7156. /* The requesting virtual function number. Set to VF_NULL if the target is a
  7157. * PF.
  7158. */
  7159. #define MC_PROXY_STATUS_BUFFER_VF_OFST 6
  7160. #define MC_PROXY_STATUS_BUFFER_VF_LEN 2
  7161. #define MC_PROXY_STATUS_BUFFER_VF_LBN 48
  7162. #define MC_PROXY_STATUS_BUFFER_VF_WIDTH 16
  7163. /* The target function RID. */
  7164. #define MC_PROXY_STATUS_BUFFER_RID_OFST 8
  7165. #define MC_PROXY_STATUS_BUFFER_RID_LEN 2
  7166. #define MC_PROXY_STATUS_BUFFER_RID_LBN 64
  7167. #define MC_PROXY_STATUS_BUFFER_RID_WIDTH 16
  7168. /* The status of the proxy as described in MC_CMD_PROXY_COMPLETE. */
  7169. #define MC_PROXY_STATUS_BUFFER_STATUS_OFST 10
  7170. #define MC_PROXY_STATUS_BUFFER_STATUS_LEN 2
  7171. #define MC_PROXY_STATUS_BUFFER_STATUS_LBN 80
  7172. #define MC_PROXY_STATUS_BUFFER_STATUS_WIDTH 16
  7173. /* If a request is authorized rather than carried out by the host, this is the
  7174. * elevated privilege mask granted to the requesting function.
  7175. */
  7176. #define MC_PROXY_STATUS_BUFFER_GRANTED_PRIVILEGES_OFST 12
  7177. #define MC_PROXY_STATUS_BUFFER_GRANTED_PRIVILEGES_LEN 4
  7178. #define MC_PROXY_STATUS_BUFFER_GRANTED_PRIVILEGES_LBN 96
  7179. #define MC_PROXY_STATUS_BUFFER_GRANTED_PRIVILEGES_WIDTH 32
  7180. /***********************************/
  7181. /* MC_CMD_PROXY_CONFIGURE
  7182. * Enable/disable authorization of MCDI requests from unprivileged functions by
  7183. * a designated admin function
  7184. */
  7185. #define MC_CMD_PROXY_CONFIGURE 0x58
  7186. #define MC_CMD_0x58_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  7187. /* MC_CMD_PROXY_CONFIGURE_IN msgrequest */
  7188. #define MC_CMD_PROXY_CONFIGURE_IN_LEN 108
  7189. #define MC_CMD_PROXY_CONFIGURE_IN_FLAGS_OFST 0
  7190. #define MC_CMD_PROXY_CONFIGURE_IN_FLAGS_LEN 4
  7191. #define MC_CMD_PROXY_CONFIGURE_IN_ENABLE_LBN 0
  7192. #define MC_CMD_PROXY_CONFIGURE_IN_ENABLE_WIDTH 1
  7193. /* Host provides a contiguous memory buffer that contains at least NUM_BLOCKS
  7194. * of blocks, each of the size REQUEST_BLOCK_SIZE.
  7195. */
  7196. #define MC_CMD_PROXY_CONFIGURE_IN_STATUS_BUFF_ADDR_OFST 4
  7197. #define MC_CMD_PROXY_CONFIGURE_IN_STATUS_BUFF_ADDR_LEN 8
  7198. #define MC_CMD_PROXY_CONFIGURE_IN_STATUS_BUFF_ADDR_LO_OFST 4
  7199. #define MC_CMD_PROXY_CONFIGURE_IN_STATUS_BUFF_ADDR_HI_OFST 8
  7200. /* Must be a power of 2 */
  7201. #define MC_CMD_PROXY_CONFIGURE_IN_STATUS_BLOCK_SIZE_OFST 12
  7202. #define MC_CMD_PROXY_CONFIGURE_IN_STATUS_BLOCK_SIZE_LEN 4
  7203. /* Host provides a contiguous memory buffer that contains at least NUM_BLOCKS
  7204. * of blocks, each of the size REPLY_BLOCK_SIZE.
  7205. */
  7206. #define MC_CMD_PROXY_CONFIGURE_IN_REQUEST_BUFF_ADDR_OFST 16
  7207. #define MC_CMD_PROXY_CONFIGURE_IN_REQUEST_BUFF_ADDR_LEN 8
  7208. #define MC_CMD_PROXY_CONFIGURE_IN_REQUEST_BUFF_ADDR_LO_OFST 16
  7209. #define MC_CMD_PROXY_CONFIGURE_IN_REQUEST_BUFF_ADDR_HI_OFST 20
  7210. /* Must be a power of 2 */
  7211. #define MC_CMD_PROXY_CONFIGURE_IN_REQUEST_BLOCK_SIZE_OFST 24
  7212. #define MC_CMD_PROXY_CONFIGURE_IN_REQUEST_BLOCK_SIZE_LEN 4
  7213. /* Host provides a contiguous memory buffer that contains at least NUM_BLOCKS
  7214. * of blocks, each of the size STATUS_BLOCK_SIZE. This buffer is only needed if
  7215. * host intends to complete proxied operations by using MC_CMD_PROXY_CMD.
  7216. */
  7217. #define MC_CMD_PROXY_CONFIGURE_IN_REPLY_BUFF_ADDR_OFST 28
  7218. #define MC_CMD_PROXY_CONFIGURE_IN_REPLY_BUFF_ADDR_LEN 8
  7219. #define MC_CMD_PROXY_CONFIGURE_IN_REPLY_BUFF_ADDR_LO_OFST 28
  7220. #define MC_CMD_PROXY_CONFIGURE_IN_REPLY_BUFF_ADDR_HI_OFST 32
  7221. /* Must be a power of 2, or zero if this buffer is not provided */
  7222. #define MC_CMD_PROXY_CONFIGURE_IN_REPLY_BLOCK_SIZE_OFST 36
  7223. #define MC_CMD_PROXY_CONFIGURE_IN_REPLY_BLOCK_SIZE_LEN 4
  7224. /* Applies to all three buffers */
  7225. #define MC_CMD_PROXY_CONFIGURE_IN_NUM_BLOCKS_OFST 40
  7226. #define MC_CMD_PROXY_CONFIGURE_IN_NUM_BLOCKS_LEN 4
  7227. /* A bit mask defining which MCDI operations may be proxied */
  7228. #define MC_CMD_PROXY_CONFIGURE_IN_ALLOWED_MCDI_MASK_OFST 44
  7229. #define MC_CMD_PROXY_CONFIGURE_IN_ALLOWED_MCDI_MASK_LEN 64
  7230. /* MC_CMD_PROXY_CONFIGURE_EXT_IN msgrequest */
  7231. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_LEN 112
  7232. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_FLAGS_OFST 0
  7233. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_FLAGS_LEN 4
  7234. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_ENABLE_LBN 0
  7235. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_ENABLE_WIDTH 1
  7236. /* Host provides a contiguous memory buffer that contains at least NUM_BLOCKS
  7237. * of blocks, each of the size REQUEST_BLOCK_SIZE.
  7238. */
  7239. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_STATUS_BUFF_ADDR_OFST 4
  7240. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_STATUS_BUFF_ADDR_LEN 8
  7241. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_STATUS_BUFF_ADDR_LO_OFST 4
  7242. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_STATUS_BUFF_ADDR_HI_OFST 8
  7243. /* Must be a power of 2 */
  7244. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_STATUS_BLOCK_SIZE_OFST 12
  7245. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_STATUS_BLOCK_SIZE_LEN 4
  7246. /* Host provides a contiguous memory buffer that contains at least NUM_BLOCKS
  7247. * of blocks, each of the size REPLY_BLOCK_SIZE.
  7248. */
  7249. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_REQUEST_BUFF_ADDR_OFST 16
  7250. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_REQUEST_BUFF_ADDR_LEN 8
  7251. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_REQUEST_BUFF_ADDR_LO_OFST 16
  7252. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_REQUEST_BUFF_ADDR_HI_OFST 20
  7253. /* Must be a power of 2 */
  7254. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_REQUEST_BLOCK_SIZE_OFST 24
  7255. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_REQUEST_BLOCK_SIZE_LEN 4
  7256. /* Host provides a contiguous memory buffer that contains at least NUM_BLOCKS
  7257. * of blocks, each of the size STATUS_BLOCK_SIZE. This buffer is only needed if
  7258. * host intends to complete proxied operations by using MC_CMD_PROXY_CMD.
  7259. */
  7260. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_REPLY_BUFF_ADDR_OFST 28
  7261. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_REPLY_BUFF_ADDR_LEN 8
  7262. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_REPLY_BUFF_ADDR_LO_OFST 28
  7263. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_REPLY_BUFF_ADDR_HI_OFST 32
  7264. /* Must be a power of 2, or zero if this buffer is not provided */
  7265. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_REPLY_BLOCK_SIZE_OFST 36
  7266. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_REPLY_BLOCK_SIZE_LEN 4
  7267. /* Applies to all three buffers */
  7268. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_NUM_BLOCKS_OFST 40
  7269. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_NUM_BLOCKS_LEN 4
  7270. /* A bit mask defining which MCDI operations may be proxied */
  7271. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_ALLOWED_MCDI_MASK_OFST 44
  7272. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_ALLOWED_MCDI_MASK_LEN 64
  7273. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_RESERVED_OFST 108
  7274. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_RESERVED_LEN 4
  7275. /* MC_CMD_PROXY_CONFIGURE_OUT msgresponse */
  7276. #define MC_CMD_PROXY_CONFIGURE_OUT_LEN 0
  7277. /***********************************/
  7278. /* MC_CMD_PROXY_COMPLETE
  7279. * Tells FW that a requested proxy operation has either been completed (by
  7280. * using MC_CMD_PROXY_CMD) or authorized/declined. May only be sent by the
  7281. * function that enabled proxying/authorization (by using
  7282. * MC_CMD_PROXY_CONFIGURE).
  7283. */
  7284. #define MC_CMD_PROXY_COMPLETE 0x5f
  7285. #define MC_CMD_0x5f_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  7286. /* MC_CMD_PROXY_COMPLETE_IN msgrequest */
  7287. #define MC_CMD_PROXY_COMPLETE_IN_LEN 12
  7288. #define MC_CMD_PROXY_COMPLETE_IN_BLOCK_INDEX_OFST 0
  7289. #define MC_CMD_PROXY_COMPLETE_IN_BLOCK_INDEX_LEN 4
  7290. #define MC_CMD_PROXY_COMPLETE_IN_STATUS_OFST 4
  7291. #define MC_CMD_PROXY_COMPLETE_IN_STATUS_LEN 4
  7292. /* enum: The operation has been completed by using MC_CMD_PROXY_CMD, the reply
  7293. * is stored in the REPLY_BUFF.
  7294. */
  7295. #define MC_CMD_PROXY_COMPLETE_IN_COMPLETE 0x0
  7296. /* enum: The operation has been authorized. The originating function may now
  7297. * try again.
  7298. */
  7299. #define MC_CMD_PROXY_COMPLETE_IN_AUTHORIZED 0x1
  7300. /* enum: The operation has been declined. */
  7301. #define MC_CMD_PROXY_COMPLETE_IN_DECLINED 0x2
  7302. /* enum: The authorization failed because the relevant application did not
  7303. * respond in time.
  7304. */
  7305. #define MC_CMD_PROXY_COMPLETE_IN_TIMEDOUT 0x3
  7306. #define MC_CMD_PROXY_COMPLETE_IN_HANDLE_OFST 8
  7307. #define MC_CMD_PROXY_COMPLETE_IN_HANDLE_LEN 4
  7308. /* MC_CMD_PROXY_COMPLETE_OUT msgresponse */
  7309. #define MC_CMD_PROXY_COMPLETE_OUT_LEN 0
  7310. /***********************************/
  7311. /* MC_CMD_ALLOC_BUFTBL_CHUNK
  7312. * Allocate a set of buffer table entries using the specified owner ID. This
  7313. * operation allocates the required buffer table entries (and fails if it
  7314. * cannot do so). The buffer table entries will initially be zeroed.
  7315. */
  7316. #define MC_CMD_ALLOC_BUFTBL_CHUNK 0x87
  7317. #define MC_CMD_0x87_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
  7318. /* MC_CMD_ALLOC_BUFTBL_CHUNK_IN msgrequest */
  7319. #define MC_CMD_ALLOC_BUFTBL_CHUNK_IN_LEN 8
  7320. /* Owner ID to use */
  7321. #define MC_CMD_ALLOC_BUFTBL_CHUNK_IN_OWNER_OFST 0
  7322. #define MC_CMD_ALLOC_BUFTBL_CHUNK_IN_OWNER_LEN 4
  7323. /* Size of buffer table pages to use, in bytes (note that only a few values are
  7324. * legal on any specific hardware).
  7325. */
  7326. #define MC_CMD_ALLOC_BUFTBL_CHUNK_IN_PAGE_SIZE_OFST 4
  7327. #define MC_CMD_ALLOC_BUFTBL_CHUNK_IN_PAGE_SIZE_LEN 4
  7328. /* MC_CMD_ALLOC_BUFTBL_CHUNK_OUT msgresponse */
  7329. #define MC_CMD_ALLOC_BUFTBL_CHUNK_OUT_LEN 12
  7330. #define MC_CMD_ALLOC_BUFTBL_CHUNK_OUT_HANDLE_OFST 0
  7331. #define MC_CMD_ALLOC_BUFTBL_CHUNK_OUT_HANDLE_LEN 4
  7332. #define MC_CMD_ALLOC_BUFTBL_CHUNK_OUT_NUMENTRIES_OFST 4
  7333. #define MC_CMD_ALLOC_BUFTBL_CHUNK_OUT_NUMENTRIES_LEN 4
  7334. /* Buffer table IDs for use in DMA descriptors. */
  7335. #define MC_CMD_ALLOC_BUFTBL_CHUNK_OUT_ID_OFST 8
  7336. #define MC_CMD_ALLOC_BUFTBL_CHUNK_OUT_ID_LEN 4
  7337. /***********************************/
  7338. /* MC_CMD_PROGRAM_BUFTBL_ENTRIES
  7339. * Reprogram a set of buffer table entries in the specified chunk.
  7340. */
  7341. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES 0x88
  7342. #define MC_CMD_0x88_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
  7343. /* MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN msgrequest */
  7344. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_LENMIN 20
  7345. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_LENMAX 268
  7346. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_LEN(num) (12+8*(num))
  7347. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_HANDLE_OFST 0
  7348. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_HANDLE_LEN 4
  7349. /* ID */
  7350. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_FIRSTID_OFST 4
  7351. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_FIRSTID_LEN 4
  7352. /* Num entries */
  7353. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_NUMENTRIES_OFST 8
  7354. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_NUMENTRIES_LEN 4
  7355. /* Buffer table entry address */
  7356. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_ENTRY_OFST 12
  7357. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_ENTRY_LEN 8
  7358. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_ENTRY_LO_OFST 12
  7359. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_ENTRY_HI_OFST 16
  7360. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_ENTRY_MINNUM 1
  7361. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_ENTRY_MAXNUM 32
  7362. /* MC_CMD_PROGRAM_BUFTBL_ENTRIES_OUT msgresponse */
  7363. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_OUT_LEN 0
  7364. /***********************************/
  7365. /* MC_CMD_FREE_BUFTBL_CHUNK
  7366. */
  7367. #define MC_CMD_FREE_BUFTBL_CHUNK 0x89
  7368. #define MC_CMD_0x89_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
  7369. /* MC_CMD_FREE_BUFTBL_CHUNK_IN msgrequest */
  7370. #define MC_CMD_FREE_BUFTBL_CHUNK_IN_LEN 4
  7371. #define MC_CMD_FREE_BUFTBL_CHUNK_IN_HANDLE_OFST 0
  7372. #define MC_CMD_FREE_BUFTBL_CHUNK_IN_HANDLE_LEN 4
  7373. /* MC_CMD_FREE_BUFTBL_CHUNK_OUT msgresponse */
  7374. #define MC_CMD_FREE_BUFTBL_CHUNK_OUT_LEN 0
  7375. /***********************************/
  7376. /* MC_CMD_FILTER_OP
  7377. * Multiplexed MCDI call for filter operations
  7378. */
  7379. #define MC_CMD_FILTER_OP 0x8a
  7380. #define MC_CMD_0x8a_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  7381. /* MC_CMD_FILTER_OP_IN msgrequest */
  7382. #define MC_CMD_FILTER_OP_IN_LEN 108
  7383. /* identifies the type of operation requested */
  7384. #define MC_CMD_FILTER_OP_IN_OP_OFST 0
  7385. #define MC_CMD_FILTER_OP_IN_OP_LEN 4
  7386. /* enum: single-recipient filter insert */
  7387. #define MC_CMD_FILTER_OP_IN_OP_INSERT 0x0
  7388. /* enum: single-recipient filter remove */
  7389. #define MC_CMD_FILTER_OP_IN_OP_REMOVE 0x1
  7390. /* enum: multi-recipient filter subscribe */
  7391. #define MC_CMD_FILTER_OP_IN_OP_SUBSCRIBE 0x2
  7392. /* enum: multi-recipient filter unsubscribe */
  7393. #define MC_CMD_FILTER_OP_IN_OP_UNSUBSCRIBE 0x3
  7394. /* enum: replace one recipient with another (warning - the filter handle may
  7395. * change)
  7396. */
  7397. #define MC_CMD_FILTER_OP_IN_OP_REPLACE 0x4
  7398. /* filter handle (for remove / unsubscribe operations) */
  7399. #define MC_CMD_FILTER_OP_IN_HANDLE_OFST 4
  7400. #define MC_CMD_FILTER_OP_IN_HANDLE_LEN 8
  7401. #define MC_CMD_FILTER_OP_IN_HANDLE_LO_OFST 4
  7402. #define MC_CMD_FILTER_OP_IN_HANDLE_HI_OFST 8
  7403. /* The port ID associated with the v-adaptor which should contain this filter.
  7404. */
  7405. #define MC_CMD_FILTER_OP_IN_PORT_ID_OFST 12
  7406. #define MC_CMD_FILTER_OP_IN_PORT_ID_LEN 4
  7407. /* fields to include in match criteria */
  7408. #define MC_CMD_FILTER_OP_IN_MATCH_FIELDS_OFST 16
  7409. #define MC_CMD_FILTER_OP_IN_MATCH_FIELDS_LEN 4
  7410. #define MC_CMD_FILTER_OP_IN_MATCH_SRC_IP_LBN 0
  7411. #define MC_CMD_FILTER_OP_IN_MATCH_SRC_IP_WIDTH 1
  7412. #define MC_CMD_FILTER_OP_IN_MATCH_DST_IP_LBN 1
  7413. #define MC_CMD_FILTER_OP_IN_MATCH_DST_IP_WIDTH 1
  7414. #define MC_CMD_FILTER_OP_IN_MATCH_SRC_MAC_LBN 2
  7415. #define MC_CMD_FILTER_OP_IN_MATCH_SRC_MAC_WIDTH 1
  7416. #define MC_CMD_FILTER_OP_IN_MATCH_SRC_PORT_LBN 3
  7417. #define MC_CMD_FILTER_OP_IN_MATCH_SRC_PORT_WIDTH 1
  7418. #define MC_CMD_FILTER_OP_IN_MATCH_DST_MAC_LBN 4
  7419. #define MC_CMD_FILTER_OP_IN_MATCH_DST_MAC_WIDTH 1
  7420. #define MC_CMD_FILTER_OP_IN_MATCH_DST_PORT_LBN 5
  7421. #define MC_CMD_FILTER_OP_IN_MATCH_DST_PORT_WIDTH 1
  7422. #define MC_CMD_FILTER_OP_IN_MATCH_ETHER_TYPE_LBN 6
  7423. #define MC_CMD_FILTER_OP_IN_MATCH_ETHER_TYPE_WIDTH 1
  7424. #define MC_CMD_FILTER_OP_IN_MATCH_INNER_VLAN_LBN 7
  7425. #define MC_CMD_FILTER_OP_IN_MATCH_INNER_VLAN_WIDTH 1
  7426. #define MC_CMD_FILTER_OP_IN_MATCH_OUTER_VLAN_LBN 8
  7427. #define MC_CMD_FILTER_OP_IN_MATCH_OUTER_VLAN_WIDTH 1
  7428. #define MC_CMD_FILTER_OP_IN_MATCH_IP_PROTO_LBN 9
  7429. #define MC_CMD_FILTER_OP_IN_MATCH_IP_PROTO_WIDTH 1
  7430. #define MC_CMD_FILTER_OP_IN_MATCH_FWDEF0_LBN 10
  7431. #define MC_CMD_FILTER_OP_IN_MATCH_FWDEF0_WIDTH 1
  7432. #define MC_CMD_FILTER_OP_IN_MATCH_FWDEF1_LBN 11
  7433. #define MC_CMD_FILTER_OP_IN_MATCH_FWDEF1_WIDTH 1
  7434. #define MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_MCAST_DST_LBN 30
  7435. #define MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_MCAST_DST_WIDTH 1
  7436. #define MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_UCAST_DST_LBN 31
  7437. #define MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_UCAST_DST_WIDTH 1
  7438. /* receive destination */
  7439. #define MC_CMD_FILTER_OP_IN_RX_DEST_OFST 20
  7440. #define MC_CMD_FILTER_OP_IN_RX_DEST_LEN 4
  7441. /* enum: drop packets */
  7442. #define MC_CMD_FILTER_OP_IN_RX_DEST_DROP 0x0
  7443. /* enum: receive to host */
  7444. #define MC_CMD_FILTER_OP_IN_RX_DEST_HOST 0x1
  7445. /* enum: receive to MC */
  7446. #define MC_CMD_FILTER_OP_IN_RX_DEST_MC 0x2
  7447. /* enum: loop back to TXDP 0 */
  7448. #define MC_CMD_FILTER_OP_IN_RX_DEST_TX0 0x3
  7449. /* enum: loop back to TXDP 1 */
  7450. #define MC_CMD_FILTER_OP_IN_RX_DEST_TX1 0x4
  7451. /* receive queue handle (for multiple queue modes, this is the base queue) */
  7452. #define MC_CMD_FILTER_OP_IN_RX_QUEUE_OFST 24
  7453. #define MC_CMD_FILTER_OP_IN_RX_QUEUE_LEN 4
  7454. /* receive mode */
  7455. #define MC_CMD_FILTER_OP_IN_RX_MODE_OFST 28
  7456. #define MC_CMD_FILTER_OP_IN_RX_MODE_LEN 4
  7457. /* enum: receive to just the specified queue */
  7458. #define MC_CMD_FILTER_OP_IN_RX_MODE_SIMPLE 0x0
  7459. /* enum: receive to multiple queues using RSS context */
  7460. #define MC_CMD_FILTER_OP_IN_RX_MODE_RSS 0x1
  7461. /* enum: receive to multiple queues using .1p mapping */
  7462. #define MC_CMD_FILTER_OP_IN_RX_MODE_DOT1P_MAPPING 0x2
  7463. /* enum: install a filter entry that will never match; for test purposes only
  7464. */
  7465. #define MC_CMD_FILTER_OP_IN_RX_MODE_TEST_NEVER_MATCH 0x80000000
  7466. /* RSS context (for RX_MODE_RSS) or .1p mapping handle (for
  7467. * RX_MODE_DOT1P_MAPPING), as returned by MC_CMD_RSS_CONTEXT_ALLOC or
  7468. * MC_CMD_DOT1P_MAPPING_ALLOC.
  7469. */
  7470. #define MC_CMD_FILTER_OP_IN_RX_CONTEXT_OFST 32
  7471. #define MC_CMD_FILTER_OP_IN_RX_CONTEXT_LEN 4
  7472. /* transmit domain (reserved; set to 0) */
  7473. #define MC_CMD_FILTER_OP_IN_TX_DOMAIN_OFST 36
  7474. #define MC_CMD_FILTER_OP_IN_TX_DOMAIN_LEN 4
  7475. /* transmit destination (either set the MAC and/or PM bits for explicit
  7476. * control, or set this field to TX_DEST_DEFAULT for sensible default
  7477. * behaviour)
  7478. */
  7479. #define MC_CMD_FILTER_OP_IN_TX_DEST_OFST 40
  7480. #define MC_CMD_FILTER_OP_IN_TX_DEST_LEN 4
  7481. /* enum: request default behaviour (based on filter type) */
  7482. #define MC_CMD_FILTER_OP_IN_TX_DEST_DEFAULT 0xffffffff
  7483. #define MC_CMD_FILTER_OP_IN_TX_DEST_MAC_LBN 0
  7484. #define MC_CMD_FILTER_OP_IN_TX_DEST_MAC_WIDTH 1
  7485. #define MC_CMD_FILTER_OP_IN_TX_DEST_PM_LBN 1
  7486. #define MC_CMD_FILTER_OP_IN_TX_DEST_PM_WIDTH 1
  7487. /* source MAC address to match (as bytes in network order) */
  7488. #define MC_CMD_FILTER_OP_IN_SRC_MAC_OFST 44
  7489. #define MC_CMD_FILTER_OP_IN_SRC_MAC_LEN 6
  7490. /* source port to match (as bytes in network order) */
  7491. #define MC_CMD_FILTER_OP_IN_SRC_PORT_OFST 50
  7492. #define MC_CMD_FILTER_OP_IN_SRC_PORT_LEN 2
  7493. /* destination MAC address to match (as bytes in network order) */
  7494. #define MC_CMD_FILTER_OP_IN_DST_MAC_OFST 52
  7495. #define MC_CMD_FILTER_OP_IN_DST_MAC_LEN 6
  7496. /* destination port to match (as bytes in network order) */
  7497. #define MC_CMD_FILTER_OP_IN_DST_PORT_OFST 58
  7498. #define MC_CMD_FILTER_OP_IN_DST_PORT_LEN 2
  7499. /* Ethernet type to match (as bytes in network order) */
  7500. #define MC_CMD_FILTER_OP_IN_ETHER_TYPE_OFST 60
  7501. #define MC_CMD_FILTER_OP_IN_ETHER_TYPE_LEN 2
  7502. /* Inner VLAN tag to match (as bytes in network order) */
  7503. #define MC_CMD_FILTER_OP_IN_INNER_VLAN_OFST 62
  7504. #define MC_CMD_FILTER_OP_IN_INNER_VLAN_LEN 2
  7505. /* Outer VLAN tag to match (as bytes in network order) */
  7506. #define MC_CMD_FILTER_OP_IN_OUTER_VLAN_OFST 64
  7507. #define MC_CMD_FILTER_OP_IN_OUTER_VLAN_LEN 2
  7508. /* IP protocol to match (in low byte; set high byte to 0) */
  7509. #define MC_CMD_FILTER_OP_IN_IP_PROTO_OFST 66
  7510. #define MC_CMD_FILTER_OP_IN_IP_PROTO_LEN 2
  7511. /* Firmware defined register 0 to match (reserved; set to 0) */
  7512. #define MC_CMD_FILTER_OP_IN_FWDEF0_OFST 68
  7513. #define MC_CMD_FILTER_OP_IN_FWDEF0_LEN 4
  7514. /* Firmware defined register 1 to match (reserved; set to 0) */
  7515. #define MC_CMD_FILTER_OP_IN_FWDEF1_OFST 72
  7516. #define MC_CMD_FILTER_OP_IN_FWDEF1_LEN 4
  7517. /* source IP address to match (as bytes in network order; set last 12 bytes to
  7518. * 0 for IPv4 address)
  7519. */
  7520. #define MC_CMD_FILTER_OP_IN_SRC_IP_OFST 76
  7521. #define MC_CMD_FILTER_OP_IN_SRC_IP_LEN 16
  7522. /* destination IP address to match (as bytes in network order; set last 12
  7523. * bytes to 0 for IPv4 address)
  7524. */
  7525. #define MC_CMD_FILTER_OP_IN_DST_IP_OFST 92
  7526. #define MC_CMD_FILTER_OP_IN_DST_IP_LEN 16
  7527. /* MC_CMD_FILTER_OP_EXT_IN msgrequest: Extension to MC_CMD_FILTER_OP_IN to
  7528. * include handling of VXLAN/NVGRE encapsulated frame filtering (which is
  7529. * supported on Medford only).
  7530. */
  7531. #define MC_CMD_FILTER_OP_EXT_IN_LEN 172
  7532. /* identifies the type of operation requested */
  7533. #define MC_CMD_FILTER_OP_EXT_IN_OP_OFST 0
  7534. #define MC_CMD_FILTER_OP_EXT_IN_OP_LEN 4
  7535. /* Enum values, see field(s): */
  7536. /* MC_CMD_FILTER_OP_IN/OP */
  7537. /* filter handle (for remove / unsubscribe operations) */
  7538. #define MC_CMD_FILTER_OP_EXT_IN_HANDLE_OFST 4
  7539. #define MC_CMD_FILTER_OP_EXT_IN_HANDLE_LEN 8
  7540. #define MC_CMD_FILTER_OP_EXT_IN_HANDLE_LO_OFST 4
  7541. #define MC_CMD_FILTER_OP_EXT_IN_HANDLE_HI_OFST 8
  7542. /* The port ID associated with the v-adaptor which should contain this filter.
  7543. */
  7544. #define MC_CMD_FILTER_OP_EXT_IN_PORT_ID_OFST 12
  7545. #define MC_CMD_FILTER_OP_EXT_IN_PORT_ID_LEN 4
  7546. /* fields to include in match criteria */
  7547. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_FIELDS_OFST 16
  7548. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_FIELDS_LEN 4
  7549. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_SRC_IP_LBN 0
  7550. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_SRC_IP_WIDTH 1
  7551. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_DST_IP_LBN 1
  7552. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_DST_IP_WIDTH 1
  7553. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_SRC_MAC_LBN 2
  7554. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_SRC_MAC_WIDTH 1
  7555. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_SRC_PORT_LBN 3
  7556. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_SRC_PORT_WIDTH 1
  7557. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_DST_MAC_LBN 4
  7558. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_DST_MAC_WIDTH 1
  7559. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_DST_PORT_LBN 5
  7560. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_DST_PORT_WIDTH 1
  7561. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_ETHER_TYPE_LBN 6
  7562. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_ETHER_TYPE_WIDTH 1
  7563. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_INNER_VLAN_LBN 7
  7564. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_INNER_VLAN_WIDTH 1
  7565. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_OUTER_VLAN_LBN 8
  7566. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_OUTER_VLAN_WIDTH 1
  7567. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IP_PROTO_LBN 9
  7568. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IP_PROTO_WIDTH 1
  7569. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_FWDEF0_LBN 10
  7570. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_FWDEF0_WIDTH 1
  7571. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_VNI_OR_VSID_LBN 11
  7572. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_VNI_OR_VSID_WIDTH 1
  7573. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_SRC_IP_LBN 12
  7574. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_SRC_IP_WIDTH 1
  7575. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_DST_IP_LBN 13
  7576. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_DST_IP_WIDTH 1
  7577. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_SRC_MAC_LBN 14
  7578. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_SRC_MAC_WIDTH 1
  7579. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_SRC_PORT_LBN 15
  7580. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_SRC_PORT_WIDTH 1
  7581. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_DST_MAC_LBN 16
  7582. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_DST_MAC_WIDTH 1
  7583. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_DST_PORT_LBN 17
  7584. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_DST_PORT_WIDTH 1
  7585. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_ETHER_TYPE_LBN 18
  7586. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_ETHER_TYPE_WIDTH 1
  7587. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_INNER_VLAN_LBN 19
  7588. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_INNER_VLAN_WIDTH 1
  7589. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_OUTER_VLAN_LBN 20
  7590. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_OUTER_VLAN_WIDTH 1
  7591. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_IP_PROTO_LBN 21
  7592. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_IP_PROTO_WIDTH 1
  7593. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_FWDEF0_LBN 22
  7594. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_FWDEF0_WIDTH 1
  7595. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_FWDEF1_LBN 23
  7596. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_FWDEF1_WIDTH 1
  7597. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_UNKNOWN_MCAST_DST_LBN 24
  7598. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_UNKNOWN_MCAST_DST_WIDTH 1
  7599. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_UNKNOWN_UCAST_DST_LBN 25
  7600. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_UNKNOWN_UCAST_DST_WIDTH 1
  7601. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_UNKNOWN_MCAST_DST_LBN 30
  7602. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_UNKNOWN_MCAST_DST_WIDTH 1
  7603. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_UNKNOWN_UCAST_DST_LBN 31
  7604. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_UNKNOWN_UCAST_DST_WIDTH 1
  7605. /* receive destination */
  7606. #define MC_CMD_FILTER_OP_EXT_IN_RX_DEST_OFST 20
  7607. #define MC_CMD_FILTER_OP_EXT_IN_RX_DEST_LEN 4
  7608. /* enum: drop packets */
  7609. #define MC_CMD_FILTER_OP_EXT_IN_RX_DEST_DROP 0x0
  7610. /* enum: receive to host */
  7611. #define MC_CMD_FILTER_OP_EXT_IN_RX_DEST_HOST 0x1
  7612. /* enum: receive to MC */
  7613. #define MC_CMD_FILTER_OP_EXT_IN_RX_DEST_MC 0x2
  7614. /* enum: loop back to TXDP 0 */
  7615. #define MC_CMD_FILTER_OP_EXT_IN_RX_DEST_TX0 0x3
  7616. /* enum: loop back to TXDP 1 */
  7617. #define MC_CMD_FILTER_OP_EXT_IN_RX_DEST_TX1 0x4
  7618. /* receive queue handle (for multiple queue modes, this is the base queue) */
  7619. #define MC_CMD_FILTER_OP_EXT_IN_RX_QUEUE_OFST 24
  7620. #define MC_CMD_FILTER_OP_EXT_IN_RX_QUEUE_LEN 4
  7621. /* receive mode */
  7622. #define MC_CMD_FILTER_OP_EXT_IN_RX_MODE_OFST 28
  7623. #define MC_CMD_FILTER_OP_EXT_IN_RX_MODE_LEN 4
  7624. /* enum: receive to just the specified queue */
  7625. #define MC_CMD_FILTER_OP_EXT_IN_RX_MODE_SIMPLE 0x0
  7626. /* enum: receive to multiple queues using RSS context */
  7627. #define MC_CMD_FILTER_OP_EXT_IN_RX_MODE_RSS 0x1
  7628. /* enum: receive to multiple queues using .1p mapping */
  7629. #define MC_CMD_FILTER_OP_EXT_IN_RX_MODE_DOT1P_MAPPING 0x2
  7630. /* enum: install a filter entry that will never match; for test purposes only
  7631. */
  7632. #define MC_CMD_FILTER_OP_EXT_IN_RX_MODE_TEST_NEVER_MATCH 0x80000000
  7633. /* RSS context (for RX_MODE_RSS) or .1p mapping handle (for
  7634. * RX_MODE_DOT1P_MAPPING), as returned by MC_CMD_RSS_CONTEXT_ALLOC or
  7635. * MC_CMD_DOT1P_MAPPING_ALLOC.
  7636. */
  7637. #define MC_CMD_FILTER_OP_EXT_IN_RX_CONTEXT_OFST 32
  7638. #define MC_CMD_FILTER_OP_EXT_IN_RX_CONTEXT_LEN 4
  7639. /* transmit domain (reserved; set to 0) */
  7640. #define MC_CMD_FILTER_OP_EXT_IN_TX_DOMAIN_OFST 36
  7641. #define MC_CMD_FILTER_OP_EXT_IN_TX_DOMAIN_LEN 4
  7642. /* transmit destination (either set the MAC and/or PM bits for explicit
  7643. * control, or set this field to TX_DEST_DEFAULT for sensible default
  7644. * behaviour)
  7645. */
  7646. #define MC_CMD_FILTER_OP_EXT_IN_TX_DEST_OFST 40
  7647. #define MC_CMD_FILTER_OP_EXT_IN_TX_DEST_LEN 4
  7648. /* enum: request default behaviour (based on filter type) */
  7649. #define MC_CMD_FILTER_OP_EXT_IN_TX_DEST_DEFAULT 0xffffffff
  7650. #define MC_CMD_FILTER_OP_EXT_IN_TX_DEST_MAC_LBN 0
  7651. #define MC_CMD_FILTER_OP_EXT_IN_TX_DEST_MAC_WIDTH 1
  7652. #define MC_CMD_FILTER_OP_EXT_IN_TX_DEST_PM_LBN 1
  7653. #define MC_CMD_FILTER_OP_EXT_IN_TX_DEST_PM_WIDTH 1
  7654. /* source MAC address to match (as bytes in network order) */
  7655. #define MC_CMD_FILTER_OP_EXT_IN_SRC_MAC_OFST 44
  7656. #define MC_CMD_FILTER_OP_EXT_IN_SRC_MAC_LEN 6
  7657. /* source port to match (as bytes in network order) */
  7658. #define MC_CMD_FILTER_OP_EXT_IN_SRC_PORT_OFST 50
  7659. #define MC_CMD_FILTER_OP_EXT_IN_SRC_PORT_LEN 2
  7660. /* destination MAC address to match (as bytes in network order) */
  7661. #define MC_CMD_FILTER_OP_EXT_IN_DST_MAC_OFST 52
  7662. #define MC_CMD_FILTER_OP_EXT_IN_DST_MAC_LEN 6
  7663. /* destination port to match (as bytes in network order) */
  7664. #define MC_CMD_FILTER_OP_EXT_IN_DST_PORT_OFST 58
  7665. #define MC_CMD_FILTER_OP_EXT_IN_DST_PORT_LEN 2
  7666. /* Ethernet type to match (as bytes in network order) */
  7667. #define MC_CMD_FILTER_OP_EXT_IN_ETHER_TYPE_OFST 60
  7668. #define MC_CMD_FILTER_OP_EXT_IN_ETHER_TYPE_LEN 2
  7669. /* Inner VLAN tag to match (as bytes in network order) */
  7670. #define MC_CMD_FILTER_OP_EXT_IN_INNER_VLAN_OFST 62
  7671. #define MC_CMD_FILTER_OP_EXT_IN_INNER_VLAN_LEN 2
  7672. /* Outer VLAN tag to match (as bytes in network order) */
  7673. #define MC_CMD_FILTER_OP_EXT_IN_OUTER_VLAN_OFST 64
  7674. #define MC_CMD_FILTER_OP_EXT_IN_OUTER_VLAN_LEN 2
  7675. /* IP protocol to match (in low byte; set high byte to 0) */
  7676. #define MC_CMD_FILTER_OP_EXT_IN_IP_PROTO_OFST 66
  7677. #define MC_CMD_FILTER_OP_EXT_IN_IP_PROTO_LEN 2
  7678. /* Firmware defined register 0 to match (reserved; set to 0) */
  7679. #define MC_CMD_FILTER_OP_EXT_IN_FWDEF0_OFST 68
  7680. #define MC_CMD_FILTER_OP_EXT_IN_FWDEF0_LEN 4
  7681. /* VNI (for VXLAN/Geneve, when IP protocol is UDP) or VSID (for NVGRE, when IP
  7682. * protocol is GRE) to match (as bytes in network order; set last byte to 0 for
  7683. * VXLAN/NVGRE, or 1 for Geneve)
  7684. */
  7685. #define MC_CMD_FILTER_OP_EXT_IN_VNI_OR_VSID_OFST 72
  7686. #define MC_CMD_FILTER_OP_EXT_IN_VNI_OR_VSID_LEN 4
  7687. #define MC_CMD_FILTER_OP_EXT_IN_VNI_VALUE_LBN 0
  7688. #define MC_CMD_FILTER_OP_EXT_IN_VNI_VALUE_WIDTH 24
  7689. #define MC_CMD_FILTER_OP_EXT_IN_VNI_TYPE_LBN 24
  7690. #define MC_CMD_FILTER_OP_EXT_IN_VNI_TYPE_WIDTH 8
  7691. /* enum: Match VXLAN traffic with this VNI */
  7692. #define MC_CMD_FILTER_OP_EXT_IN_VNI_TYPE_VXLAN 0x0
  7693. /* enum: Match Geneve traffic with this VNI */
  7694. #define MC_CMD_FILTER_OP_EXT_IN_VNI_TYPE_GENEVE 0x1
  7695. /* enum: Reserved for experimental development use */
  7696. #define MC_CMD_FILTER_OP_EXT_IN_VNI_TYPE_EXPERIMENTAL 0xfe
  7697. #define MC_CMD_FILTER_OP_EXT_IN_VSID_VALUE_LBN 0
  7698. #define MC_CMD_FILTER_OP_EXT_IN_VSID_VALUE_WIDTH 24
  7699. #define MC_CMD_FILTER_OP_EXT_IN_VSID_TYPE_LBN 24
  7700. #define MC_CMD_FILTER_OP_EXT_IN_VSID_TYPE_WIDTH 8
  7701. /* enum: Match NVGRE traffic with this VSID */
  7702. #define MC_CMD_FILTER_OP_EXT_IN_VSID_TYPE_NVGRE 0x0
  7703. /* source IP address to match (as bytes in network order; set last 12 bytes to
  7704. * 0 for IPv4 address)
  7705. */
  7706. #define MC_CMD_FILTER_OP_EXT_IN_SRC_IP_OFST 76
  7707. #define MC_CMD_FILTER_OP_EXT_IN_SRC_IP_LEN 16
  7708. /* destination IP address to match (as bytes in network order; set last 12
  7709. * bytes to 0 for IPv4 address)
  7710. */
  7711. #define MC_CMD_FILTER_OP_EXT_IN_DST_IP_OFST 92
  7712. #define MC_CMD_FILTER_OP_EXT_IN_DST_IP_LEN 16
  7713. /* VXLAN/NVGRE inner frame source MAC address to match (as bytes in network
  7714. * order)
  7715. */
  7716. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_SRC_MAC_OFST 108
  7717. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_SRC_MAC_LEN 6
  7718. /* VXLAN/NVGRE inner frame source port to match (as bytes in network order) */
  7719. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_SRC_PORT_OFST 114
  7720. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_SRC_PORT_LEN 2
  7721. /* VXLAN/NVGRE inner frame destination MAC address to match (as bytes in
  7722. * network order)
  7723. */
  7724. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_DST_MAC_OFST 116
  7725. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_DST_MAC_LEN 6
  7726. /* VXLAN/NVGRE inner frame destination port to match (as bytes in network
  7727. * order)
  7728. */
  7729. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_DST_PORT_OFST 122
  7730. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_DST_PORT_LEN 2
  7731. /* VXLAN/NVGRE inner frame Ethernet type to match (as bytes in network order)
  7732. */
  7733. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_ETHER_TYPE_OFST 124
  7734. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_ETHER_TYPE_LEN 2
  7735. /* VXLAN/NVGRE inner frame Inner VLAN tag to match (as bytes in network order)
  7736. */
  7737. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_INNER_VLAN_OFST 126
  7738. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_INNER_VLAN_LEN 2
  7739. /* VXLAN/NVGRE inner frame Outer VLAN tag to match (as bytes in network order)
  7740. */
  7741. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_OUTER_VLAN_OFST 128
  7742. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_OUTER_VLAN_LEN 2
  7743. /* VXLAN/NVGRE inner frame IP protocol to match (in low byte; set high byte to
  7744. * 0)
  7745. */
  7746. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_IP_PROTO_OFST 130
  7747. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_IP_PROTO_LEN 2
  7748. /* VXLAN/NVGRE inner frame Firmware defined register 0 to match (reserved; set
  7749. * to 0)
  7750. */
  7751. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_FWDEF0_OFST 132
  7752. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_FWDEF0_LEN 4
  7753. /* VXLAN/NVGRE inner frame Firmware defined register 1 to match (reserved; set
  7754. * to 0)
  7755. */
  7756. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_FWDEF1_OFST 136
  7757. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_FWDEF1_LEN 4
  7758. /* VXLAN/NVGRE inner frame source IP address to match (as bytes in network
  7759. * order; set last 12 bytes to 0 for IPv4 address)
  7760. */
  7761. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_SRC_IP_OFST 140
  7762. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_SRC_IP_LEN 16
  7763. /* VXLAN/NVGRE inner frame destination IP address to match (as bytes in network
  7764. * order; set last 12 bytes to 0 for IPv4 address)
  7765. */
  7766. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_DST_IP_OFST 156
  7767. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_DST_IP_LEN 16
  7768. /* MC_CMD_FILTER_OP_V3_IN msgrequest: FILTER_OP extension to support additional
  7769. * filter actions for Intel's DPDK (Data Plane Development Kit, dpdk.org) via
  7770. * its rte_flow API. This extension is only useful with the sfc_efx driver
  7771. * included as part of DPDK, used in conjunction with the dpdk datapath
  7772. * firmware variant.
  7773. */
  7774. #define MC_CMD_FILTER_OP_V3_IN_LEN 180
  7775. /* identifies the type of operation requested */
  7776. #define MC_CMD_FILTER_OP_V3_IN_OP_OFST 0
  7777. #define MC_CMD_FILTER_OP_V3_IN_OP_LEN 4
  7778. /* Enum values, see field(s): */
  7779. /* MC_CMD_FILTER_OP_IN/OP */
  7780. /* filter handle (for remove / unsubscribe operations) */
  7781. #define MC_CMD_FILTER_OP_V3_IN_HANDLE_OFST 4
  7782. #define MC_CMD_FILTER_OP_V3_IN_HANDLE_LEN 8
  7783. #define MC_CMD_FILTER_OP_V3_IN_HANDLE_LO_OFST 4
  7784. #define MC_CMD_FILTER_OP_V3_IN_HANDLE_HI_OFST 8
  7785. /* The port ID associated with the v-adaptor which should contain this filter.
  7786. */
  7787. #define MC_CMD_FILTER_OP_V3_IN_PORT_ID_OFST 12
  7788. #define MC_CMD_FILTER_OP_V3_IN_PORT_ID_LEN 4
  7789. /* fields to include in match criteria */
  7790. #define MC_CMD_FILTER_OP_V3_IN_MATCH_FIELDS_OFST 16
  7791. #define MC_CMD_FILTER_OP_V3_IN_MATCH_FIELDS_LEN 4
  7792. #define MC_CMD_FILTER_OP_V3_IN_MATCH_SRC_IP_LBN 0
  7793. #define MC_CMD_FILTER_OP_V3_IN_MATCH_SRC_IP_WIDTH 1
  7794. #define MC_CMD_FILTER_OP_V3_IN_MATCH_DST_IP_LBN 1
  7795. #define MC_CMD_FILTER_OP_V3_IN_MATCH_DST_IP_WIDTH 1
  7796. #define MC_CMD_FILTER_OP_V3_IN_MATCH_SRC_MAC_LBN 2
  7797. #define MC_CMD_FILTER_OP_V3_IN_MATCH_SRC_MAC_WIDTH 1
  7798. #define MC_CMD_FILTER_OP_V3_IN_MATCH_SRC_PORT_LBN 3
  7799. #define MC_CMD_FILTER_OP_V3_IN_MATCH_SRC_PORT_WIDTH 1
  7800. #define MC_CMD_FILTER_OP_V3_IN_MATCH_DST_MAC_LBN 4
  7801. #define MC_CMD_FILTER_OP_V3_IN_MATCH_DST_MAC_WIDTH 1
  7802. #define MC_CMD_FILTER_OP_V3_IN_MATCH_DST_PORT_LBN 5
  7803. #define MC_CMD_FILTER_OP_V3_IN_MATCH_DST_PORT_WIDTH 1
  7804. #define MC_CMD_FILTER_OP_V3_IN_MATCH_ETHER_TYPE_LBN 6
  7805. #define MC_CMD_FILTER_OP_V3_IN_MATCH_ETHER_TYPE_WIDTH 1
  7806. #define MC_CMD_FILTER_OP_V3_IN_MATCH_INNER_VLAN_LBN 7
  7807. #define MC_CMD_FILTER_OP_V3_IN_MATCH_INNER_VLAN_WIDTH 1
  7808. #define MC_CMD_FILTER_OP_V3_IN_MATCH_OUTER_VLAN_LBN 8
  7809. #define MC_CMD_FILTER_OP_V3_IN_MATCH_OUTER_VLAN_WIDTH 1
  7810. #define MC_CMD_FILTER_OP_V3_IN_MATCH_IP_PROTO_LBN 9
  7811. #define MC_CMD_FILTER_OP_V3_IN_MATCH_IP_PROTO_WIDTH 1
  7812. #define MC_CMD_FILTER_OP_V3_IN_MATCH_FWDEF0_LBN 10
  7813. #define MC_CMD_FILTER_OP_V3_IN_MATCH_FWDEF0_WIDTH 1
  7814. #define MC_CMD_FILTER_OP_V3_IN_MATCH_VNI_OR_VSID_LBN 11
  7815. #define MC_CMD_FILTER_OP_V3_IN_MATCH_VNI_OR_VSID_WIDTH 1
  7816. #define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_SRC_IP_LBN 12
  7817. #define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_SRC_IP_WIDTH 1
  7818. #define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_DST_IP_LBN 13
  7819. #define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_DST_IP_WIDTH 1
  7820. #define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_SRC_MAC_LBN 14
  7821. #define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_SRC_MAC_WIDTH 1
  7822. #define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_SRC_PORT_LBN 15
  7823. #define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_SRC_PORT_WIDTH 1
  7824. #define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_DST_MAC_LBN 16
  7825. #define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_DST_MAC_WIDTH 1
  7826. #define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_DST_PORT_LBN 17
  7827. #define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_DST_PORT_WIDTH 1
  7828. #define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_ETHER_TYPE_LBN 18
  7829. #define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_ETHER_TYPE_WIDTH 1
  7830. #define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_INNER_VLAN_LBN 19
  7831. #define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_INNER_VLAN_WIDTH 1
  7832. #define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_OUTER_VLAN_LBN 20
  7833. #define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_OUTER_VLAN_WIDTH 1
  7834. #define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_IP_PROTO_LBN 21
  7835. #define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_IP_PROTO_WIDTH 1
  7836. #define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_FWDEF0_LBN 22
  7837. #define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_FWDEF0_WIDTH 1
  7838. #define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_FWDEF1_LBN 23
  7839. #define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_FWDEF1_WIDTH 1
  7840. #define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_UNKNOWN_MCAST_DST_LBN 24
  7841. #define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_UNKNOWN_MCAST_DST_WIDTH 1
  7842. #define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_UNKNOWN_UCAST_DST_LBN 25
  7843. #define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_UNKNOWN_UCAST_DST_WIDTH 1
  7844. #define MC_CMD_FILTER_OP_V3_IN_MATCH_UNKNOWN_MCAST_DST_LBN 30
  7845. #define MC_CMD_FILTER_OP_V3_IN_MATCH_UNKNOWN_MCAST_DST_WIDTH 1
  7846. #define MC_CMD_FILTER_OP_V3_IN_MATCH_UNKNOWN_UCAST_DST_LBN 31
  7847. #define MC_CMD_FILTER_OP_V3_IN_MATCH_UNKNOWN_UCAST_DST_WIDTH 1
  7848. /* receive destination */
  7849. #define MC_CMD_FILTER_OP_V3_IN_RX_DEST_OFST 20
  7850. #define MC_CMD_FILTER_OP_V3_IN_RX_DEST_LEN 4
  7851. /* enum: drop packets */
  7852. #define MC_CMD_FILTER_OP_V3_IN_RX_DEST_DROP 0x0
  7853. /* enum: receive to host */
  7854. #define MC_CMD_FILTER_OP_V3_IN_RX_DEST_HOST 0x1
  7855. /* enum: receive to MC */
  7856. #define MC_CMD_FILTER_OP_V3_IN_RX_DEST_MC 0x2
  7857. /* enum: loop back to TXDP 0 */
  7858. #define MC_CMD_FILTER_OP_V3_IN_RX_DEST_TX0 0x3
  7859. /* enum: loop back to TXDP 1 */
  7860. #define MC_CMD_FILTER_OP_V3_IN_RX_DEST_TX1 0x4
  7861. /* receive queue handle (for multiple queue modes, this is the base queue) */
  7862. #define MC_CMD_FILTER_OP_V3_IN_RX_QUEUE_OFST 24
  7863. #define MC_CMD_FILTER_OP_V3_IN_RX_QUEUE_LEN 4
  7864. /* receive mode */
  7865. #define MC_CMD_FILTER_OP_V3_IN_RX_MODE_OFST 28
  7866. #define MC_CMD_FILTER_OP_V3_IN_RX_MODE_LEN 4
  7867. /* enum: receive to just the specified queue */
  7868. #define MC_CMD_FILTER_OP_V3_IN_RX_MODE_SIMPLE 0x0
  7869. /* enum: receive to multiple queues using RSS context */
  7870. #define MC_CMD_FILTER_OP_V3_IN_RX_MODE_RSS 0x1
  7871. /* enum: receive to multiple queues using .1p mapping */
  7872. #define MC_CMD_FILTER_OP_V3_IN_RX_MODE_DOT1P_MAPPING 0x2
  7873. /* enum: install a filter entry that will never match; for test purposes only
  7874. */
  7875. #define MC_CMD_FILTER_OP_V3_IN_RX_MODE_TEST_NEVER_MATCH 0x80000000
  7876. /* RSS context (for RX_MODE_RSS) or .1p mapping handle (for
  7877. * RX_MODE_DOT1P_MAPPING), as returned by MC_CMD_RSS_CONTEXT_ALLOC or
  7878. * MC_CMD_DOT1P_MAPPING_ALLOC.
  7879. */
  7880. #define MC_CMD_FILTER_OP_V3_IN_RX_CONTEXT_OFST 32
  7881. #define MC_CMD_FILTER_OP_V3_IN_RX_CONTEXT_LEN 4
  7882. /* transmit domain (reserved; set to 0) */
  7883. #define MC_CMD_FILTER_OP_V3_IN_TX_DOMAIN_OFST 36
  7884. #define MC_CMD_FILTER_OP_V3_IN_TX_DOMAIN_LEN 4
  7885. /* transmit destination (either set the MAC and/or PM bits for explicit
  7886. * control, or set this field to TX_DEST_DEFAULT for sensible default
  7887. * behaviour)
  7888. */
  7889. #define MC_CMD_FILTER_OP_V3_IN_TX_DEST_OFST 40
  7890. #define MC_CMD_FILTER_OP_V3_IN_TX_DEST_LEN 4
  7891. /* enum: request default behaviour (based on filter type) */
  7892. #define MC_CMD_FILTER_OP_V3_IN_TX_DEST_DEFAULT 0xffffffff
  7893. #define MC_CMD_FILTER_OP_V3_IN_TX_DEST_MAC_LBN 0
  7894. #define MC_CMD_FILTER_OP_V3_IN_TX_DEST_MAC_WIDTH 1
  7895. #define MC_CMD_FILTER_OP_V3_IN_TX_DEST_PM_LBN 1
  7896. #define MC_CMD_FILTER_OP_V3_IN_TX_DEST_PM_WIDTH 1
  7897. /* source MAC address to match (as bytes in network order) */
  7898. #define MC_CMD_FILTER_OP_V3_IN_SRC_MAC_OFST 44
  7899. #define MC_CMD_FILTER_OP_V3_IN_SRC_MAC_LEN 6
  7900. /* source port to match (as bytes in network order) */
  7901. #define MC_CMD_FILTER_OP_V3_IN_SRC_PORT_OFST 50
  7902. #define MC_CMD_FILTER_OP_V3_IN_SRC_PORT_LEN 2
  7903. /* destination MAC address to match (as bytes in network order) */
  7904. #define MC_CMD_FILTER_OP_V3_IN_DST_MAC_OFST 52
  7905. #define MC_CMD_FILTER_OP_V3_IN_DST_MAC_LEN 6
  7906. /* destination port to match (as bytes in network order) */
  7907. #define MC_CMD_FILTER_OP_V3_IN_DST_PORT_OFST 58
  7908. #define MC_CMD_FILTER_OP_V3_IN_DST_PORT_LEN 2
  7909. /* Ethernet type to match (as bytes in network order) */
  7910. #define MC_CMD_FILTER_OP_V3_IN_ETHER_TYPE_OFST 60
  7911. #define MC_CMD_FILTER_OP_V3_IN_ETHER_TYPE_LEN 2
  7912. /* Inner VLAN tag to match (as bytes in network order) */
  7913. #define MC_CMD_FILTER_OP_V3_IN_INNER_VLAN_OFST 62
  7914. #define MC_CMD_FILTER_OP_V3_IN_INNER_VLAN_LEN 2
  7915. /* Outer VLAN tag to match (as bytes in network order) */
  7916. #define MC_CMD_FILTER_OP_V3_IN_OUTER_VLAN_OFST 64
  7917. #define MC_CMD_FILTER_OP_V3_IN_OUTER_VLAN_LEN 2
  7918. /* IP protocol to match (in low byte; set high byte to 0) */
  7919. #define MC_CMD_FILTER_OP_V3_IN_IP_PROTO_OFST 66
  7920. #define MC_CMD_FILTER_OP_V3_IN_IP_PROTO_LEN 2
  7921. /* Firmware defined register 0 to match (reserved; set to 0) */
  7922. #define MC_CMD_FILTER_OP_V3_IN_FWDEF0_OFST 68
  7923. #define MC_CMD_FILTER_OP_V3_IN_FWDEF0_LEN 4
  7924. /* VNI (for VXLAN/Geneve, when IP protocol is UDP) or VSID (for NVGRE, when IP
  7925. * protocol is GRE) to match (as bytes in network order; set last byte to 0 for
  7926. * VXLAN/NVGRE, or 1 for Geneve)
  7927. */
  7928. #define MC_CMD_FILTER_OP_V3_IN_VNI_OR_VSID_OFST 72
  7929. #define MC_CMD_FILTER_OP_V3_IN_VNI_OR_VSID_LEN 4
  7930. #define MC_CMD_FILTER_OP_V3_IN_VNI_VALUE_LBN 0
  7931. #define MC_CMD_FILTER_OP_V3_IN_VNI_VALUE_WIDTH 24
  7932. #define MC_CMD_FILTER_OP_V3_IN_VNI_TYPE_LBN 24
  7933. #define MC_CMD_FILTER_OP_V3_IN_VNI_TYPE_WIDTH 8
  7934. /* enum: Match VXLAN traffic with this VNI */
  7935. #define MC_CMD_FILTER_OP_V3_IN_VNI_TYPE_VXLAN 0x0
  7936. /* enum: Match Geneve traffic with this VNI */
  7937. #define MC_CMD_FILTER_OP_V3_IN_VNI_TYPE_GENEVE 0x1
  7938. /* enum: Reserved for experimental development use */
  7939. #define MC_CMD_FILTER_OP_V3_IN_VNI_TYPE_EXPERIMENTAL 0xfe
  7940. #define MC_CMD_FILTER_OP_V3_IN_VSID_VALUE_LBN 0
  7941. #define MC_CMD_FILTER_OP_V3_IN_VSID_VALUE_WIDTH 24
  7942. #define MC_CMD_FILTER_OP_V3_IN_VSID_TYPE_LBN 24
  7943. #define MC_CMD_FILTER_OP_V3_IN_VSID_TYPE_WIDTH 8
  7944. /* enum: Match NVGRE traffic with this VSID */
  7945. #define MC_CMD_FILTER_OP_V3_IN_VSID_TYPE_NVGRE 0x0
  7946. /* source IP address to match (as bytes in network order; set last 12 bytes to
  7947. * 0 for IPv4 address)
  7948. */
  7949. #define MC_CMD_FILTER_OP_V3_IN_SRC_IP_OFST 76
  7950. #define MC_CMD_FILTER_OP_V3_IN_SRC_IP_LEN 16
  7951. /* destination IP address to match (as bytes in network order; set last 12
  7952. * bytes to 0 for IPv4 address)
  7953. */
  7954. #define MC_CMD_FILTER_OP_V3_IN_DST_IP_OFST 92
  7955. #define MC_CMD_FILTER_OP_V3_IN_DST_IP_LEN 16
  7956. /* VXLAN/NVGRE inner frame source MAC address to match (as bytes in network
  7957. * order)
  7958. */
  7959. #define MC_CMD_FILTER_OP_V3_IN_IFRM_SRC_MAC_OFST 108
  7960. #define MC_CMD_FILTER_OP_V3_IN_IFRM_SRC_MAC_LEN 6
  7961. /* VXLAN/NVGRE inner frame source port to match (as bytes in network order) */
  7962. #define MC_CMD_FILTER_OP_V3_IN_IFRM_SRC_PORT_OFST 114
  7963. #define MC_CMD_FILTER_OP_V3_IN_IFRM_SRC_PORT_LEN 2
  7964. /* VXLAN/NVGRE inner frame destination MAC address to match (as bytes in
  7965. * network order)
  7966. */
  7967. #define MC_CMD_FILTER_OP_V3_IN_IFRM_DST_MAC_OFST 116
  7968. #define MC_CMD_FILTER_OP_V3_IN_IFRM_DST_MAC_LEN 6
  7969. /* VXLAN/NVGRE inner frame destination port to match (as bytes in network
  7970. * order)
  7971. */
  7972. #define MC_CMD_FILTER_OP_V3_IN_IFRM_DST_PORT_OFST 122
  7973. #define MC_CMD_FILTER_OP_V3_IN_IFRM_DST_PORT_LEN 2
  7974. /* VXLAN/NVGRE inner frame Ethernet type to match (as bytes in network order)
  7975. */
  7976. #define MC_CMD_FILTER_OP_V3_IN_IFRM_ETHER_TYPE_OFST 124
  7977. #define MC_CMD_FILTER_OP_V3_IN_IFRM_ETHER_TYPE_LEN 2
  7978. /* VXLAN/NVGRE inner frame Inner VLAN tag to match (as bytes in network order)
  7979. */
  7980. #define MC_CMD_FILTER_OP_V3_IN_IFRM_INNER_VLAN_OFST 126
  7981. #define MC_CMD_FILTER_OP_V3_IN_IFRM_INNER_VLAN_LEN 2
  7982. /* VXLAN/NVGRE inner frame Outer VLAN tag to match (as bytes in network order)
  7983. */
  7984. #define MC_CMD_FILTER_OP_V3_IN_IFRM_OUTER_VLAN_OFST 128
  7985. #define MC_CMD_FILTER_OP_V3_IN_IFRM_OUTER_VLAN_LEN 2
  7986. /* VXLAN/NVGRE inner frame IP protocol to match (in low byte; set high byte to
  7987. * 0)
  7988. */
  7989. #define MC_CMD_FILTER_OP_V3_IN_IFRM_IP_PROTO_OFST 130
  7990. #define MC_CMD_FILTER_OP_V3_IN_IFRM_IP_PROTO_LEN 2
  7991. /* VXLAN/NVGRE inner frame Firmware defined register 0 to match (reserved; set
  7992. * to 0)
  7993. */
  7994. #define MC_CMD_FILTER_OP_V3_IN_IFRM_FWDEF0_OFST 132
  7995. #define MC_CMD_FILTER_OP_V3_IN_IFRM_FWDEF0_LEN 4
  7996. /* VXLAN/NVGRE inner frame Firmware defined register 1 to match (reserved; set
  7997. * to 0)
  7998. */
  7999. #define MC_CMD_FILTER_OP_V3_IN_IFRM_FWDEF1_OFST 136
  8000. #define MC_CMD_FILTER_OP_V3_IN_IFRM_FWDEF1_LEN 4
  8001. /* VXLAN/NVGRE inner frame source IP address to match (as bytes in network
  8002. * order; set last 12 bytes to 0 for IPv4 address)
  8003. */
  8004. #define MC_CMD_FILTER_OP_V3_IN_IFRM_SRC_IP_OFST 140
  8005. #define MC_CMD_FILTER_OP_V3_IN_IFRM_SRC_IP_LEN 16
  8006. /* VXLAN/NVGRE inner frame destination IP address to match (as bytes in network
  8007. * order; set last 12 bytes to 0 for IPv4 address)
  8008. */
  8009. #define MC_CMD_FILTER_OP_V3_IN_IFRM_DST_IP_OFST 156
  8010. #define MC_CMD_FILTER_OP_V3_IN_IFRM_DST_IP_LEN 16
  8011. /* Set an action for all packets matching this filter. The DPDK driver and dpdk
  8012. * f/w variant use their own specific delivery structures, which are documented
  8013. * in the DPDK Firmware Driver Interface (SF-119419-TC). Requesting anything
  8014. * other than MATCH_ACTION_NONE when the NIC is running another f/w variant
  8015. * will cause the filter insertion to fail with ENOTSUP.
  8016. */
  8017. #define MC_CMD_FILTER_OP_V3_IN_MATCH_ACTION_OFST 172
  8018. #define MC_CMD_FILTER_OP_V3_IN_MATCH_ACTION_LEN 4
  8019. /* enum: do nothing extra */
  8020. #define MC_CMD_FILTER_OP_V3_IN_MATCH_ACTION_NONE 0x0
  8021. /* enum: Set the match flag in the packet prefix for packets matching the
  8022. * filter (only with dpdk firmware, otherwise fails with ENOTSUP). Used to
  8023. * support the DPDK rte_flow "FLAG" action.
  8024. */
  8025. #define MC_CMD_FILTER_OP_V3_IN_MATCH_ACTION_FLAG 0x1
  8026. /* enum: Insert MATCH_MARK_VALUE into the packet prefix for packets matching
  8027. * the filter (only with dpdk firmware, otherwise fails with ENOTSUP). Used to
  8028. * support the DPDK rte_flow "MARK" action.
  8029. */
  8030. #define MC_CMD_FILTER_OP_V3_IN_MATCH_ACTION_MARK 0x2
  8031. /* the mark value for MATCH_ACTION_MARK */
  8032. #define MC_CMD_FILTER_OP_V3_IN_MATCH_MARK_VALUE_OFST 176
  8033. #define MC_CMD_FILTER_OP_V3_IN_MATCH_MARK_VALUE_LEN 4
  8034. /* MC_CMD_FILTER_OP_OUT msgresponse */
  8035. #define MC_CMD_FILTER_OP_OUT_LEN 12
  8036. /* identifies the type of operation requested */
  8037. #define MC_CMD_FILTER_OP_OUT_OP_OFST 0
  8038. #define MC_CMD_FILTER_OP_OUT_OP_LEN 4
  8039. /* Enum values, see field(s): */
  8040. /* MC_CMD_FILTER_OP_IN/OP */
  8041. /* Returned filter handle (for insert / subscribe operations). Note that these
  8042. * handles should be considered opaque to the host, although a value of
  8043. * 0xFFFFFFFF_FFFFFFFF is guaranteed never to be a valid handle.
  8044. */
  8045. #define MC_CMD_FILTER_OP_OUT_HANDLE_OFST 4
  8046. #define MC_CMD_FILTER_OP_OUT_HANDLE_LEN 8
  8047. #define MC_CMD_FILTER_OP_OUT_HANDLE_LO_OFST 4
  8048. #define MC_CMD_FILTER_OP_OUT_HANDLE_HI_OFST 8
  8049. /* enum: guaranteed invalid filter handle (low 32 bits) */
  8050. #define MC_CMD_FILTER_OP_OUT_HANDLE_LO_INVALID 0xffffffff
  8051. /* enum: guaranteed invalid filter handle (high 32 bits) */
  8052. #define MC_CMD_FILTER_OP_OUT_HANDLE_HI_INVALID 0xffffffff
  8053. /* MC_CMD_FILTER_OP_EXT_OUT msgresponse */
  8054. #define MC_CMD_FILTER_OP_EXT_OUT_LEN 12
  8055. /* identifies the type of operation requested */
  8056. #define MC_CMD_FILTER_OP_EXT_OUT_OP_OFST 0
  8057. #define MC_CMD_FILTER_OP_EXT_OUT_OP_LEN 4
  8058. /* Enum values, see field(s): */
  8059. /* MC_CMD_FILTER_OP_EXT_IN/OP */
  8060. /* Returned filter handle (for insert / subscribe operations). Note that these
  8061. * handles should be considered opaque to the host, although a value of
  8062. * 0xFFFFFFFF_FFFFFFFF is guaranteed never to be a valid handle.
  8063. */
  8064. #define MC_CMD_FILTER_OP_EXT_OUT_HANDLE_OFST 4
  8065. #define MC_CMD_FILTER_OP_EXT_OUT_HANDLE_LEN 8
  8066. #define MC_CMD_FILTER_OP_EXT_OUT_HANDLE_LO_OFST 4
  8067. #define MC_CMD_FILTER_OP_EXT_OUT_HANDLE_HI_OFST 8
  8068. /* Enum values, see field(s): */
  8069. /* MC_CMD_FILTER_OP_OUT/HANDLE */
  8070. /***********************************/
  8071. /* MC_CMD_GET_PARSER_DISP_INFO
  8072. * Get information related to the parser-dispatcher subsystem
  8073. */
  8074. #define MC_CMD_GET_PARSER_DISP_INFO 0xe4
  8075. #define MC_CMD_0xe4_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8076. /* MC_CMD_GET_PARSER_DISP_INFO_IN msgrequest */
  8077. #define MC_CMD_GET_PARSER_DISP_INFO_IN_LEN 4
  8078. /* identifies the type of operation requested */
  8079. #define MC_CMD_GET_PARSER_DISP_INFO_IN_OP_OFST 0
  8080. #define MC_CMD_GET_PARSER_DISP_INFO_IN_OP_LEN 4
  8081. /* enum: read the list of supported RX filter matches */
  8082. #define MC_CMD_GET_PARSER_DISP_INFO_IN_OP_GET_SUPPORTED_RX_MATCHES 0x1
  8083. /* enum: read flags indicating restrictions on filter insertion for the calling
  8084. * client
  8085. */
  8086. #define MC_CMD_GET_PARSER_DISP_INFO_IN_OP_GET_RESTRICTIONS 0x2
  8087. /* enum: read properties relating to security rules (Medford-only; for use by
  8088. * SolarSecure apps, not directly by drivers. See SF-114946-SW.)
  8089. */
  8090. #define MC_CMD_GET_PARSER_DISP_INFO_IN_OP_GET_SECURITY_RULE_INFO 0x3
  8091. /* enum: read the list of supported RX filter matches for VXLAN/NVGRE
  8092. * encapsulated frames, which follow a different match sequence to normal
  8093. * frames (Medford only)
  8094. */
  8095. #define MC_CMD_GET_PARSER_DISP_INFO_IN_OP_GET_SUPPORTED_ENCAP_RX_MATCHES 0x4
  8096. /* MC_CMD_GET_PARSER_DISP_INFO_OUT msgresponse */
  8097. #define MC_CMD_GET_PARSER_DISP_INFO_OUT_LENMIN 8
  8098. #define MC_CMD_GET_PARSER_DISP_INFO_OUT_LENMAX 252
  8099. #define MC_CMD_GET_PARSER_DISP_INFO_OUT_LEN(num) (8+4*(num))
  8100. /* identifies the type of operation requested */
  8101. #define MC_CMD_GET_PARSER_DISP_INFO_OUT_OP_OFST 0
  8102. #define MC_CMD_GET_PARSER_DISP_INFO_OUT_OP_LEN 4
  8103. /* Enum values, see field(s): */
  8104. /* MC_CMD_GET_PARSER_DISP_INFO_IN/OP */
  8105. /* number of supported match types */
  8106. #define MC_CMD_GET_PARSER_DISP_INFO_OUT_NUM_SUPPORTED_MATCHES_OFST 4
  8107. #define MC_CMD_GET_PARSER_DISP_INFO_OUT_NUM_SUPPORTED_MATCHES_LEN 4
  8108. /* array of supported match types (valid MATCH_FIELDS values for
  8109. * MC_CMD_FILTER_OP) sorted in decreasing priority order
  8110. */
  8111. #define MC_CMD_GET_PARSER_DISP_INFO_OUT_SUPPORTED_MATCHES_OFST 8
  8112. #define MC_CMD_GET_PARSER_DISP_INFO_OUT_SUPPORTED_MATCHES_LEN 4
  8113. #define MC_CMD_GET_PARSER_DISP_INFO_OUT_SUPPORTED_MATCHES_MINNUM 0
  8114. #define MC_CMD_GET_PARSER_DISP_INFO_OUT_SUPPORTED_MATCHES_MAXNUM 61
  8115. /* MC_CMD_GET_PARSER_DISP_RESTRICTIONS_OUT msgresponse */
  8116. #define MC_CMD_GET_PARSER_DISP_RESTRICTIONS_OUT_LEN 8
  8117. /* identifies the type of operation requested */
  8118. #define MC_CMD_GET_PARSER_DISP_RESTRICTIONS_OUT_OP_OFST 0
  8119. #define MC_CMD_GET_PARSER_DISP_RESTRICTIONS_OUT_OP_LEN 4
  8120. /* Enum values, see field(s): */
  8121. /* MC_CMD_GET_PARSER_DISP_INFO_IN/OP */
  8122. /* bitfield of filter insertion restrictions */
  8123. #define MC_CMD_GET_PARSER_DISP_RESTRICTIONS_OUT_RESTRICTION_FLAGS_OFST 4
  8124. #define MC_CMD_GET_PARSER_DISP_RESTRICTIONS_OUT_RESTRICTION_FLAGS_LEN 4
  8125. #define MC_CMD_GET_PARSER_DISP_RESTRICTIONS_OUT_DST_IP_MCAST_ONLY_LBN 0
  8126. #define MC_CMD_GET_PARSER_DISP_RESTRICTIONS_OUT_DST_IP_MCAST_ONLY_WIDTH 1
  8127. /***********************************/
  8128. /* MC_CMD_PARSER_DISP_RW
  8129. * Direct read/write of parser-dispatcher state (DICPUs and LUE) for debugging.
  8130. * Please note that this interface is only of use to debug tools which have
  8131. * knowledge of firmware and hardware data structures; nothing here is intended
  8132. * for use by normal driver code. Note that although this command is in the
  8133. * Admin privilege group, in tamperproof adapters, only read operations are
  8134. * permitted.
  8135. */
  8136. #define MC_CMD_PARSER_DISP_RW 0xe5
  8137. #define MC_CMD_0xe5_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  8138. /* MC_CMD_PARSER_DISP_RW_IN msgrequest */
  8139. #define MC_CMD_PARSER_DISP_RW_IN_LEN 32
  8140. /* identifies the target of the operation */
  8141. #define MC_CMD_PARSER_DISP_RW_IN_TARGET_OFST 0
  8142. #define MC_CMD_PARSER_DISP_RW_IN_TARGET_LEN 4
  8143. /* enum: RX dispatcher CPU */
  8144. #define MC_CMD_PARSER_DISP_RW_IN_RX_DICPU 0x0
  8145. /* enum: TX dispatcher CPU */
  8146. #define MC_CMD_PARSER_DISP_RW_IN_TX_DICPU 0x1
  8147. /* enum: Lookup engine (with original metadata format). Deprecated; used only
  8148. * by cmdclient as a fallback for very old Huntington firmware, and not
  8149. * supported in firmware beyond v6.4.0.1005. Use LUE_VERSIONED_METADATA
  8150. * instead.
  8151. */
  8152. #define MC_CMD_PARSER_DISP_RW_IN_LUE 0x2
  8153. /* enum: Lookup engine (with requested metadata format) */
  8154. #define MC_CMD_PARSER_DISP_RW_IN_LUE_VERSIONED_METADATA 0x3
  8155. /* enum: RX0 dispatcher CPU (alias for RX_DICPU; Medford has 2 RX DICPUs) */
  8156. #define MC_CMD_PARSER_DISP_RW_IN_RX0_DICPU 0x0
  8157. /* enum: RX1 dispatcher CPU (only valid for Medford) */
  8158. #define MC_CMD_PARSER_DISP_RW_IN_RX1_DICPU 0x4
  8159. /* enum: Miscellaneous other state (only valid for Medford) */
  8160. #define MC_CMD_PARSER_DISP_RW_IN_MISC_STATE 0x5
  8161. /* identifies the type of operation requested */
  8162. #define MC_CMD_PARSER_DISP_RW_IN_OP_OFST 4
  8163. #define MC_CMD_PARSER_DISP_RW_IN_OP_LEN 4
  8164. /* enum: Read a word of DICPU DMEM or a LUE entry */
  8165. #define MC_CMD_PARSER_DISP_RW_IN_READ 0x0
  8166. /* enum: Write a word of DICPU DMEM or a LUE entry. Not permitted on
  8167. * tamperproof adapters.
  8168. */
  8169. #define MC_CMD_PARSER_DISP_RW_IN_WRITE 0x1
  8170. /* enum: Read-modify-write a word of DICPU DMEM (not valid for LUE). Not
  8171. * permitted on tamperproof adapters.
  8172. */
  8173. #define MC_CMD_PARSER_DISP_RW_IN_RMW 0x2
  8174. /* data memory address (DICPU targets) or LUE index (LUE targets) */
  8175. #define MC_CMD_PARSER_DISP_RW_IN_ADDRESS_OFST 8
  8176. #define MC_CMD_PARSER_DISP_RW_IN_ADDRESS_LEN 4
  8177. /* selector (for MISC_STATE target) */
  8178. #define MC_CMD_PARSER_DISP_RW_IN_SELECTOR_OFST 8
  8179. #define MC_CMD_PARSER_DISP_RW_IN_SELECTOR_LEN 4
  8180. /* enum: Port to datapath mapping */
  8181. #define MC_CMD_PARSER_DISP_RW_IN_PORT_DP_MAPPING 0x1
  8182. /* value to write (for DMEM writes) */
  8183. #define MC_CMD_PARSER_DISP_RW_IN_DMEM_WRITE_VALUE_OFST 12
  8184. #define MC_CMD_PARSER_DISP_RW_IN_DMEM_WRITE_VALUE_LEN 4
  8185. /* XOR value (for DMEM read-modify-writes: new = (old & mask) ^ value) */
  8186. #define MC_CMD_PARSER_DISP_RW_IN_DMEM_RMW_XOR_VALUE_OFST 12
  8187. #define MC_CMD_PARSER_DISP_RW_IN_DMEM_RMW_XOR_VALUE_LEN 4
  8188. /* AND mask (for DMEM read-modify-writes: new = (old & mask) ^ value) */
  8189. #define MC_CMD_PARSER_DISP_RW_IN_DMEM_RMW_AND_MASK_OFST 16
  8190. #define MC_CMD_PARSER_DISP_RW_IN_DMEM_RMW_AND_MASK_LEN 4
  8191. /* metadata format (for LUE reads using LUE_VERSIONED_METADATA) */
  8192. #define MC_CMD_PARSER_DISP_RW_IN_LUE_READ_METADATA_VERSION_OFST 12
  8193. #define MC_CMD_PARSER_DISP_RW_IN_LUE_READ_METADATA_VERSION_LEN 4
  8194. /* value to write (for LUE writes) */
  8195. #define MC_CMD_PARSER_DISP_RW_IN_LUE_WRITE_VALUE_OFST 12
  8196. #define MC_CMD_PARSER_DISP_RW_IN_LUE_WRITE_VALUE_LEN 20
  8197. /* MC_CMD_PARSER_DISP_RW_OUT msgresponse */
  8198. #define MC_CMD_PARSER_DISP_RW_OUT_LEN 52
  8199. /* value read (for DMEM reads) */
  8200. #define MC_CMD_PARSER_DISP_RW_OUT_DMEM_READ_VALUE_OFST 0
  8201. #define MC_CMD_PARSER_DISP_RW_OUT_DMEM_READ_VALUE_LEN 4
  8202. /* value read (for LUE reads) */
  8203. #define MC_CMD_PARSER_DISP_RW_OUT_LUE_READ_VALUE_OFST 0
  8204. #define MC_CMD_PARSER_DISP_RW_OUT_LUE_READ_VALUE_LEN 20
  8205. /* up to 8 32-bit words of additional soft state from the LUE manager (the
  8206. * exact content is firmware-dependent and intended only for debug use)
  8207. */
  8208. #define MC_CMD_PARSER_DISP_RW_OUT_LUE_MGR_STATE_OFST 20
  8209. #define MC_CMD_PARSER_DISP_RW_OUT_LUE_MGR_STATE_LEN 32
  8210. /* datapath(s) used for each port (for MISC_STATE PORT_DP_MAPPING selector) */
  8211. #define MC_CMD_PARSER_DISP_RW_OUT_PORT_DP_MAPPING_OFST 0
  8212. #define MC_CMD_PARSER_DISP_RW_OUT_PORT_DP_MAPPING_LEN 4
  8213. #define MC_CMD_PARSER_DISP_RW_OUT_PORT_DP_MAPPING_NUM 4
  8214. #define MC_CMD_PARSER_DISP_RW_OUT_DP0 0x1 /* enum */
  8215. #define MC_CMD_PARSER_DISP_RW_OUT_DP1 0x2 /* enum */
  8216. /***********************************/
  8217. /* MC_CMD_GET_PF_COUNT
  8218. * Get number of PFs on the device.
  8219. */
  8220. #define MC_CMD_GET_PF_COUNT 0xb6
  8221. #define MC_CMD_0xb6_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8222. /* MC_CMD_GET_PF_COUNT_IN msgrequest */
  8223. #define MC_CMD_GET_PF_COUNT_IN_LEN 0
  8224. /* MC_CMD_GET_PF_COUNT_OUT msgresponse */
  8225. #define MC_CMD_GET_PF_COUNT_OUT_LEN 1
  8226. /* Identifies the number of PFs on the device. */
  8227. #define MC_CMD_GET_PF_COUNT_OUT_PF_COUNT_OFST 0
  8228. #define MC_CMD_GET_PF_COUNT_OUT_PF_COUNT_LEN 1
  8229. /***********************************/
  8230. /* MC_CMD_SET_PF_COUNT
  8231. * Set number of PFs on the device.
  8232. */
  8233. #define MC_CMD_SET_PF_COUNT 0xb7
  8234. /* MC_CMD_SET_PF_COUNT_IN msgrequest */
  8235. #define MC_CMD_SET_PF_COUNT_IN_LEN 4
  8236. /* New number of PFs on the device. */
  8237. #define MC_CMD_SET_PF_COUNT_IN_PF_COUNT_OFST 0
  8238. #define MC_CMD_SET_PF_COUNT_IN_PF_COUNT_LEN 4
  8239. /* MC_CMD_SET_PF_COUNT_OUT msgresponse */
  8240. #define MC_CMD_SET_PF_COUNT_OUT_LEN 0
  8241. /***********************************/
  8242. /* MC_CMD_GET_PORT_ASSIGNMENT
  8243. * Get port assignment for current PCI function.
  8244. */
  8245. #define MC_CMD_GET_PORT_ASSIGNMENT 0xb8
  8246. #define MC_CMD_0xb8_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8247. /* MC_CMD_GET_PORT_ASSIGNMENT_IN msgrequest */
  8248. #define MC_CMD_GET_PORT_ASSIGNMENT_IN_LEN 0
  8249. /* MC_CMD_GET_PORT_ASSIGNMENT_OUT msgresponse */
  8250. #define MC_CMD_GET_PORT_ASSIGNMENT_OUT_LEN 4
  8251. /* Identifies the port assignment for this function. */
  8252. #define MC_CMD_GET_PORT_ASSIGNMENT_OUT_PORT_OFST 0
  8253. #define MC_CMD_GET_PORT_ASSIGNMENT_OUT_PORT_LEN 4
  8254. /***********************************/
  8255. /* MC_CMD_SET_PORT_ASSIGNMENT
  8256. * Set port assignment for current PCI function.
  8257. */
  8258. #define MC_CMD_SET_PORT_ASSIGNMENT 0xb9
  8259. #define MC_CMD_0xb9_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  8260. /* MC_CMD_SET_PORT_ASSIGNMENT_IN msgrequest */
  8261. #define MC_CMD_SET_PORT_ASSIGNMENT_IN_LEN 4
  8262. /* Identifies the port assignment for this function. */
  8263. #define MC_CMD_SET_PORT_ASSIGNMENT_IN_PORT_OFST 0
  8264. #define MC_CMD_SET_PORT_ASSIGNMENT_IN_PORT_LEN 4
  8265. /* MC_CMD_SET_PORT_ASSIGNMENT_OUT msgresponse */
  8266. #define MC_CMD_SET_PORT_ASSIGNMENT_OUT_LEN 0
  8267. /***********************************/
  8268. /* MC_CMD_ALLOC_VIS
  8269. * Allocate VIs for current PCI function.
  8270. */
  8271. #define MC_CMD_ALLOC_VIS 0x8b
  8272. #define MC_CMD_0x8b_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8273. /* MC_CMD_ALLOC_VIS_IN msgrequest */
  8274. #define MC_CMD_ALLOC_VIS_IN_LEN 8
  8275. /* The minimum number of VIs that is acceptable */
  8276. #define MC_CMD_ALLOC_VIS_IN_MIN_VI_COUNT_OFST 0
  8277. #define MC_CMD_ALLOC_VIS_IN_MIN_VI_COUNT_LEN 4
  8278. /* The maximum number of VIs that would be useful */
  8279. #define MC_CMD_ALLOC_VIS_IN_MAX_VI_COUNT_OFST 4
  8280. #define MC_CMD_ALLOC_VIS_IN_MAX_VI_COUNT_LEN 4
  8281. /* MC_CMD_ALLOC_VIS_OUT msgresponse: Huntington-compatible VI_ALLOC request.
  8282. * Use extended version in new code.
  8283. */
  8284. #define MC_CMD_ALLOC_VIS_OUT_LEN 8
  8285. /* The number of VIs allocated on this function */
  8286. #define MC_CMD_ALLOC_VIS_OUT_VI_COUNT_OFST 0
  8287. #define MC_CMD_ALLOC_VIS_OUT_VI_COUNT_LEN 4
  8288. /* The base absolute VI number allocated to this function. Required to
  8289. * correctly interpret wakeup events.
  8290. */
  8291. #define MC_CMD_ALLOC_VIS_OUT_VI_BASE_OFST 4
  8292. #define MC_CMD_ALLOC_VIS_OUT_VI_BASE_LEN 4
  8293. /* MC_CMD_ALLOC_VIS_EXT_OUT msgresponse */
  8294. #define MC_CMD_ALLOC_VIS_EXT_OUT_LEN 12
  8295. /* The number of VIs allocated on this function */
  8296. #define MC_CMD_ALLOC_VIS_EXT_OUT_VI_COUNT_OFST 0
  8297. #define MC_CMD_ALLOC_VIS_EXT_OUT_VI_COUNT_LEN 4
  8298. /* The base absolute VI number allocated to this function. Required to
  8299. * correctly interpret wakeup events.
  8300. */
  8301. #define MC_CMD_ALLOC_VIS_EXT_OUT_VI_BASE_OFST 4
  8302. #define MC_CMD_ALLOC_VIS_EXT_OUT_VI_BASE_LEN 4
  8303. /* Function's port vi_shift value (always 0 on Huntington) */
  8304. #define MC_CMD_ALLOC_VIS_EXT_OUT_VI_SHIFT_OFST 8
  8305. #define MC_CMD_ALLOC_VIS_EXT_OUT_VI_SHIFT_LEN 4
  8306. /***********************************/
  8307. /* MC_CMD_FREE_VIS
  8308. * Free VIs for current PCI function. Any linked PIO buffers will be unlinked,
  8309. * but not freed.
  8310. */
  8311. #define MC_CMD_FREE_VIS 0x8c
  8312. #define MC_CMD_0x8c_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8313. /* MC_CMD_FREE_VIS_IN msgrequest */
  8314. #define MC_CMD_FREE_VIS_IN_LEN 0
  8315. /* MC_CMD_FREE_VIS_OUT msgresponse */
  8316. #define MC_CMD_FREE_VIS_OUT_LEN 0
  8317. /***********************************/
  8318. /* MC_CMD_GET_SRIOV_CFG
  8319. * Get SRIOV config for this PF.
  8320. */
  8321. #define MC_CMD_GET_SRIOV_CFG 0xba
  8322. #define MC_CMD_0xba_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8323. /* MC_CMD_GET_SRIOV_CFG_IN msgrequest */
  8324. #define MC_CMD_GET_SRIOV_CFG_IN_LEN 0
  8325. /* MC_CMD_GET_SRIOV_CFG_OUT msgresponse */
  8326. #define MC_CMD_GET_SRIOV_CFG_OUT_LEN 20
  8327. /* Number of VFs currently enabled. */
  8328. #define MC_CMD_GET_SRIOV_CFG_OUT_VF_CURRENT_OFST 0
  8329. #define MC_CMD_GET_SRIOV_CFG_OUT_VF_CURRENT_LEN 4
  8330. /* Max number of VFs before sriov stride and offset may need to be changed. */
  8331. #define MC_CMD_GET_SRIOV_CFG_OUT_VF_MAX_OFST 4
  8332. #define MC_CMD_GET_SRIOV_CFG_OUT_VF_MAX_LEN 4
  8333. #define MC_CMD_GET_SRIOV_CFG_OUT_FLAGS_OFST 8
  8334. #define MC_CMD_GET_SRIOV_CFG_OUT_FLAGS_LEN 4
  8335. #define MC_CMD_GET_SRIOV_CFG_OUT_VF_ENABLED_LBN 0
  8336. #define MC_CMD_GET_SRIOV_CFG_OUT_VF_ENABLED_WIDTH 1
  8337. /* RID offset of first VF from PF. */
  8338. #define MC_CMD_GET_SRIOV_CFG_OUT_VF_OFFSET_OFST 12
  8339. #define MC_CMD_GET_SRIOV_CFG_OUT_VF_OFFSET_LEN 4
  8340. /* RID offset of each subsequent VF from the previous. */
  8341. #define MC_CMD_GET_SRIOV_CFG_OUT_VF_STRIDE_OFST 16
  8342. #define MC_CMD_GET_SRIOV_CFG_OUT_VF_STRIDE_LEN 4
  8343. /***********************************/
  8344. /* MC_CMD_SET_SRIOV_CFG
  8345. * Set SRIOV config for this PF.
  8346. */
  8347. #define MC_CMD_SET_SRIOV_CFG 0xbb
  8348. #define MC_CMD_0xbb_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  8349. /* MC_CMD_SET_SRIOV_CFG_IN msgrequest */
  8350. #define MC_CMD_SET_SRIOV_CFG_IN_LEN 20
  8351. /* Number of VFs currently enabled. */
  8352. #define MC_CMD_SET_SRIOV_CFG_IN_VF_CURRENT_OFST 0
  8353. #define MC_CMD_SET_SRIOV_CFG_IN_VF_CURRENT_LEN 4
  8354. /* Max number of VFs before sriov stride and offset may need to be changed. */
  8355. #define MC_CMD_SET_SRIOV_CFG_IN_VF_MAX_OFST 4
  8356. #define MC_CMD_SET_SRIOV_CFG_IN_VF_MAX_LEN 4
  8357. #define MC_CMD_SET_SRIOV_CFG_IN_FLAGS_OFST 8
  8358. #define MC_CMD_SET_SRIOV_CFG_IN_FLAGS_LEN 4
  8359. #define MC_CMD_SET_SRIOV_CFG_IN_VF_ENABLED_LBN 0
  8360. #define MC_CMD_SET_SRIOV_CFG_IN_VF_ENABLED_WIDTH 1
  8361. /* RID offset of first VF from PF, or 0 for no change, or
  8362. * MC_CMD_RESOURCE_INSTANCE_ANY to allow the system to allocate an offset.
  8363. */
  8364. #define MC_CMD_SET_SRIOV_CFG_IN_VF_OFFSET_OFST 12
  8365. #define MC_CMD_SET_SRIOV_CFG_IN_VF_OFFSET_LEN 4
  8366. /* RID offset of each subsequent VF from the previous, 0 for no change, or
  8367. * MC_CMD_RESOURCE_INSTANCE_ANY to allow the system to allocate a stride.
  8368. */
  8369. #define MC_CMD_SET_SRIOV_CFG_IN_VF_STRIDE_OFST 16
  8370. #define MC_CMD_SET_SRIOV_CFG_IN_VF_STRIDE_LEN 4
  8371. /* MC_CMD_SET_SRIOV_CFG_OUT msgresponse */
  8372. #define MC_CMD_SET_SRIOV_CFG_OUT_LEN 0
  8373. /***********************************/
  8374. /* MC_CMD_GET_VI_ALLOC_INFO
  8375. * Get information about number of VI's and base VI number allocated to this
  8376. * function.
  8377. */
  8378. #define MC_CMD_GET_VI_ALLOC_INFO 0x8d
  8379. #define MC_CMD_0x8d_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8380. /* MC_CMD_GET_VI_ALLOC_INFO_IN msgrequest */
  8381. #define MC_CMD_GET_VI_ALLOC_INFO_IN_LEN 0
  8382. /* MC_CMD_GET_VI_ALLOC_INFO_OUT msgresponse */
  8383. #define MC_CMD_GET_VI_ALLOC_INFO_OUT_LEN 12
  8384. /* The number of VIs allocated on this function */
  8385. #define MC_CMD_GET_VI_ALLOC_INFO_OUT_VI_COUNT_OFST 0
  8386. #define MC_CMD_GET_VI_ALLOC_INFO_OUT_VI_COUNT_LEN 4
  8387. /* The base absolute VI number allocated to this function. Required to
  8388. * correctly interpret wakeup events.
  8389. */
  8390. #define MC_CMD_GET_VI_ALLOC_INFO_OUT_VI_BASE_OFST 4
  8391. #define MC_CMD_GET_VI_ALLOC_INFO_OUT_VI_BASE_LEN 4
  8392. /* Function's port vi_shift value (always 0 on Huntington) */
  8393. #define MC_CMD_GET_VI_ALLOC_INFO_OUT_VI_SHIFT_OFST 8
  8394. #define MC_CMD_GET_VI_ALLOC_INFO_OUT_VI_SHIFT_LEN 4
  8395. /***********************************/
  8396. /* MC_CMD_DUMP_VI_STATE
  8397. * For CmdClient use. Dump pertinent information on a specific absolute VI.
  8398. */
  8399. #define MC_CMD_DUMP_VI_STATE 0x8e
  8400. #define MC_CMD_0x8e_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8401. /* MC_CMD_DUMP_VI_STATE_IN msgrequest */
  8402. #define MC_CMD_DUMP_VI_STATE_IN_LEN 4
  8403. /* The VI number to query. */
  8404. #define MC_CMD_DUMP_VI_STATE_IN_VI_NUMBER_OFST 0
  8405. #define MC_CMD_DUMP_VI_STATE_IN_VI_NUMBER_LEN 4
  8406. /* MC_CMD_DUMP_VI_STATE_OUT msgresponse */
  8407. #define MC_CMD_DUMP_VI_STATE_OUT_LEN 96
  8408. /* The PF part of the function owning this VI. */
  8409. #define MC_CMD_DUMP_VI_STATE_OUT_OWNER_PF_OFST 0
  8410. #define MC_CMD_DUMP_VI_STATE_OUT_OWNER_PF_LEN 2
  8411. /* The VF part of the function owning this VI. */
  8412. #define MC_CMD_DUMP_VI_STATE_OUT_OWNER_VF_OFST 2
  8413. #define MC_CMD_DUMP_VI_STATE_OUT_OWNER_VF_LEN 2
  8414. /* Base of VIs allocated to this function. */
  8415. #define MC_CMD_DUMP_VI_STATE_OUT_FUNC_VI_BASE_OFST 4
  8416. #define MC_CMD_DUMP_VI_STATE_OUT_FUNC_VI_BASE_LEN 2
  8417. /* Count of VIs allocated to the owner function. */
  8418. #define MC_CMD_DUMP_VI_STATE_OUT_FUNC_VI_COUNT_OFST 6
  8419. #define MC_CMD_DUMP_VI_STATE_OUT_FUNC_VI_COUNT_LEN 2
  8420. /* Base interrupt vector allocated to this function. */
  8421. #define MC_CMD_DUMP_VI_STATE_OUT_FUNC_VECTOR_BASE_OFST 8
  8422. #define MC_CMD_DUMP_VI_STATE_OUT_FUNC_VECTOR_BASE_LEN 2
  8423. /* Number of interrupt vectors allocated to this function. */
  8424. #define MC_CMD_DUMP_VI_STATE_OUT_FUNC_VECTOR_COUNT_OFST 10
  8425. #define MC_CMD_DUMP_VI_STATE_OUT_FUNC_VECTOR_COUNT_LEN 2
  8426. /* Raw evq ptr table data. */
  8427. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EVQ_PTR_RAW_OFST 12
  8428. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EVQ_PTR_RAW_LEN 8
  8429. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EVQ_PTR_RAW_LO_OFST 12
  8430. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EVQ_PTR_RAW_HI_OFST 16
  8431. /* Raw evq timer table data. */
  8432. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_TIMER_RAW_OFST 20
  8433. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_TIMER_RAW_LEN 8
  8434. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_TIMER_RAW_LO_OFST 20
  8435. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_TIMER_RAW_HI_OFST 24
  8436. /* Combined metadata field. */
  8437. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_META_OFST 28
  8438. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_META_LEN 4
  8439. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_META_BUFS_BASE_LBN 0
  8440. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_META_BUFS_BASE_WIDTH 16
  8441. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_META_BUFS_NPAGES_LBN 16
  8442. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_META_BUFS_NPAGES_WIDTH 8
  8443. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_META_WKUP_REF_LBN 24
  8444. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_META_WKUP_REF_WIDTH 8
  8445. /* TXDPCPU raw table data for queue. */
  8446. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_0_OFST 32
  8447. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_0_LEN 8
  8448. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_0_LO_OFST 32
  8449. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_0_HI_OFST 36
  8450. /* TXDPCPU raw table data for queue. */
  8451. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_1_OFST 40
  8452. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_1_LEN 8
  8453. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_1_LO_OFST 40
  8454. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_1_HI_OFST 44
  8455. /* TXDPCPU raw table data for queue. */
  8456. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_2_OFST 48
  8457. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_2_LEN 8
  8458. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_2_LO_OFST 48
  8459. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_2_HI_OFST 52
  8460. /* Combined metadata field. */
  8461. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_OFST 56
  8462. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_LEN 8
  8463. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_LO_OFST 56
  8464. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_HI_OFST 60
  8465. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_BUFS_BASE_LBN 0
  8466. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_BUFS_BASE_WIDTH 16
  8467. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_BUFS_NPAGES_LBN 16
  8468. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_BUFS_NPAGES_WIDTH 8
  8469. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_QSTATE_LBN 24
  8470. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_QSTATE_WIDTH 8
  8471. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_WAITCOUNT_LBN 32
  8472. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_WAITCOUNT_WIDTH 8
  8473. #define MC_CMD_DUMP_VI_STATE_OUT_VI_PADDING_LBN 40
  8474. #define MC_CMD_DUMP_VI_STATE_OUT_VI_PADDING_WIDTH 24
  8475. /* RXDPCPU raw table data for queue. */
  8476. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_0_OFST 64
  8477. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_0_LEN 8
  8478. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_0_LO_OFST 64
  8479. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_0_HI_OFST 68
  8480. /* RXDPCPU raw table data for queue. */
  8481. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_1_OFST 72
  8482. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_1_LEN 8
  8483. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_1_LO_OFST 72
  8484. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_1_HI_OFST 76
  8485. /* Reserved, currently 0. */
  8486. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_2_OFST 80
  8487. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_2_LEN 8
  8488. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_2_LO_OFST 80
  8489. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_2_HI_OFST 84
  8490. /* Combined metadata field. */
  8491. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_OFST 88
  8492. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_LEN 8
  8493. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_LO_OFST 88
  8494. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_HI_OFST 92
  8495. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_BUFS_BASE_LBN 0
  8496. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_BUFS_BASE_WIDTH 16
  8497. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_BUFS_NPAGES_LBN 16
  8498. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_BUFS_NPAGES_WIDTH 8
  8499. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_QSTATE_LBN 24
  8500. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_QSTATE_WIDTH 8
  8501. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_WAITCOUNT_LBN 32
  8502. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_WAITCOUNT_WIDTH 8
  8503. /***********************************/
  8504. /* MC_CMD_ALLOC_PIOBUF
  8505. * Allocate a push I/O buffer for later use with a tx queue.
  8506. */
  8507. #define MC_CMD_ALLOC_PIOBUF 0x8f
  8508. #define MC_CMD_0x8f_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
  8509. /* MC_CMD_ALLOC_PIOBUF_IN msgrequest */
  8510. #define MC_CMD_ALLOC_PIOBUF_IN_LEN 0
  8511. /* MC_CMD_ALLOC_PIOBUF_OUT msgresponse */
  8512. #define MC_CMD_ALLOC_PIOBUF_OUT_LEN 4
  8513. /* Handle for allocated push I/O buffer. */
  8514. #define MC_CMD_ALLOC_PIOBUF_OUT_PIOBUF_HANDLE_OFST 0
  8515. #define MC_CMD_ALLOC_PIOBUF_OUT_PIOBUF_HANDLE_LEN 4
  8516. /***********************************/
  8517. /* MC_CMD_FREE_PIOBUF
  8518. * Free a push I/O buffer.
  8519. */
  8520. #define MC_CMD_FREE_PIOBUF 0x90
  8521. #define MC_CMD_0x90_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
  8522. /* MC_CMD_FREE_PIOBUF_IN msgrequest */
  8523. #define MC_CMD_FREE_PIOBUF_IN_LEN 4
  8524. /* Handle for allocated push I/O buffer. */
  8525. #define MC_CMD_FREE_PIOBUF_IN_PIOBUF_HANDLE_OFST 0
  8526. #define MC_CMD_FREE_PIOBUF_IN_PIOBUF_HANDLE_LEN 4
  8527. /* MC_CMD_FREE_PIOBUF_OUT msgresponse */
  8528. #define MC_CMD_FREE_PIOBUF_OUT_LEN 0
  8529. /***********************************/
  8530. /* MC_CMD_GET_VI_TLP_PROCESSING
  8531. * Get TLP steering and ordering information for a VI.
  8532. */
  8533. #define MC_CMD_GET_VI_TLP_PROCESSING 0xb0
  8534. #define MC_CMD_0xb0_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8535. /* MC_CMD_GET_VI_TLP_PROCESSING_IN msgrequest */
  8536. #define MC_CMD_GET_VI_TLP_PROCESSING_IN_LEN 4
  8537. /* VI number to get information for. */
  8538. #define MC_CMD_GET_VI_TLP_PROCESSING_IN_INSTANCE_OFST 0
  8539. #define MC_CMD_GET_VI_TLP_PROCESSING_IN_INSTANCE_LEN 4
  8540. /* MC_CMD_GET_VI_TLP_PROCESSING_OUT msgresponse */
  8541. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_LEN 4
  8542. /* Transaction processing steering hint 1 for use with the Rx Queue. */
  8543. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_TPH_TAG1_RX_OFST 0
  8544. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_TPH_TAG1_RX_LEN 1
  8545. /* Transaction processing steering hint 2 for use with the Ev Queue. */
  8546. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_TPH_TAG2_EV_OFST 1
  8547. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_TPH_TAG2_EV_LEN 1
  8548. /* Use Relaxed ordering model for TLPs on this VI. */
  8549. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_RELAXED_ORDERING_LBN 16
  8550. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_RELAXED_ORDERING_WIDTH 1
  8551. /* Use ID based ordering for TLPs on this VI. */
  8552. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_ID_BASED_ORDERING_LBN 17
  8553. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_ID_BASED_ORDERING_WIDTH 1
  8554. /* Set no snoop bit for TLPs on this VI. */
  8555. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_NO_SNOOP_LBN 18
  8556. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_NO_SNOOP_WIDTH 1
  8557. /* Enable TPH for TLPs on this VI. */
  8558. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_TPH_ON_LBN 19
  8559. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_TPH_ON_WIDTH 1
  8560. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_DATA_OFST 0
  8561. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_DATA_LEN 4
  8562. /***********************************/
  8563. /* MC_CMD_SET_VI_TLP_PROCESSING
  8564. * Set TLP steering and ordering information for a VI.
  8565. */
  8566. #define MC_CMD_SET_VI_TLP_PROCESSING 0xb1
  8567. #define MC_CMD_0xb1_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8568. /* MC_CMD_SET_VI_TLP_PROCESSING_IN msgrequest */
  8569. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_LEN 8
  8570. /* VI number to set information for. */
  8571. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_INSTANCE_OFST 0
  8572. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_INSTANCE_LEN 4
  8573. /* Transaction processing steering hint 1 for use with the Rx Queue. */
  8574. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_TPH_TAG1_RX_OFST 4
  8575. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_TPH_TAG1_RX_LEN 1
  8576. /* Transaction processing steering hint 2 for use with the Ev Queue. */
  8577. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_TPH_TAG2_EV_OFST 5
  8578. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_TPH_TAG2_EV_LEN 1
  8579. /* Use Relaxed ordering model for TLPs on this VI. */
  8580. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_RELAXED_ORDERING_LBN 48
  8581. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_RELAXED_ORDERING_WIDTH 1
  8582. /* Use ID based ordering for TLPs on this VI. */
  8583. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_ID_BASED_ORDERING_LBN 49
  8584. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_ID_BASED_ORDERING_WIDTH 1
  8585. /* Set the no snoop bit for TLPs on this VI. */
  8586. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_NO_SNOOP_LBN 50
  8587. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_NO_SNOOP_WIDTH 1
  8588. /* Enable TPH for TLPs on this VI. */
  8589. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_TPH_ON_LBN 51
  8590. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_TPH_ON_WIDTH 1
  8591. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_DATA_OFST 4
  8592. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_DATA_LEN 4
  8593. /* MC_CMD_SET_VI_TLP_PROCESSING_OUT msgresponse */
  8594. #define MC_CMD_SET_VI_TLP_PROCESSING_OUT_LEN 0
  8595. /***********************************/
  8596. /* MC_CMD_GET_TLP_PROCESSING_GLOBALS
  8597. * Get global PCIe steering and transaction processing configuration.
  8598. */
  8599. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS 0xbc
  8600. #define MC_CMD_0xbc_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  8601. /* MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN msgrequest */
  8602. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN_LEN 4
  8603. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN_TLP_GLOBAL_CATEGORY_OFST 0
  8604. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN_TLP_GLOBAL_CATEGORY_LEN 4
  8605. /* enum: MISC. */
  8606. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN_TLP_GLOBAL_CATEGORY_MISC 0x0
  8607. /* enum: IDO. */
  8608. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN_TLP_GLOBAL_CATEGORY_IDO 0x1
  8609. /* enum: RO. */
  8610. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN_TLP_GLOBAL_CATEGORY_RO 0x2
  8611. /* enum: TPH Type. */
  8612. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN_TLP_GLOBAL_CATEGORY_TPH_TYPE 0x3
  8613. /* MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT msgresponse */
  8614. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_LEN 8
  8615. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_GLOBAL_CATEGORY_OFST 0
  8616. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_GLOBAL_CATEGORY_LEN 4
  8617. /* Enum values, see field(s): */
  8618. /* MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN/TLP_GLOBAL_CATEGORY */
  8619. /* Amalgamated TLP info word. */
  8620. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_WORD_OFST 4
  8621. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_WORD_LEN 4
  8622. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_MISC_WTAG_EN_LBN 0
  8623. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_MISC_WTAG_EN_WIDTH 1
  8624. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_MISC_SPARE_LBN 1
  8625. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_MISC_SPARE_WIDTH 31
  8626. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_DL_EN_LBN 0
  8627. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_DL_EN_WIDTH 1
  8628. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_TX_EN_LBN 1
  8629. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_TX_EN_WIDTH 1
  8630. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_EV_EN_LBN 2
  8631. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_EV_EN_WIDTH 1
  8632. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_RX_EN_LBN 3
  8633. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_RX_EN_WIDTH 1
  8634. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_SPARE_LBN 4
  8635. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_SPARE_WIDTH 28
  8636. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_RO_RXDMA_EN_LBN 0
  8637. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_RO_RXDMA_EN_WIDTH 1
  8638. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_RO_TXDMA_EN_LBN 1
  8639. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_RO_TXDMA_EN_WIDTH 1
  8640. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_RO_DL_EN_LBN 2
  8641. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_RO_DL_EN_WIDTH 1
  8642. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_RO_SPARE_LBN 3
  8643. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_RO_SPARE_WIDTH 29
  8644. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_MSIX_LBN 0
  8645. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_MSIX_WIDTH 2
  8646. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_DL_LBN 2
  8647. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_DL_WIDTH 2
  8648. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_TX_LBN 4
  8649. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_TX_WIDTH 2
  8650. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_EV_LBN 6
  8651. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_EV_WIDTH 2
  8652. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_RX_LBN 8
  8653. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_RX_WIDTH 2
  8654. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TLP_TYPE_SPARE_LBN 9
  8655. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TLP_TYPE_SPARE_WIDTH 23
  8656. /***********************************/
  8657. /* MC_CMD_SET_TLP_PROCESSING_GLOBALS
  8658. * Set global PCIe steering and transaction processing configuration.
  8659. */
  8660. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS 0xbd
  8661. #define MC_CMD_0xbd_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  8662. /* MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN msgrequest */
  8663. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_LEN 8
  8664. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_GLOBAL_CATEGORY_OFST 0
  8665. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_GLOBAL_CATEGORY_LEN 4
  8666. /* Enum values, see field(s): */
  8667. /* MC_CMD_GET_TLP_PROCESSING_GLOBALS/MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN/TLP_GLOBAL_CATEGORY */
  8668. /* Amalgamated TLP info word. */
  8669. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_WORD_OFST 4
  8670. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_WORD_LEN 4
  8671. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_MISC_WTAG_EN_LBN 0
  8672. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_MISC_WTAG_EN_WIDTH 1
  8673. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_IDO_DL_EN_LBN 0
  8674. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_IDO_DL_EN_WIDTH 1
  8675. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_IDO_TX_EN_LBN 1
  8676. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_IDO_TX_EN_WIDTH 1
  8677. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_IDO_EV_EN_LBN 2
  8678. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_IDO_EV_EN_WIDTH 1
  8679. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_IDO_RX_EN_LBN 3
  8680. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_IDO_RX_EN_WIDTH 1
  8681. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_RO_RXDMA_EN_LBN 0
  8682. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_RO_RXDMA_EN_WIDTH 1
  8683. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_RO_TXDMA_EN_LBN 1
  8684. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_RO_TXDMA_EN_WIDTH 1
  8685. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_RO_DL_EN_LBN 2
  8686. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_RO_DL_EN_WIDTH 1
  8687. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_MSIX_LBN 0
  8688. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_MSIX_WIDTH 2
  8689. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_DL_LBN 2
  8690. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_DL_WIDTH 2
  8691. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_TX_LBN 4
  8692. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_TX_WIDTH 2
  8693. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_EV_LBN 6
  8694. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_EV_WIDTH 2
  8695. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_RX_LBN 8
  8696. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_RX_WIDTH 2
  8697. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_SPARE_LBN 10
  8698. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_SPARE_WIDTH 22
  8699. /* MC_CMD_SET_TLP_PROCESSING_GLOBALS_OUT msgresponse */
  8700. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_OUT_LEN 0
  8701. /***********************************/
  8702. /* MC_CMD_SATELLITE_DOWNLOAD
  8703. * Download a new set of images to the satellite CPUs from the host.
  8704. */
  8705. #define MC_CMD_SATELLITE_DOWNLOAD 0x91
  8706. #define MC_CMD_0x91_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  8707. /* MC_CMD_SATELLITE_DOWNLOAD_IN msgrequest: The reset requirements for the CPUs
  8708. * are subtle, and so downloads must proceed in a number of phases.
  8709. *
  8710. * 1) PHASE_RESET with a target of TARGET_ALL and chunk ID/length of 0.
  8711. *
  8712. * 2) PHASE_IMEMS for each of the IMEM targets (target IDs 0-11). Each download
  8713. * may consist of multiple chunks. The final chunk (with CHUNK_ID_LAST) should
  8714. * be a checksum (a simple 32-bit sum) of the transferred data. An individual
  8715. * download may be aborted using CHUNK_ID_ABORT.
  8716. *
  8717. * 3) PHASE_VECTORS for each of the vector table targets (target IDs 12-15),
  8718. * similar to PHASE_IMEMS.
  8719. *
  8720. * 4) PHASE_READY with a target of TARGET_ALL and chunk ID/length of 0.
  8721. *
  8722. * After any error (a requested abort is not considered to be an error) the
  8723. * sequence must be restarted from PHASE_RESET.
  8724. */
  8725. #define MC_CMD_SATELLITE_DOWNLOAD_IN_LENMIN 20
  8726. #define MC_CMD_SATELLITE_DOWNLOAD_IN_LENMAX 252
  8727. #define MC_CMD_SATELLITE_DOWNLOAD_IN_LEN(num) (16+4*(num))
  8728. /* Download phase. (Note: the IDLE phase is used internally and is never valid
  8729. * in a command from the host.)
  8730. */
  8731. #define MC_CMD_SATELLITE_DOWNLOAD_IN_PHASE_OFST 0
  8732. #define MC_CMD_SATELLITE_DOWNLOAD_IN_PHASE_LEN 4
  8733. #define MC_CMD_SATELLITE_DOWNLOAD_IN_PHASE_IDLE 0x0 /* enum */
  8734. #define MC_CMD_SATELLITE_DOWNLOAD_IN_PHASE_RESET 0x1 /* enum */
  8735. #define MC_CMD_SATELLITE_DOWNLOAD_IN_PHASE_IMEMS 0x2 /* enum */
  8736. #define MC_CMD_SATELLITE_DOWNLOAD_IN_PHASE_VECTORS 0x3 /* enum */
  8737. #define MC_CMD_SATELLITE_DOWNLOAD_IN_PHASE_READY 0x4 /* enum */
  8738. /* Target for download. (These match the blob numbers defined in
  8739. * mc_flash_layout.h.)
  8740. */
  8741. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_OFST 4
  8742. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_LEN 4
  8743. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  8744. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_TXDI_TEXT 0x0
  8745. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  8746. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_RXDI_TEXT 0x1
  8747. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  8748. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_TXDP_TEXT 0x2
  8749. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  8750. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_RXDP_TEXT 0x3
  8751. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  8752. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_RXHRSL_HR_LUT 0x4
  8753. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  8754. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_RXHRSL_HR_LUT_CFG 0x5
  8755. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  8756. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_TXHRSL_HR_LUT 0x6
  8757. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  8758. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_TXHRSL_HR_LUT_CFG 0x7
  8759. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  8760. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_RXHRSL_HR_PGM 0x8
  8761. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  8762. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_RXHRSL_SL_PGM 0x9
  8763. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  8764. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_TXHRSL_HR_PGM 0xa
  8765. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  8766. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_TXHRSL_SL_PGM 0xb
  8767. /* enum: Valid in phase 3 (PHASE_VECTORS) only */
  8768. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_RXDI_VTBL0 0xc
  8769. /* enum: Valid in phase 3 (PHASE_VECTORS) only */
  8770. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_TXDI_VTBL0 0xd
  8771. /* enum: Valid in phase 3 (PHASE_VECTORS) only */
  8772. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_RXDI_VTBL1 0xe
  8773. /* enum: Valid in phase 3 (PHASE_VECTORS) only */
  8774. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_TXDI_VTBL1 0xf
  8775. /* enum: Valid in phases 1 (PHASE_RESET) and 4 (PHASE_READY) only */
  8776. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_ALL 0xffffffff
  8777. /* Chunk ID, or CHUNK_ID_LAST or CHUNK_ID_ABORT */
  8778. #define MC_CMD_SATELLITE_DOWNLOAD_IN_CHUNK_ID_OFST 8
  8779. #define MC_CMD_SATELLITE_DOWNLOAD_IN_CHUNK_ID_LEN 4
  8780. /* enum: Last chunk, containing checksum rather than data */
  8781. #define MC_CMD_SATELLITE_DOWNLOAD_IN_CHUNK_ID_LAST 0xffffffff
  8782. /* enum: Abort download of this item */
  8783. #define MC_CMD_SATELLITE_DOWNLOAD_IN_CHUNK_ID_ABORT 0xfffffffe
  8784. /* Length of this chunk in bytes */
  8785. #define MC_CMD_SATELLITE_DOWNLOAD_IN_CHUNK_LEN_OFST 12
  8786. #define MC_CMD_SATELLITE_DOWNLOAD_IN_CHUNK_LEN_LEN 4
  8787. /* Data for this chunk */
  8788. #define MC_CMD_SATELLITE_DOWNLOAD_IN_CHUNK_DATA_OFST 16
  8789. #define MC_CMD_SATELLITE_DOWNLOAD_IN_CHUNK_DATA_LEN 4
  8790. #define MC_CMD_SATELLITE_DOWNLOAD_IN_CHUNK_DATA_MINNUM 1
  8791. #define MC_CMD_SATELLITE_DOWNLOAD_IN_CHUNK_DATA_MAXNUM 59
  8792. /* MC_CMD_SATELLITE_DOWNLOAD_OUT msgresponse */
  8793. #define MC_CMD_SATELLITE_DOWNLOAD_OUT_LEN 8
  8794. /* Same as MC_CMD_ERR field, but included as 0 in success cases */
  8795. #define MC_CMD_SATELLITE_DOWNLOAD_OUT_RESULT_OFST 0
  8796. #define MC_CMD_SATELLITE_DOWNLOAD_OUT_RESULT_LEN 4
  8797. /* Extra status information */
  8798. #define MC_CMD_SATELLITE_DOWNLOAD_OUT_INFO_OFST 4
  8799. #define MC_CMD_SATELLITE_DOWNLOAD_OUT_INFO_LEN 4
  8800. /* enum: Code download OK, completed. */
  8801. #define MC_CMD_SATELLITE_DOWNLOAD_OUT_OK_COMPLETE 0x0
  8802. /* enum: Code download aborted as requested. */
  8803. #define MC_CMD_SATELLITE_DOWNLOAD_OUT_OK_ABORTED 0x1
  8804. /* enum: Code download OK so far, send next chunk. */
  8805. #define MC_CMD_SATELLITE_DOWNLOAD_OUT_OK_NEXT_CHUNK 0x2
  8806. /* enum: Download phases out of sequence */
  8807. #define MC_CMD_SATELLITE_DOWNLOAD_OUT_ERR_BAD_PHASE 0x100
  8808. /* enum: Bad target for this phase */
  8809. #define MC_CMD_SATELLITE_DOWNLOAD_OUT_ERR_BAD_TARGET 0x101
  8810. /* enum: Chunk ID out of sequence */
  8811. #define MC_CMD_SATELLITE_DOWNLOAD_OUT_ERR_BAD_CHUNK_ID 0x200
  8812. /* enum: Chunk length zero or too large */
  8813. #define MC_CMD_SATELLITE_DOWNLOAD_OUT_ERR_BAD_CHUNK_LEN 0x201
  8814. /* enum: Checksum was incorrect */
  8815. #define MC_CMD_SATELLITE_DOWNLOAD_OUT_ERR_BAD_CHECKSUM 0x300
  8816. /***********************************/
  8817. /* MC_CMD_GET_CAPABILITIES
  8818. * Get device capabilities.
  8819. *
  8820. * This is supplementary to the MC_CMD_GET_BOARD_CFG command, and intended to
  8821. * reference inherent device capabilities as opposed to current NVRAM config.
  8822. */
  8823. #define MC_CMD_GET_CAPABILITIES 0xbe
  8824. #define MC_CMD_0xbe_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8825. /* MC_CMD_GET_CAPABILITIES_IN msgrequest */
  8826. #define MC_CMD_GET_CAPABILITIES_IN_LEN 0
  8827. /* MC_CMD_GET_CAPABILITIES_OUT msgresponse */
  8828. #define MC_CMD_GET_CAPABILITIES_OUT_LEN 20
  8829. /* First word of flags. */
  8830. #define MC_CMD_GET_CAPABILITIES_OUT_FLAGS1_OFST 0
  8831. #define MC_CMD_GET_CAPABILITIES_OUT_FLAGS1_LEN 4
  8832. #define MC_CMD_GET_CAPABILITIES_OUT_VPORT_RECONFIGURE_LBN 3
  8833. #define MC_CMD_GET_CAPABILITIES_OUT_VPORT_RECONFIGURE_WIDTH 1
  8834. #define MC_CMD_GET_CAPABILITIES_OUT_TX_STRIPING_LBN 4
  8835. #define MC_CMD_GET_CAPABILITIES_OUT_TX_STRIPING_WIDTH 1
  8836. #define MC_CMD_GET_CAPABILITIES_OUT_VADAPTOR_QUERY_LBN 5
  8837. #define MC_CMD_GET_CAPABILITIES_OUT_VADAPTOR_QUERY_WIDTH 1
  8838. #define MC_CMD_GET_CAPABILITIES_OUT_EVB_PORT_VLAN_RESTRICT_LBN 6
  8839. #define MC_CMD_GET_CAPABILITIES_OUT_EVB_PORT_VLAN_RESTRICT_WIDTH 1
  8840. #define MC_CMD_GET_CAPABILITIES_OUT_DRV_ATTACH_PREBOOT_LBN 7
  8841. #define MC_CMD_GET_CAPABILITIES_OUT_DRV_ATTACH_PREBOOT_WIDTH 1
  8842. #define MC_CMD_GET_CAPABILITIES_OUT_RX_FORCE_EVENT_MERGING_LBN 8
  8843. #define MC_CMD_GET_CAPABILITIES_OUT_RX_FORCE_EVENT_MERGING_WIDTH 1
  8844. #define MC_CMD_GET_CAPABILITIES_OUT_SET_MAC_ENHANCED_LBN 9
  8845. #define MC_CMD_GET_CAPABILITIES_OUT_SET_MAC_ENHANCED_WIDTH 1
  8846. #define MC_CMD_GET_CAPABILITIES_OUT_UNKNOWN_UCAST_DST_FILTER_ALWAYS_MULTI_RECIPIENT_LBN 10
  8847. #define MC_CMD_GET_CAPABILITIES_OUT_UNKNOWN_UCAST_DST_FILTER_ALWAYS_MULTI_RECIPIENT_WIDTH 1
  8848. #define MC_CMD_GET_CAPABILITIES_OUT_VADAPTOR_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED_LBN 11
  8849. #define MC_CMD_GET_CAPABILITIES_OUT_VADAPTOR_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED_WIDTH 1
  8850. #define MC_CMD_GET_CAPABILITIES_OUT_TX_MAC_SECURITY_FILTERING_LBN 12
  8851. #define MC_CMD_GET_CAPABILITIES_OUT_TX_MAC_SECURITY_FILTERING_WIDTH 1
  8852. #define MC_CMD_GET_CAPABILITIES_OUT_ADDITIONAL_RSS_MODES_LBN 13
  8853. #define MC_CMD_GET_CAPABILITIES_OUT_ADDITIONAL_RSS_MODES_WIDTH 1
  8854. #define MC_CMD_GET_CAPABILITIES_OUT_QBB_LBN 14
  8855. #define MC_CMD_GET_CAPABILITIES_OUT_QBB_WIDTH 1
  8856. #define MC_CMD_GET_CAPABILITIES_OUT_RX_PACKED_STREAM_VAR_BUFFERS_LBN 15
  8857. #define MC_CMD_GET_CAPABILITIES_OUT_RX_PACKED_STREAM_VAR_BUFFERS_WIDTH 1
  8858. #define MC_CMD_GET_CAPABILITIES_OUT_RX_RSS_LIMITED_LBN 16
  8859. #define MC_CMD_GET_CAPABILITIES_OUT_RX_RSS_LIMITED_WIDTH 1
  8860. #define MC_CMD_GET_CAPABILITIES_OUT_RX_PACKED_STREAM_LBN 17
  8861. #define MC_CMD_GET_CAPABILITIES_OUT_RX_PACKED_STREAM_WIDTH 1
  8862. #define MC_CMD_GET_CAPABILITIES_OUT_RX_INCLUDE_FCS_LBN 18
  8863. #define MC_CMD_GET_CAPABILITIES_OUT_RX_INCLUDE_FCS_WIDTH 1
  8864. #define MC_CMD_GET_CAPABILITIES_OUT_TX_VLAN_INSERTION_LBN 19
  8865. #define MC_CMD_GET_CAPABILITIES_OUT_TX_VLAN_INSERTION_WIDTH 1
  8866. #define MC_CMD_GET_CAPABILITIES_OUT_RX_VLAN_STRIPPING_LBN 20
  8867. #define MC_CMD_GET_CAPABILITIES_OUT_RX_VLAN_STRIPPING_WIDTH 1
  8868. #define MC_CMD_GET_CAPABILITIES_OUT_TX_TSO_LBN 21
  8869. #define MC_CMD_GET_CAPABILITIES_OUT_TX_TSO_WIDTH 1
  8870. #define MC_CMD_GET_CAPABILITIES_OUT_RX_PREFIX_LEN_0_LBN 22
  8871. #define MC_CMD_GET_CAPABILITIES_OUT_RX_PREFIX_LEN_0_WIDTH 1
  8872. #define MC_CMD_GET_CAPABILITIES_OUT_RX_PREFIX_LEN_14_LBN 23
  8873. #define MC_CMD_GET_CAPABILITIES_OUT_RX_PREFIX_LEN_14_WIDTH 1
  8874. #define MC_CMD_GET_CAPABILITIES_OUT_RX_TIMESTAMP_LBN 24
  8875. #define MC_CMD_GET_CAPABILITIES_OUT_RX_TIMESTAMP_WIDTH 1
  8876. #define MC_CMD_GET_CAPABILITIES_OUT_RX_BATCHING_LBN 25
  8877. #define MC_CMD_GET_CAPABILITIES_OUT_RX_BATCHING_WIDTH 1
  8878. #define MC_CMD_GET_CAPABILITIES_OUT_MCAST_FILTER_CHAINING_LBN 26
  8879. #define MC_CMD_GET_CAPABILITIES_OUT_MCAST_FILTER_CHAINING_WIDTH 1
  8880. #define MC_CMD_GET_CAPABILITIES_OUT_PM_AND_RXDP_COUNTERS_LBN 27
  8881. #define MC_CMD_GET_CAPABILITIES_OUT_PM_AND_RXDP_COUNTERS_WIDTH 1
  8882. #define MC_CMD_GET_CAPABILITIES_OUT_RX_DISABLE_SCATTER_LBN 28
  8883. #define MC_CMD_GET_CAPABILITIES_OUT_RX_DISABLE_SCATTER_WIDTH 1
  8884. #define MC_CMD_GET_CAPABILITIES_OUT_TX_MCAST_UDP_LOOPBACK_LBN 29
  8885. #define MC_CMD_GET_CAPABILITIES_OUT_TX_MCAST_UDP_LOOPBACK_WIDTH 1
  8886. #define MC_CMD_GET_CAPABILITIES_OUT_EVB_LBN 30
  8887. #define MC_CMD_GET_CAPABILITIES_OUT_EVB_WIDTH 1
  8888. #define MC_CMD_GET_CAPABILITIES_OUT_VXLAN_NVGRE_LBN 31
  8889. #define MC_CMD_GET_CAPABILITIES_OUT_VXLAN_NVGRE_WIDTH 1
  8890. /* RxDPCPU firmware id. */
  8891. #define MC_CMD_GET_CAPABILITIES_OUT_RX_DPCPU_FW_ID_OFST 4
  8892. #define MC_CMD_GET_CAPABILITIES_OUT_RX_DPCPU_FW_ID_LEN 2
  8893. /* enum: Standard RXDP firmware */
  8894. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP 0x0
  8895. /* enum: Low latency RXDP firmware */
  8896. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_LOW_LATENCY 0x1
  8897. /* enum: Packed stream RXDP firmware */
  8898. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_PACKED_STREAM 0x2
  8899. /* enum: Rules engine RXDP firmware */
  8900. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_RULES_ENGINE 0x5
  8901. /* enum: DPDK RXDP firmware */
  8902. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_DPDK 0x6
  8903. /* enum: BIST RXDP firmware */
  8904. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_BIST 0x10a
  8905. /* enum: RXDP Test firmware image 1 */
  8906. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_FW_TO_MC_CUT_THROUGH 0x101
  8907. /* enum: RXDP Test firmware image 2 */
  8908. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_FW_TO_MC_STORE_FORWARD 0x102
  8909. /* enum: RXDP Test firmware image 3 */
  8910. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_FW_TO_MC_STORE_FORWARD_FIRST 0x103
  8911. /* enum: RXDP Test firmware image 4 */
  8912. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_EVERY_EVENT_BATCHABLE 0x104
  8913. /* enum: RXDP Test firmware image 5 */
  8914. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_BACKPRESSURE 0x105
  8915. /* enum: RXDP Test firmware image 6 */
  8916. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_FW_PACKET_EDITS 0x106
  8917. /* enum: RXDP Test firmware image 7 */
  8918. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_FW_RX_HDR_SPLIT 0x107
  8919. /* enum: RXDP Test firmware image 8 */
  8920. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_FW_DISABLE_DL 0x108
  8921. /* enum: RXDP Test firmware image 9 */
  8922. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_FW_DOORBELL_DELAY 0x10b
  8923. /* enum: RXDP Test firmware image 10 */
  8924. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_FW_SLOW 0x10c
  8925. /* TxDPCPU firmware id. */
  8926. #define MC_CMD_GET_CAPABILITIES_OUT_TX_DPCPU_FW_ID_OFST 6
  8927. #define MC_CMD_GET_CAPABILITIES_OUT_TX_DPCPU_FW_ID_LEN 2
  8928. /* enum: Standard TXDP firmware */
  8929. #define MC_CMD_GET_CAPABILITIES_OUT_TXDP 0x0
  8930. /* enum: Low latency TXDP firmware */
  8931. #define MC_CMD_GET_CAPABILITIES_OUT_TXDP_LOW_LATENCY 0x1
  8932. /* enum: High packet rate TXDP firmware */
  8933. #define MC_CMD_GET_CAPABILITIES_OUT_TXDP_HIGH_PACKET_RATE 0x3
  8934. /* enum: Rules engine TXDP firmware */
  8935. #define MC_CMD_GET_CAPABILITIES_OUT_TXDP_RULES_ENGINE 0x5
  8936. /* enum: DPDK TXDP firmware */
  8937. #define MC_CMD_GET_CAPABILITIES_OUT_TXDP_DPDK 0x6
  8938. /* enum: BIST TXDP firmware */
  8939. #define MC_CMD_GET_CAPABILITIES_OUT_TXDP_BIST 0x12d
  8940. /* enum: TXDP Test firmware image 1 */
  8941. #define MC_CMD_GET_CAPABILITIES_OUT_TXDP_TEST_FW_TSO_EDIT 0x101
  8942. /* enum: TXDP Test firmware image 2 */
  8943. #define MC_CMD_GET_CAPABILITIES_OUT_TXDP_TEST_FW_PACKET_EDITS 0x102
  8944. /* enum: TXDP CSR bus test firmware */
  8945. #define MC_CMD_GET_CAPABILITIES_OUT_TXDP_TEST_FW_CSR 0x103
  8946. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_VERSION_OFST 8
  8947. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_VERSION_LEN 2
  8948. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_VERSION_REV_LBN 0
  8949. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_VERSION_REV_WIDTH 12
  8950. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_VERSION_TYPE_LBN 12
  8951. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_VERSION_TYPE_WIDTH 4
  8952. /* enum: reserved value - do not use (may indicate alternative interpretation
  8953. * of REV field in future)
  8954. */
  8955. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_RESERVED 0x0
  8956. /* enum: Trivial RX PD firmware for early Huntington development (Huntington
  8957. * development only)
  8958. */
  8959. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_FIRST_PKT 0x1
  8960. /* enum: RX PD firmware with approximately Siena-compatible behaviour
  8961. * (Huntington development only)
  8962. */
  8963. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_SIENA_COMPAT 0x2
  8964. /* enum: Full featured RX PD production firmware */
  8965. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_FULL_FEATURED 0x3
  8966. /* enum: (deprecated original name for the FULL_FEATURED variant) */
  8967. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_VSWITCH 0x3
  8968. /* enum: siena_compat variant RX PD firmware using PM rather than MAC
  8969. * (Huntington development only)
  8970. */
  8971. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_SIENA_COMPAT_PM 0x4
  8972. /* enum: Low latency RX PD production firmware */
  8973. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_LOW_LATENCY 0x5
  8974. /* enum: Packed stream RX PD production firmware */
  8975. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_PACKED_STREAM 0x6
  8976. /* enum: RX PD firmware handling layer 2 only for high packet rate performance
  8977. * tests (Medford development only)
  8978. */
  8979. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_LAYER2_PERF 0x7
  8980. /* enum: Rules engine RX PD production firmware */
  8981. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_RULES_ENGINE 0x8
  8982. /* enum: Custom firmware variant (see SF-119495-PD and bug69716) */
  8983. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_L3XUDP 0x9
  8984. /* enum: DPDK RX PD production firmware */
  8985. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_DPDK 0xa
  8986. /* enum: RX PD firmware for GUE parsing prototype (Medford development only) */
  8987. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_TESTFW_GUE_PROTOTYPE 0xe
  8988. /* enum: RX PD firmware parsing but not filtering network overlay tunnel
  8989. * encapsulations (Medford development only)
  8990. */
  8991. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_TESTFW_ENCAP_PARSING_ONLY 0xf
  8992. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_VERSION_OFST 10
  8993. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_VERSION_LEN 2
  8994. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_VERSION_REV_LBN 0
  8995. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_VERSION_REV_WIDTH 12
  8996. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_VERSION_TYPE_LBN 12
  8997. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_VERSION_TYPE_WIDTH 4
  8998. /* enum: reserved value - do not use (may indicate alternative interpretation
  8999. * of REV field in future)
  9000. */
  9001. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_RESERVED 0x0
  9002. /* enum: Trivial TX PD firmware for early Huntington development (Huntington
  9003. * development only)
  9004. */
  9005. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_FIRST_PKT 0x1
  9006. /* enum: TX PD firmware with approximately Siena-compatible behaviour
  9007. * (Huntington development only)
  9008. */
  9009. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_SIENA_COMPAT 0x2
  9010. /* enum: Full featured TX PD production firmware */
  9011. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_FULL_FEATURED 0x3
  9012. /* enum: (deprecated original name for the FULL_FEATURED variant) */
  9013. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_VSWITCH 0x3
  9014. /* enum: siena_compat variant TX PD firmware using PM rather than MAC
  9015. * (Huntington development only)
  9016. */
  9017. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_SIENA_COMPAT_PM 0x4
  9018. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_LOW_LATENCY 0x5 /* enum */
  9019. /* enum: TX PD firmware handling layer 2 only for high packet rate performance
  9020. * tests (Medford development only)
  9021. */
  9022. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_LAYER2_PERF 0x7
  9023. /* enum: Rules engine TX PD production firmware */
  9024. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_RULES_ENGINE 0x8
  9025. /* enum: Custom firmware variant (see SF-119495-PD and bug69716) */
  9026. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_L3XUDP 0x9
  9027. /* enum: DPDK TX PD production firmware */
  9028. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_DPDK 0xa
  9029. /* enum: RX PD firmware for GUE parsing prototype (Medford development only) */
  9030. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_TESTFW_GUE_PROTOTYPE 0xe
  9031. /* Hardware capabilities of NIC */
  9032. #define MC_CMD_GET_CAPABILITIES_OUT_HW_CAPABILITIES_OFST 12
  9033. #define MC_CMD_GET_CAPABILITIES_OUT_HW_CAPABILITIES_LEN 4
  9034. /* Licensed capabilities */
  9035. #define MC_CMD_GET_CAPABILITIES_OUT_LICENSE_CAPABILITIES_OFST 16
  9036. #define MC_CMD_GET_CAPABILITIES_OUT_LICENSE_CAPABILITIES_LEN 4
  9037. /* MC_CMD_GET_CAPABILITIES_V2_IN msgrequest */
  9038. #define MC_CMD_GET_CAPABILITIES_V2_IN_LEN 0
  9039. /* MC_CMD_GET_CAPABILITIES_V2_OUT msgresponse */
  9040. #define MC_CMD_GET_CAPABILITIES_V2_OUT_LEN 72
  9041. /* First word of flags. */
  9042. #define MC_CMD_GET_CAPABILITIES_V2_OUT_FLAGS1_OFST 0
  9043. #define MC_CMD_GET_CAPABILITIES_V2_OUT_FLAGS1_LEN 4
  9044. #define MC_CMD_GET_CAPABILITIES_V2_OUT_VPORT_RECONFIGURE_LBN 3
  9045. #define MC_CMD_GET_CAPABILITIES_V2_OUT_VPORT_RECONFIGURE_WIDTH 1
  9046. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_STRIPING_LBN 4
  9047. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_STRIPING_WIDTH 1
  9048. #define MC_CMD_GET_CAPABILITIES_V2_OUT_VADAPTOR_QUERY_LBN 5
  9049. #define MC_CMD_GET_CAPABILITIES_V2_OUT_VADAPTOR_QUERY_WIDTH 1
  9050. #define MC_CMD_GET_CAPABILITIES_V2_OUT_EVB_PORT_VLAN_RESTRICT_LBN 6
  9051. #define MC_CMD_GET_CAPABILITIES_V2_OUT_EVB_PORT_VLAN_RESTRICT_WIDTH 1
  9052. #define MC_CMD_GET_CAPABILITIES_V2_OUT_DRV_ATTACH_PREBOOT_LBN 7
  9053. #define MC_CMD_GET_CAPABILITIES_V2_OUT_DRV_ATTACH_PREBOOT_WIDTH 1
  9054. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_FORCE_EVENT_MERGING_LBN 8
  9055. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_FORCE_EVENT_MERGING_WIDTH 1
  9056. #define MC_CMD_GET_CAPABILITIES_V2_OUT_SET_MAC_ENHANCED_LBN 9
  9057. #define MC_CMD_GET_CAPABILITIES_V2_OUT_SET_MAC_ENHANCED_WIDTH 1
  9058. #define MC_CMD_GET_CAPABILITIES_V2_OUT_UNKNOWN_UCAST_DST_FILTER_ALWAYS_MULTI_RECIPIENT_LBN 10
  9059. #define MC_CMD_GET_CAPABILITIES_V2_OUT_UNKNOWN_UCAST_DST_FILTER_ALWAYS_MULTI_RECIPIENT_WIDTH 1
  9060. #define MC_CMD_GET_CAPABILITIES_V2_OUT_VADAPTOR_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED_LBN 11
  9061. #define MC_CMD_GET_CAPABILITIES_V2_OUT_VADAPTOR_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED_WIDTH 1
  9062. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_MAC_SECURITY_FILTERING_LBN 12
  9063. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_MAC_SECURITY_FILTERING_WIDTH 1
  9064. #define MC_CMD_GET_CAPABILITIES_V2_OUT_ADDITIONAL_RSS_MODES_LBN 13
  9065. #define MC_CMD_GET_CAPABILITIES_V2_OUT_ADDITIONAL_RSS_MODES_WIDTH 1
  9066. #define MC_CMD_GET_CAPABILITIES_V2_OUT_QBB_LBN 14
  9067. #define MC_CMD_GET_CAPABILITIES_V2_OUT_QBB_WIDTH 1
  9068. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_PACKED_STREAM_VAR_BUFFERS_LBN 15
  9069. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_PACKED_STREAM_VAR_BUFFERS_WIDTH 1
  9070. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_RSS_LIMITED_LBN 16
  9071. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_RSS_LIMITED_WIDTH 1
  9072. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_PACKED_STREAM_LBN 17
  9073. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_PACKED_STREAM_WIDTH 1
  9074. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_INCLUDE_FCS_LBN 18
  9075. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_INCLUDE_FCS_WIDTH 1
  9076. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_VLAN_INSERTION_LBN 19
  9077. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_VLAN_INSERTION_WIDTH 1
  9078. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_VLAN_STRIPPING_LBN 20
  9079. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_VLAN_STRIPPING_WIDTH 1
  9080. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_TSO_LBN 21
  9081. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_TSO_WIDTH 1
  9082. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_PREFIX_LEN_0_LBN 22
  9083. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_PREFIX_LEN_0_WIDTH 1
  9084. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_PREFIX_LEN_14_LBN 23
  9085. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_PREFIX_LEN_14_WIDTH 1
  9086. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_TIMESTAMP_LBN 24
  9087. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_TIMESTAMP_WIDTH 1
  9088. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_BATCHING_LBN 25
  9089. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_BATCHING_WIDTH 1
  9090. #define MC_CMD_GET_CAPABILITIES_V2_OUT_MCAST_FILTER_CHAINING_LBN 26
  9091. #define MC_CMD_GET_CAPABILITIES_V2_OUT_MCAST_FILTER_CHAINING_WIDTH 1
  9092. #define MC_CMD_GET_CAPABILITIES_V2_OUT_PM_AND_RXDP_COUNTERS_LBN 27
  9093. #define MC_CMD_GET_CAPABILITIES_V2_OUT_PM_AND_RXDP_COUNTERS_WIDTH 1
  9094. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_DISABLE_SCATTER_LBN 28
  9095. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_DISABLE_SCATTER_WIDTH 1
  9096. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_MCAST_UDP_LOOPBACK_LBN 29
  9097. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_MCAST_UDP_LOOPBACK_WIDTH 1
  9098. #define MC_CMD_GET_CAPABILITIES_V2_OUT_EVB_LBN 30
  9099. #define MC_CMD_GET_CAPABILITIES_V2_OUT_EVB_WIDTH 1
  9100. #define MC_CMD_GET_CAPABILITIES_V2_OUT_VXLAN_NVGRE_LBN 31
  9101. #define MC_CMD_GET_CAPABILITIES_V2_OUT_VXLAN_NVGRE_WIDTH 1
  9102. /* RxDPCPU firmware id. */
  9103. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_DPCPU_FW_ID_OFST 4
  9104. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_DPCPU_FW_ID_LEN 2
  9105. /* enum: Standard RXDP firmware */
  9106. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP 0x0
  9107. /* enum: Low latency RXDP firmware */
  9108. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_LOW_LATENCY 0x1
  9109. /* enum: Packed stream RXDP firmware */
  9110. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_PACKED_STREAM 0x2
  9111. /* enum: Rules engine RXDP firmware */
  9112. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_RULES_ENGINE 0x5
  9113. /* enum: DPDK RXDP firmware */
  9114. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_DPDK 0x6
  9115. /* enum: BIST RXDP firmware */
  9116. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_BIST 0x10a
  9117. /* enum: RXDP Test firmware image 1 */
  9118. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_TEST_FW_TO_MC_CUT_THROUGH 0x101
  9119. /* enum: RXDP Test firmware image 2 */
  9120. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_TEST_FW_TO_MC_STORE_FORWARD 0x102
  9121. /* enum: RXDP Test firmware image 3 */
  9122. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_TEST_FW_TO_MC_STORE_FORWARD_FIRST 0x103
  9123. /* enum: RXDP Test firmware image 4 */
  9124. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_TEST_EVERY_EVENT_BATCHABLE 0x104
  9125. /* enum: RXDP Test firmware image 5 */
  9126. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_TEST_BACKPRESSURE 0x105
  9127. /* enum: RXDP Test firmware image 6 */
  9128. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_TEST_FW_PACKET_EDITS 0x106
  9129. /* enum: RXDP Test firmware image 7 */
  9130. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_TEST_FW_RX_HDR_SPLIT 0x107
  9131. /* enum: RXDP Test firmware image 8 */
  9132. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_TEST_FW_DISABLE_DL 0x108
  9133. /* enum: RXDP Test firmware image 9 */
  9134. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_TEST_FW_DOORBELL_DELAY 0x10b
  9135. /* enum: RXDP Test firmware image 10 */
  9136. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_TEST_FW_SLOW 0x10c
  9137. /* TxDPCPU firmware id. */
  9138. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_DPCPU_FW_ID_OFST 6
  9139. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_DPCPU_FW_ID_LEN 2
  9140. /* enum: Standard TXDP firmware */
  9141. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXDP 0x0
  9142. /* enum: Low latency TXDP firmware */
  9143. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXDP_LOW_LATENCY 0x1
  9144. /* enum: High packet rate TXDP firmware */
  9145. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXDP_HIGH_PACKET_RATE 0x3
  9146. /* enum: Rules engine TXDP firmware */
  9147. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXDP_RULES_ENGINE 0x5
  9148. /* enum: DPDK TXDP firmware */
  9149. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXDP_DPDK 0x6
  9150. /* enum: BIST TXDP firmware */
  9151. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXDP_BIST 0x12d
  9152. /* enum: TXDP Test firmware image 1 */
  9153. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXDP_TEST_FW_TSO_EDIT 0x101
  9154. /* enum: TXDP Test firmware image 2 */
  9155. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXDP_TEST_FW_PACKET_EDITS 0x102
  9156. /* enum: TXDP CSR bus test firmware */
  9157. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXDP_TEST_FW_CSR 0x103
  9158. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_VERSION_OFST 8
  9159. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_VERSION_LEN 2
  9160. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_VERSION_REV_LBN 0
  9161. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_VERSION_REV_WIDTH 12
  9162. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_VERSION_TYPE_LBN 12
  9163. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_VERSION_TYPE_WIDTH 4
  9164. /* enum: reserved value - do not use (may indicate alternative interpretation
  9165. * of REV field in future)
  9166. */
  9167. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_RESERVED 0x0
  9168. /* enum: Trivial RX PD firmware for early Huntington development (Huntington
  9169. * development only)
  9170. */
  9171. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_FIRST_PKT 0x1
  9172. /* enum: RX PD firmware with approximately Siena-compatible behaviour
  9173. * (Huntington development only)
  9174. */
  9175. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_SIENA_COMPAT 0x2
  9176. /* enum: Full featured RX PD production firmware */
  9177. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_FULL_FEATURED 0x3
  9178. /* enum: (deprecated original name for the FULL_FEATURED variant) */
  9179. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_VSWITCH 0x3
  9180. /* enum: siena_compat variant RX PD firmware using PM rather than MAC
  9181. * (Huntington development only)
  9182. */
  9183. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_SIENA_COMPAT_PM 0x4
  9184. /* enum: Low latency RX PD production firmware */
  9185. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_LOW_LATENCY 0x5
  9186. /* enum: Packed stream RX PD production firmware */
  9187. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_PACKED_STREAM 0x6
  9188. /* enum: RX PD firmware handling layer 2 only for high packet rate performance
  9189. * tests (Medford development only)
  9190. */
  9191. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_LAYER2_PERF 0x7
  9192. /* enum: Rules engine RX PD production firmware */
  9193. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_RULES_ENGINE 0x8
  9194. /* enum: Custom firmware variant (see SF-119495-PD and bug69716) */
  9195. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_L3XUDP 0x9
  9196. /* enum: DPDK RX PD production firmware */
  9197. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_DPDK 0xa
  9198. /* enum: RX PD firmware for GUE parsing prototype (Medford development only) */
  9199. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_TESTFW_GUE_PROTOTYPE 0xe
  9200. /* enum: RX PD firmware parsing but not filtering network overlay tunnel
  9201. * encapsulations (Medford development only)
  9202. */
  9203. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_TESTFW_ENCAP_PARSING_ONLY 0xf
  9204. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_VERSION_OFST 10
  9205. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_VERSION_LEN 2
  9206. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_VERSION_REV_LBN 0
  9207. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_VERSION_REV_WIDTH 12
  9208. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_VERSION_TYPE_LBN 12
  9209. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_VERSION_TYPE_WIDTH 4
  9210. /* enum: reserved value - do not use (may indicate alternative interpretation
  9211. * of REV field in future)
  9212. */
  9213. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_RESERVED 0x0
  9214. /* enum: Trivial TX PD firmware for early Huntington development (Huntington
  9215. * development only)
  9216. */
  9217. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_FIRST_PKT 0x1
  9218. /* enum: TX PD firmware with approximately Siena-compatible behaviour
  9219. * (Huntington development only)
  9220. */
  9221. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_SIENA_COMPAT 0x2
  9222. /* enum: Full featured TX PD production firmware */
  9223. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_FULL_FEATURED 0x3
  9224. /* enum: (deprecated original name for the FULL_FEATURED variant) */
  9225. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_VSWITCH 0x3
  9226. /* enum: siena_compat variant TX PD firmware using PM rather than MAC
  9227. * (Huntington development only)
  9228. */
  9229. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_SIENA_COMPAT_PM 0x4
  9230. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_LOW_LATENCY 0x5 /* enum */
  9231. /* enum: TX PD firmware handling layer 2 only for high packet rate performance
  9232. * tests (Medford development only)
  9233. */
  9234. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_LAYER2_PERF 0x7
  9235. /* enum: Rules engine TX PD production firmware */
  9236. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_RULES_ENGINE 0x8
  9237. /* enum: Custom firmware variant (see SF-119495-PD and bug69716) */
  9238. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_L3XUDP 0x9
  9239. /* enum: DPDK TX PD production firmware */
  9240. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_DPDK 0xa
  9241. /* enum: RX PD firmware for GUE parsing prototype (Medford development only) */
  9242. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_TESTFW_GUE_PROTOTYPE 0xe
  9243. /* Hardware capabilities of NIC */
  9244. #define MC_CMD_GET_CAPABILITIES_V2_OUT_HW_CAPABILITIES_OFST 12
  9245. #define MC_CMD_GET_CAPABILITIES_V2_OUT_HW_CAPABILITIES_LEN 4
  9246. /* Licensed capabilities */
  9247. #define MC_CMD_GET_CAPABILITIES_V2_OUT_LICENSE_CAPABILITIES_OFST 16
  9248. #define MC_CMD_GET_CAPABILITIES_V2_OUT_LICENSE_CAPABILITIES_LEN 4
  9249. /* Second word of flags. Not present on older firmware (check the length). */
  9250. #define MC_CMD_GET_CAPABILITIES_V2_OUT_FLAGS2_OFST 20
  9251. #define MC_CMD_GET_CAPABILITIES_V2_OUT_FLAGS2_LEN 4
  9252. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_TSO_V2_LBN 0
  9253. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_TSO_V2_WIDTH 1
  9254. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_TSO_V2_ENCAP_LBN 1
  9255. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_TSO_V2_ENCAP_WIDTH 1
  9256. #define MC_CMD_GET_CAPABILITIES_V2_OUT_EVQ_TIMER_CTRL_LBN 2
  9257. #define MC_CMD_GET_CAPABILITIES_V2_OUT_EVQ_TIMER_CTRL_WIDTH 1
  9258. #define MC_CMD_GET_CAPABILITIES_V2_OUT_EVENT_CUT_THROUGH_LBN 3
  9259. #define MC_CMD_GET_CAPABILITIES_V2_OUT_EVENT_CUT_THROUGH_WIDTH 1
  9260. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_CUT_THROUGH_LBN 4
  9261. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_CUT_THROUGH_WIDTH 1
  9262. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_VFIFO_ULL_MODE_LBN 5
  9263. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_VFIFO_ULL_MODE_WIDTH 1
  9264. #define MC_CMD_GET_CAPABILITIES_V2_OUT_MAC_STATS_40G_TX_SIZE_BINS_LBN 6
  9265. #define MC_CMD_GET_CAPABILITIES_V2_OUT_MAC_STATS_40G_TX_SIZE_BINS_WIDTH 1
  9266. #define MC_CMD_GET_CAPABILITIES_V2_OUT_INIT_EVQ_V2_LBN 7
  9267. #define MC_CMD_GET_CAPABILITIES_V2_OUT_INIT_EVQ_V2_WIDTH 1
  9268. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_MAC_TIMESTAMPING_LBN 8
  9269. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_MAC_TIMESTAMPING_WIDTH 1
  9270. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_TIMESTAMP_LBN 9
  9271. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_TIMESTAMP_WIDTH 1
  9272. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_SNIFF_LBN 10
  9273. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_SNIFF_WIDTH 1
  9274. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_SNIFF_LBN 11
  9275. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_SNIFF_WIDTH 1
  9276. #define MC_CMD_GET_CAPABILITIES_V2_OUT_NVRAM_UPDATE_REPORT_VERIFY_RESULT_LBN 12
  9277. #define MC_CMD_GET_CAPABILITIES_V2_OUT_NVRAM_UPDATE_REPORT_VERIFY_RESULT_WIDTH 1
  9278. #define MC_CMD_GET_CAPABILITIES_V2_OUT_MCDI_BACKGROUND_LBN 13
  9279. #define MC_CMD_GET_CAPABILITIES_V2_OUT_MCDI_BACKGROUND_WIDTH 1
  9280. #define MC_CMD_GET_CAPABILITIES_V2_OUT_MCDI_DB_RETURN_LBN 14
  9281. #define MC_CMD_GET_CAPABILITIES_V2_OUT_MCDI_DB_RETURN_WIDTH 1
  9282. #define MC_CMD_GET_CAPABILITIES_V2_OUT_CTPIO_LBN 15
  9283. #define MC_CMD_GET_CAPABILITIES_V2_OUT_CTPIO_WIDTH 1
  9284. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TSA_SUPPORT_LBN 16
  9285. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TSA_SUPPORT_WIDTH 1
  9286. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TSA_BOUND_LBN 17
  9287. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TSA_BOUND_WIDTH 1
  9288. #define MC_CMD_GET_CAPABILITIES_V2_OUT_SF_ADAPTER_AUTHENTICATION_LBN 18
  9289. #define MC_CMD_GET_CAPABILITIES_V2_OUT_SF_ADAPTER_AUTHENTICATION_WIDTH 1
  9290. #define MC_CMD_GET_CAPABILITIES_V2_OUT_FILTER_ACTION_FLAG_LBN 19
  9291. #define MC_CMD_GET_CAPABILITIES_V2_OUT_FILTER_ACTION_FLAG_WIDTH 1
  9292. #define MC_CMD_GET_CAPABILITIES_V2_OUT_FILTER_ACTION_MARK_LBN 20
  9293. #define MC_CMD_GET_CAPABILITIES_V2_OUT_FILTER_ACTION_MARK_WIDTH 1
  9294. #define MC_CMD_GET_CAPABILITIES_V2_OUT_EQUAL_STRIDE_PACKED_STREAM_LBN 21
  9295. #define MC_CMD_GET_CAPABILITIES_V2_OUT_EQUAL_STRIDE_PACKED_STREAM_WIDTH 1
  9296. #define MC_CMD_GET_CAPABILITIES_V2_OUT_L3XUDP_SUPPORT_LBN 22
  9297. #define MC_CMD_GET_CAPABILITIES_V2_OUT_L3XUDP_SUPPORT_WIDTH 1
  9298. #define MC_CMD_GET_CAPABILITIES_V2_OUT_FW_SUBVARIANT_NO_TX_CSUM_LBN 23
  9299. #define MC_CMD_GET_CAPABILITIES_V2_OUT_FW_SUBVARIANT_NO_TX_CSUM_WIDTH 1
  9300. #define MC_CMD_GET_CAPABILITIES_V2_OUT_VI_SPREADING_LBN 24
  9301. #define MC_CMD_GET_CAPABILITIES_V2_OUT_VI_SPREADING_WIDTH 1
  9302. /* Number of FATSOv2 contexts per datapath supported by this NIC. Not present
  9303. * on older firmware (check the length).
  9304. */
  9305. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_TSO_V2_N_CONTEXTS_OFST 24
  9306. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_TSO_V2_N_CONTEXTS_LEN 2
  9307. /* One byte per PF containing the number of the external port assigned to this
  9308. * PF, indexed by PF number. Special values indicate that a PF is either not
  9309. * present or not assigned.
  9310. */
  9311. #define MC_CMD_GET_CAPABILITIES_V2_OUT_PFS_TO_PORTS_ASSIGNMENT_OFST 26
  9312. #define MC_CMD_GET_CAPABILITIES_V2_OUT_PFS_TO_PORTS_ASSIGNMENT_LEN 1
  9313. #define MC_CMD_GET_CAPABILITIES_V2_OUT_PFS_TO_PORTS_ASSIGNMENT_NUM 16
  9314. /* enum: The caller is not permitted to access information on this PF. */
  9315. #define MC_CMD_GET_CAPABILITIES_V2_OUT_ACCESS_NOT_PERMITTED 0xff
  9316. /* enum: PF does not exist. */
  9317. #define MC_CMD_GET_CAPABILITIES_V2_OUT_PF_NOT_PRESENT 0xfe
  9318. /* enum: PF does exist but is not assigned to any external port. */
  9319. #define MC_CMD_GET_CAPABILITIES_V2_OUT_PF_NOT_ASSIGNED 0xfd
  9320. /* enum: This value indicates that PF is assigned, but it cannot be expressed
  9321. * in this field. It is intended for a possible future situation where a more
  9322. * complex scheme of PFs to ports mapping is being used. The future driver
  9323. * should look for a new field supporting the new scheme. The current/old
  9324. * driver should treat this value as PF_NOT_ASSIGNED.
  9325. */
  9326. #define MC_CMD_GET_CAPABILITIES_V2_OUT_INCOMPATIBLE_ASSIGNMENT 0xfc
  9327. /* One byte per PF containing the number of its VFs, indexed by PF number. A
  9328. * special value indicates that a PF is not present.
  9329. */
  9330. #define MC_CMD_GET_CAPABILITIES_V2_OUT_NUM_VFS_PER_PF_OFST 42
  9331. #define MC_CMD_GET_CAPABILITIES_V2_OUT_NUM_VFS_PER_PF_LEN 1
  9332. #define MC_CMD_GET_CAPABILITIES_V2_OUT_NUM_VFS_PER_PF_NUM 16
  9333. /* enum: The caller is not permitted to access information on this PF. */
  9334. /* MC_CMD_GET_CAPABILITIES_V2_OUT_ACCESS_NOT_PERMITTED 0xff */
  9335. /* enum: PF does not exist. */
  9336. /* MC_CMD_GET_CAPABILITIES_V2_OUT_PF_NOT_PRESENT 0xfe */
  9337. /* Number of VIs available for each external port */
  9338. #define MC_CMD_GET_CAPABILITIES_V2_OUT_NUM_VIS_PER_PORT_OFST 58
  9339. #define MC_CMD_GET_CAPABILITIES_V2_OUT_NUM_VIS_PER_PORT_LEN 2
  9340. #define MC_CMD_GET_CAPABILITIES_V2_OUT_NUM_VIS_PER_PORT_NUM 4
  9341. /* Size of RX descriptor cache expressed as binary logarithm The actual size
  9342. * equals (2 ^ RX_DESC_CACHE_SIZE)
  9343. */
  9344. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_DESC_CACHE_SIZE_OFST 66
  9345. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_DESC_CACHE_SIZE_LEN 1
  9346. /* Size of TX descriptor cache expressed as binary logarithm The actual size
  9347. * equals (2 ^ TX_DESC_CACHE_SIZE)
  9348. */
  9349. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_DESC_CACHE_SIZE_OFST 67
  9350. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_DESC_CACHE_SIZE_LEN 1
  9351. /* Total number of available PIO buffers */
  9352. #define MC_CMD_GET_CAPABILITIES_V2_OUT_NUM_PIO_BUFFS_OFST 68
  9353. #define MC_CMD_GET_CAPABILITIES_V2_OUT_NUM_PIO_BUFFS_LEN 2
  9354. /* Size of a single PIO buffer */
  9355. #define MC_CMD_GET_CAPABILITIES_V2_OUT_SIZE_PIO_BUFF_OFST 70
  9356. #define MC_CMD_GET_CAPABILITIES_V2_OUT_SIZE_PIO_BUFF_LEN 2
  9357. /* MC_CMD_GET_CAPABILITIES_V3_OUT msgresponse */
  9358. #define MC_CMD_GET_CAPABILITIES_V3_OUT_LEN 76
  9359. /* First word of flags. */
  9360. #define MC_CMD_GET_CAPABILITIES_V3_OUT_FLAGS1_OFST 0
  9361. #define MC_CMD_GET_CAPABILITIES_V3_OUT_FLAGS1_LEN 4
  9362. #define MC_CMD_GET_CAPABILITIES_V3_OUT_VPORT_RECONFIGURE_LBN 3
  9363. #define MC_CMD_GET_CAPABILITIES_V3_OUT_VPORT_RECONFIGURE_WIDTH 1
  9364. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_STRIPING_LBN 4
  9365. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_STRIPING_WIDTH 1
  9366. #define MC_CMD_GET_CAPABILITIES_V3_OUT_VADAPTOR_QUERY_LBN 5
  9367. #define MC_CMD_GET_CAPABILITIES_V3_OUT_VADAPTOR_QUERY_WIDTH 1
  9368. #define MC_CMD_GET_CAPABILITIES_V3_OUT_EVB_PORT_VLAN_RESTRICT_LBN 6
  9369. #define MC_CMD_GET_CAPABILITIES_V3_OUT_EVB_PORT_VLAN_RESTRICT_WIDTH 1
  9370. #define MC_CMD_GET_CAPABILITIES_V3_OUT_DRV_ATTACH_PREBOOT_LBN 7
  9371. #define MC_CMD_GET_CAPABILITIES_V3_OUT_DRV_ATTACH_PREBOOT_WIDTH 1
  9372. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_FORCE_EVENT_MERGING_LBN 8
  9373. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_FORCE_EVENT_MERGING_WIDTH 1
  9374. #define MC_CMD_GET_CAPABILITIES_V3_OUT_SET_MAC_ENHANCED_LBN 9
  9375. #define MC_CMD_GET_CAPABILITIES_V3_OUT_SET_MAC_ENHANCED_WIDTH 1
  9376. #define MC_CMD_GET_CAPABILITIES_V3_OUT_UNKNOWN_UCAST_DST_FILTER_ALWAYS_MULTI_RECIPIENT_LBN 10
  9377. #define MC_CMD_GET_CAPABILITIES_V3_OUT_UNKNOWN_UCAST_DST_FILTER_ALWAYS_MULTI_RECIPIENT_WIDTH 1
  9378. #define MC_CMD_GET_CAPABILITIES_V3_OUT_VADAPTOR_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED_LBN 11
  9379. #define MC_CMD_GET_CAPABILITIES_V3_OUT_VADAPTOR_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED_WIDTH 1
  9380. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_MAC_SECURITY_FILTERING_LBN 12
  9381. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_MAC_SECURITY_FILTERING_WIDTH 1
  9382. #define MC_CMD_GET_CAPABILITIES_V3_OUT_ADDITIONAL_RSS_MODES_LBN 13
  9383. #define MC_CMD_GET_CAPABILITIES_V3_OUT_ADDITIONAL_RSS_MODES_WIDTH 1
  9384. #define MC_CMD_GET_CAPABILITIES_V3_OUT_QBB_LBN 14
  9385. #define MC_CMD_GET_CAPABILITIES_V3_OUT_QBB_WIDTH 1
  9386. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_PACKED_STREAM_VAR_BUFFERS_LBN 15
  9387. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_PACKED_STREAM_VAR_BUFFERS_WIDTH 1
  9388. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_RSS_LIMITED_LBN 16
  9389. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_RSS_LIMITED_WIDTH 1
  9390. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_PACKED_STREAM_LBN 17
  9391. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_PACKED_STREAM_WIDTH 1
  9392. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_INCLUDE_FCS_LBN 18
  9393. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_INCLUDE_FCS_WIDTH 1
  9394. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_VLAN_INSERTION_LBN 19
  9395. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_VLAN_INSERTION_WIDTH 1
  9396. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_VLAN_STRIPPING_LBN 20
  9397. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_VLAN_STRIPPING_WIDTH 1
  9398. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_TSO_LBN 21
  9399. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_TSO_WIDTH 1
  9400. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_PREFIX_LEN_0_LBN 22
  9401. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_PREFIX_LEN_0_WIDTH 1
  9402. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_PREFIX_LEN_14_LBN 23
  9403. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_PREFIX_LEN_14_WIDTH 1
  9404. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_TIMESTAMP_LBN 24
  9405. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_TIMESTAMP_WIDTH 1
  9406. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_BATCHING_LBN 25
  9407. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_BATCHING_WIDTH 1
  9408. #define MC_CMD_GET_CAPABILITIES_V3_OUT_MCAST_FILTER_CHAINING_LBN 26
  9409. #define MC_CMD_GET_CAPABILITIES_V3_OUT_MCAST_FILTER_CHAINING_WIDTH 1
  9410. #define MC_CMD_GET_CAPABILITIES_V3_OUT_PM_AND_RXDP_COUNTERS_LBN 27
  9411. #define MC_CMD_GET_CAPABILITIES_V3_OUT_PM_AND_RXDP_COUNTERS_WIDTH 1
  9412. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_DISABLE_SCATTER_LBN 28
  9413. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_DISABLE_SCATTER_WIDTH 1
  9414. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_MCAST_UDP_LOOPBACK_LBN 29
  9415. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_MCAST_UDP_LOOPBACK_WIDTH 1
  9416. #define MC_CMD_GET_CAPABILITIES_V3_OUT_EVB_LBN 30
  9417. #define MC_CMD_GET_CAPABILITIES_V3_OUT_EVB_WIDTH 1
  9418. #define MC_CMD_GET_CAPABILITIES_V3_OUT_VXLAN_NVGRE_LBN 31
  9419. #define MC_CMD_GET_CAPABILITIES_V3_OUT_VXLAN_NVGRE_WIDTH 1
  9420. /* RxDPCPU firmware id. */
  9421. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_DPCPU_FW_ID_OFST 4
  9422. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_DPCPU_FW_ID_LEN 2
  9423. /* enum: Standard RXDP firmware */
  9424. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP 0x0
  9425. /* enum: Low latency RXDP firmware */
  9426. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_LOW_LATENCY 0x1
  9427. /* enum: Packed stream RXDP firmware */
  9428. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_PACKED_STREAM 0x2
  9429. /* enum: Rules engine RXDP firmware */
  9430. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_RULES_ENGINE 0x5
  9431. /* enum: DPDK RXDP firmware */
  9432. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_DPDK 0x6
  9433. /* enum: BIST RXDP firmware */
  9434. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_BIST 0x10a
  9435. /* enum: RXDP Test firmware image 1 */
  9436. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_TEST_FW_TO_MC_CUT_THROUGH 0x101
  9437. /* enum: RXDP Test firmware image 2 */
  9438. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_TEST_FW_TO_MC_STORE_FORWARD 0x102
  9439. /* enum: RXDP Test firmware image 3 */
  9440. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_TEST_FW_TO_MC_STORE_FORWARD_FIRST 0x103
  9441. /* enum: RXDP Test firmware image 4 */
  9442. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_TEST_EVERY_EVENT_BATCHABLE 0x104
  9443. /* enum: RXDP Test firmware image 5 */
  9444. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_TEST_BACKPRESSURE 0x105
  9445. /* enum: RXDP Test firmware image 6 */
  9446. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_TEST_FW_PACKET_EDITS 0x106
  9447. /* enum: RXDP Test firmware image 7 */
  9448. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_TEST_FW_RX_HDR_SPLIT 0x107
  9449. /* enum: RXDP Test firmware image 8 */
  9450. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_TEST_FW_DISABLE_DL 0x108
  9451. /* enum: RXDP Test firmware image 9 */
  9452. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_TEST_FW_DOORBELL_DELAY 0x10b
  9453. /* enum: RXDP Test firmware image 10 */
  9454. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_TEST_FW_SLOW 0x10c
  9455. /* TxDPCPU firmware id. */
  9456. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_DPCPU_FW_ID_OFST 6
  9457. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_DPCPU_FW_ID_LEN 2
  9458. /* enum: Standard TXDP firmware */
  9459. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXDP 0x0
  9460. /* enum: Low latency TXDP firmware */
  9461. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXDP_LOW_LATENCY 0x1
  9462. /* enum: High packet rate TXDP firmware */
  9463. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXDP_HIGH_PACKET_RATE 0x3
  9464. /* enum: Rules engine TXDP firmware */
  9465. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXDP_RULES_ENGINE 0x5
  9466. /* enum: DPDK TXDP firmware */
  9467. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXDP_DPDK 0x6
  9468. /* enum: BIST TXDP firmware */
  9469. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXDP_BIST 0x12d
  9470. /* enum: TXDP Test firmware image 1 */
  9471. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXDP_TEST_FW_TSO_EDIT 0x101
  9472. /* enum: TXDP Test firmware image 2 */
  9473. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXDP_TEST_FW_PACKET_EDITS 0x102
  9474. /* enum: TXDP CSR bus test firmware */
  9475. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXDP_TEST_FW_CSR 0x103
  9476. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_VERSION_OFST 8
  9477. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_VERSION_LEN 2
  9478. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_VERSION_REV_LBN 0
  9479. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_VERSION_REV_WIDTH 12
  9480. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_VERSION_TYPE_LBN 12
  9481. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_VERSION_TYPE_WIDTH 4
  9482. /* enum: reserved value - do not use (may indicate alternative interpretation
  9483. * of REV field in future)
  9484. */
  9485. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_RESERVED 0x0
  9486. /* enum: Trivial RX PD firmware for early Huntington development (Huntington
  9487. * development only)
  9488. */
  9489. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_FIRST_PKT 0x1
  9490. /* enum: RX PD firmware with approximately Siena-compatible behaviour
  9491. * (Huntington development only)
  9492. */
  9493. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_SIENA_COMPAT 0x2
  9494. /* enum: Full featured RX PD production firmware */
  9495. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_FULL_FEATURED 0x3
  9496. /* enum: (deprecated original name for the FULL_FEATURED variant) */
  9497. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_VSWITCH 0x3
  9498. /* enum: siena_compat variant RX PD firmware using PM rather than MAC
  9499. * (Huntington development only)
  9500. */
  9501. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_SIENA_COMPAT_PM 0x4
  9502. /* enum: Low latency RX PD production firmware */
  9503. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_LOW_LATENCY 0x5
  9504. /* enum: Packed stream RX PD production firmware */
  9505. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_PACKED_STREAM 0x6
  9506. /* enum: RX PD firmware handling layer 2 only for high packet rate performance
  9507. * tests (Medford development only)
  9508. */
  9509. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_LAYER2_PERF 0x7
  9510. /* enum: Rules engine RX PD production firmware */
  9511. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_RULES_ENGINE 0x8
  9512. /* enum: Custom firmware variant (see SF-119495-PD and bug69716) */
  9513. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_L3XUDP 0x9
  9514. /* enum: DPDK RX PD production firmware */
  9515. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_DPDK 0xa
  9516. /* enum: RX PD firmware for GUE parsing prototype (Medford development only) */
  9517. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_TESTFW_GUE_PROTOTYPE 0xe
  9518. /* enum: RX PD firmware parsing but not filtering network overlay tunnel
  9519. * encapsulations (Medford development only)
  9520. */
  9521. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_TESTFW_ENCAP_PARSING_ONLY 0xf
  9522. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_VERSION_OFST 10
  9523. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_VERSION_LEN 2
  9524. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_VERSION_REV_LBN 0
  9525. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_VERSION_REV_WIDTH 12
  9526. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_VERSION_TYPE_LBN 12
  9527. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_VERSION_TYPE_WIDTH 4
  9528. /* enum: reserved value - do not use (may indicate alternative interpretation
  9529. * of REV field in future)
  9530. */
  9531. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_RESERVED 0x0
  9532. /* enum: Trivial TX PD firmware for early Huntington development (Huntington
  9533. * development only)
  9534. */
  9535. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_FIRST_PKT 0x1
  9536. /* enum: TX PD firmware with approximately Siena-compatible behaviour
  9537. * (Huntington development only)
  9538. */
  9539. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_SIENA_COMPAT 0x2
  9540. /* enum: Full featured TX PD production firmware */
  9541. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_FULL_FEATURED 0x3
  9542. /* enum: (deprecated original name for the FULL_FEATURED variant) */
  9543. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_VSWITCH 0x3
  9544. /* enum: siena_compat variant TX PD firmware using PM rather than MAC
  9545. * (Huntington development only)
  9546. */
  9547. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_SIENA_COMPAT_PM 0x4
  9548. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_LOW_LATENCY 0x5 /* enum */
  9549. /* enum: TX PD firmware handling layer 2 only for high packet rate performance
  9550. * tests (Medford development only)
  9551. */
  9552. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_LAYER2_PERF 0x7
  9553. /* enum: Rules engine TX PD production firmware */
  9554. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_RULES_ENGINE 0x8
  9555. /* enum: Custom firmware variant (see SF-119495-PD and bug69716) */
  9556. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_L3XUDP 0x9
  9557. /* enum: DPDK TX PD production firmware */
  9558. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_DPDK 0xa
  9559. /* enum: RX PD firmware for GUE parsing prototype (Medford development only) */
  9560. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_TESTFW_GUE_PROTOTYPE 0xe
  9561. /* Hardware capabilities of NIC */
  9562. #define MC_CMD_GET_CAPABILITIES_V3_OUT_HW_CAPABILITIES_OFST 12
  9563. #define MC_CMD_GET_CAPABILITIES_V3_OUT_HW_CAPABILITIES_LEN 4
  9564. /* Licensed capabilities */
  9565. #define MC_CMD_GET_CAPABILITIES_V3_OUT_LICENSE_CAPABILITIES_OFST 16
  9566. #define MC_CMD_GET_CAPABILITIES_V3_OUT_LICENSE_CAPABILITIES_LEN 4
  9567. /* Second word of flags. Not present on older firmware (check the length). */
  9568. #define MC_CMD_GET_CAPABILITIES_V3_OUT_FLAGS2_OFST 20
  9569. #define MC_CMD_GET_CAPABILITIES_V3_OUT_FLAGS2_LEN 4
  9570. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_TSO_V2_LBN 0
  9571. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_TSO_V2_WIDTH 1
  9572. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_TSO_V2_ENCAP_LBN 1
  9573. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_TSO_V2_ENCAP_WIDTH 1
  9574. #define MC_CMD_GET_CAPABILITIES_V3_OUT_EVQ_TIMER_CTRL_LBN 2
  9575. #define MC_CMD_GET_CAPABILITIES_V3_OUT_EVQ_TIMER_CTRL_WIDTH 1
  9576. #define MC_CMD_GET_CAPABILITIES_V3_OUT_EVENT_CUT_THROUGH_LBN 3
  9577. #define MC_CMD_GET_CAPABILITIES_V3_OUT_EVENT_CUT_THROUGH_WIDTH 1
  9578. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_CUT_THROUGH_LBN 4
  9579. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_CUT_THROUGH_WIDTH 1
  9580. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_VFIFO_ULL_MODE_LBN 5
  9581. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_VFIFO_ULL_MODE_WIDTH 1
  9582. #define MC_CMD_GET_CAPABILITIES_V3_OUT_MAC_STATS_40G_TX_SIZE_BINS_LBN 6
  9583. #define MC_CMD_GET_CAPABILITIES_V3_OUT_MAC_STATS_40G_TX_SIZE_BINS_WIDTH 1
  9584. #define MC_CMD_GET_CAPABILITIES_V3_OUT_INIT_EVQ_V2_LBN 7
  9585. #define MC_CMD_GET_CAPABILITIES_V3_OUT_INIT_EVQ_V2_WIDTH 1
  9586. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_MAC_TIMESTAMPING_LBN 8
  9587. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_MAC_TIMESTAMPING_WIDTH 1
  9588. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_TIMESTAMP_LBN 9
  9589. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_TIMESTAMP_WIDTH 1
  9590. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_SNIFF_LBN 10
  9591. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_SNIFF_WIDTH 1
  9592. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_SNIFF_LBN 11
  9593. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_SNIFF_WIDTH 1
  9594. #define MC_CMD_GET_CAPABILITIES_V3_OUT_NVRAM_UPDATE_REPORT_VERIFY_RESULT_LBN 12
  9595. #define MC_CMD_GET_CAPABILITIES_V3_OUT_NVRAM_UPDATE_REPORT_VERIFY_RESULT_WIDTH 1
  9596. #define MC_CMD_GET_CAPABILITIES_V3_OUT_MCDI_BACKGROUND_LBN 13
  9597. #define MC_CMD_GET_CAPABILITIES_V3_OUT_MCDI_BACKGROUND_WIDTH 1
  9598. #define MC_CMD_GET_CAPABILITIES_V3_OUT_MCDI_DB_RETURN_LBN 14
  9599. #define MC_CMD_GET_CAPABILITIES_V3_OUT_MCDI_DB_RETURN_WIDTH 1
  9600. #define MC_CMD_GET_CAPABILITIES_V3_OUT_CTPIO_LBN 15
  9601. #define MC_CMD_GET_CAPABILITIES_V3_OUT_CTPIO_WIDTH 1
  9602. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TSA_SUPPORT_LBN 16
  9603. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TSA_SUPPORT_WIDTH 1
  9604. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TSA_BOUND_LBN 17
  9605. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TSA_BOUND_WIDTH 1
  9606. #define MC_CMD_GET_CAPABILITIES_V3_OUT_SF_ADAPTER_AUTHENTICATION_LBN 18
  9607. #define MC_CMD_GET_CAPABILITIES_V3_OUT_SF_ADAPTER_AUTHENTICATION_WIDTH 1
  9608. #define MC_CMD_GET_CAPABILITIES_V3_OUT_FILTER_ACTION_FLAG_LBN 19
  9609. #define MC_CMD_GET_CAPABILITIES_V3_OUT_FILTER_ACTION_FLAG_WIDTH 1
  9610. #define MC_CMD_GET_CAPABILITIES_V3_OUT_FILTER_ACTION_MARK_LBN 20
  9611. #define MC_CMD_GET_CAPABILITIES_V3_OUT_FILTER_ACTION_MARK_WIDTH 1
  9612. #define MC_CMD_GET_CAPABILITIES_V3_OUT_EQUAL_STRIDE_PACKED_STREAM_LBN 21
  9613. #define MC_CMD_GET_CAPABILITIES_V3_OUT_EQUAL_STRIDE_PACKED_STREAM_WIDTH 1
  9614. #define MC_CMD_GET_CAPABILITIES_V3_OUT_L3XUDP_SUPPORT_LBN 22
  9615. #define MC_CMD_GET_CAPABILITIES_V3_OUT_L3XUDP_SUPPORT_WIDTH 1
  9616. #define MC_CMD_GET_CAPABILITIES_V3_OUT_FW_SUBVARIANT_NO_TX_CSUM_LBN 23
  9617. #define MC_CMD_GET_CAPABILITIES_V3_OUT_FW_SUBVARIANT_NO_TX_CSUM_WIDTH 1
  9618. #define MC_CMD_GET_CAPABILITIES_V3_OUT_VI_SPREADING_LBN 24
  9619. #define MC_CMD_GET_CAPABILITIES_V3_OUT_VI_SPREADING_WIDTH 1
  9620. /* Number of FATSOv2 contexts per datapath supported by this NIC. Not present
  9621. * on older firmware (check the length).
  9622. */
  9623. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_TSO_V2_N_CONTEXTS_OFST 24
  9624. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_TSO_V2_N_CONTEXTS_LEN 2
  9625. /* One byte per PF containing the number of the external port assigned to this
  9626. * PF, indexed by PF number. Special values indicate that a PF is either not
  9627. * present or not assigned.
  9628. */
  9629. #define MC_CMD_GET_CAPABILITIES_V3_OUT_PFS_TO_PORTS_ASSIGNMENT_OFST 26
  9630. #define MC_CMD_GET_CAPABILITIES_V3_OUT_PFS_TO_PORTS_ASSIGNMENT_LEN 1
  9631. #define MC_CMD_GET_CAPABILITIES_V3_OUT_PFS_TO_PORTS_ASSIGNMENT_NUM 16
  9632. /* enum: The caller is not permitted to access information on this PF. */
  9633. #define MC_CMD_GET_CAPABILITIES_V3_OUT_ACCESS_NOT_PERMITTED 0xff
  9634. /* enum: PF does not exist. */
  9635. #define MC_CMD_GET_CAPABILITIES_V3_OUT_PF_NOT_PRESENT 0xfe
  9636. /* enum: PF does exist but is not assigned to any external port. */
  9637. #define MC_CMD_GET_CAPABILITIES_V3_OUT_PF_NOT_ASSIGNED 0xfd
  9638. /* enum: This value indicates that PF is assigned, but it cannot be expressed
  9639. * in this field. It is intended for a possible future situation where a more
  9640. * complex scheme of PFs to ports mapping is being used. The future driver
  9641. * should look for a new field supporting the new scheme. The current/old
  9642. * driver should treat this value as PF_NOT_ASSIGNED.
  9643. */
  9644. #define MC_CMD_GET_CAPABILITIES_V3_OUT_INCOMPATIBLE_ASSIGNMENT 0xfc
  9645. /* One byte per PF containing the number of its VFs, indexed by PF number. A
  9646. * special value indicates that a PF is not present.
  9647. */
  9648. #define MC_CMD_GET_CAPABILITIES_V3_OUT_NUM_VFS_PER_PF_OFST 42
  9649. #define MC_CMD_GET_CAPABILITIES_V3_OUT_NUM_VFS_PER_PF_LEN 1
  9650. #define MC_CMD_GET_CAPABILITIES_V3_OUT_NUM_VFS_PER_PF_NUM 16
  9651. /* enum: The caller is not permitted to access information on this PF. */
  9652. /* MC_CMD_GET_CAPABILITIES_V3_OUT_ACCESS_NOT_PERMITTED 0xff */
  9653. /* enum: PF does not exist. */
  9654. /* MC_CMD_GET_CAPABILITIES_V3_OUT_PF_NOT_PRESENT 0xfe */
  9655. /* Number of VIs available for each external port */
  9656. #define MC_CMD_GET_CAPABILITIES_V3_OUT_NUM_VIS_PER_PORT_OFST 58
  9657. #define MC_CMD_GET_CAPABILITIES_V3_OUT_NUM_VIS_PER_PORT_LEN 2
  9658. #define MC_CMD_GET_CAPABILITIES_V3_OUT_NUM_VIS_PER_PORT_NUM 4
  9659. /* Size of RX descriptor cache expressed as binary logarithm The actual size
  9660. * equals (2 ^ RX_DESC_CACHE_SIZE)
  9661. */
  9662. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_DESC_CACHE_SIZE_OFST 66
  9663. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_DESC_CACHE_SIZE_LEN 1
  9664. /* Size of TX descriptor cache expressed as binary logarithm The actual size
  9665. * equals (2 ^ TX_DESC_CACHE_SIZE)
  9666. */
  9667. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_DESC_CACHE_SIZE_OFST 67
  9668. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_DESC_CACHE_SIZE_LEN 1
  9669. /* Total number of available PIO buffers */
  9670. #define MC_CMD_GET_CAPABILITIES_V3_OUT_NUM_PIO_BUFFS_OFST 68
  9671. #define MC_CMD_GET_CAPABILITIES_V3_OUT_NUM_PIO_BUFFS_LEN 2
  9672. /* Size of a single PIO buffer */
  9673. #define MC_CMD_GET_CAPABILITIES_V3_OUT_SIZE_PIO_BUFF_OFST 70
  9674. #define MC_CMD_GET_CAPABILITIES_V3_OUT_SIZE_PIO_BUFF_LEN 2
  9675. /* On chips later than Medford the amount of address space assigned to each VI
  9676. * is configurable. This is a global setting that the driver must query to
  9677. * discover the VI to address mapping. Cut-through PIO (CTPIO) is not available
  9678. * with 8k VI windows.
  9679. */
  9680. #define MC_CMD_GET_CAPABILITIES_V3_OUT_VI_WINDOW_MODE_OFST 72
  9681. #define MC_CMD_GET_CAPABILITIES_V3_OUT_VI_WINDOW_MODE_LEN 1
  9682. /* enum: Each VI occupies 8k as on Huntington and Medford. PIO is at offset 4k.
  9683. * CTPIO is not mapped.
  9684. */
  9685. #define MC_CMD_GET_CAPABILITIES_V3_OUT_VI_WINDOW_MODE_8K 0x0
  9686. /* enum: Each VI occupies 16k. PIO is at offset 4k. CTPIO is at offset 12k. */
  9687. #define MC_CMD_GET_CAPABILITIES_V3_OUT_VI_WINDOW_MODE_16K 0x1
  9688. /* enum: Each VI occupies 64k. PIO is at offset 4k. CTPIO is at offset 12k. */
  9689. #define MC_CMD_GET_CAPABILITIES_V3_OUT_VI_WINDOW_MODE_64K 0x2
  9690. /* Number of vFIFOs per adapter that can be used for VFIFO Stuffing
  9691. * (SF-115995-SW) in the present configuration of firmware and port mode.
  9692. */
  9693. #define MC_CMD_GET_CAPABILITIES_V3_OUT_VFIFO_STUFFING_NUM_VFIFOS_OFST 73
  9694. #define MC_CMD_GET_CAPABILITIES_V3_OUT_VFIFO_STUFFING_NUM_VFIFOS_LEN 1
  9695. /* Number of buffers per adapter that can be used for VFIFO Stuffing
  9696. * (SF-115995-SW) in the present configuration of firmware and port mode.
  9697. */
  9698. #define MC_CMD_GET_CAPABILITIES_V3_OUT_VFIFO_STUFFING_NUM_CP_BUFFERS_OFST 74
  9699. #define MC_CMD_GET_CAPABILITIES_V3_OUT_VFIFO_STUFFING_NUM_CP_BUFFERS_LEN 2
  9700. /* MC_CMD_GET_CAPABILITIES_V4_OUT msgresponse */
  9701. #define MC_CMD_GET_CAPABILITIES_V4_OUT_LEN 78
  9702. /* First word of flags. */
  9703. #define MC_CMD_GET_CAPABILITIES_V4_OUT_FLAGS1_OFST 0
  9704. #define MC_CMD_GET_CAPABILITIES_V4_OUT_FLAGS1_LEN 4
  9705. #define MC_CMD_GET_CAPABILITIES_V4_OUT_VPORT_RECONFIGURE_LBN 3
  9706. #define MC_CMD_GET_CAPABILITIES_V4_OUT_VPORT_RECONFIGURE_WIDTH 1
  9707. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TX_STRIPING_LBN 4
  9708. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TX_STRIPING_WIDTH 1
  9709. #define MC_CMD_GET_CAPABILITIES_V4_OUT_VADAPTOR_QUERY_LBN 5
  9710. #define MC_CMD_GET_CAPABILITIES_V4_OUT_VADAPTOR_QUERY_WIDTH 1
  9711. #define MC_CMD_GET_CAPABILITIES_V4_OUT_EVB_PORT_VLAN_RESTRICT_LBN 6
  9712. #define MC_CMD_GET_CAPABILITIES_V4_OUT_EVB_PORT_VLAN_RESTRICT_WIDTH 1
  9713. #define MC_CMD_GET_CAPABILITIES_V4_OUT_DRV_ATTACH_PREBOOT_LBN 7
  9714. #define MC_CMD_GET_CAPABILITIES_V4_OUT_DRV_ATTACH_PREBOOT_WIDTH 1
  9715. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RX_FORCE_EVENT_MERGING_LBN 8
  9716. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RX_FORCE_EVENT_MERGING_WIDTH 1
  9717. #define MC_CMD_GET_CAPABILITIES_V4_OUT_SET_MAC_ENHANCED_LBN 9
  9718. #define MC_CMD_GET_CAPABILITIES_V4_OUT_SET_MAC_ENHANCED_WIDTH 1
  9719. #define MC_CMD_GET_CAPABILITIES_V4_OUT_UNKNOWN_UCAST_DST_FILTER_ALWAYS_MULTI_RECIPIENT_LBN 10
  9720. #define MC_CMD_GET_CAPABILITIES_V4_OUT_UNKNOWN_UCAST_DST_FILTER_ALWAYS_MULTI_RECIPIENT_WIDTH 1
  9721. #define MC_CMD_GET_CAPABILITIES_V4_OUT_VADAPTOR_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED_LBN 11
  9722. #define MC_CMD_GET_CAPABILITIES_V4_OUT_VADAPTOR_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED_WIDTH 1
  9723. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TX_MAC_SECURITY_FILTERING_LBN 12
  9724. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TX_MAC_SECURITY_FILTERING_WIDTH 1
  9725. #define MC_CMD_GET_CAPABILITIES_V4_OUT_ADDITIONAL_RSS_MODES_LBN 13
  9726. #define MC_CMD_GET_CAPABILITIES_V4_OUT_ADDITIONAL_RSS_MODES_WIDTH 1
  9727. #define MC_CMD_GET_CAPABILITIES_V4_OUT_QBB_LBN 14
  9728. #define MC_CMD_GET_CAPABILITIES_V4_OUT_QBB_WIDTH 1
  9729. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RX_PACKED_STREAM_VAR_BUFFERS_LBN 15
  9730. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RX_PACKED_STREAM_VAR_BUFFERS_WIDTH 1
  9731. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RX_RSS_LIMITED_LBN 16
  9732. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RX_RSS_LIMITED_WIDTH 1
  9733. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RX_PACKED_STREAM_LBN 17
  9734. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RX_PACKED_STREAM_WIDTH 1
  9735. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RX_INCLUDE_FCS_LBN 18
  9736. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RX_INCLUDE_FCS_WIDTH 1
  9737. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TX_VLAN_INSERTION_LBN 19
  9738. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TX_VLAN_INSERTION_WIDTH 1
  9739. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RX_VLAN_STRIPPING_LBN 20
  9740. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RX_VLAN_STRIPPING_WIDTH 1
  9741. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TX_TSO_LBN 21
  9742. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TX_TSO_WIDTH 1
  9743. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RX_PREFIX_LEN_0_LBN 22
  9744. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RX_PREFIX_LEN_0_WIDTH 1
  9745. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RX_PREFIX_LEN_14_LBN 23
  9746. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RX_PREFIX_LEN_14_WIDTH 1
  9747. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RX_TIMESTAMP_LBN 24
  9748. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RX_TIMESTAMP_WIDTH 1
  9749. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RX_BATCHING_LBN 25
  9750. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RX_BATCHING_WIDTH 1
  9751. #define MC_CMD_GET_CAPABILITIES_V4_OUT_MCAST_FILTER_CHAINING_LBN 26
  9752. #define MC_CMD_GET_CAPABILITIES_V4_OUT_MCAST_FILTER_CHAINING_WIDTH 1
  9753. #define MC_CMD_GET_CAPABILITIES_V4_OUT_PM_AND_RXDP_COUNTERS_LBN 27
  9754. #define MC_CMD_GET_CAPABILITIES_V4_OUT_PM_AND_RXDP_COUNTERS_WIDTH 1
  9755. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RX_DISABLE_SCATTER_LBN 28
  9756. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RX_DISABLE_SCATTER_WIDTH 1
  9757. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TX_MCAST_UDP_LOOPBACK_LBN 29
  9758. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TX_MCAST_UDP_LOOPBACK_WIDTH 1
  9759. #define MC_CMD_GET_CAPABILITIES_V4_OUT_EVB_LBN 30
  9760. #define MC_CMD_GET_CAPABILITIES_V4_OUT_EVB_WIDTH 1
  9761. #define MC_CMD_GET_CAPABILITIES_V4_OUT_VXLAN_NVGRE_LBN 31
  9762. #define MC_CMD_GET_CAPABILITIES_V4_OUT_VXLAN_NVGRE_WIDTH 1
  9763. /* RxDPCPU firmware id. */
  9764. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RX_DPCPU_FW_ID_OFST 4
  9765. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RX_DPCPU_FW_ID_LEN 2
  9766. /* enum: Standard RXDP firmware */
  9767. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXDP 0x0
  9768. /* enum: Low latency RXDP firmware */
  9769. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXDP_LOW_LATENCY 0x1
  9770. /* enum: Packed stream RXDP firmware */
  9771. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXDP_PACKED_STREAM 0x2
  9772. /* enum: Rules engine RXDP firmware */
  9773. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXDP_RULES_ENGINE 0x5
  9774. /* enum: DPDK RXDP firmware */
  9775. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXDP_DPDK 0x6
  9776. /* enum: BIST RXDP firmware */
  9777. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXDP_BIST 0x10a
  9778. /* enum: RXDP Test firmware image 1 */
  9779. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXDP_TEST_FW_TO_MC_CUT_THROUGH 0x101
  9780. /* enum: RXDP Test firmware image 2 */
  9781. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXDP_TEST_FW_TO_MC_STORE_FORWARD 0x102
  9782. /* enum: RXDP Test firmware image 3 */
  9783. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXDP_TEST_FW_TO_MC_STORE_FORWARD_FIRST 0x103
  9784. /* enum: RXDP Test firmware image 4 */
  9785. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXDP_TEST_EVERY_EVENT_BATCHABLE 0x104
  9786. /* enum: RXDP Test firmware image 5 */
  9787. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXDP_TEST_BACKPRESSURE 0x105
  9788. /* enum: RXDP Test firmware image 6 */
  9789. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXDP_TEST_FW_PACKET_EDITS 0x106
  9790. /* enum: RXDP Test firmware image 7 */
  9791. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXDP_TEST_FW_RX_HDR_SPLIT 0x107
  9792. /* enum: RXDP Test firmware image 8 */
  9793. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXDP_TEST_FW_DISABLE_DL 0x108
  9794. /* enum: RXDP Test firmware image 9 */
  9795. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXDP_TEST_FW_DOORBELL_DELAY 0x10b
  9796. /* enum: RXDP Test firmware image 10 */
  9797. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXDP_TEST_FW_SLOW 0x10c
  9798. /* TxDPCPU firmware id. */
  9799. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TX_DPCPU_FW_ID_OFST 6
  9800. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TX_DPCPU_FW_ID_LEN 2
  9801. /* enum: Standard TXDP firmware */
  9802. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TXDP 0x0
  9803. /* enum: Low latency TXDP firmware */
  9804. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TXDP_LOW_LATENCY 0x1
  9805. /* enum: High packet rate TXDP firmware */
  9806. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TXDP_HIGH_PACKET_RATE 0x3
  9807. /* enum: Rules engine TXDP firmware */
  9808. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TXDP_RULES_ENGINE 0x5
  9809. /* enum: DPDK TXDP firmware */
  9810. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TXDP_DPDK 0x6
  9811. /* enum: BIST TXDP firmware */
  9812. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TXDP_BIST 0x12d
  9813. /* enum: TXDP Test firmware image 1 */
  9814. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TXDP_TEST_FW_TSO_EDIT 0x101
  9815. /* enum: TXDP Test firmware image 2 */
  9816. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TXDP_TEST_FW_PACKET_EDITS 0x102
  9817. /* enum: TXDP CSR bus test firmware */
  9818. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TXDP_TEST_FW_CSR 0x103
  9819. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXPD_FW_VERSION_OFST 8
  9820. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXPD_FW_VERSION_LEN 2
  9821. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXPD_FW_VERSION_REV_LBN 0
  9822. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXPD_FW_VERSION_REV_WIDTH 12
  9823. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXPD_FW_VERSION_TYPE_LBN 12
  9824. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXPD_FW_VERSION_TYPE_WIDTH 4
  9825. /* enum: reserved value - do not use (may indicate alternative interpretation
  9826. * of REV field in future)
  9827. */
  9828. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXPD_FW_TYPE_RESERVED 0x0
  9829. /* enum: Trivial RX PD firmware for early Huntington development (Huntington
  9830. * development only)
  9831. */
  9832. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXPD_FW_TYPE_FIRST_PKT 0x1
  9833. /* enum: RX PD firmware with approximately Siena-compatible behaviour
  9834. * (Huntington development only)
  9835. */
  9836. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXPD_FW_TYPE_SIENA_COMPAT 0x2
  9837. /* enum: Full featured RX PD production firmware */
  9838. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXPD_FW_TYPE_FULL_FEATURED 0x3
  9839. /* enum: (deprecated original name for the FULL_FEATURED variant) */
  9840. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXPD_FW_TYPE_VSWITCH 0x3
  9841. /* enum: siena_compat variant RX PD firmware using PM rather than MAC
  9842. * (Huntington development only)
  9843. */
  9844. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXPD_FW_TYPE_SIENA_COMPAT_PM 0x4
  9845. /* enum: Low latency RX PD production firmware */
  9846. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXPD_FW_TYPE_LOW_LATENCY 0x5
  9847. /* enum: Packed stream RX PD production firmware */
  9848. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXPD_FW_TYPE_PACKED_STREAM 0x6
  9849. /* enum: RX PD firmware handling layer 2 only for high packet rate performance
  9850. * tests (Medford development only)
  9851. */
  9852. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXPD_FW_TYPE_LAYER2_PERF 0x7
  9853. /* enum: Rules engine RX PD production firmware */
  9854. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXPD_FW_TYPE_RULES_ENGINE 0x8
  9855. /* enum: Custom firmware variant (see SF-119495-PD and bug69716) */
  9856. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXPD_FW_TYPE_L3XUDP 0x9
  9857. /* enum: DPDK RX PD production firmware */
  9858. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXPD_FW_TYPE_DPDK 0xa
  9859. /* enum: RX PD firmware for GUE parsing prototype (Medford development only) */
  9860. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXPD_FW_TYPE_TESTFW_GUE_PROTOTYPE 0xe
  9861. /* enum: RX PD firmware parsing but not filtering network overlay tunnel
  9862. * encapsulations (Medford development only)
  9863. */
  9864. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXPD_FW_TYPE_TESTFW_ENCAP_PARSING_ONLY 0xf
  9865. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TXPD_FW_VERSION_OFST 10
  9866. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TXPD_FW_VERSION_LEN 2
  9867. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TXPD_FW_VERSION_REV_LBN 0
  9868. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TXPD_FW_VERSION_REV_WIDTH 12
  9869. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TXPD_FW_VERSION_TYPE_LBN 12
  9870. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TXPD_FW_VERSION_TYPE_WIDTH 4
  9871. /* enum: reserved value - do not use (may indicate alternative interpretation
  9872. * of REV field in future)
  9873. */
  9874. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TXPD_FW_TYPE_RESERVED 0x0
  9875. /* enum: Trivial TX PD firmware for early Huntington development (Huntington
  9876. * development only)
  9877. */
  9878. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TXPD_FW_TYPE_FIRST_PKT 0x1
  9879. /* enum: TX PD firmware with approximately Siena-compatible behaviour
  9880. * (Huntington development only)
  9881. */
  9882. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TXPD_FW_TYPE_SIENA_COMPAT 0x2
  9883. /* enum: Full featured TX PD production firmware */
  9884. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TXPD_FW_TYPE_FULL_FEATURED 0x3
  9885. /* enum: (deprecated original name for the FULL_FEATURED variant) */
  9886. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TXPD_FW_TYPE_VSWITCH 0x3
  9887. /* enum: siena_compat variant TX PD firmware using PM rather than MAC
  9888. * (Huntington development only)
  9889. */
  9890. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TXPD_FW_TYPE_SIENA_COMPAT_PM 0x4
  9891. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TXPD_FW_TYPE_LOW_LATENCY 0x5 /* enum */
  9892. /* enum: TX PD firmware handling layer 2 only for high packet rate performance
  9893. * tests (Medford development only)
  9894. */
  9895. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TXPD_FW_TYPE_LAYER2_PERF 0x7
  9896. /* enum: Rules engine TX PD production firmware */
  9897. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TXPD_FW_TYPE_RULES_ENGINE 0x8
  9898. /* enum: Custom firmware variant (see SF-119495-PD and bug69716) */
  9899. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TXPD_FW_TYPE_L3XUDP 0x9
  9900. /* enum: DPDK TX PD production firmware */
  9901. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TXPD_FW_TYPE_DPDK 0xa
  9902. /* enum: RX PD firmware for GUE parsing prototype (Medford development only) */
  9903. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TXPD_FW_TYPE_TESTFW_GUE_PROTOTYPE 0xe
  9904. /* Hardware capabilities of NIC */
  9905. #define MC_CMD_GET_CAPABILITIES_V4_OUT_HW_CAPABILITIES_OFST 12
  9906. #define MC_CMD_GET_CAPABILITIES_V4_OUT_HW_CAPABILITIES_LEN 4
  9907. /* Licensed capabilities */
  9908. #define MC_CMD_GET_CAPABILITIES_V4_OUT_LICENSE_CAPABILITIES_OFST 16
  9909. #define MC_CMD_GET_CAPABILITIES_V4_OUT_LICENSE_CAPABILITIES_LEN 4
  9910. /* Second word of flags. Not present on older firmware (check the length). */
  9911. #define MC_CMD_GET_CAPABILITIES_V4_OUT_FLAGS2_OFST 20
  9912. #define MC_CMD_GET_CAPABILITIES_V4_OUT_FLAGS2_LEN 4
  9913. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TX_TSO_V2_LBN 0
  9914. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TX_TSO_V2_WIDTH 1
  9915. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TX_TSO_V2_ENCAP_LBN 1
  9916. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TX_TSO_V2_ENCAP_WIDTH 1
  9917. #define MC_CMD_GET_CAPABILITIES_V4_OUT_EVQ_TIMER_CTRL_LBN 2
  9918. #define MC_CMD_GET_CAPABILITIES_V4_OUT_EVQ_TIMER_CTRL_WIDTH 1
  9919. #define MC_CMD_GET_CAPABILITIES_V4_OUT_EVENT_CUT_THROUGH_LBN 3
  9920. #define MC_CMD_GET_CAPABILITIES_V4_OUT_EVENT_CUT_THROUGH_WIDTH 1
  9921. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RX_CUT_THROUGH_LBN 4
  9922. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RX_CUT_THROUGH_WIDTH 1
  9923. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TX_VFIFO_ULL_MODE_LBN 5
  9924. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TX_VFIFO_ULL_MODE_WIDTH 1
  9925. #define MC_CMD_GET_CAPABILITIES_V4_OUT_MAC_STATS_40G_TX_SIZE_BINS_LBN 6
  9926. #define MC_CMD_GET_CAPABILITIES_V4_OUT_MAC_STATS_40G_TX_SIZE_BINS_WIDTH 1
  9927. #define MC_CMD_GET_CAPABILITIES_V4_OUT_INIT_EVQ_V2_LBN 7
  9928. #define MC_CMD_GET_CAPABILITIES_V4_OUT_INIT_EVQ_V2_WIDTH 1
  9929. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TX_MAC_TIMESTAMPING_LBN 8
  9930. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TX_MAC_TIMESTAMPING_WIDTH 1
  9931. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TX_TIMESTAMP_LBN 9
  9932. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TX_TIMESTAMP_WIDTH 1
  9933. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RX_SNIFF_LBN 10
  9934. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RX_SNIFF_WIDTH 1
  9935. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TX_SNIFF_LBN 11
  9936. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TX_SNIFF_WIDTH 1
  9937. #define MC_CMD_GET_CAPABILITIES_V4_OUT_NVRAM_UPDATE_REPORT_VERIFY_RESULT_LBN 12
  9938. #define MC_CMD_GET_CAPABILITIES_V4_OUT_NVRAM_UPDATE_REPORT_VERIFY_RESULT_WIDTH 1
  9939. #define MC_CMD_GET_CAPABILITIES_V4_OUT_MCDI_BACKGROUND_LBN 13
  9940. #define MC_CMD_GET_CAPABILITIES_V4_OUT_MCDI_BACKGROUND_WIDTH 1
  9941. #define MC_CMD_GET_CAPABILITIES_V4_OUT_MCDI_DB_RETURN_LBN 14
  9942. #define MC_CMD_GET_CAPABILITIES_V4_OUT_MCDI_DB_RETURN_WIDTH 1
  9943. #define MC_CMD_GET_CAPABILITIES_V4_OUT_CTPIO_LBN 15
  9944. #define MC_CMD_GET_CAPABILITIES_V4_OUT_CTPIO_WIDTH 1
  9945. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TSA_SUPPORT_LBN 16
  9946. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TSA_SUPPORT_WIDTH 1
  9947. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TSA_BOUND_LBN 17
  9948. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TSA_BOUND_WIDTH 1
  9949. #define MC_CMD_GET_CAPABILITIES_V4_OUT_SF_ADAPTER_AUTHENTICATION_LBN 18
  9950. #define MC_CMD_GET_CAPABILITIES_V4_OUT_SF_ADAPTER_AUTHENTICATION_WIDTH 1
  9951. #define MC_CMD_GET_CAPABILITIES_V4_OUT_FILTER_ACTION_FLAG_LBN 19
  9952. #define MC_CMD_GET_CAPABILITIES_V4_OUT_FILTER_ACTION_FLAG_WIDTH 1
  9953. #define MC_CMD_GET_CAPABILITIES_V4_OUT_FILTER_ACTION_MARK_LBN 20
  9954. #define MC_CMD_GET_CAPABILITIES_V4_OUT_FILTER_ACTION_MARK_WIDTH 1
  9955. #define MC_CMD_GET_CAPABILITIES_V4_OUT_EQUAL_STRIDE_PACKED_STREAM_LBN 21
  9956. #define MC_CMD_GET_CAPABILITIES_V4_OUT_EQUAL_STRIDE_PACKED_STREAM_WIDTH 1
  9957. #define MC_CMD_GET_CAPABILITIES_V4_OUT_L3XUDP_SUPPORT_LBN 22
  9958. #define MC_CMD_GET_CAPABILITIES_V4_OUT_L3XUDP_SUPPORT_WIDTH 1
  9959. #define MC_CMD_GET_CAPABILITIES_V4_OUT_FW_SUBVARIANT_NO_TX_CSUM_LBN 23
  9960. #define MC_CMD_GET_CAPABILITIES_V4_OUT_FW_SUBVARIANT_NO_TX_CSUM_WIDTH 1
  9961. #define MC_CMD_GET_CAPABILITIES_V4_OUT_VI_SPREADING_LBN 24
  9962. #define MC_CMD_GET_CAPABILITIES_V4_OUT_VI_SPREADING_WIDTH 1
  9963. /* Number of FATSOv2 contexts per datapath supported by this NIC. Not present
  9964. * on older firmware (check the length).
  9965. */
  9966. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TX_TSO_V2_N_CONTEXTS_OFST 24
  9967. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TX_TSO_V2_N_CONTEXTS_LEN 2
  9968. /* One byte per PF containing the number of the external port assigned to this
  9969. * PF, indexed by PF number. Special values indicate that a PF is either not
  9970. * present or not assigned.
  9971. */
  9972. #define MC_CMD_GET_CAPABILITIES_V4_OUT_PFS_TO_PORTS_ASSIGNMENT_OFST 26
  9973. #define MC_CMD_GET_CAPABILITIES_V4_OUT_PFS_TO_PORTS_ASSIGNMENT_LEN 1
  9974. #define MC_CMD_GET_CAPABILITIES_V4_OUT_PFS_TO_PORTS_ASSIGNMENT_NUM 16
  9975. /* enum: The caller is not permitted to access information on this PF. */
  9976. #define MC_CMD_GET_CAPABILITIES_V4_OUT_ACCESS_NOT_PERMITTED 0xff
  9977. /* enum: PF does not exist. */
  9978. #define MC_CMD_GET_CAPABILITIES_V4_OUT_PF_NOT_PRESENT 0xfe
  9979. /* enum: PF does exist but is not assigned to any external port. */
  9980. #define MC_CMD_GET_CAPABILITIES_V4_OUT_PF_NOT_ASSIGNED 0xfd
  9981. /* enum: This value indicates that PF is assigned, but it cannot be expressed
  9982. * in this field. It is intended for a possible future situation where a more
  9983. * complex scheme of PFs to ports mapping is being used. The future driver
  9984. * should look for a new field supporting the new scheme. The current/old
  9985. * driver should treat this value as PF_NOT_ASSIGNED.
  9986. */
  9987. #define MC_CMD_GET_CAPABILITIES_V4_OUT_INCOMPATIBLE_ASSIGNMENT 0xfc
  9988. /* One byte per PF containing the number of its VFs, indexed by PF number. A
  9989. * special value indicates that a PF is not present.
  9990. */
  9991. #define MC_CMD_GET_CAPABILITIES_V4_OUT_NUM_VFS_PER_PF_OFST 42
  9992. #define MC_CMD_GET_CAPABILITIES_V4_OUT_NUM_VFS_PER_PF_LEN 1
  9993. #define MC_CMD_GET_CAPABILITIES_V4_OUT_NUM_VFS_PER_PF_NUM 16
  9994. /* enum: The caller is not permitted to access information on this PF. */
  9995. /* MC_CMD_GET_CAPABILITIES_V4_OUT_ACCESS_NOT_PERMITTED 0xff */
  9996. /* enum: PF does not exist. */
  9997. /* MC_CMD_GET_CAPABILITIES_V4_OUT_PF_NOT_PRESENT 0xfe */
  9998. /* Number of VIs available for each external port */
  9999. #define MC_CMD_GET_CAPABILITIES_V4_OUT_NUM_VIS_PER_PORT_OFST 58
  10000. #define MC_CMD_GET_CAPABILITIES_V4_OUT_NUM_VIS_PER_PORT_LEN 2
  10001. #define MC_CMD_GET_CAPABILITIES_V4_OUT_NUM_VIS_PER_PORT_NUM 4
  10002. /* Size of RX descriptor cache expressed as binary logarithm The actual size
  10003. * equals (2 ^ RX_DESC_CACHE_SIZE)
  10004. */
  10005. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RX_DESC_CACHE_SIZE_OFST 66
  10006. #define MC_CMD_GET_CAPABILITIES_V4_OUT_RX_DESC_CACHE_SIZE_LEN 1
  10007. /* Size of TX descriptor cache expressed as binary logarithm The actual size
  10008. * equals (2 ^ TX_DESC_CACHE_SIZE)
  10009. */
  10010. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TX_DESC_CACHE_SIZE_OFST 67
  10011. #define MC_CMD_GET_CAPABILITIES_V4_OUT_TX_DESC_CACHE_SIZE_LEN 1
  10012. /* Total number of available PIO buffers */
  10013. #define MC_CMD_GET_CAPABILITIES_V4_OUT_NUM_PIO_BUFFS_OFST 68
  10014. #define MC_CMD_GET_CAPABILITIES_V4_OUT_NUM_PIO_BUFFS_LEN 2
  10015. /* Size of a single PIO buffer */
  10016. #define MC_CMD_GET_CAPABILITIES_V4_OUT_SIZE_PIO_BUFF_OFST 70
  10017. #define MC_CMD_GET_CAPABILITIES_V4_OUT_SIZE_PIO_BUFF_LEN 2
  10018. /* On chips later than Medford the amount of address space assigned to each VI
  10019. * is configurable. This is a global setting that the driver must query to
  10020. * discover the VI to address mapping. Cut-through PIO (CTPIO) is not available
  10021. * with 8k VI windows.
  10022. */
  10023. #define MC_CMD_GET_CAPABILITIES_V4_OUT_VI_WINDOW_MODE_OFST 72
  10024. #define MC_CMD_GET_CAPABILITIES_V4_OUT_VI_WINDOW_MODE_LEN 1
  10025. /* enum: Each VI occupies 8k as on Huntington and Medford. PIO is at offset 4k.
  10026. * CTPIO is not mapped.
  10027. */
  10028. #define MC_CMD_GET_CAPABILITIES_V4_OUT_VI_WINDOW_MODE_8K 0x0
  10029. /* enum: Each VI occupies 16k. PIO is at offset 4k. CTPIO is at offset 12k. */
  10030. #define MC_CMD_GET_CAPABILITIES_V4_OUT_VI_WINDOW_MODE_16K 0x1
  10031. /* enum: Each VI occupies 64k. PIO is at offset 4k. CTPIO is at offset 12k. */
  10032. #define MC_CMD_GET_CAPABILITIES_V4_OUT_VI_WINDOW_MODE_64K 0x2
  10033. /* Number of vFIFOs per adapter that can be used for VFIFO Stuffing
  10034. * (SF-115995-SW) in the present configuration of firmware and port mode.
  10035. */
  10036. #define MC_CMD_GET_CAPABILITIES_V4_OUT_VFIFO_STUFFING_NUM_VFIFOS_OFST 73
  10037. #define MC_CMD_GET_CAPABILITIES_V4_OUT_VFIFO_STUFFING_NUM_VFIFOS_LEN 1
  10038. /* Number of buffers per adapter that can be used for VFIFO Stuffing
  10039. * (SF-115995-SW) in the present configuration of firmware and port mode.
  10040. */
  10041. #define MC_CMD_GET_CAPABILITIES_V4_OUT_VFIFO_STUFFING_NUM_CP_BUFFERS_OFST 74
  10042. #define MC_CMD_GET_CAPABILITIES_V4_OUT_VFIFO_STUFFING_NUM_CP_BUFFERS_LEN 2
  10043. /* Entry count in the MAC stats array, including the final GENERATION_END
  10044. * entry. For MAC stats DMA, drivers should allocate a buffer large enough to
  10045. * hold at least this many 64-bit stats values, if they wish to receive all
  10046. * available stats. If the buffer is shorter than MAC_STATS_NUM_STATS * 8, the
  10047. * stats array returned will be truncated.
  10048. */
  10049. #define MC_CMD_GET_CAPABILITIES_V4_OUT_MAC_STATS_NUM_STATS_OFST 76
  10050. #define MC_CMD_GET_CAPABILITIES_V4_OUT_MAC_STATS_NUM_STATS_LEN 2
  10051. /***********************************/
  10052. /* MC_CMD_V2_EXTN
  10053. * Encapsulation for a v2 extended command
  10054. */
  10055. #define MC_CMD_V2_EXTN 0x7f
  10056. /* MC_CMD_V2_EXTN_IN msgrequest */
  10057. #define MC_CMD_V2_EXTN_IN_LEN 4
  10058. /* the extended command number */
  10059. #define MC_CMD_V2_EXTN_IN_EXTENDED_CMD_LBN 0
  10060. #define MC_CMD_V2_EXTN_IN_EXTENDED_CMD_WIDTH 15
  10061. #define MC_CMD_V2_EXTN_IN_UNUSED_LBN 15
  10062. #define MC_CMD_V2_EXTN_IN_UNUSED_WIDTH 1
  10063. /* the actual length of the encapsulated command (which is not in the v1
  10064. * header)
  10065. */
  10066. #define MC_CMD_V2_EXTN_IN_ACTUAL_LEN_LBN 16
  10067. #define MC_CMD_V2_EXTN_IN_ACTUAL_LEN_WIDTH 10
  10068. #define MC_CMD_V2_EXTN_IN_UNUSED2_LBN 26
  10069. #define MC_CMD_V2_EXTN_IN_UNUSED2_WIDTH 2
  10070. /* Type of command/response */
  10071. #define MC_CMD_V2_EXTN_IN_MESSAGE_TYPE_LBN 28
  10072. #define MC_CMD_V2_EXTN_IN_MESSAGE_TYPE_WIDTH 4
  10073. /* enum: MCDI command directed to or response originating from the MC. */
  10074. #define MC_CMD_V2_EXTN_IN_MCDI_MESSAGE_TYPE_MC 0x0
  10075. /* enum: MCDI command directed to a TSA controller. MCDI responses of this type
  10076. * are not defined.
  10077. */
  10078. #define MC_CMD_V2_EXTN_IN_MCDI_MESSAGE_TYPE_TSA 0x1
  10079. /***********************************/
  10080. /* MC_CMD_TCM_BUCKET_ALLOC
  10081. * Allocate a pacer bucket (for qau rp or a snapper test)
  10082. */
  10083. #define MC_CMD_TCM_BUCKET_ALLOC 0xb2
  10084. #define MC_CMD_0xb2_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10085. /* MC_CMD_TCM_BUCKET_ALLOC_IN msgrequest */
  10086. #define MC_CMD_TCM_BUCKET_ALLOC_IN_LEN 0
  10087. /* MC_CMD_TCM_BUCKET_ALLOC_OUT msgresponse */
  10088. #define MC_CMD_TCM_BUCKET_ALLOC_OUT_LEN 4
  10089. /* the bucket id */
  10090. #define MC_CMD_TCM_BUCKET_ALLOC_OUT_BUCKET_OFST 0
  10091. #define MC_CMD_TCM_BUCKET_ALLOC_OUT_BUCKET_LEN 4
  10092. /***********************************/
  10093. /* MC_CMD_TCM_BUCKET_FREE
  10094. * Free a pacer bucket
  10095. */
  10096. #define MC_CMD_TCM_BUCKET_FREE 0xb3
  10097. #define MC_CMD_0xb3_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10098. /* MC_CMD_TCM_BUCKET_FREE_IN msgrequest */
  10099. #define MC_CMD_TCM_BUCKET_FREE_IN_LEN 4
  10100. /* the bucket id */
  10101. #define MC_CMD_TCM_BUCKET_FREE_IN_BUCKET_OFST 0
  10102. #define MC_CMD_TCM_BUCKET_FREE_IN_BUCKET_LEN 4
  10103. /* MC_CMD_TCM_BUCKET_FREE_OUT msgresponse */
  10104. #define MC_CMD_TCM_BUCKET_FREE_OUT_LEN 0
  10105. /***********************************/
  10106. /* MC_CMD_TCM_BUCKET_INIT
  10107. * Initialise pacer bucket with a given rate
  10108. */
  10109. #define MC_CMD_TCM_BUCKET_INIT 0xb4
  10110. #define MC_CMD_0xb4_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10111. /* MC_CMD_TCM_BUCKET_INIT_IN msgrequest */
  10112. #define MC_CMD_TCM_BUCKET_INIT_IN_LEN 8
  10113. /* the bucket id */
  10114. #define MC_CMD_TCM_BUCKET_INIT_IN_BUCKET_OFST 0
  10115. #define MC_CMD_TCM_BUCKET_INIT_IN_BUCKET_LEN 4
  10116. /* the rate in mbps */
  10117. #define MC_CMD_TCM_BUCKET_INIT_IN_RATE_OFST 4
  10118. #define MC_CMD_TCM_BUCKET_INIT_IN_RATE_LEN 4
  10119. /* MC_CMD_TCM_BUCKET_INIT_EXT_IN msgrequest */
  10120. #define MC_CMD_TCM_BUCKET_INIT_EXT_IN_LEN 12
  10121. /* the bucket id */
  10122. #define MC_CMD_TCM_BUCKET_INIT_EXT_IN_BUCKET_OFST 0
  10123. #define MC_CMD_TCM_BUCKET_INIT_EXT_IN_BUCKET_LEN 4
  10124. /* the rate in mbps */
  10125. #define MC_CMD_TCM_BUCKET_INIT_EXT_IN_RATE_OFST 4
  10126. #define MC_CMD_TCM_BUCKET_INIT_EXT_IN_RATE_LEN 4
  10127. /* the desired maximum fill level */
  10128. #define MC_CMD_TCM_BUCKET_INIT_EXT_IN_MAX_FILL_OFST 8
  10129. #define MC_CMD_TCM_BUCKET_INIT_EXT_IN_MAX_FILL_LEN 4
  10130. /* MC_CMD_TCM_BUCKET_INIT_OUT msgresponse */
  10131. #define MC_CMD_TCM_BUCKET_INIT_OUT_LEN 0
  10132. /***********************************/
  10133. /* MC_CMD_TCM_TXQ_INIT
  10134. * Initialise txq in pacer with given options or set options
  10135. */
  10136. #define MC_CMD_TCM_TXQ_INIT 0xb5
  10137. #define MC_CMD_0xb5_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10138. /* MC_CMD_TCM_TXQ_INIT_IN msgrequest */
  10139. #define MC_CMD_TCM_TXQ_INIT_IN_LEN 28
  10140. /* the txq id */
  10141. #define MC_CMD_TCM_TXQ_INIT_IN_QID_OFST 0
  10142. #define MC_CMD_TCM_TXQ_INIT_IN_QID_LEN 4
  10143. /* the static priority associated with the txq */
  10144. #define MC_CMD_TCM_TXQ_INIT_IN_LABEL_OFST 4
  10145. #define MC_CMD_TCM_TXQ_INIT_IN_LABEL_LEN 4
  10146. /* bitmask of the priority queues this txq is inserted into when inserted. */
  10147. #define MC_CMD_TCM_TXQ_INIT_IN_PQ_FLAGS_OFST 8
  10148. #define MC_CMD_TCM_TXQ_INIT_IN_PQ_FLAGS_LEN 4
  10149. #define MC_CMD_TCM_TXQ_INIT_IN_PQ_FLAG_GUARANTEED_LBN 0
  10150. #define MC_CMD_TCM_TXQ_INIT_IN_PQ_FLAG_GUARANTEED_WIDTH 1
  10151. #define MC_CMD_TCM_TXQ_INIT_IN_PQ_FLAG_NORMAL_LBN 1
  10152. #define MC_CMD_TCM_TXQ_INIT_IN_PQ_FLAG_NORMAL_WIDTH 1
  10153. #define MC_CMD_TCM_TXQ_INIT_IN_PQ_FLAG_LOW_LBN 2
  10154. #define MC_CMD_TCM_TXQ_INIT_IN_PQ_FLAG_LOW_WIDTH 1
  10155. /* the reaction point (RP) bucket */
  10156. #define MC_CMD_TCM_TXQ_INIT_IN_RP_BKT_OFST 12
  10157. #define MC_CMD_TCM_TXQ_INIT_IN_RP_BKT_LEN 4
  10158. /* an already reserved bucket (typically set to bucket associated with outer
  10159. * vswitch)
  10160. */
  10161. #define MC_CMD_TCM_TXQ_INIT_IN_MAX_BKT1_OFST 16
  10162. #define MC_CMD_TCM_TXQ_INIT_IN_MAX_BKT1_LEN 4
  10163. /* an already reserved bucket (typically set to bucket associated with inner
  10164. * vswitch)
  10165. */
  10166. #define MC_CMD_TCM_TXQ_INIT_IN_MAX_BKT2_OFST 20
  10167. #define MC_CMD_TCM_TXQ_INIT_IN_MAX_BKT2_LEN 4
  10168. /* the min bucket (typically for ETS/minimum bandwidth) */
  10169. #define MC_CMD_TCM_TXQ_INIT_IN_MIN_BKT_OFST 24
  10170. #define MC_CMD_TCM_TXQ_INIT_IN_MIN_BKT_LEN 4
  10171. /* MC_CMD_TCM_TXQ_INIT_EXT_IN msgrequest */
  10172. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_LEN 32
  10173. /* the txq id */
  10174. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_QID_OFST 0
  10175. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_QID_LEN 4
  10176. /* the static priority associated with the txq */
  10177. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_LABEL_NORMAL_OFST 4
  10178. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_LABEL_NORMAL_LEN 4
  10179. /* bitmask of the priority queues this txq is inserted into when inserted. */
  10180. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_PQ_FLAGS_OFST 8
  10181. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_PQ_FLAGS_LEN 4
  10182. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_PQ_FLAG_GUARANTEED_LBN 0
  10183. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_PQ_FLAG_GUARANTEED_WIDTH 1
  10184. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_PQ_FLAG_NORMAL_LBN 1
  10185. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_PQ_FLAG_NORMAL_WIDTH 1
  10186. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_PQ_FLAG_LOW_LBN 2
  10187. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_PQ_FLAG_LOW_WIDTH 1
  10188. /* the reaction point (RP) bucket */
  10189. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_RP_BKT_OFST 12
  10190. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_RP_BKT_LEN 4
  10191. /* an already reserved bucket (typically set to bucket associated with outer
  10192. * vswitch)
  10193. */
  10194. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_MAX_BKT1_OFST 16
  10195. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_MAX_BKT1_LEN 4
  10196. /* an already reserved bucket (typically set to bucket associated with inner
  10197. * vswitch)
  10198. */
  10199. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_MAX_BKT2_OFST 20
  10200. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_MAX_BKT2_LEN 4
  10201. /* the min bucket (typically for ETS/minimum bandwidth) */
  10202. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_MIN_BKT_OFST 24
  10203. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_MIN_BKT_LEN 4
  10204. /* the static priority associated with the txq */
  10205. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_LABEL_GUARANTEED_OFST 28
  10206. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_LABEL_GUARANTEED_LEN 4
  10207. /* MC_CMD_TCM_TXQ_INIT_OUT msgresponse */
  10208. #define MC_CMD_TCM_TXQ_INIT_OUT_LEN 0
  10209. /***********************************/
  10210. /* MC_CMD_LINK_PIOBUF
  10211. * Link a push I/O buffer to a TxQ
  10212. */
  10213. #define MC_CMD_LINK_PIOBUF 0x92
  10214. #define MC_CMD_0x92_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
  10215. /* MC_CMD_LINK_PIOBUF_IN msgrequest */
  10216. #define MC_CMD_LINK_PIOBUF_IN_LEN 8
  10217. /* Handle for allocated push I/O buffer. */
  10218. #define MC_CMD_LINK_PIOBUF_IN_PIOBUF_HANDLE_OFST 0
  10219. #define MC_CMD_LINK_PIOBUF_IN_PIOBUF_HANDLE_LEN 4
  10220. /* Function Local Instance (VI) number. */
  10221. #define MC_CMD_LINK_PIOBUF_IN_TXQ_INSTANCE_OFST 4
  10222. #define MC_CMD_LINK_PIOBUF_IN_TXQ_INSTANCE_LEN 4
  10223. /* MC_CMD_LINK_PIOBUF_OUT msgresponse */
  10224. #define MC_CMD_LINK_PIOBUF_OUT_LEN 0
  10225. /***********************************/
  10226. /* MC_CMD_UNLINK_PIOBUF
  10227. * Unlink a push I/O buffer from a TxQ
  10228. */
  10229. #define MC_CMD_UNLINK_PIOBUF 0x93
  10230. #define MC_CMD_0x93_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
  10231. /* MC_CMD_UNLINK_PIOBUF_IN msgrequest */
  10232. #define MC_CMD_UNLINK_PIOBUF_IN_LEN 4
  10233. /* Function Local Instance (VI) number. */
  10234. #define MC_CMD_UNLINK_PIOBUF_IN_TXQ_INSTANCE_OFST 0
  10235. #define MC_CMD_UNLINK_PIOBUF_IN_TXQ_INSTANCE_LEN 4
  10236. /* MC_CMD_UNLINK_PIOBUF_OUT msgresponse */
  10237. #define MC_CMD_UNLINK_PIOBUF_OUT_LEN 0
  10238. /***********************************/
  10239. /* MC_CMD_VSWITCH_ALLOC
  10240. * allocate and initialise a v-switch.
  10241. */
  10242. #define MC_CMD_VSWITCH_ALLOC 0x94
  10243. #define MC_CMD_0x94_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10244. /* MC_CMD_VSWITCH_ALLOC_IN msgrequest */
  10245. #define MC_CMD_VSWITCH_ALLOC_IN_LEN 16
  10246. /* The port to connect to the v-switch's upstream port. */
  10247. #define MC_CMD_VSWITCH_ALLOC_IN_UPSTREAM_PORT_ID_OFST 0
  10248. #define MC_CMD_VSWITCH_ALLOC_IN_UPSTREAM_PORT_ID_LEN 4
  10249. /* The type of v-switch to create. */
  10250. #define MC_CMD_VSWITCH_ALLOC_IN_TYPE_OFST 4
  10251. #define MC_CMD_VSWITCH_ALLOC_IN_TYPE_LEN 4
  10252. /* enum: VLAN */
  10253. #define MC_CMD_VSWITCH_ALLOC_IN_VSWITCH_TYPE_VLAN 0x1
  10254. /* enum: VEB */
  10255. #define MC_CMD_VSWITCH_ALLOC_IN_VSWITCH_TYPE_VEB 0x2
  10256. /* enum: VEPA (obsolete) */
  10257. #define MC_CMD_VSWITCH_ALLOC_IN_VSWITCH_TYPE_VEPA 0x3
  10258. /* enum: MUX */
  10259. #define MC_CMD_VSWITCH_ALLOC_IN_VSWITCH_TYPE_MUX 0x4
  10260. /* enum: Snapper specific; semantics TBD */
  10261. #define MC_CMD_VSWITCH_ALLOC_IN_VSWITCH_TYPE_TEST 0x5
  10262. /* Flags controlling v-port creation */
  10263. #define MC_CMD_VSWITCH_ALLOC_IN_FLAGS_OFST 8
  10264. #define MC_CMD_VSWITCH_ALLOC_IN_FLAGS_LEN 4
  10265. #define MC_CMD_VSWITCH_ALLOC_IN_FLAG_AUTO_PORT_LBN 0
  10266. #define MC_CMD_VSWITCH_ALLOC_IN_FLAG_AUTO_PORT_WIDTH 1
  10267. /* The number of VLAN tags to allow for attached v-ports. For VLAN aggregators,
  10268. * this must be one or greated, and the attached v-ports must have exactly this
  10269. * number of tags. For other v-switch types, this must be zero of greater, and
  10270. * is an upper limit on the number of VLAN tags for attached v-ports. An error
  10271. * will be returned if existing configuration means we can't support attached
  10272. * v-ports with this number of tags.
  10273. */
  10274. #define MC_CMD_VSWITCH_ALLOC_IN_NUM_VLAN_TAGS_OFST 12
  10275. #define MC_CMD_VSWITCH_ALLOC_IN_NUM_VLAN_TAGS_LEN 4
  10276. /* MC_CMD_VSWITCH_ALLOC_OUT msgresponse */
  10277. #define MC_CMD_VSWITCH_ALLOC_OUT_LEN 0
  10278. /***********************************/
  10279. /* MC_CMD_VSWITCH_FREE
  10280. * de-allocate a v-switch.
  10281. */
  10282. #define MC_CMD_VSWITCH_FREE 0x95
  10283. #define MC_CMD_0x95_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10284. /* MC_CMD_VSWITCH_FREE_IN msgrequest */
  10285. #define MC_CMD_VSWITCH_FREE_IN_LEN 4
  10286. /* The port to which the v-switch is connected. */
  10287. #define MC_CMD_VSWITCH_FREE_IN_UPSTREAM_PORT_ID_OFST 0
  10288. #define MC_CMD_VSWITCH_FREE_IN_UPSTREAM_PORT_ID_LEN 4
  10289. /* MC_CMD_VSWITCH_FREE_OUT msgresponse */
  10290. #define MC_CMD_VSWITCH_FREE_OUT_LEN 0
  10291. /***********************************/
  10292. /* MC_CMD_VSWITCH_QUERY
  10293. * read some config of v-switch. For now this command is an empty placeholder.
  10294. * It may be used to check if a v-switch is connected to a given EVB port (if
  10295. * not, then the command returns ENOENT).
  10296. */
  10297. #define MC_CMD_VSWITCH_QUERY 0x63
  10298. #define MC_CMD_0x63_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10299. /* MC_CMD_VSWITCH_QUERY_IN msgrequest */
  10300. #define MC_CMD_VSWITCH_QUERY_IN_LEN 4
  10301. /* The port to which the v-switch is connected. */
  10302. #define MC_CMD_VSWITCH_QUERY_IN_UPSTREAM_PORT_ID_OFST 0
  10303. #define MC_CMD_VSWITCH_QUERY_IN_UPSTREAM_PORT_ID_LEN 4
  10304. /* MC_CMD_VSWITCH_QUERY_OUT msgresponse */
  10305. #define MC_CMD_VSWITCH_QUERY_OUT_LEN 0
  10306. /***********************************/
  10307. /* MC_CMD_VPORT_ALLOC
  10308. * allocate a v-port.
  10309. */
  10310. #define MC_CMD_VPORT_ALLOC 0x96
  10311. #define MC_CMD_0x96_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10312. /* MC_CMD_VPORT_ALLOC_IN msgrequest */
  10313. #define MC_CMD_VPORT_ALLOC_IN_LEN 20
  10314. /* The port to which the v-switch is connected. */
  10315. #define MC_CMD_VPORT_ALLOC_IN_UPSTREAM_PORT_ID_OFST 0
  10316. #define MC_CMD_VPORT_ALLOC_IN_UPSTREAM_PORT_ID_LEN 4
  10317. /* The type of the new v-port. */
  10318. #define MC_CMD_VPORT_ALLOC_IN_TYPE_OFST 4
  10319. #define MC_CMD_VPORT_ALLOC_IN_TYPE_LEN 4
  10320. /* enum: VLAN (obsolete) */
  10321. #define MC_CMD_VPORT_ALLOC_IN_VPORT_TYPE_VLAN 0x1
  10322. /* enum: VEB (obsolete) */
  10323. #define MC_CMD_VPORT_ALLOC_IN_VPORT_TYPE_VEB 0x2
  10324. /* enum: VEPA (obsolete) */
  10325. #define MC_CMD_VPORT_ALLOC_IN_VPORT_TYPE_VEPA 0x3
  10326. /* enum: A normal v-port receives packets which match a specified MAC and/or
  10327. * VLAN.
  10328. */
  10329. #define MC_CMD_VPORT_ALLOC_IN_VPORT_TYPE_NORMAL 0x4
  10330. /* enum: An expansion v-port packets traffic which don't match any other
  10331. * v-port.
  10332. */
  10333. #define MC_CMD_VPORT_ALLOC_IN_VPORT_TYPE_EXPANSION 0x5
  10334. /* enum: An test v-port receives packets which match any filters installed by
  10335. * its downstream components.
  10336. */
  10337. #define MC_CMD_VPORT_ALLOC_IN_VPORT_TYPE_TEST 0x6
  10338. /* Flags controlling v-port creation */
  10339. #define MC_CMD_VPORT_ALLOC_IN_FLAGS_OFST 8
  10340. #define MC_CMD_VPORT_ALLOC_IN_FLAGS_LEN 4
  10341. #define MC_CMD_VPORT_ALLOC_IN_FLAG_AUTO_PORT_LBN 0
  10342. #define MC_CMD_VPORT_ALLOC_IN_FLAG_AUTO_PORT_WIDTH 1
  10343. #define MC_CMD_VPORT_ALLOC_IN_FLAG_VLAN_RESTRICT_LBN 1
  10344. #define MC_CMD_VPORT_ALLOC_IN_FLAG_VLAN_RESTRICT_WIDTH 1
  10345. /* The number of VLAN tags to insert/remove. An error will be returned if
  10346. * incompatible with the number of VLAN tags specified for the upstream
  10347. * v-switch.
  10348. */
  10349. #define MC_CMD_VPORT_ALLOC_IN_NUM_VLAN_TAGS_OFST 12
  10350. #define MC_CMD_VPORT_ALLOC_IN_NUM_VLAN_TAGS_LEN 4
  10351. /* The actual VLAN tags to insert/remove */
  10352. #define MC_CMD_VPORT_ALLOC_IN_VLAN_TAGS_OFST 16
  10353. #define MC_CMD_VPORT_ALLOC_IN_VLAN_TAGS_LEN 4
  10354. #define MC_CMD_VPORT_ALLOC_IN_VLAN_TAG_0_LBN 0
  10355. #define MC_CMD_VPORT_ALLOC_IN_VLAN_TAG_0_WIDTH 16
  10356. #define MC_CMD_VPORT_ALLOC_IN_VLAN_TAG_1_LBN 16
  10357. #define MC_CMD_VPORT_ALLOC_IN_VLAN_TAG_1_WIDTH 16
  10358. /* MC_CMD_VPORT_ALLOC_OUT msgresponse */
  10359. #define MC_CMD_VPORT_ALLOC_OUT_LEN 4
  10360. /* The handle of the new v-port */
  10361. #define MC_CMD_VPORT_ALLOC_OUT_VPORT_ID_OFST 0
  10362. #define MC_CMD_VPORT_ALLOC_OUT_VPORT_ID_LEN 4
  10363. /***********************************/
  10364. /* MC_CMD_VPORT_FREE
  10365. * de-allocate a v-port.
  10366. */
  10367. #define MC_CMD_VPORT_FREE 0x97
  10368. #define MC_CMD_0x97_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10369. /* MC_CMD_VPORT_FREE_IN msgrequest */
  10370. #define MC_CMD_VPORT_FREE_IN_LEN 4
  10371. /* The handle of the v-port */
  10372. #define MC_CMD_VPORT_FREE_IN_VPORT_ID_OFST 0
  10373. #define MC_CMD_VPORT_FREE_IN_VPORT_ID_LEN 4
  10374. /* MC_CMD_VPORT_FREE_OUT msgresponse */
  10375. #define MC_CMD_VPORT_FREE_OUT_LEN 0
  10376. /***********************************/
  10377. /* MC_CMD_VADAPTOR_ALLOC
  10378. * allocate a v-adaptor.
  10379. */
  10380. #define MC_CMD_VADAPTOR_ALLOC 0x98
  10381. #define MC_CMD_0x98_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10382. /* MC_CMD_VADAPTOR_ALLOC_IN msgrequest */
  10383. #define MC_CMD_VADAPTOR_ALLOC_IN_LEN 30
  10384. /* The port to connect to the v-adaptor's port. */
  10385. #define MC_CMD_VADAPTOR_ALLOC_IN_UPSTREAM_PORT_ID_OFST 0
  10386. #define MC_CMD_VADAPTOR_ALLOC_IN_UPSTREAM_PORT_ID_LEN 4
  10387. /* Flags controlling v-adaptor creation */
  10388. #define MC_CMD_VADAPTOR_ALLOC_IN_FLAGS_OFST 8
  10389. #define MC_CMD_VADAPTOR_ALLOC_IN_FLAGS_LEN 4
  10390. #define MC_CMD_VADAPTOR_ALLOC_IN_FLAG_AUTO_VADAPTOR_LBN 0
  10391. #define MC_CMD_VADAPTOR_ALLOC_IN_FLAG_AUTO_VADAPTOR_WIDTH 1
  10392. #define MC_CMD_VADAPTOR_ALLOC_IN_FLAG_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED_LBN 1
  10393. #define MC_CMD_VADAPTOR_ALLOC_IN_FLAG_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED_WIDTH 1
  10394. /* The number of VLAN tags to strip on receive */
  10395. #define MC_CMD_VADAPTOR_ALLOC_IN_NUM_VLANS_OFST 12
  10396. #define MC_CMD_VADAPTOR_ALLOC_IN_NUM_VLANS_LEN 4
  10397. /* The number of VLAN tags to transparently insert/remove. */
  10398. #define MC_CMD_VADAPTOR_ALLOC_IN_NUM_VLAN_TAGS_OFST 16
  10399. #define MC_CMD_VADAPTOR_ALLOC_IN_NUM_VLAN_TAGS_LEN 4
  10400. /* The actual VLAN tags to insert/remove */
  10401. #define MC_CMD_VADAPTOR_ALLOC_IN_VLAN_TAGS_OFST 20
  10402. #define MC_CMD_VADAPTOR_ALLOC_IN_VLAN_TAGS_LEN 4
  10403. #define MC_CMD_VADAPTOR_ALLOC_IN_VLAN_TAG_0_LBN 0
  10404. #define MC_CMD_VADAPTOR_ALLOC_IN_VLAN_TAG_0_WIDTH 16
  10405. #define MC_CMD_VADAPTOR_ALLOC_IN_VLAN_TAG_1_LBN 16
  10406. #define MC_CMD_VADAPTOR_ALLOC_IN_VLAN_TAG_1_WIDTH 16
  10407. /* The MAC address to assign to this v-adaptor */
  10408. #define MC_CMD_VADAPTOR_ALLOC_IN_MACADDR_OFST 24
  10409. #define MC_CMD_VADAPTOR_ALLOC_IN_MACADDR_LEN 6
  10410. /* enum: Derive the MAC address from the upstream port */
  10411. #define MC_CMD_VADAPTOR_ALLOC_IN_AUTO_MAC 0x0
  10412. /* MC_CMD_VADAPTOR_ALLOC_OUT msgresponse */
  10413. #define MC_CMD_VADAPTOR_ALLOC_OUT_LEN 0
  10414. /***********************************/
  10415. /* MC_CMD_VADAPTOR_FREE
  10416. * de-allocate a v-adaptor.
  10417. */
  10418. #define MC_CMD_VADAPTOR_FREE 0x99
  10419. #define MC_CMD_0x99_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10420. /* MC_CMD_VADAPTOR_FREE_IN msgrequest */
  10421. #define MC_CMD_VADAPTOR_FREE_IN_LEN 4
  10422. /* The port to which the v-adaptor is connected. */
  10423. #define MC_CMD_VADAPTOR_FREE_IN_UPSTREAM_PORT_ID_OFST 0
  10424. #define MC_CMD_VADAPTOR_FREE_IN_UPSTREAM_PORT_ID_LEN 4
  10425. /* MC_CMD_VADAPTOR_FREE_OUT msgresponse */
  10426. #define MC_CMD_VADAPTOR_FREE_OUT_LEN 0
  10427. /***********************************/
  10428. /* MC_CMD_VADAPTOR_SET_MAC
  10429. * assign a new MAC address to a v-adaptor.
  10430. */
  10431. #define MC_CMD_VADAPTOR_SET_MAC 0x5d
  10432. #define MC_CMD_0x5d_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10433. /* MC_CMD_VADAPTOR_SET_MAC_IN msgrequest */
  10434. #define MC_CMD_VADAPTOR_SET_MAC_IN_LEN 10
  10435. /* The port to which the v-adaptor is connected. */
  10436. #define MC_CMD_VADAPTOR_SET_MAC_IN_UPSTREAM_PORT_ID_OFST 0
  10437. #define MC_CMD_VADAPTOR_SET_MAC_IN_UPSTREAM_PORT_ID_LEN 4
  10438. /* The new MAC address to assign to this v-adaptor */
  10439. #define MC_CMD_VADAPTOR_SET_MAC_IN_MACADDR_OFST 4
  10440. #define MC_CMD_VADAPTOR_SET_MAC_IN_MACADDR_LEN 6
  10441. /* MC_CMD_VADAPTOR_SET_MAC_OUT msgresponse */
  10442. #define MC_CMD_VADAPTOR_SET_MAC_OUT_LEN 0
  10443. /***********************************/
  10444. /* MC_CMD_VADAPTOR_GET_MAC
  10445. * read the MAC address assigned to a v-adaptor.
  10446. */
  10447. #define MC_CMD_VADAPTOR_GET_MAC 0x5e
  10448. #define MC_CMD_0x5e_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10449. /* MC_CMD_VADAPTOR_GET_MAC_IN msgrequest */
  10450. #define MC_CMD_VADAPTOR_GET_MAC_IN_LEN 4
  10451. /* The port to which the v-adaptor is connected. */
  10452. #define MC_CMD_VADAPTOR_GET_MAC_IN_UPSTREAM_PORT_ID_OFST 0
  10453. #define MC_CMD_VADAPTOR_GET_MAC_IN_UPSTREAM_PORT_ID_LEN 4
  10454. /* MC_CMD_VADAPTOR_GET_MAC_OUT msgresponse */
  10455. #define MC_CMD_VADAPTOR_GET_MAC_OUT_LEN 6
  10456. /* The MAC address assigned to this v-adaptor */
  10457. #define MC_CMD_VADAPTOR_GET_MAC_OUT_MACADDR_OFST 0
  10458. #define MC_CMD_VADAPTOR_GET_MAC_OUT_MACADDR_LEN 6
  10459. /***********************************/
  10460. /* MC_CMD_VADAPTOR_QUERY
  10461. * read some config of v-adaptor.
  10462. */
  10463. #define MC_CMD_VADAPTOR_QUERY 0x61
  10464. #define MC_CMD_0x61_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10465. /* MC_CMD_VADAPTOR_QUERY_IN msgrequest */
  10466. #define MC_CMD_VADAPTOR_QUERY_IN_LEN 4
  10467. /* The port to which the v-adaptor is connected. */
  10468. #define MC_CMD_VADAPTOR_QUERY_IN_UPSTREAM_PORT_ID_OFST 0
  10469. #define MC_CMD_VADAPTOR_QUERY_IN_UPSTREAM_PORT_ID_LEN 4
  10470. /* MC_CMD_VADAPTOR_QUERY_OUT msgresponse */
  10471. #define MC_CMD_VADAPTOR_QUERY_OUT_LEN 12
  10472. /* The EVB port flags as defined at MC_CMD_VPORT_ALLOC. */
  10473. #define MC_CMD_VADAPTOR_QUERY_OUT_PORT_FLAGS_OFST 0
  10474. #define MC_CMD_VADAPTOR_QUERY_OUT_PORT_FLAGS_LEN 4
  10475. /* The v-adaptor flags as defined at MC_CMD_VADAPTOR_ALLOC. */
  10476. #define MC_CMD_VADAPTOR_QUERY_OUT_VADAPTOR_FLAGS_OFST 4
  10477. #define MC_CMD_VADAPTOR_QUERY_OUT_VADAPTOR_FLAGS_LEN 4
  10478. /* The number of VLAN tags that may still be added */
  10479. #define MC_CMD_VADAPTOR_QUERY_OUT_NUM_AVAILABLE_VLAN_TAGS_OFST 8
  10480. #define MC_CMD_VADAPTOR_QUERY_OUT_NUM_AVAILABLE_VLAN_TAGS_LEN 4
  10481. /***********************************/
  10482. /* MC_CMD_EVB_PORT_ASSIGN
  10483. * assign a port to a PCI function.
  10484. */
  10485. #define MC_CMD_EVB_PORT_ASSIGN 0x9a
  10486. #define MC_CMD_0x9a_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10487. /* MC_CMD_EVB_PORT_ASSIGN_IN msgrequest */
  10488. #define MC_CMD_EVB_PORT_ASSIGN_IN_LEN 8
  10489. /* The port to assign. */
  10490. #define MC_CMD_EVB_PORT_ASSIGN_IN_PORT_ID_OFST 0
  10491. #define MC_CMD_EVB_PORT_ASSIGN_IN_PORT_ID_LEN 4
  10492. /* The target function to modify. */
  10493. #define MC_CMD_EVB_PORT_ASSIGN_IN_FUNCTION_OFST 4
  10494. #define MC_CMD_EVB_PORT_ASSIGN_IN_FUNCTION_LEN 4
  10495. #define MC_CMD_EVB_PORT_ASSIGN_IN_PF_LBN 0
  10496. #define MC_CMD_EVB_PORT_ASSIGN_IN_PF_WIDTH 16
  10497. #define MC_CMD_EVB_PORT_ASSIGN_IN_VF_LBN 16
  10498. #define MC_CMD_EVB_PORT_ASSIGN_IN_VF_WIDTH 16
  10499. /* MC_CMD_EVB_PORT_ASSIGN_OUT msgresponse */
  10500. #define MC_CMD_EVB_PORT_ASSIGN_OUT_LEN 0
  10501. /***********************************/
  10502. /* MC_CMD_RDWR_A64_REGIONS
  10503. * Assign the 64 bit region addresses.
  10504. */
  10505. #define MC_CMD_RDWR_A64_REGIONS 0x9b
  10506. #define MC_CMD_0x9b_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  10507. /* MC_CMD_RDWR_A64_REGIONS_IN msgrequest */
  10508. #define MC_CMD_RDWR_A64_REGIONS_IN_LEN 17
  10509. #define MC_CMD_RDWR_A64_REGIONS_IN_REGION0_OFST 0
  10510. #define MC_CMD_RDWR_A64_REGIONS_IN_REGION0_LEN 4
  10511. #define MC_CMD_RDWR_A64_REGIONS_IN_REGION1_OFST 4
  10512. #define MC_CMD_RDWR_A64_REGIONS_IN_REGION1_LEN 4
  10513. #define MC_CMD_RDWR_A64_REGIONS_IN_REGION2_OFST 8
  10514. #define MC_CMD_RDWR_A64_REGIONS_IN_REGION2_LEN 4
  10515. #define MC_CMD_RDWR_A64_REGIONS_IN_REGION3_OFST 12
  10516. #define MC_CMD_RDWR_A64_REGIONS_IN_REGION3_LEN 4
  10517. /* Write enable bits 0-3, set to write, clear to read. */
  10518. #define MC_CMD_RDWR_A64_REGIONS_IN_WRITE_MASK_LBN 128
  10519. #define MC_CMD_RDWR_A64_REGIONS_IN_WRITE_MASK_WIDTH 4
  10520. #define MC_CMD_RDWR_A64_REGIONS_IN_WRITE_MASK_BYTE_OFST 16
  10521. #define MC_CMD_RDWR_A64_REGIONS_IN_WRITE_MASK_BYTE_LEN 1
  10522. /* MC_CMD_RDWR_A64_REGIONS_OUT msgresponse: This data always included
  10523. * regardless of state of write bits in the request.
  10524. */
  10525. #define MC_CMD_RDWR_A64_REGIONS_OUT_LEN 16
  10526. #define MC_CMD_RDWR_A64_REGIONS_OUT_REGION0_OFST 0
  10527. #define MC_CMD_RDWR_A64_REGIONS_OUT_REGION0_LEN 4
  10528. #define MC_CMD_RDWR_A64_REGIONS_OUT_REGION1_OFST 4
  10529. #define MC_CMD_RDWR_A64_REGIONS_OUT_REGION1_LEN 4
  10530. #define MC_CMD_RDWR_A64_REGIONS_OUT_REGION2_OFST 8
  10531. #define MC_CMD_RDWR_A64_REGIONS_OUT_REGION2_LEN 4
  10532. #define MC_CMD_RDWR_A64_REGIONS_OUT_REGION3_OFST 12
  10533. #define MC_CMD_RDWR_A64_REGIONS_OUT_REGION3_LEN 4
  10534. /***********************************/
  10535. /* MC_CMD_ONLOAD_STACK_ALLOC
  10536. * Allocate an Onload stack ID.
  10537. */
  10538. #define MC_CMD_ONLOAD_STACK_ALLOC 0x9c
  10539. #define MC_CMD_0x9c_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
  10540. /* MC_CMD_ONLOAD_STACK_ALLOC_IN msgrequest */
  10541. #define MC_CMD_ONLOAD_STACK_ALLOC_IN_LEN 4
  10542. /* The handle of the owning upstream port */
  10543. #define MC_CMD_ONLOAD_STACK_ALLOC_IN_UPSTREAM_PORT_ID_OFST 0
  10544. #define MC_CMD_ONLOAD_STACK_ALLOC_IN_UPSTREAM_PORT_ID_LEN 4
  10545. /* MC_CMD_ONLOAD_STACK_ALLOC_OUT msgresponse */
  10546. #define MC_CMD_ONLOAD_STACK_ALLOC_OUT_LEN 4
  10547. /* The handle of the new Onload stack */
  10548. #define MC_CMD_ONLOAD_STACK_ALLOC_OUT_ONLOAD_STACK_ID_OFST 0
  10549. #define MC_CMD_ONLOAD_STACK_ALLOC_OUT_ONLOAD_STACK_ID_LEN 4
  10550. /***********************************/
  10551. /* MC_CMD_ONLOAD_STACK_FREE
  10552. * Free an Onload stack ID.
  10553. */
  10554. #define MC_CMD_ONLOAD_STACK_FREE 0x9d
  10555. #define MC_CMD_0x9d_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
  10556. /* MC_CMD_ONLOAD_STACK_FREE_IN msgrequest */
  10557. #define MC_CMD_ONLOAD_STACK_FREE_IN_LEN 4
  10558. /* The handle of the Onload stack */
  10559. #define MC_CMD_ONLOAD_STACK_FREE_IN_ONLOAD_STACK_ID_OFST 0
  10560. #define MC_CMD_ONLOAD_STACK_FREE_IN_ONLOAD_STACK_ID_LEN 4
  10561. /* MC_CMD_ONLOAD_STACK_FREE_OUT msgresponse */
  10562. #define MC_CMD_ONLOAD_STACK_FREE_OUT_LEN 0
  10563. /***********************************/
  10564. /* MC_CMD_RSS_CONTEXT_ALLOC
  10565. * Allocate an RSS context.
  10566. */
  10567. #define MC_CMD_RSS_CONTEXT_ALLOC 0x9e
  10568. #define MC_CMD_0x9e_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10569. /* MC_CMD_RSS_CONTEXT_ALLOC_IN msgrequest */
  10570. #define MC_CMD_RSS_CONTEXT_ALLOC_IN_LEN 12
  10571. /* The handle of the owning upstream port */
  10572. #define MC_CMD_RSS_CONTEXT_ALLOC_IN_UPSTREAM_PORT_ID_OFST 0
  10573. #define MC_CMD_RSS_CONTEXT_ALLOC_IN_UPSTREAM_PORT_ID_LEN 4
  10574. /* The type of context to allocate */
  10575. #define MC_CMD_RSS_CONTEXT_ALLOC_IN_TYPE_OFST 4
  10576. #define MC_CMD_RSS_CONTEXT_ALLOC_IN_TYPE_LEN 4
  10577. /* enum: Allocate a context for exclusive use. The key and indirection table
  10578. * must be explicitly configured.
  10579. */
  10580. #define MC_CMD_RSS_CONTEXT_ALLOC_IN_TYPE_EXCLUSIVE 0x0
  10581. /* enum: Allocate a context for shared use; this will spread across a range of
  10582. * queues, but the key and indirection table are pre-configured and may not be
  10583. * changed. For this mode, NUM_QUEUES must 2, 4, 8, 16, 32 or 64.
  10584. */
  10585. #define MC_CMD_RSS_CONTEXT_ALLOC_IN_TYPE_SHARED 0x1
  10586. /* Number of queues spanned by this context, in the range 1-64; valid offsets
  10587. * in the indirection table will be in the range 0 to NUM_QUEUES-1.
  10588. */
  10589. #define MC_CMD_RSS_CONTEXT_ALLOC_IN_NUM_QUEUES_OFST 8
  10590. #define MC_CMD_RSS_CONTEXT_ALLOC_IN_NUM_QUEUES_LEN 4
  10591. /* MC_CMD_RSS_CONTEXT_ALLOC_OUT msgresponse */
  10592. #define MC_CMD_RSS_CONTEXT_ALLOC_OUT_LEN 4
  10593. /* The handle of the new RSS context. This should be considered opaque to the
  10594. * host, although a value of 0xFFFFFFFF is guaranteed never to be a valid
  10595. * handle.
  10596. */
  10597. #define MC_CMD_RSS_CONTEXT_ALLOC_OUT_RSS_CONTEXT_ID_OFST 0
  10598. #define MC_CMD_RSS_CONTEXT_ALLOC_OUT_RSS_CONTEXT_ID_LEN 4
  10599. /* enum: guaranteed invalid RSS context handle value */
  10600. #define MC_CMD_RSS_CONTEXT_ALLOC_OUT_RSS_CONTEXT_ID_INVALID 0xffffffff
  10601. /***********************************/
  10602. /* MC_CMD_RSS_CONTEXT_FREE
  10603. * Free an RSS context.
  10604. */
  10605. #define MC_CMD_RSS_CONTEXT_FREE 0x9f
  10606. #define MC_CMD_0x9f_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10607. /* MC_CMD_RSS_CONTEXT_FREE_IN msgrequest */
  10608. #define MC_CMD_RSS_CONTEXT_FREE_IN_LEN 4
  10609. /* The handle of the RSS context */
  10610. #define MC_CMD_RSS_CONTEXT_FREE_IN_RSS_CONTEXT_ID_OFST 0
  10611. #define MC_CMD_RSS_CONTEXT_FREE_IN_RSS_CONTEXT_ID_LEN 4
  10612. /* MC_CMD_RSS_CONTEXT_FREE_OUT msgresponse */
  10613. #define MC_CMD_RSS_CONTEXT_FREE_OUT_LEN 0
  10614. /***********************************/
  10615. /* MC_CMD_RSS_CONTEXT_SET_KEY
  10616. * Set the Toeplitz hash key for an RSS context.
  10617. */
  10618. #define MC_CMD_RSS_CONTEXT_SET_KEY 0xa0
  10619. #define MC_CMD_0xa0_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10620. /* MC_CMD_RSS_CONTEXT_SET_KEY_IN msgrequest */
  10621. #define MC_CMD_RSS_CONTEXT_SET_KEY_IN_LEN 44
  10622. /* The handle of the RSS context */
  10623. #define MC_CMD_RSS_CONTEXT_SET_KEY_IN_RSS_CONTEXT_ID_OFST 0
  10624. #define MC_CMD_RSS_CONTEXT_SET_KEY_IN_RSS_CONTEXT_ID_LEN 4
  10625. /* The 40-byte Toeplitz hash key (TBD endianness issues?) */
  10626. #define MC_CMD_RSS_CONTEXT_SET_KEY_IN_TOEPLITZ_KEY_OFST 4
  10627. #define MC_CMD_RSS_CONTEXT_SET_KEY_IN_TOEPLITZ_KEY_LEN 40
  10628. /* MC_CMD_RSS_CONTEXT_SET_KEY_OUT msgresponse */
  10629. #define MC_CMD_RSS_CONTEXT_SET_KEY_OUT_LEN 0
  10630. /***********************************/
  10631. /* MC_CMD_RSS_CONTEXT_GET_KEY
  10632. * Get the Toeplitz hash key for an RSS context.
  10633. */
  10634. #define MC_CMD_RSS_CONTEXT_GET_KEY 0xa1
  10635. #define MC_CMD_0xa1_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10636. /* MC_CMD_RSS_CONTEXT_GET_KEY_IN msgrequest */
  10637. #define MC_CMD_RSS_CONTEXT_GET_KEY_IN_LEN 4
  10638. /* The handle of the RSS context */
  10639. #define MC_CMD_RSS_CONTEXT_GET_KEY_IN_RSS_CONTEXT_ID_OFST 0
  10640. #define MC_CMD_RSS_CONTEXT_GET_KEY_IN_RSS_CONTEXT_ID_LEN 4
  10641. /* MC_CMD_RSS_CONTEXT_GET_KEY_OUT msgresponse */
  10642. #define MC_CMD_RSS_CONTEXT_GET_KEY_OUT_LEN 44
  10643. /* The 40-byte Toeplitz hash key (TBD endianness issues?) */
  10644. #define MC_CMD_RSS_CONTEXT_GET_KEY_OUT_TOEPLITZ_KEY_OFST 4
  10645. #define MC_CMD_RSS_CONTEXT_GET_KEY_OUT_TOEPLITZ_KEY_LEN 40
  10646. /***********************************/
  10647. /* MC_CMD_RSS_CONTEXT_SET_TABLE
  10648. * Set the indirection table for an RSS context.
  10649. */
  10650. #define MC_CMD_RSS_CONTEXT_SET_TABLE 0xa2
  10651. #define MC_CMD_0xa2_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10652. /* MC_CMD_RSS_CONTEXT_SET_TABLE_IN msgrequest */
  10653. #define MC_CMD_RSS_CONTEXT_SET_TABLE_IN_LEN 132
  10654. /* The handle of the RSS context */
  10655. #define MC_CMD_RSS_CONTEXT_SET_TABLE_IN_RSS_CONTEXT_ID_OFST 0
  10656. #define MC_CMD_RSS_CONTEXT_SET_TABLE_IN_RSS_CONTEXT_ID_LEN 4
  10657. /* The 128-byte indirection table (1 byte per entry) */
  10658. #define MC_CMD_RSS_CONTEXT_SET_TABLE_IN_INDIRECTION_TABLE_OFST 4
  10659. #define MC_CMD_RSS_CONTEXT_SET_TABLE_IN_INDIRECTION_TABLE_LEN 128
  10660. /* MC_CMD_RSS_CONTEXT_SET_TABLE_OUT msgresponse */
  10661. #define MC_CMD_RSS_CONTEXT_SET_TABLE_OUT_LEN 0
  10662. /***********************************/
  10663. /* MC_CMD_RSS_CONTEXT_GET_TABLE
  10664. * Get the indirection table for an RSS context.
  10665. */
  10666. #define MC_CMD_RSS_CONTEXT_GET_TABLE 0xa3
  10667. #define MC_CMD_0xa3_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10668. /* MC_CMD_RSS_CONTEXT_GET_TABLE_IN msgrequest */
  10669. #define MC_CMD_RSS_CONTEXT_GET_TABLE_IN_LEN 4
  10670. /* The handle of the RSS context */
  10671. #define MC_CMD_RSS_CONTEXT_GET_TABLE_IN_RSS_CONTEXT_ID_OFST 0
  10672. #define MC_CMD_RSS_CONTEXT_GET_TABLE_IN_RSS_CONTEXT_ID_LEN 4
  10673. /* MC_CMD_RSS_CONTEXT_GET_TABLE_OUT msgresponse */
  10674. #define MC_CMD_RSS_CONTEXT_GET_TABLE_OUT_LEN 132
  10675. /* The 128-byte indirection table (1 byte per entry) */
  10676. #define MC_CMD_RSS_CONTEXT_GET_TABLE_OUT_INDIRECTION_TABLE_OFST 4
  10677. #define MC_CMD_RSS_CONTEXT_GET_TABLE_OUT_INDIRECTION_TABLE_LEN 128
  10678. /***********************************/
  10679. /* MC_CMD_RSS_CONTEXT_SET_FLAGS
  10680. * Set various control flags for an RSS context.
  10681. */
  10682. #define MC_CMD_RSS_CONTEXT_SET_FLAGS 0xe1
  10683. #define MC_CMD_0xe1_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10684. /* MC_CMD_RSS_CONTEXT_SET_FLAGS_IN msgrequest */
  10685. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_LEN 8
  10686. /* The handle of the RSS context */
  10687. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_RSS_CONTEXT_ID_OFST 0
  10688. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_RSS_CONTEXT_ID_LEN 4
  10689. /* Hash control flags. The _EN bits are always supported, but new modes are
  10690. * available when ADDITIONAL_RSS_MODES is reported by MC_CMD_GET_CAPABILITIES:
  10691. * in this case, the MODE fields may be set to non-zero values, and will take
  10692. * effect regardless of the settings of the _EN flags. See the RSS_MODE
  10693. * structure for the meaning of the mode bits. Drivers must check the
  10694. * capability before trying to set any _MODE fields, as older firmware will
  10695. * reject any attempt to set the FLAGS field to a value > 0xff with EINVAL. In
  10696. * the case where all the _MODE flags are zero, the _EN flags take effect,
  10697. * providing backward compatibility for existing drivers. (Setting all _MODE
  10698. * *and* all _EN flags to zero is valid, to disable RSS spreading for that
  10699. * particular packet type.)
  10700. */
  10701. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_FLAGS_OFST 4
  10702. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_FLAGS_LEN 4
  10703. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV4_EN_LBN 0
  10704. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV4_EN_WIDTH 1
  10705. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_TCPV4_EN_LBN 1
  10706. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_TCPV4_EN_WIDTH 1
  10707. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV6_EN_LBN 2
  10708. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV6_EN_WIDTH 1
  10709. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_TCPV6_EN_LBN 3
  10710. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_TCPV6_EN_WIDTH 1
  10711. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_RESERVED_LBN 4
  10712. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_RESERVED_WIDTH 4
  10713. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TCP_IPV4_RSS_MODE_LBN 8
  10714. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TCP_IPV4_RSS_MODE_WIDTH 4
  10715. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_UDP_IPV4_RSS_MODE_LBN 12
  10716. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_UDP_IPV4_RSS_MODE_WIDTH 4
  10717. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_OTHER_IPV4_RSS_MODE_LBN 16
  10718. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_OTHER_IPV4_RSS_MODE_WIDTH 4
  10719. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TCP_IPV6_RSS_MODE_LBN 20
  10720. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TCP_IPV6_RSS_MODE_WIDTH 4
  10721. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_UDP_IPV6_RSS_MODE_LBN 24
  10722. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_UDP_IPV6_RSS_MODE_WIDTH 4
  10723. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_OTHER_IPV6_RSS_MODE_LBN 28
  10724. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_OTHER_IPV6_RSS_MODE_WIDTH 4
  10725. /* MC_CMD_RSS_CONTEXT_SET_FLAGS_OUT msgresponse */
  10726. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_OUT_LEN 0
  10727. /***********************************/
  10728. /* MC_CMD_RSS_CONTEXT_GET_FLAGS
  10729. * Get various control flags for an RSS context.
  10730. */
  10731. #define MC_CMD_RSS_CONTEXT_GET_FLAGS 0xe2
  10732. #define MC_CMD_0xe2_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10733. /* MC_CMD_RSS_CONTEXT_GET_FLAGS_IN msgrequest */
  10734. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_IN_LEN 4
  10735. /* The handle of the RSS context */
  10736. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_IN_RSS_CONTEXT_ID_OFST 0
  10737. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_IN_RSS_CONTEXT_ID_LEN 4
  10738. /* MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT msgresponse */
  10739. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_LEN 8
  10740. /* Hash control flags. If all _MODE bits are zero (which will always be true
  10741. * for older firmware which does not report the ADDITIONAL_RSS_MODES
  10742. * capability), the _EN bits report the state. If any _MODE bits are non-zero
  10743. * (which will only be true when the firmware reports ADDITIONAL_RSS_MODES)
  10744. * then the _EN bits should be disregarded, although the _MODE flags are
  10745. * guaranteed to be consistent with the _EN flags for a freshly-allocated RSS
  10746. * context and in the case where the _EN flags were used in the SET. This
  10747. * provides backward compatibility: old drivers will not be attempting to
  10748. * derive any meaning from the _MODE bits (and can never set them to any value
  10749. * not representable by the _EN bits); new drivers can always determine the
  10750. * mode by looking only at the _MODE bits; the value returned by a GET can
  10751. * always be used for a SET regardless of old/new driver vs. old/new firmware.
  10752. */
  10753. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_FLAGS_OFST 4
  10754. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_FLAGS_LEN 4
  10755. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TOEPLITZ_IPV4_EN_LBN 0
  10756. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TOEPLITZ_IPV4_EN_WIDTH 1
  10757. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TOEPLITZ_TCPV4_EN_LBN 1
  10758. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TOEPLITZ_TCPV4_EN_WIDTH 1
  10759. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TOEPLITZ_IPV6_EN_LBN 2
  10760. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TOEPLITZ_IPV6_EN_WIDTH 1
  10761. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TOEPLITZ_TCPV6_EN_LBN 3
  10762. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TOEPLITZ_TCPV6_EN_WIDTH 1
  10763. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_RESERVED_LBN 4
  10764. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_RESERVED_WIDTH 4
  10765. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TCP_IPV4_RSS_MODE_LBN 8
  10766. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TCP_IPV4_RSS_MODE_WIDTH 4
  10767. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_UDP_IPV4_RSS_MODE_LBN 12
  10768. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_UDP_IPV4_RSS_MODE_WIDTH 4
  10769. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_OTHER_IPV4_RSS_MODE_LBN 16
  10770. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_OTHER_IPV4_RSS_MODE_WIDTH 4
  10771. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TCP_IPV6_RSS_MODE_LBN 20
  10772. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TCP_IPV6_RSS_MODE_WIDTH 4
  10773. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_UDP_IPV6_RSS_MODE_LBN 24
  10774. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_UDP_IPV6_RSS_MODE_WIDTH 4
  10775. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_OTHER_IPV6_RSS_MODE_LBN 28
  10776. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_OTHER_IPV6_RSS_MODE_WIDTH 4
  10777. /***********************************/
  10778. /* MC_CMD_DOT1P_MAPPING_ALLOC
  10779. * Allocate a .1p mapping.
  10780. */
  10781. #define MC_CMD_DOT1P_MAPPING_ALLOC 0xa4
  10782. #define MC_CMD_0xa4_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  10783. /* MC_CMD_DOT1P_MAPPING_ALLOC_IN msgrequest */
  10784. #define MC_CMD_DOT1P_MAPPING_ALLOC_IN_LEN 8
  10785. /* The handle of the owning upstream port */
  10786. #define MC_CMD_DOT1P_MAPPING_ALLOC_IN_UPSTREAM_PORT_ID_OFST 0
  10787. #define MC_CMD_DOT1P_MAPPING_ALLOC_IN_UPSTREAM_PORT_ID_LEN 4
  10788. /* Number of queues spanned by this mapping, in the range 1-64; valid fixed
  10789. * offsets in the mapping table will be in the range 0 to NUM_QUEUES-1, and
  10790. * referenced RSS contexts must span no more than this number.
  10791. */
  10792. #define MC_CMD_DOT1P_MAPPING_ALLOC_IN_NUM_QUEUES_OFST 4
  10793. #define MC_CMD_DOT1P_MAPPING_ALLOC_IN_NUM_QUEUES_LEN 4
  10794. /* MC_CMD_DOT1P_MAPPING_ALLOC_OUT msgresponse */
  10795. #define MC_CMD_DOT1P_MAPPING_ALLOC_OUT_LEN 4
  10796. /* The handle of the new .1p mapping. This should be considered opaque to the
  10797. * host, although a value of 0xFFFFFFFF is guaranteed never to be a valid
  10798. * handle.
  10799. */
  10800. #define MC_CMD_DOT1P_MAPPING_ALLOC_OUT_DOT1P_MAPPING_ID_OFST 0
  10801. #define MC_CMD_DOT1P_MAPPING_ALLOC_OUT_DOT1P_MAPPING_ID_LEN 4
  10802. /* enum: guaranteed invalid .1p mapping handle value */
  10803. #define MC_CMD_DOT1P_MAPPING_ALLOC_OUT_DOT1P_MAPPING_ID_INVALID 0xffffffff
  10804. /***********************************/
  10805. /* MC_CMD_DOT1P_MAPPING_FREE
  10806. * Free a .1p mapping.
  10807. */
  10808. #define MC_CMD_DOT1P_MAPPING_FREE 0xa5
  10809. #define MC_CMD_0xa5_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  10810. /* MC_CMD_DOT1P_MAPPING_FREE_IN msgrequest */
  10811. #define MC_CMD_DOT1P_MAPPING_FREE_IN_LEN 4
  10812. /* The handle of the .1p mapping */
  10813. #define MC_CMD_DOT1P_MAPPING_FREE_IN_DOT1P_MAPPING_ID_OFST 0
  10814. #define MC_CMD_DOT1P_MAPPING_FREE_IN_DOT1P_MAPPING_ID_LEN 4
  10815. /* MC_CMD_DOT1P_MAPPING_FREE_OUT msgresponse */
  10816. #define MC_CMD_DOT1P_MAPPING_FREE_OUT_LEN 0
  10817. /***********************************/
  10818. /* MC_CMD_DOT1P_MAPPING_SET_TABLE
  10819. * Set the mapping table for a .1p mapping.
  10820. */
  10821. #define MC_CMD_DOT1P_MAPPING_SET_TABLE 0xa6
  10822. #define MC_CMD_0xa6_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  10823. /* MC_CMD_DOT1P_MAPPING_SET_TABLE_IN msgrequest */
  10824. #define MC_CMD_DOT1P_MAPPING_SET_TABLE_IN_LEN 36
  10825. /* The handle of the .1p mapping */
  10826. #define MC_CMD_DOT1P_MAPPING_SET_TABLE_IN_DOT1P_MAPPING_ID_OFST 0
  10827. #define MC_CMD_DOT1P_MAPPING_SET_TABLE_IN_DOT1P_MAPPING_ID_LEN 4
  10828. /* Per-priority mappings (1 32-bit word per entry - an offset or RSS context
  10829. * handle)
  10830. */
  10831. #define MC_CMD_DOT1P_MAPPING_SET_TABLE_IN_MAPPING_TABLE_OFST 4
  10832. #define MC_CMD_DOT1P_MAPPING_SET_TABLE_IN_MAPPING_TABLE_LEN 32
  10833. /* MC_CMD_DOT1P_MAPPING_SET_TABLE_OUT msgresponse */
  10834. #define MC_CMD_DOT1P_MAPPING_SET_TABLE_OUT_LEN 0
  10835. /***********************************/
  10836. /* MC_CMD_DOT1P_MAPPING_GET_TABLE
  10837. * Get the mapping table for a .1p mapping.
  10838. */
  10839. #define MC_CMD_DOT1P_MAPPING_GET_TABLE 0xa7
  10840. #define MC_CMD_0xa7_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  10841. /* MC_CMD_DOT1P_MAPPING_GET_TABLE_IN msgrequest */
  10842. #define MC_CMD_DOT1P_MAPPING_GET_TABLE_IN_LEN 4
  10843. /* The handle of the .1p mapping */
  10844. #define MC_CMD_DOT1P_MAPPING_GET_TABLE_IN_DOT1P_MAPPING_ID_OFST 0
  10845. #define MC_CMD_DOT1P_MAPPING_GET_TABLE_IN_DOT1P_MAPPING_ID_LEN 4
  10846. /* MC_CMD_DOT1P_MAPPING_GET_TABLE_OUT msgresponse */
  10847. #define MC_CMD_DOT1P_MAPPING_GET_TABLE_OUT_LEN 36
  10848. /* Per-priority mappings (1 32-bit word per entry - an offset or RSS context
  10849. * handle)
  10850. */
  10851. #define MC_CMD_DOT1P_MAPPING_GET_TABLE_OUT_MAPPING_TABLE_OFST 4
  10852. #define MC_CMD_DOT1P_MAPPING_GET_TABLE_OUT_MAPPING_TABLE_LEN 32
  10853. /***********************************/
  10854. /* MC_CMD_GET_VECTOR_CFG
  10855. * Get Interrupt Vector config for this PF.
  10856. */
  10857. #define MC_CMD_GET_VECTOR_CFG 0xbf
  10858. #define MC_CMD_0xbf_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10859. /* MC_CMD_GET_VECTOR_CFG_IN msgrequest */
  10860. #define MC_CMD_GET_VECTOR_CFG_IN_LEN 0
  10861. /* MC_CMD_GET_VECTOR_CFG_OUT msgresponse */
  10862. #define MC_CMD_GET_VECTOR_CFG_OUT_LEN 12
  10863. /* Base absolute interrupt vector number. */
  10864. #define MC_CMD_GET_VECTOR_CFG_OUT_VEC_BASE_OFST 0
  10865. #define MC_CMD_GET_VECTOR_CFG_OUT_VEC_BASE_LEN 4
  10866. /* Number of interrupt vectors allocate to this PF. */
  10867. #define MC_CMD_GET_VECTOR_CFG_OUT_VECS_PER_PF_OFST 4
  10868. #define MC_CMD_GET_VECTOR_CFG_OUT_VECS_PER_PF_LEN 4
  10869. /* Number of interrupt vectors to allocate per VF. */
  10870. #define MC_CMD_GET_VECTOR_CFG_OUT_VECS_PER_VF_OFST 8
  10871. #define MC_CMD_GET_VECTOR_CFG_OUT_VECS_PER_VF_LEN 4
  10872. /***********************************/
  10873. /* MC_CMD_SET_VECTOR_CFG
  10874. * Set Interrupt Vector config for this PF.
  10875. */
  10876. #define MC_CMD_SET_VECTOR_CFG 0xc0
  10877. #define MC_CMD_0xc0_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10878. /* MC_CMD_SET_VECTOR_CFG_IN msgrequest */
  10879. #define MC_CMD_SET_VECTOR_CFG_IN_LEN 12
  10880. /* Base absolute interrupt vector number, or MC_CMD_RESOURCE_INSTANCE_ANY to
  10881. * let the system find a suitable base.
  10882. */
  10883. #define MC_CMD_SET_VECTOR_CFG_IN_VEC_BASE_OFST 0
  10884. #define MC_CMD_SET_VECTOR_CFG_IN_VEC_BASE_LEN 4
  10885. /* Number of interrupt vectors allocate to this PF. */
  10886. #define MC_CMD_SET_VECTOR_CFG_IN_VECS_PER_PF_OFST 4
  10887. #define MC_CMD_SET_VECTOR_CFG_IN_VECS_PER_PF_LEN 4
  10888. /* Number of interrupt vectors to allocate per VF. */
  10889. #define MC_CMD_SET_VECTOR_CFG_IN_VECS_PER_VF_OFST 8
  10890. #define MC_CMD_SET_VECTOR_CFG_IN_VECS_PER_VF_LEN 4
  10891. /* MC_CMD_SET_VECTOR_CFG_OUT msgresponse */
  10892. #define MC_CMD_SET_VECTOR_CFG_OUT_LEN 0
  10893. /***********************************/
  10894. /* MC_CMD_VPORT_ADD_MAC_ADDRESS
  10895. * Add a MAC address to a v-port
  10896. */
  10897. #define MC_CMD_VPORT_ADD_MAC_ADDRESS 0xa8
  10898. #define MC_CMD_0xa8_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10899. /* MC_CMD_VPORT_ADD_MAC_ADDRESS_IN msgrequest */
  10900. #define MC_CMD_VPORT_ADD_MAC_ADDRESS_IN_LEN 10
  10901. /* The handle of the v-port */
  10902. #define MC_CMD_VPORT_ADD_MAC_ADDRESS_IN_VPORT_ID_OFST 0
  10903. #define MC_CMD_VPORT_ADD_MAC_ADDRESS_IN_VPORT_ID_LEN 4
  10904. /* MAC address to add */
  10905. #define MC_CMD_VPORT_ADD_MAC_ADDRESS_IN_MACADDR_OFST 4
  10906. #define MC_CMD_VPORT_ADD_MAC_ADDRESS_IN_MACADDR_LEN 6
  10907. /* MC_CMD_VPORT_ADD_MAC_ADDRESS_OUT msgresponse */
  10908. #define MC_CMD_VPORT_ADD_MAC_ADDRESS_OUT_LEN 0
  10909. /***********************************/
  10910. /* MC_CMD_VPORT_DEL_MAC_ADDRESS
  10911. * Delete a MAC address from a v-port
  10912. */
  10913. #define MC_CMD_VPORT_DEL_MAC_ADDRESS 0xa9
  10914. #define MC_CMD_0xa9_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10915. /* MC_CMD_VPORT_DEL_MAC_ADDRESS_IN msgrequest */
  10916. #define MC_CMD_VPORT_DEL_MAC_ADDRESS_IN_LEN 10
  10917. /* The handle of the v-port */
  10918. #define MC_CMD_VPORT_DEL_MAC_ADDRESS_IN_VPORT_ID_OFST 0
  10919. #define MC_CMD_VPORT_DEL_MAC_ADDRESS_IN_VPORT_ID_LEN 4
  10920. /* MAC address to add */
  10921. #define MC_CMD_VPORT_DEL_MAC_ADDRESS_IN_MACADDR_OFST 4
  10922. #define MC_CMD_VPORT_DEL_MAC_ADDRESS_IN_MACADDR_LEN 6
  10923. /* MC_CMD_VPORT_DEL_MAC_ADDRESS_OUT msgresponse */
  10924. #define MC_CMD_VPORT_DEL_MAC_ADDRESS_OUT_LEN 0
  10925. /***********************************/
  10926. /* MC_CMD_VPORT_GET_MAC_ADDRESSES
  10927. * Delete a MAC address from a v-port
  10928. */
  10929. #define MC_CMD_VPORT_GET_MAC_ADDRESSES 0xaa
  10930. #define MC_CMD_0xaa_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10931. /* MC_CMD_VPORT_GET_MAC_ADDRESSES_IN msgrequest */
  10932. #define MC_CMD_VPORT_GET_MAC_ADDRESSES_IN_LEN 4
  10933. /* The handle of the v-port */
  10934. #define MC_CMD_VPORT_GET_MAC_ADDRESSES_IN_VPORT_ID_OFST 0
  10935. #define MC_CMD_VPORT_GET_MAC_ADDRESSES_IN_VPORT_ID_LEN 4
  10936. /* MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT msgresponse */
  10937. #define MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_LENMIN 4
  10938. #define MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_LENMAX 250
  10939. #define MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_LEN(num) (4+6*(num))
  10940. /* The number of MAC addresses returned */
  10941. #define MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_MACADDR_COUNT_OFST 0
  10942. #define MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_MACADDR_COUNT_LEN 4
  10943. /* Array of MAC addresses */
  10944. #define MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_MACADDR_OFST 4
  10945. #define MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_MACADDR_LEN 6
  10946. #define MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_MACADDR_MINNUM 0
  10947. #define MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_MACADDR_MAXNUM 41
  10948. /***********************************/
  10949. /* MC_CMD_VPORT_RECONFIGURE
  10950. * Replace VLAN tags and/or MAC addresses of an existing v-port. If the v-port
  10951. * has already been passed to another function (v-port's user), then that
  10952. * function will be reset before applying the changes.
  10953. */
  10954. #define MC_CMD_VPORT_RECONFIGURE 0xeb
  10955. #define MC_CMD_0xeb_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10956. /* MC_CMD_VPORT_RECONFIGURE_IN msgrequest */
  10957. #define MC_CMD_VPORT_RECONFIGURE_IN_LEN 44
  10958. /* The handle of the v-port */
  10959. #define MC_CMD_VPORT_RECONFIGURE_IN_VPORT_ID_OFST 0
  10960. #define MC_CMD_VPORT_RECONFIGURE_IN_VPORT_ID_LEN 4
  10961. /* Flags requesting what should be changed. */
  10962. #define MC_CMD_VPORT_RECONFIGURE_IN_FLAGS_OFST 4
  10963. #define MC_CMD_VPORT_RECONFIGURE_IN_FLAGS_LEN 4
  10964. #define MC_CMD_VPORT_RECONFIGURE_IN_REPLACE_VLAN_TAGS_LBN 0
  10965. #define MC_CMD_VPORT_RECONFIGURE_IN_REPLACE_VLAN_TAGS_WIDTH 1
  10966. #define MC_CMD_VPORT_RECONFIGURE_IN_REPLACE_MACADDRS_LBN 1
  10967. #define MC_CMD_VPORT_RECONFIGURE_IN_REPLACE_MACADDRS_WIDTH 1
  10968. /* The number of VLAN tags to insert/remove. An error will be returned if
  10969. * incompatible with the number of VLAN tags specified for the upstream
  10970. * v-switch.
  10971. */
  10972. #define MC_CMD_VPORT_RECONFIGURE_IN_NUM_VLAN_TAGS_OFST 8
  10973. #define MC_CMD_VPORT_RECONFIGURE_IN_NUM_VLAN_TAGS_LEN 4
  10974. /* The actual VLAN tags to insert/remove */
  10975. #define MC_CMD_VPORT_RECONFIGURE_IN_VLAN_TAGS_OFST 12
  10976. #define MC_CMD_VPORT_RECONFIGURE_IN_VLAN_TAGS_LEN 4
  10977. #define MC_CMD_VPORT_RECONFIGURE_IN_VLAN_TAG_0_LBN 0
  10978. #define MC_CMD_VPORT_RECONFIGURE_IN_VLAN_TAG_0_WIDTH 16
  10979. #define MC_CMD_VPORT_RECONFIGURE_IN_VLAN_TAG_1_LBN 16
  10980. #define MC_CMD_VPORT_RECONFIGURE_IN_VLAN_TAG_1_WIDTH 16
  10981. /* The number of MAC addresses to add */
  10982. #define MC_CMD_VPORT_RECONFIGURE_IN_NUM_MACADDRS_OFST 16
  10983. #define MC_CMD_VPORT_RECONFIGURE_IN_NUM_MACADDRS_LEN 4
  10984. /* MAC addresses to add */
  10985. #define MC_CMD_VPORT_RECONFIGURE_IN_MACADDRS_OFST 20
  10986. #define MC_CMD_VPORT_RECONFIGURE_IN_MACADDRS_LEN 6
  10987. #define MC_CMD_VPORT_RECONFIGURE_IN_MACADDRS_NUM 4
  10988. /* MC_CMD_VPORT_RECONFIGURE_OUT msgresponse */
  10989. #define MC_CMD_VPORT_RECONFIGURE_OUT_LEN 4
  10990. #define MC_CMD_VPORT_RECONFIGURE_OUT_FLAGS_OFST 0
  10991. #define MC_CMD_VPORT_RECONFIGURE_OUT_FLAGS_LEN 4
  10992. #define MC_CMD_VPORT_RECONFIGURE_OUT_RESET_DONE_LBN 0
  10993. #define MC_CMD_VPORT_RECONFIGURE_OUT_RESET_DONE_WIDTH 1
  10994. /***********************************/
  10995. /* MC_CMD_EVB_PORT_QUERY
  10996. * read some config of v-port.
  10997. */
  10998. #define MC_CMD_EVB_PORT_QUERY 0x62
  10999. #define MC_CMD_0x62_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  11000. /* MC_CMD_EVB_PORT_QUERY_IN msgrequest */
  11001. #define MC_CMD_EVB_PORT_QUERY_IN_LEN 4
  11002. /* The handle of the v-port */
  11003. #define MC_CMD_EVB_PORT_QUERY_IN_PORT_ID_OFST 0
  11004. #define MC_CMD_EVB_PORT_QUERY_IN_PORT_ID_LEN 4
  11005. /* MC_CMD_EVB_PORT_QUERY_OUT msgresponse */
  11006. #define MC_CMD_EVB_PORT_QUERY_OUT_LEN 8
  11007. /* The EVB port flags as defined at MC_CMD_VPORT_ALLOC. */
  11008. #define MC_CMD_EVB_PORT_QUERY_OUT_PORT_FLAGS_OFST 0
  11009. #define MC_CMD_EVB_PORT_QUERY_OUT_PORT_FLAGS_LEN 4
  11010. /* The number of VLAN tags that may be used on a v-adaptor connected to this
  11011. * EVB port.
  11012. */
  11013. #define MC_CMD_EVB_PORT_QUERY_OUT_NUM_AVAILABLE_VLAN_TAGS_OFST 4
  11014. #define MC_CMD_EVB_PORT_QUERY_OUT_NUM_AVAILABLE_VLAN_TAGS_LEN 4
  11015. /***********************************/
  11016. /* MC_CMD_DUMP_BUFTBL_ENTRIES
  11017. * Dump buffer table entries, mainly for command client debug use. Dumps
  11018. * absolute entries, and does not use chunk handles. All entries must be in
  11019. * range, and used for q page mapping, Although the latter restriction may be
  11020. * lifted in future.
  11021. */
  11022. #define MC_CMD_DUMP_BUFTBL_ENTRIES 0xab
  11023. #define MC_CMD_0xab_PRIVILEGE_CTG SRIOV_CTG_INSECURE
  11024. /* MC_CMD_DUMP_BUFTBL_ENTRIES_IN msgrequest */
  11025. #define MC_CMD_DUMP_BUFTBL_ENTRIES_IN_LEN 8
  11026. /* Index of the first buffer table entry. */
  11027. #define MC_CMD_DUMP_BUFTBL_ENTRIES_IN_FIRSTID_OFST 0
  11028. #define MC_CMD_DUMP_BUFTBL_ENTRIES_IN_FIRSTID_LEN 4
  11029. /* Number of buffer table entries to dump. */
  11030. #define MC_CMD_DUMP_BUFTBL_ENTRIES_IN_NUMENTRIES_OFST 4
  11031. #define MC_CMD_DUMP_BUFTBL_ENTRIES_IN_NUMENTRIES_LEN 4
  11032. /* MC_CMD_DUMP_BUFTBL_ENTRIES_OUT msgresponse */
  11033. #define MC_CMD_DUMP_BUFTBL_ENTRIES_OUT_LENMIN 12
  11034. #define MC_CMD_DUMP_BUFTBL_ENTRIES_OUT_LENMAX 252
  11035. #define MC_CMD_DUMP_BUFTBL_ENTRIES_OUT_LEN(num) (0+12*(num))
  11036. /* Raw buffer table entries, layed out as BUFTBL_ENTRY. */
  11037. #define MC_CMD_DUMP_BUFTBL_ENTRIES_OUT_ENTRY_OFST 0
  11038. #define MC_CMD_DUMP_BUFTBL_ENTRIES_OUT_ENTRY_LEN 12
  11039. #define MC_CMD_DUMP_BUFTBL_ENTRIES_OUT_ENTRY_MINNUM 1
  11040. #define MC_CMD_DUMP_BUFTBL_ENTRIES_OUT_ENTRY_MAXNUM 21
  11041. /***********************************/
  11042. /* MC_CMD_SET_RXDP_CONFIG
  11043. * Set global RXDP configuration settings
  11044. */
  11045. #define MC_CMD_SET_RXDP_CONFIG 0xc1
  11046. #define MC_CMD_0xc1_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  11047. /* MC_CMD_SET_RXDP_CONFIG_IN msgrequest */
  11048. #define MC_CMD_SET_RXDP_CONFIG_IN_LEN 4
  11049. #define MC_CMD_SET_RXDP_CONFIG_IN_DATA_OFST 0
  11050. #define MC_CMD_SET_RXDP_CONFIG_IN_DATA_LEN 4
  11051. #define MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_DMA_LBN 0
  11052. #define MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_DMA_WIDTH 1
  11053. #define MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_LEN_LBN 1
  11054. #define MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_LEN_WIDTH 2
  11055. /* enum: pad to 64 bytes */
  11056. #define MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_64 0x0
  11057. /* enum: pad to 128 bytes (Medford only) */
  11058. #define MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_128 0x1
  11059. /* enum: pad to 256 bytes (Medford only) */
  11060. #define MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_256 0x2
  11061. /* MC_CMD_SET_RXDP_CONFIG_OUT msgresponse */
  11062. #define MC_CMD_SET_RXDP_CONFIG_OUT_LEN 0
  11063. /***********************************/
  11064. /* MC_CMD_GET_RXDP_CONFIG
  11065. * Get global RXDP configuration settings
  11066. */
  11067. #define MC_CMD_GET_RXDP_CONFIG 0xc2
  11068. #define MC_CMD_0xc2_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  11069. /* MC_CMD_GET_RXDP_CONFIG_IN msgrequest */
  11070. #define MC_CMD_GET_RXDP_CONFIG_IN_LEN 0
  11071. /* MC_CMD_GET_RXDP_CONFIG_OUT msgresponse */
  11072. #define MC_CMD_GET_RXDP_CONFIG_OUT_LEN 4
  11073. #define MC_CMD_GET_RXDP_CONFIG_OUT_DATA_OFST 0
  11074. #define MC_CMD_GET_RXDP_CONFIG_OUT_DATA_LEN 4
  11075. #define MC_CMD_GET_RXDP_CONFIG_OUT_PAD_HOST_DMA_LBN 0
  11076. #define MC_CMD_GET_RXDP_CONFIG_OUT_PAD_HOST_DMA_WIDTH 1
  11077. #define MC_CMD_GET_RXDP_CONFIG_OUT_PAD_HOST_LEN_LBN 1
  11078. #define MC_CMD_GET_RXDP_CONFIG_OUT_PAD_HOST_LEN_WIDTH 2
  11079. /* Enum values, see field(s): */
  11080. /* MC_CMD_SET_RXDP_CONFIG/MC_CMD_SET_RXDP_CONFIG_IN/PAD_HOST_LEN */
  11081. /***********************************/
  11082. /* MC_CMD_GET_CLOCK
  11083. * Return the system and PDCPU clock frequencies.
  11084. */
  11085. #define MC_CMD_GET_CLOCK 0xac
  11086. #define MC_CMD_0xac_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  11087. /* MC_CMD_GET_CLOCK_IN msgrequest */
  11088. #define MC_CMD_GET_CLOCK_IN_LEN 0
  11089. /* MC_CMD_GET_CLOCK_OUT msgresponse */
  11090. #define MC_CMD_GET_CLOCK_OUT_LEN 8
  11091. /* System frequency, MHz */
  11092. #define MC_CMD_GET_CLOCK_OUT_SYS_FREQ_OFST 0
  11093. #define MC_CMD_GET_CLOCK_OUT_SYS_FREQ_LEN 4
  11094. /* DPCPU frequency, MHz */
  11095. #define MC_CMD_GET_CLOCK_OUT_DPCPU_FREQ_OFST 4
  11096. #define MC_CMD_GET_CLOCK_OUT_DPCPU_FREQ_LEN 4
  11097. /***********************************/
  11098. /* MC_CMD_SET_CLOCK
  11099. * Control the system and DPCPU clock frequencies. Changes are lost reboot.
  11100. */
  11101. #define MC_CMD_SET_CLOCK 0xad
  11102. #define MC_CMD_0xad_PRIVILEGE_CTG SRIOV_CTG_INSECURE
  11103. /* MC_CMD_SET_CLOCK_IN msgrequest */
  11104. #define MC_CMD_SET_CLOCK_IN_LEN 28
  11105. /* Requested frequency in MHz for system clock domain */
  11106. #define MC_CMD_SET_CLOCK_IN_SYS_FREQ_OFST 0
  11107. #define MC_CMD_SET_CLOCK_IN_SYS_FREQ_LEN 4
  11108. /* enum: Leave the system clock domain frequency unchanged */
  11109. #define MC_CMD_SET_CLOCK_IN_SYS_DOMAIN_DONT_CHANGE 0x0
  11110. /* Requested frequency in MHz for inter-core clock domain */
  11111. #define MC_CMD_SET_CLOCK_IN_ICORE_FREQ_OFST 4
  11112. #define MC_CMD_SET_CLOCK_IN_ICORE_FREQ_LEN 4
  11113. /* enum: Leave the inter-core clock domain frequency unchanged */
  11114. #define MC_CMD_SET_CLOCK_IN_ICORE_DOMAIN_DONT_CHANGE 0x0
  11115. /* Requested frequency in MHz for DPCPU clock domain */
  11116. #define MC_CMD_SET_CLOCK_IN_DPCPU_FREQ_OFST 8
  11117. #define MC_CMD_SET_CLOCK_IN_DPCPU_FREQ_LEN 4
  11118. /* enum: Leave the DPCPU clock domain frequency unchanged */
  11119. #define MC_CMD_SET_CLOCK_IN_DPCPU_DOMAIN_DONT_CHANGE 0x0
  11120. /* Requested frequency in MHz for PCS clock domain */
  11121. #define MC_CMD_SET_CLOCK_IN_PCS_FREQ_OFST 12
  11122. #define MC_CMD_SET_CLOCK_IN_PCS_FREQ_LEN 4
  11123. /* enum: Leave the PCS clock domain frequency unchanged */
  11124. #define MC_CMD_SET_CLOCK_IN_PCS_DOMAIN_DONT_CHANGE 0x0
  11125. /* Requested frequency in MHz for MC clock domain */
  11126. #define MC_CMD_SET_CLOCK_IN_MC_FREQ_OFST 16
  11127. #define MC_CMD_SET_CLOCK_IN_MC_FREQ_LEN 4
  11128. /* enum: Leave the MC clock domain frequency unchanged */
  11129. #define MC_CMD_SET_CLOCK_IN_MC_DOMAIN_DONT_CHANGE 0x0
  11130. /* Requested frequency in MHz for rmon clock domain */
  11131. #define MC_CMD_SET_CLOCK_IN_RMON_FREQ_OFST 20
  11132. #define MC_CMD_SET_CLOCK_IN_RMON_FREQ_LEN 4
  11133. /* enum: Leave the rmon clock domain frequency unchanged */
  11134. #define MC_CMD_SET_CLOCK_IN_RMON_DOMAIN_DONT_CHANGE 0x0
  11135. /* Requested frequency in MHz for vswitch clock domain */
  11136. #define MC_CMD_SET_CLOCK_IN_VSWITCH_FREQ_OFST 24
  11137. #define MC_CMD_SET_CLOCK_IN_VSWITCH_FREQ_LEN 4
  11138. /* enum: Leave the vswitch clock domain frequency unchanged */
  11139. #define MC_CMD_SET_CLOCK_IN_VSWITCH_DOMAIN_DONT_CHANGE 0x0
  11140. /* MC_CMD_SET_CLOCK_OUT msgresponse */
  11141. #define MC_CMD_SET_CLOCK_OUT_LEN 28
  11142. /* Resulting system frequency in MHz */
  11143. #define MC_CMD_SET_CLOCK_OUT_SYS_FREQ_OFST 0
  11144. #define MC_CMD_SET_CLOCK_OUT_SYS_FREQ_LEN 4
  11145. /* enum: The system clock domain doesn't exist */
  11146. #define MC_CMD_SET_CLOCK_OUT_SYS_DOMAIN_UNSUPPORTED 0x0
  11147. /* Resulting inter-core frequency in MHz */
  11148. #define MC_CMD_SET_CLOCK_OUT_ICORE_FREQ_OFST 4
  11149. #define MC_CMD_SET_CLOCK_OUT_ICORE_FREQ_LEN 4
  11150. /* enum: The inter-core clock domain doesn't exist / isn't used */
  11151. #define MC_CMD_SET_CLOCK_OUT_ICORE_DOMAIN_UNSUPPORTED 0x0
  11152. /* Resulting DPCPU frequency in MHz */
  11153. #define MC_CMD_SET_CLOCK_OUT_DPCPU_FREQ_OFST 8
  11154. #define MC_CMD_SET_CLOCK_OUT_DPCPU_FREQ_LEN 4
  11155. /* enum: The dpcpu clock domain doesn't exist */
  11156. #define MC_CMD_SET_CLOCK_OUT_DPCPU_DOMAIN_UNSUPPORTED 0x0
  11157. /* Resulting PCS frequency in MHz */
  11158. #define MC_CMD_SET_CLOCK_OUT_PCS_FREQ_OFST 12
  11159. #define MC_CMD_SET_CLOCK_OUT_PCS_FREQ_LEN 4
  11160. /* enum: The PCS clock domain doesn't exist / isn't controlled */
  11161. #define MC_CMD_SET_CLOCK_OUT_PCS_DOMAIN_UNSUPPORTED 0x0
  11162. /* Resulting MC frequency in MHz */
  11163. #define MC_CMD_SET_CLOCK_OUT_MC_FREQ_OFST 16
  11164. #define MC_CMD_SET_CLOCK_OUT_MC_FREQ_LEN 4
  11165. /* enum: The MC clock domain doesn't exist / isn't controlled */
  11166. #define MC_CMD_SET_CLOCK_OUT_MC_DOMAIN_UNSUPPORTED 0x0
  11167. /* Resulting rmon frequency in MHz */
  11168. #define MC_CMD_SET_CLOCK_OUT_RMON_FREQ_OFST 20
  11169. #define MC_CMD_SET_CLOCK_OUT_RMON_FREQ_LEN 4
  11170. /* enum: The rmon clock domain doesn't exist / isn't controlled */
  11171. #define MC_CMD_SET_CLOCK_OUT_RMON_DOMAIN_UNSUPPORTED 0x0
  11172. /* Resulting vswitch frequency in MHz */
  11173. #define MC_CMD_SET_CLOCK_OUT_VSWITCH_FREQ_OFST 24
  11174. #define MC_CMD_SET_CLOCK_OUT_VSWITCH_FREQ_LEN 4
  11175. /* enum: The vswitch clock domain doesn't exist / isn't controlled */
  11176. #define MC_CMD_SET_CLOCK_OUT_VSWITCH_DOMAIN_UNSUPPORTED 0x0
  11177. /***********************************/
  11178. /* MC_CMD_DPCPU_RPC
  11179. * Send an arbitrary DPCPU message.
  11180. */
  11181. #define MC_CMD_DPCPU_RPC 0xae
  11182. #define MC_CMD_0xae_PRIVILEGE_CTG SRIOV_CTG_INSECURE
  11183. /* MC_CMD_DPCPU_RPC_IN msgrequest */
  11184. #define MC_CMD_DPCPU_RPC_IN_LEN 36
  11185. #define MC_CMD_DPCPU_RPC_IN_CPU_OFST 0
  11186. #define MC_CMD_DPCPU_RPC_IN_CPU_LEN 4
  11187. /* enum: RxDPCPU0 */
  11188. #define MC_CMD_DPCPU_RPC_IN_DPCPU_RX0 0x0
  11189. /* enum: TxDPCPU0 */
  11190. #define MC_CMD_DPCPU_RPC_IN_DPCPU_TX0 0x1
  11191. /* enum: TxDPCPU1 */
  11192. #define MC_CMD_DPCPU_RPC_IN_DPCPU_TX1 0x2
  11193. /* enum: RxDPCPU1 (Medford only) */
  11194. #define MC_CMD_DPCPU_RPC_IN_DPCPU_RX1 0x3
  11195. /* enum: RxDPCPU (will be for the calling function; for now, just an alias of
  11196. * DPCPU_RX0)
  11197. */
  11198. #define MC_CMD_DPCPU_RPC_IN_DPCPU_RX 0x80
  11199. /* enum: TxDPCPU (will be for the calling function; for now, just an alias of
  11200. * DPCPU_TX0)
  11201. */
  11202. #define MC_CMD_DPCPU_RPC_IN_DPCPU_TX 0x81
  11203. /* First 8 bits [39:32] of DATA are consumed by MC-DPCPU protocol and must be
  11204. * initialised to zero
  11205. */
  11206. #define MC_CMD_DPCPU_RPC_IN_DATA_OFST 4
  11207. #define MC_CMD_DPCPU_RPC_IN_DATA_LEN 32
  11208. #define MC_CMD_DPCPU_RPC_IN_HDR_CMD_CMDNUM_LBN 8
  11209. #define MC_CMD_DPCPU_RPC_IN_HDR_CMD_CMDNUM_WIDTH 8
  11210. #define MC_CMD_DPCPU_RPC_IN_CMDNUM_TXDPCPU_READ 0x6 /* enum */
  11211. #define MC_CMD_DPCPU_RPC_IN_CMDNUM_TXDPCPU_WRITE 0x7 /* enum */
  11212. #define MC_CMD_DPCPU_RPC_IN_CMDNUM_TXDPCPU_SELF_TEST 0xc /* enum */
  11213. #define MC_CMD_DPCPU_RPC_IN_CMDNUM_TXDPCPU_CSR_ACCESS 0xe /* enum */
  11214. #define MC_CMD_DPCPU_RPC_IN_CMDNUM_RXDPCPU_READ 0x46 /* enum */
  11215. #define MC_CMD_DPCPU_RPC_IN_CMDNUM_RXDPCPU_WRITE 0x47 /* enum */
  11216. #define MC_CMD_DPCPU_RPC_IN_CMDNUM_RXDPCPU_SELF_TEST 0x4a /* enum */
  11217. #define MC_CMD_DPCPU_RPC_IN_CMDNUM_RXDPCPU_CSR_ACCESS 0x4c /* enum */
  11218. #define MC_CMD_DPCPU_RPC_IN_CMDNUM_RXDPCPU_SET_MC_REPLAY_CNTXT 0x4d /* enum */
  11219. #define MC_CMD_DPCPU_RPC_IN_HDR_CMD_REQ_OBJID_LBN 16
  11220. #define MC_CMD_DPCPU_RPC_IN_HDR_CMD_REQ_OBJID_WIDTH 16
  11221. #define MC_CMD_DPCPU_RPC_IN_HDR_CMD_REQ_ADDR_LBN 16
  11222. #define MC_CMD_DPCPU_RPC_IN_HDR_CMD_REQ_ADDR_WIDTH 16
  11223. #define MC_CMD_DPCPU_RPC_IN_HDR_CMD_REQ_COUNT_LBN 48
  11224. #define MC_CMD_DPCPU_RPC_IN_HDR_CMD_REQ_COUNT_WIDTH 16
  11225. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_INFO_LBN 16
  11226. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_INFO_WIDTH 240
  11227. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_CMD_LBN 16
  11228. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_CMD_WIDTH 16
  11229. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_CMD_STOP_RETURN_RESULT 0x0 /* enum */
  11230. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_CMD_START_READ 0x1 /* enum */
  11231. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_CMD_START_WRITE 0x2 /* enum */
  11232. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_CMD_START_WRITE_READ 0x3 /* enum */
  11233. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_CMD_START_PIPELINED_READ 0x4 /* enum */
  11234. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_START_DELAY_LBN 48
  11235. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_START_DELAY_WIDTH 16
  11236. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_RPT_COUNT_LBN 64
  11237. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_RPT_COUNT_WIDTH 16
  11238. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_GAP_DELAY_LBN 80
  11239. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_GAP_DELAY_WIDTH 16
  11240. #define MC_CMD_DPCPU_RPC_IN_MC_REPLAY_MODE_LBN 16
  11241. #define MC_CMD_DPCPU_RPC_IN_MC_REPLAY_MODE_WIDTH 16
  11242. #define MC_CMD_DPCPU_RPC_IN_MC_REPLAY_MODE_CUT_THROUGH 0x1 /* enum */
  11243. #define MC_CMD_DPCPU_RPC_IN_MC_REPLAY_MODE_STORE_FORWARD 0x2 /* enum */
  11244. #define MC_CMD_DPCPU_RPC_IN_MC_REPLAY_MODE_STORE_FORWARD_FIRST 0x3 /* enum */
  11245. #define MC_CMD_DPCPU_RPC_IN_MC_REPLAY_CNTXT_LBN 64
  11246. #define MC_CMD_DPCPU_RPC_IN_MC_REPLAY_CNTXT_WIDTH 16
  11247. #define MC_CMD_DPCPU_RPC_IN_WDATA_OFST 12
  11248. #define MC_CMD_DPCPU_RPC_IN_WDATA_LEN 24
  11249. /* Register data to write. Only valid in write/write-read. */
  11250. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_DATA_OFST 16
  11251. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_DATA_LEN 4
  11252. /* Register address. */
  11253. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_ADDRESS_OFST 20
  11254. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_ADDRESS_LEN 4
  11255. /* MC_CMD_DPCPU_RPC_OUT msgresponse */
  11256. #define MC_CMD_DPCPU_RPC_OUT_LEN 36
  11257. #define MC_CMD_DPCPU_RPC_OUT_RC_OFST 0
  11258. #define MC_CMD_DPCPU_RPC_OUT_RC_LEN 4
  11259. /* DATA */
  11260. #define MC_CMD_DPCPU_RPC_OUT_DATA_OFST 4
  11261. #define MC_CMD_DPCPU_RPC_OUT_DATA_LEN 32
  11262. #define MC_CMD_DPCPU_RPC_OUT_HDR_CMD_RESP_ERRCODE_LBN 32
  11263. #define MC_CMD_DPCPU_RPC_OUT_HDR_CMD_RESP_ERRCODE_WIDTH 16
  11264. #define MC_CMD_DPCPU_RPC_OUT_CSR_ACCESS_READ_COUNT_LBN 48
  11265. #define MC_CMD_DPCPU_RPC_OUT_CSR_ACCESS_READ_COUNT_WIDTH 16
  11266. #define MC_CMD_DPCPU_RPC_OUT_RDATA_OFST 12
  11267. #define MC_CMD_DPCPU_RPC_OUT_RDATA_LEN 24
  11268. #define MC_CMD_DPCPU_RPC_OUT_CSR_ACCESS_READ_VAL_1_OFST 12
  11269. #define MC_CMD_DPCPU_RPC_OUT_CSR_ACCESS_READ_VAL_1_LEN 4
  11270. #define MC_CMD_DPCPU_RPC_OUT_CSR_ACCESS_READ_VAL_2_OFST 16
  11271. #define MC_CMD_DPCPU_RPC_OUT_CSR_ACCESS_READ_VAL_2_LEN 4
  11272. #define MC_CMD_DPCPU_RPC_OUT_CSR_ACCESS_READ_VAL_3_OFST 20
  11273. #define MC_CMD_DPCPU_RPC_OUT_CSR_ACCESS_READ_VAL_3_LEN 4
  11274. #define MC_CMD_DPCPU_RPC_OUT_CSR_ACCESS_READ_VAL_4_OFST 24
  11275. #define MC_CMD_DPCPU_RPC_OUT_CSR_ACCESS_READ_VAL_4_LEN 4
  11276. /***********************************/
  11277. /* MC_CMD_TRIGGER_INTERRUPT
  11278. * Trigger an interrupt by prodding the BIU.
  11279. */
  11280. #define MC_CMD_TRIGGER_INTERRUPT 0xe3
  11281. #define MC_CMD_0xe3_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  11282. /* MC_CMD_TRIGGER_INTERRUPT_IN msgrequest */
  11283. #define MC_CMD_TRIGGER_INTERRUPT_IN_LEN 4
  11284. /* Interrupt level relative to base for function. */
  11285. #define MC_CMD_TRIGGER_INTERRUPT_IN_INTR_LEVEL_OFST 0
  11286. #define MC_CMD_TRIGGER_INTERRUPT_IN_INTR_LEVEL_LEN 4
  11287. /* MC_CMD_TRIGGER_INTERRUPT_OUT msgresponse */
  11288. #define MC_CMD_TRIGGER_INTERRUPT_OUT_LEN 0
  11289. /***********************************/
  11290. /* MC_CMD_SHMBOOT_OP
  11291. * Special operations to support (for now) shmboot.
  11292. */
  11293. #define MC_CMD_SHMBOOT_OP 0xe6
  11294. #define MC_CMD_0xe6_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  11295. /* MC_CMD_SHMBOOT_OP_IN msgrequest */
  11296. #define MC_CMD_SHMBOOT_OP_IN_LEN 4
  11297. /* Identifies the operation to perform */
  11298. #define MC_CMD_SHMBOOT_OP_IN_SHMBOOT_OP_OFST 0
  11299. #define MC_CMD_SHMBOOT_OP_IN_SHMBOOT_OP_LEN 4
  11300. /* enum: Copy slave_data section to the slave core. (Greenport only) */
  11301. #define MC_CMD_SHMBOOT_OP_IN_PUSH_SLAVE_DATA 0x0
  11302. /* MC_CMD_SHMBOOT_OP_OUT msgresponse */
  11303. #define MC_CMD_SHMBOOT_OP_OUT_LEN 0
  11304. /***********************************/
  11305. /* MC_CMD_CAP_BLK_READ
  11306. * Read multiple 64bit words from capture block memory
  11307. */
  11308. #define MC_CMD_CAP_BLK_READ 0xe7
  11309. #define MC_CMD_0xe7_PRIVILEGE_CTG SRIOV_CTG_INSECURE
  11310. /* MC_CMD_CAP_BLK_READ_IN msgrequest */
  11311. #define MC_CMD_CAP_BLK_READ_IN_LEN 12
  11312. #define MC_CMD_CAP_BLK_READ_IN_CAP_REG_OFST 0
  11313. #define MC_CMD_CAP_BLK_READ_IN_CAP_REG_LEN 4
  11314. #define MC_CMD_CAP_BLK_READ_IN_ADDR_OFST 4
  11315. #define MC_CMD_CAP_BLK_READ_IN_ADDR_LEN 4
  11316. #define MC_CMD_CAP_BLK_READ_IN_COUNT_OFST 8
  11317. #define MC_CMD_CAP_BLK_READ_IN_COUNT_LEN 4
  11318. /* MC_CMD_CAP_BLK_READ_OUT msgresponse */
  11319. #define MC_CMD_CAP_BLK_READ_OUT_LENMIN 8
  11320. #define MC_CMD_CAP_BLK_READ_OUT_LENMAX 248
  11321. #define MC_CMD_CAP_BLK_READ_OUT_LEN(num) (0+8*(num))
  11322. #define MC_CMD_CAP_BLK_READ_OUT_BUFFER_OFST 0
  11323. #define MC_CMD_CAP_BLK_READ_OUT_BUFFER_LEN 8
  11324. #define MC_CMD_CAP_BLK_READ_OUT_BUFFER_LO_OFST 0
  11325. #define MC_CMD_CAP_BLK_READ_OUT_BUFFER_HI_OFST 4
  11326. #define MC_CMD_CAP_BLK_READ_OUT_BUFFER_MINNUM 1
  11327. #define MC_CMD_CAP_BLK_READ_OUT_BUFFER_MAXNUM 31
  11328. /***********************************/
  11329. /* MC_CMD_DUMP_DO
  11330. * Take a dump of the DUT state
  11331. */
  11332. #define MC_CMD_DUMP_DO 0xe8
  11333. #define MC_CMD_0xe8_PRIVILEGE_CTG SRIOV_CTG_INSECURE
  11334. /* MC_CMD_DUMP_DO_IN msgrequest */
  11335. #define MC_CMD_DUMP_DO_IN_LEN 52
  11336. #define MC_CMD_DUMP_DO_IN_PADDING_OFST 0
  11337. #define MC_CMD_DUMP_DO_IN_PADDING_LEN 4
  11338. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_OFST 4
  11339. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_LEN 4
  11340. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM 0x0 /* enum */
  11341. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_DEFAULT 0x1 /* enum */
  11342. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_TYPE_OFST 8
  11343. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_TYPE_LEN 4
  11344. #define MC_CMD_DUMP_DO_IN_DUMP_LOCATION_NVRAM 0x1 /* enum */
  11345. #define MC_CMD_DUMP_DO_IN_DUMP_LOCATION_HOST_MEMORY 0x2 /* enum */
  11346. #define MC_CMD_DUMP_DO_IN_DUMP_LOCATION_HOST_MEMORY_MLI 0x3 /* enum */
  11347. #define MC_CMD_DUMP_DO_IN_DUMP_LOCATION_UART 0x4 /* enum */
  11348. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_NVRAM_PARTITION_TYPE_ID_OFST 12
  11349. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_NVRAM_PARTITION_TYPE_ID_LEN 4
  11350. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_NVRAM_OFFSET_OFST 16
  11351. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_NVRAM_OFFSET_LEN 4
  11352. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_ADDR_LO_OFST 12
  11353. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_ADDR_LO_LEN 4
  11354. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_ADDR_HI_OFST 16
  11355. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_ADDR_HI_LEN 4
  11356. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_LO_OFST 12
  11357. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_LO_LEN 4
  11358. #define MC_CMD_DUMP_DO_IN_HOST_MEMORY_MLI_PAGE_SIZE 0x1000 /* enum */
  11359. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_HI_OFST 16
  11360. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_HI_LEN 4
  11361. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_MLI_DEPTH_OFST 20
  11362. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_MLI_DEPTH_LEN 4
  11363. #define MC_CMD_DUMP_DO_IN_HOST_MEMORY_MLI_MAX_DEPTH 0x2 /* enum */
  11364. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_UART_PORT_OFST 12
  11365. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_UART_PORT_LEN 4
  11366. /* enum: The uart port this command was received over (if using a uart
  11367. * transport)
  11368. */
  11369. #define MC_CMD_DUMP_DO_IN_UART_PORT_SRC 0xff
  11370. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_SIZE_OFST 24
  11371. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_SIZE_LEN 4
  11372. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_OFST 28
  11373. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_LEN 4
  11374. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM 0x0 /* enum */
  11375. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_NVRAM_DUMP_PARTITION 0x1 /* enum */
  11376. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_TYPE_OFST 32
  11377. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_TYPE_LEN 4
  11378. /* Enum values, see field(s): */
  11379. /* MC_CMD_DUMP_DO_IN/DUMPSPEC_SRC_CUSTOM_TYPE */
  11380. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_NVRAM_PARTITION_TYPE_ID_OFST 36
  11381. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_NVRAM_PARTITION_TYPE_ID_LEN 4
  11382. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_NVRAM_OFFSET_OFST 40
  11383. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_NVRAM_OFFSET_LEN 4
  11384. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_ADDR_LO_OFST 36
  11385. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_ADDR_LO_LEN 4
  11386. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_ADDR_HI_OFST 40
  11387. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_ADDR_HI_LEN 4
  11388. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_LO_OFST 36
  11389. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_LO_LEN 4
  11390. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_HI_OFST 40
  11391. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_HI_LEN 4
  11392. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_MLI_DEPTH_OFST 44
  11393. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_MLI_DEPTH_LEN 4
  11394. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_UART_PORT_OFST 36
  11395. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_UART_PORT_LEN 4
  11396. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_SIZE_OFST 48
  11397. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_SIZE_LEN 4
  11398. /* MC_CMD_DUMP_DO_OUT msgresponse */
  11399. #define MC_CMD_DUMP_DO_OUT_LEN 4
  11400. #define MC_CMD_DUMP_DO_OUT_DUMPFILE_SIZE_OFST 0
  11401. #define MC_CMD_DUMP_DO_OUT_DUMPFILE_SIZE_LEN 4
  11402. /***********************************/
  11403. /* MC_CMD_DUMP_CONFIGURE_UNSOLICITED
  11404. * Configure unsolicited dumps
  11405. */
  11406. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED 0xe9
  11407. #define MC_CMD_0xe9_PRIVILEGE_CTG SRIOV_CTG_INSECURE
  11408. /* MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN msgrequest */
  11409. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_LEN 52
  11410. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_ENABLE_OFST 0
  11411. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_ENABLE_LEN 4
  11412. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_OFST 4
  11413. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_LEN 4
  11414. /* Enum values, see field(s): */
  11415. /* MC_CMD_DUMP_DO/MC_CMD_DUMP_DO_IN/DUMPSPEC_SRC */
  11416. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_TYPE_OFST 8
  11417. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_TYPE_LEN 4
  11418. /* Enum values, see field(s): */
  11419. /* MC_CMD_DUMP_DO/MC_CMD_DUMP_DO_IN/DUMPSPEC_SRC_CUSTOM_TYPE */
  11420. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_NVRAM_PARTITION_TYPE_ID_OFST 12
  11421. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_NVRAM_PARTITION_TYPE_ID_LEN 4
  11422. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_NVRAM_OFFSET_OFST 16
  11423. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_NVRAM_OFFSET_LEN 4
  11424. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_ADDR_LO_OFST 12
  11425. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_ADDR_LO_LEN 4
  11426. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_ADDR_HI_OFST 16
  11427. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_ADDR_HI_LEN 4
  11428. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_LO_OFST 12
  11429. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_LO_LEN 4
  11430. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_HI_OFST 16
  11431. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_HI_LEN 4
  11432. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_MLI_DEPTH_OFST 20
  11433. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_MLI_DEPTH_LEN 4
  11434. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_UART_PORT_OFST 12
  11435. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_UART_PORT_LEN 4
  11436. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_SIZE_OFST 24
  11437. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_SIZE_LEN 4
  11438. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_OFST 28
  11439. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_LEN 4
  11440. /* Enum values, see field(s): */
  11441. /* MC_CMD_DUMP_DO/MC_CMD_DUMP_DO_IN/DUMPFILE_DST */
  11442. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_TYPE_OFST 32
  11443. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_TYPE_LEN 4
  11444. /* Enum values, see field(s): */
  11445. /* MC_CMD_DUMP_DO/MC_CMD_DUMP_DO_IN/DUMPSPEC_SRC_CUSTOM_TYPE */
  11446. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_NVRAM_PARTITION_TYPE_ID_OFST 36
  11447. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_NVRAM_PARTITION_TYPE_ID_LEN 4
  11448. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_NVRAM_OFFSET_OFST 40
  11449. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_NVRAM_OFFSET_LEN 4
  11450. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_ADDR_LO_OFST 36
  11451. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_ADDR_LO_LEN 4
  11452. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_ADDR_HI_OFST 40
  11453. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_ADDR_HI_LEN 4
  11454. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_LO_OFST 36
  11455. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_LO_LEN 4
  11456. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_HI_OFST 40
  11457. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_HI_LEN 4
  11458. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_MLI_DEPTH_OFST 44
  11459. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_MLI_DEPTH_LEN 4
  11460. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_UART_PORT_OFST 36
  11461. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_UART_PORT_LEN 4
  11462. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_SIZE_OFST 48
  11463. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_SIZE_LEN 4
  11464. /***********************************/
  11465. /* MC_CMD_SET_PSU
  11466. * Adjusts power supply parameters. This is a warranty-voiding operation.
  11467. * Returns: ENOENT if the parameter or rail specified does not exist, EINVAL if
  11468. * the parameter is out of range.
  11469. */
  11470. #define MC_CMD_SET_PSU 0xea
  11471. #define MC_CMD_0xea_PRIVILEGE_CTG SRIOV_CTG_INSECURE
  11472. /* MC_CMD_SET_PSU_IN msgrequest */
  11473. #define MC_CMD_SET_PSU_IN_LEN 12
  11474. #define MC_CMD_SET_PSU_IN_PARAM_OFST 0
  11475. #define MC_CMD_SET_PSU_IN_PARAM_LEN 4
  11476. #define MC_CMD_SET_PSU_IN_PARAM_SUPPLY_VOLTAGE 0x0 /* enum */
  11477. #define MC_CMD_SET_PSU_IN_RAIL_OFST 4
  11478. #define MC_CMD_SET_PSU_IN_RAIL_LEN 4
  11479. #define MC_CMD_SET_PSU_IN_RAIL_0V9 0x0 /* enum */
  11480. #define MC_CMD_SET_PSU_IN_RAIL_1V2 0x1 /* enum */
  11481. /* desired value, eg voltage in mV */
  11482. #define MC_CMD_SET_PSU_IN_VALUE_OFST 8
  11483. #define MC_CMD_SET_PSU_IN_VALUE_LEN 4
  11484. /* MC_CMD_SET_PSU_OUT msgresponse */
  11485. #define MC_CMD_SET_PSU_OUT_LEN 0
  11486. /***********************************/
  11487. /* MC_CMD_GET_FUNCTION_INFO
  11488. * Get function information. PF and VF number.
  11489. */
  11490. #define MC_CMD_GET_FUNCTION_INFO 0xec
  11491. #define MC_CMD_0xec_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  11492. /* MC_CMD_GET_FUNCTION_INFO_IN msgrequest */
  11493. #define MC_CMD_GET_FUNCTION_INFO_IN_LEN 0
  11494. /* MC_CMD_GET_FUNCTION_INFO_OUT msgresponse */
  11495. #define MC_CMD_GET_FUNCTION_INFO_OUT_LEN 8
  11496. #define MC_CMD_GET_FUNCTION_INFO_OUT_PF_OFST 0
  11497. #define MC_CMD_GET_FUNCTION_INFO_OUT_PF_LEN 4
  11498. #define MC_CMD_GET_FUNCTION_INFO_OUT_VF_OFST 4
  11499. #define MC_CMD_GET_FUNCTION_INFO_OUT_VF_LEN 4
  11500. /***********************************/
  11501. /* MC_CMD_ENABLE_OFFLINE_BIST
  11502. * Enters offline BIST mode. All queues are torn down, chip enters quiescent
  11503. * mode, calling function gets exclusive MCDI ownership. The only way out is
  11504. * reboot.
  11505. */
  11506. #define MC_CMD_ENABLE_OFFLINE_BIST 0xed
  11507. #define MC_CMD_0xed_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  11508. /* MC_CMD_ENABLE_OFFLINE_BIST_IN msgrequest */
  11509. #define MC_CMD_ENABLE_OFFLINE_BIST_IN_LEN 0
  11510. /* MC_CMD_ENABLE_OFFLINE_BIST_OUT msgresponse */
  11511. #define MC_CMD_ENABLE_OFFLINE_BIST_OUT_LEN 0
  11512. /***********************************/
  11513. /* MC_CMD_UART_SEND_DATA
  11514. * Send checksummed[sic] block of data over the uart. Response is a placeholder
  11515. * should we wish to make this reliable; currently requests are fire-and-
  11516. * forget.
  11517. */
  11518. #define MC_CMD_UART_SEND_DATA 0xee
  11519. #define MC_CMD_0xee_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  11520. /* MC_CMD_UART_SEND_DATA_OUT msgrequest */
  11521. #define MC_CMD_UART_SEND_DATA_OUT_LENMIN 16
  11522. #define MC_CMD_UART_SEND_DATA_OUT_LENMAX 252
  11523. #define MC_CMD_UART_SEND_DATA_OUT_LEN(num) (16+1*(num))
  11524. /* CRC32 over OFFSET, LENGTH, RESERVED, DATA */
  11525. #define MC_CMD_UART_SEND_DATA_OUT_CHECKSUM_OFST 0
  11526. #define MC_CMD_UART_SEND_DATA_OUT_CHECKSUM_LEN 4
  11527. /* Offset at which to write the data */
  11528. #define MC_CMD_UART_SEND_DATA_OUT_OFFSET_OFST 4
  11529. #define MC_CMD_UART_SEND_DATA_OUT_OFFSET_LEN 4
  11530. /* Length of data */
  11531. #define MC_CMD_UART_SEND_DATA_OUT_LENGTH_OFST 8
  11532. #define MC_CMD_UART_SEND_DATA_OUT_LENGTH_LEN 4
  11533. /* Reserved for future use */
  11534. #define MC_CMD_UART_SEND_DATA_OUT_RESERVED_OFST 12
  11535. #define MC_CMD_UART_SEND_DATA_OUT_RESERVED_LEN 4
  11536. #define MC_CMD_UART_SEND_DATA_OUT_DATA_OFST 16
  11537. #define MC_CMD_UART_SEND_DATA_OUT_DATA_LEN 1
  11538. #define MC_CMD_UART_SEND_DATA_OUT_DATA_MINNUM 0
  11539. #define MC_CMD_UART_SEND_DATA_OUT_DATA_MAXNUM 236
  11540. /* MC_CMD_UART_SEND_DATA_IN msgresponse */
  11541. #define MC_CMD_UART_SEND_DATA_IN_LEN 0
  11542. /***********************************/
  11543. /* MC_CMD_UART_RECV_DATA
  11544. * Request checksummed[sic] block of data over the uart. Only a placeholder,
  11545. * subject to change and not currently implemented.
  11546. */
  11547. #define MC_CMD_UART_RECV_DATA 0xef
  11548. #define MC_CMD_0xef_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  11549. /* MC_CMD_UART_RECV_DATA_OUT msgrequest */
  11550. #define MC_CMD_UART_RECV_DATA_OUT_LEN 16
  11551. /* CRC32 over OFFSET, LENGTH, RESERVED */
  11552. #define MC_CMD_UART_RECV_DATA_OUT_CHECKSUM_OFST 0
  11553. #define MC_CMD_UART_RECV_DATA_OUT_CHECKSUM_LEN 4
  11554. /* Offset from which to read the data */
  11555. #define MC_CMD_UART_RECV_DATA_OUT_OFFSET_OFST 4
  11556. #define MC_CMD_UART_RECV_DATA_OUT_OFFSET_LEN 4
  11557. /* Length of data */
  11558. #define MC_CMD_UART_RECV_DATA_OUT_LENGTH_OFST 8
  11559. #define MC_CMD_UART_RECV_DATA_OUT_LENGTH_LEN 4
  11560. /* Reserved for future use */
  11561. #define MC_CMD_UART_RECV_DATA_OUT_RESERVED_OFST 12
  11562. #define MC_CMD_UART_RECV_DATA_OUT_RESERVED_LEN 4
  11563. /* MC_CMD_UART_RECV_DATA_IN msgresponse */
  11564. #define MC_CMD_UART_RECV_DATA_IN_LENMIN 16
  11565. #define MC_CMD_UART_RECV_DATA_IN_LENMAX 252
  11566. #define MC_CMD_UART_RECV_DATA_IN_LEN(num) (16+1*(num))
  11567. /* CRC32 over RESERVED1, RESERVED2, RESERVED3, DATA */
  11568. #define MC_CMD_UART_RECV_DATA_IN_CHECKSUM_OFST 0
  11569. #define MC_CMD_UART_RECV_DATA_IN_CHECKSUM_LEN 4
  11570. /* Offset at which to write the data */
  11571. #define MC_CMD_UART_RECV_DATA_IN_RESERVED1_OFST 4
  11572. #define MC_CMD_UART_RECV_DATA_IN_RESERVED1_LEN 4
  11573. /* Length of data */
  11574. #define MC_CMD_UART_RECV_DATA_IN_RESERVED2_OFST 8
  11575. #define MC_CMD_UART_RECV_DATA_IN_RESERVED2_LEN 4
  11576. /* Reserved for future use */
  11577. #define MC_CMD_UART_RECV_DATA_IN_RESERVED3_OFST 12
  11578. #define MC_CMD_UART_RECV_DATA_IN_RESERVED3_LEN 4
  11579. #define MC_CMD_UART_RECV_DATA_IN_DATA_OFST 16
  11580. #define MC_CMD_UART_RECV_DATA_IN_DATA_LEN 1
  11581. #define MC_CMD_UART_RECV_DATA_IN_DATA_MINNUM 0
  11582. #define MC_CMD_UART_RECV_DATA_IN_DATA_MAXNUM 236
  11583. /***********************************/
  11584. /* MC_CMD_READ_FUSES
  11585. * Read data programmed into the device One-Time-Programmable (OTP) Fuses
  11586. */
  11587. #define MC_CMD_READ_FUSES 0xf0
  11588. #define MC_CMD_0xf0_PRIVILEGE_CTG SRIOV_CTG_INSECURE
  11589. /* MC_CMD_READ_FUSES_IN msgrequest */
  11590. #define MC_CMD_READ_FUSES_IN_LEN 8
  11591. /* Offset in OTP to read */
  11592. #define MC_CMD_READ_FUSES_IN_OFFSET_OFST 0
  11593. #define MC_CMD_READ_FUSES_IN_OFFSET_LEN 4
  11594. /* Length of data to read in bytes */
  11595. #define MC_CMD_READ_FUSES_IN_LENGTH_OFST 4
  11596. #define MC_CMD_READ_FUSES_IN_LENGTH_LEN 4
  11597. /* MC_CMD_READ_FUSES_OUT msgresponse */
  11598. #define MC_CMD_READ_FUSES_OUT_LENMIN 4
  11599. #define MC_CMD_READ_FUSES_OUT_LENMAX 252
  11600. #define MC_CMD_READ_FUSES_OUT_LEN(num) (4+1*(num))
  11601. /* Length of returned OTP data in bytes */
  11602. #define MC_CMD_READ_FUSES_OUT_LENGTH_OFST 0
  11603. #define MC_CMD_READ_FUSES_OUT_LENGTH_LEN 4
  11604. /* Returned data */
  11605. #define MC_CMD_READ_FUSES_OUT_DATA_OFST 4
  11606. #define MC_CMD_READ_FUSES_OUT_DATA_LEN 1
  11607. #define MC_CMD_READ_FUSES_OUT_DATA_MINNUM 0
  11608. #define MC_CMD_READ_FUSES_OUT_DATA_MAXNUM 248
  11609. /***********************************/
  11610. /* MC_CMD_KR_TUNE
  11611. * Get or set KR Serdes RXEQ and TX Driver settings
  11612. */
  11613. #define MC_CMD_KR_TUNE 0xf1
  11614. #define MC_CMD_0xf1_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  11615. /* MC_CMD_KR_TUNE_IN msgrequest */
  11616. #define MC_CMD_KR_TUNE_IN_LENMIN 4
  11617. #define MC_CMD_KR_TUNE_IN_LENMAX 252
  11618. #define MC_CMD_KR_TUNE_IN_LEN(num) (4+4*(num))
  11619. /* Requested operation */
  11620. #define MC_CMD_KR_TUNE_IN_KR_TUNE_OP_OFST 0
  11621. #define MC_CMD_KR_TUNE_IN_KR_TUNE_OP_LEN 1
  11622. /* enum: Get current RXEQ settings */
  11623. #define MC_CMD_KR_TUNE_IN_RXEQ_GET 0x0
  11624. /* enum: Override RXEQ settings */
  11625. #define MC_CMD_KR_TUNE_IN_RXEQ_SET 0x1
  11626. /* enum: Get current TX Driver settings */
  11627. #define MC_CMD_KR_TUNE_IN_TXEQ_GET 0x2
  11628. /* enum: Override TX Driver settings */
  11629. #define MC_CMD_KR_TUNE_IN_TXEQ_SET 0x3
  11630. /* enum: Force KR Serdes reset / recalibration */
  11631. #define MC_CMD_KR_TUNE_IN_RECAL 0x4
  11632. /* enum: Start KR Serdes Eye diagram plot on a given lane. Lane must have valid
  11633. * signal.
  11634. */
  11635. #define MC_CMD_KR_TUNE_IN_START_EYE_PLOT 0x5
  11636. /* enum: Poll KR Serdes Eye diagram plot. Returns one row of BER data. The
  11637. * caller should call this command repeatedly after starting eye plot, until no
  11638. * more data is returned.
  11639. */
  11640. #define MC_CMD_KR_TUNE_IN_POLL_EYE_PLOT 0x6
  11641. /* enum: Read Figure Of Merit (eye quality, higher is better). */
  11642. #define MC_CMD_KR_TUNE_IN_READ_FOM 0x7
  11643. /* enum: Start/stop link training frames */
  11644. #define MC_CMD_KR_TUNE_IN_LINK_TRAIN_RUN 0x8
  11645. /* enum: Issue KR link training command (control training coefficients) */
  11646. #define MC_CMD_KR_TUNE_IN_LINK_TRAIN_CMD 0x9
  11647. /* Align the arguments to 32 bits */
  11648. #define MC_CMD_KR_TUNE_IN_KR_TUNE_RSVD_OFST 1
  11649. #define MC_CMD_KR_TUNE_IN_KR_TUNE_RSVD_LEN 3
  11650. /* Arguments specific to the operation */
  11651. #define MC_CMD_KR_TUNE_IN_KR_TUNE_ARGS_OFST 4
  11652. #define MC_CMD_KR_TUNE_IN_KR_TUNE_ARGS_LEN 4
  11653. #define MC_CMD_KR_TUNE_IN_KR_TUNE_ARGS_MINNUM 0
  11654. #define MC_CMD_KR_TUNE_IN_KR_TUNE_ARGS_MAXNUM 62
  11655. /* MC_CMD_KR_TUNE_OUT msgresponse */
  11656. #define MC_CMD_KR_TUNE_OUT_LEN 0
  11657. /* MC_CMD_KR_TUNE_RXEQ_GET_IN msgrequest */
  11658. #define MC_CMD_KR_TUNE_RXEQ_GET_IN_LEN 4
  11659. /* Requested operation */
  11660. #define MC_CMD_KR_TUNE_RXEQ_GET_IN_KR_TUNE_OP_OFST 0
  11661. #define MC_CMD_KR_TUNE_RXEQ_GET_IN_KR_TUNE_OP_LEN 1
  11662. /* Align the arguments to 32 bits */
  11663. #define MC_CMD_KR_TUNE_RXEQ_GET_IN_KR_TUNE_RSVD_OFST 1
  11664. #define MC_CMD_KR_TUNE_RXEQ_GET_IN_KR_TUNE_RSVD_LEN 3
  11665. /* MC_CMD_KR_TUNE_RXEQ_GET_OUT msgresponse */
  11666. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_LENMIN 4
  11667. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_LENMAX 252
  11668. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_LEN(num) (0+4*(num))
  11669. /* RXEQ Parameter */
  11670. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_OFST 0
  11671. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_LEN 4
  11672. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_MINNUM 1
  11673. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_MAXNUM 63
  11674. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_ID_LBN 0
  11675. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_ID_WIDTH 8
  11676. /* enum: Attenuation (0-15, Huntington) */
  11677. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_ATT 0x0
  11678. /* enum: CTLE Boost (0-15, Huntington) */
  11679. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_BOOST 0x1
  11680. /* enum: Edge DFE Tap1 (Huntington - 0 - max negative, 64 - zero, 127 - max
  11681. * positive, Medford - 0-31)
  11682. */
  11683. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_EDFE_TAP1 0x2
  11684. /* enum: Edge DFE Tap2 (Huntington - 0 - max negative, 32 - zero, 63 - max
  11685. * positive, Medford - 0-31)
  11686. */
  11687. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_EDFE_TAP2 0x3
  11688. /* enum: Edge DFE Tap3 (Huntington - 0 - max negative, 32 - zero, 63 - max
  11689. * positive, Medford - 0-16)
  11690. */
  11691. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_EDFE_TAP3 0x4
  11692. /* enum: Edge DFE Tap4 (Huntington - 0 - max negative, 32 - zero, 63 - max
  11693. * positive, Medford - 0-16)
  11694. */
  11695. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_EDFE_TAP4 0x5
  11696. /* enum: Edge DFE Tap5 (Huntington - 0 - max negative, 32 - zero, 63 - max
  11697. * positive, Medford - 0-16)
  11698. */
  11699. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_EDFE_TAP5 0x6
  11700. /* enum: Edge DFE DLEV (0-128 for Medford) */
  11701. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_EDFE_DLEV 0x7
  11702. /* enum: Variable Gain Amplifier (0-15, Medford) */
  11703. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_VGA 0x8
  11704. /* enum: CTLE EQ Capacitor (0-15, Medford) */
  11705. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_CTLE_EQC 0x9
  11706. /* enum: CTLE EQ Resistor (0-7, Medford) */
  11707. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_CTLE_EQRES 0xa
  11708. /* enum: CTLE gain (0-31, Medford2) */
  11709. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_CTLE_GAIN 0xb
  11710. /* enum: CTLE pole (0-31, Medford2) */
  11711. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_CTLE_POLE 0xc
  11712. /* enum: CTLE peaking (0-31, Medford2) */
  11713. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_CTLE_PEAK 0xd
  11714. /* enum: DFE Tap1 - even path (Medford2 - 6 bit signed (-29 - +29)) */
  11715. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_DFE_TAP1_EVEN 0xe
  11716. /* enum: DFE Tap1 - odd path (Medford2 - 6 bit signed (-29 - +29)) */
  11717. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_DFE_TAP1_ODD 0xf
  11718. /* enum: DFE Tap2 (Medford2 - 6 bit signed (-20 - +20)) */
  11719. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_DFE_TAP2 0x10
  11720. /* enum: DFE Tap3 (Medford2 - 6 bit signed (-20 - +20)) */
  11721. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_DFE_TAP3 0x11
  11722. /* enum: DFE Tap4 (Medford2 - 6 bit signed (-20 - +20)) */
  11723. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_DFE_TAP4 0x12
  11724. /* enum: DFE Tap5 (Medford2 - 6 bit signed (-24 - +24)) */
  11725. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_DFE_TAP5 0x13
  11726. /* enum: DFE Tap6 (Medford2 - 6 bit signed (-24 - +24)) */
  11727. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_DFE_TAP6 0x14
  11728. /* enum: DFE Tap7 (Medford2 - 6 bit signed (-24 - +24)) */
  11729. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_DFE_TAP7 0x15
  11730. /* enum: DFE Tap8 (Medford2 - 6 bit signed (-24 - +24)) */
  11731. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_DFE_TAP8 0x16
  11732. /* enum: DFE Tap9 (Medford2 - 6 bit signed (-24 - +24)) */
  11733. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_DFE_TAP9 0x17
  11734. /* enum: DFE Tap10 (Medford2 - 6 bit signed (-24 - +24)) */
  11735. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_DFE_TAP10 0x18
  11736. /* enum: DFE Tap11 (Medford2 - 6 bit signed (-24 - +24)) */
  11737. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_DFE_TAP11 0x19
  11738. /* enum: DFE Tap12 (Medford2 - 6 bit signed (-24 - +24)) */
  11739. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_DFE_TAP12 0x1a
  11740. /* enum: I/Q clk offset (Medford2 - 4 bit signed (-5 - +5))) */
  11741. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_IQ_OFF 0x1b
  11742. /* enum: Negative h1 polarity data sampler offset calibration code, even path
  11743. * (Medford2 - 6 bit signed (-29 - +29)))
  11744. */
  11745. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_H1N_OFF_EVEN 0x1c
  11746. /* enum: Negative h1 polarity data sampler offset calibration code, odd path
  11747. * (Medford2 - 6 bit signed (-29 - +29)))
  11748. */
  11749. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_H1N_OFF_ODD 0x1d
  11750. /* enum: Positive h1 polarity data sampler offset calibration code, even path
  11751. * (Medford2 - 6 bit signed (-29 - +29)))
  11752. */
  11753. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_H1P_OFF_EVEN 0x1e
  11754. /* enum: Positive h1 polarity data sampler offset calibration code, odd path
  11755. * (Medford2 - 6 bit signed (-29 - +29)))
  11756. */
  11757. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_H1P_OFF_ODD 0x1f
  11758. /* enum: CDR calibration loop code (Medford2) */
  11759. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_CDR_PVT 0x20
  11760. /* enum: CDR integral loop code (Medford2) */
  11761. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_CDR_INTEG 0x21
  11762. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_LANE_LBN 8
  11763. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_LANE_WIDTH 3
  11764. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_LANE_0 0x0 /* enum */
  11765. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_LANE_1 0x1 /* enum */
  11766. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_LANE_2 0x2 /* enum */
  11767. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_LANE_3 0x3 /* enum */
  11768. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_LANE_ALL 0x4 /* enum */
  11769. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_AUTOCAL_LBN 11
  11770. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_AUTOCAL_WIDTH 1
  11771. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_RESERVED_LBN 12
  11772. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_RESERVED_WIDTH 4
  11773. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_INITIAL_LBN 16
  11774. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_INITIAL_WIDTH 8
  11775. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_CURRENT_LBN 24
  11776. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_CURRENT_WIDTH 8
  11777. /* MC_CMD_KR_TUNE_RXEQ_SET_IN msgrequest */
  11778. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_LENMIN 8
  11779. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_LENMAX 252
  11780. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_LEN(num) (4+4*(num))
  11781. /* Requested operation */
  11782. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_KR_TUNE_OP_OFST 0
  11783. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_KR_TUNE_OP_LEN 1
  11784. /* Align the arguments to 32 bits */
  11785. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_KR_TUNE_RSVD_OFST 1
  11786. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_KR_TUNE_RSVD_LEN 3
  11787. /* RXEQ Parameter */
  11788. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_OFST 4
  11789. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_LEN 4
  11790. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_MINNUM 1
  11791. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_MAXNUM 62
  11792. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_ID_LBN 0
  11793. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_ID_WIDTH 8
  11794. /* Enum values, see field(s): */
  11795. /* MC_CMD_KR_TUNE_RXEQ_GET_OUT/PARAM_ID */
  11796. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_LANE_LBN 8
  11797. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_LANE_WIDTH 3
  11798. /* Enum values, see field(s): */
  11799. /* MC_CMD_KR_TUNE_RXEQ_GET_OUT/PARAM_LANE */
  11800. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_AUTOCAL_LBN 11
  11801. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_AUTOCAL_WIDTH 1
  11802. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_RESERVED_LBN 12
  11803. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_RESERVED_WIDTH 4
  11804. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_INITIAL_LBN 16
  11805. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_INITIAL_WIDTH 8
  11806. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_RESERVED2_LBN 24
  11807. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_RESERVED2_WIDTH 8
  11808. /* MC_CMD_KR_TUNE_RXEQ_SET_OUT msgresponse */
  11809. #define MC_CMD_KR_TUNE_RXEQ_SET_OUT_LEN 0
  11810. /* MC_CMD_KR_TUNE_TXEQ_GET_IN msgrequest */
  11811. #define MC_CMD_KR_TUNE_TXEQ_GET_IN_LEN 4
  11812. /* Requested operation */
  11813. #define MC_CMD_KR_TUNE_TXEQ_GET_IN_KR_TUNE_OP_OFST 0
  11814. #define MC_CMD_KR_TUNE_TXEQ_GET_IN_KR_TUNE_OP_LEN 1
  11815. /* Align the arguments to 32 bits */
  11816. #define MC_CMD_KR_TUNE_TXEQ_GET_IN_KR_TUNE_RSVD_OFST 1
  11817. #define MC_CMD_KR_TUNE_TXEQ_GET_IN_KR_TUNE_RSVD_LEN 3
  11818. /* MC_CMD_KR_TUNE_TXEQ_GET_OUT msgresponse */
  11819. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_LENMIN 4
  11820. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_LENMAX 252
  11821. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_LEN(num) (0+4*(num))
  11822. /* TXEQ Parameter */
  11823. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_OFST 0
  11824. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_LEN 4
  11825. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_MINNUM 1
  11826. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_MAXNUM 63
  11827. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_ID_LBN 0
  11828. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_ID_WIDTH 8
  11829. /* enum: TX Amplitude (Huntington, Medford, Medford2) */
  11830. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_LEV 0x0
  11831. /* enum: De-Emphasis Tap1 Magnitude (0-7) (Huntington) */
  11832. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_MODE 0x1
  11833. /* enum: De-Emphasis Tap1 Fine */
  11834. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_DTLEV 0x2
  11835. /* enum: De-Emphasis Tap2 Magnitude (0-6) (Huntington) */
  11836. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_D2 0x3
  11837. /* enum: De-Emphasis Tap2 Fine (Huntington) */
  11838. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_D2TLEV 0x4
  11839. /* enum: Pre-Emphasis Magnitude (Huntington) */
  11840. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_E 0x5
  11841. /* enum: Pre-Emphasis Fine (Huntington) */
  11842. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_ETLEV 0x6
  11843. /* enum: TX Slew Rate Coarse control (Huntington) */
  11844. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_PREDRV_DLY 0x7
  11845. /* enum: TX Slew Rate Fine control (Huntington) */
  11846. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_SR_SET 0x8
  11847. /* enum: TX Termination Impedance control (Huntington) */
  11848. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_RT_SET 0x9
  11849. /* enum: TX Amplitude Fine control (Medford) */
  11850. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_LEV_FINE 0xa
  11851. /* enum: Pre-shoot Tap (Medford, Medford2) */
  11852. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TAP_ADV 0xb
  11853. /* enum: De-emphasis Tap (Medford, Medford2) */
  11854. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TAP_DLY 0xc
  11855. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_LANE_LBN 8
  11856. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_LANE_WIDTH 3
  11857. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_LANE_0 0x0 /* enum */
  11858. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_LANE_1 0x1 /* enum */
  11859. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_LANE_2 0x2 /* enum */
  11860. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_LANE_3 0x3 /* enum */
  11861. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_LANE_ALL 0x4 /* enum */
  11862. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_RESERVED_LBN 11
  11863. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_RESERVED_WIDTH 5
  11864. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_INITIAL_LBN 16
  11865. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_INITIAL_WIDTH 8
  11866. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_RESERVED2_LBN 24
  11867. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_RESERVED2_WIDTH 8
  11868. /* MC_CMD_KR_TUNE_TXEQ_SET_IN msgrequest */
  11869. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_LENMIN 8
  11870. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_LENMAX 252
  11871. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_LEN(num) (4+4*(num))
  11872. /* Requested operation */
  11873. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_KR_TUNE_OP_OFST 0
  11874. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_KR_TUNE_OP_LEN 1
  11875. /* Align the arguments to 32 bits */
  11876. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_KR_TUNE_RSVD_OFST 1
  11877. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_KR_TUNE_RSVD_LEN 3
  11878. /* TXEQ Parameter */
  11879. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_OFST 4
  11880. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_LEN 4
  11881. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_MINNUM 1
  11882. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_MAXNUM 62
  11883. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_ID_LBN 0
  11884. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_ID_WIDTH 8
  11885. /* Enum values, see field(s): */
  11886. /* MC_CMD_KR_TUNE_TXEQ_GET_OUT/PARAM_ID */
  11887. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_LANE_LBN 8
  11888. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_LANE_WIDTH 3
  11889. /* Enum values, see field(s): */
  11890. /* MC_CMD_KR_TUNE_TXEQ_GET_OUT/PARAM_LANE */
  11891. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_RESERVED_LBN 11
  11892. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_RESERVED_WIDTH 5
  11893. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_INITIAL_LBN 16
  11894. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_INITIAL_WIDTH 8
  11895. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_RESERVED2_LBN 24
  11896. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_RESERVED2_WIDTH 8
  11897. /* MC_CMD_KR_TUNE_TXEQ_SET_OUT msgresponse */
  11898. #define MC_CMD_KR_TUNE_TXEQ_SET_OUT_LEN 0
  11899. /* MC_CMD_KR_TUNE_RECAL_IN msgrequest */
  11900. #define MC_CMD_KR_TUNE_RECAL_IN_LEN 4
  11901. /* Requested operation */
  11902. #define MC_CMD_KR_TUNE_RECAL_IN_KR_TUNE_OP_OFST 0
  11903. #define MC_CMD_KR_TUNE_RECAL_IN_KR_TUNE_OP_LEN 1
  11904. /* Align the arguments to 32 bits */
  11905. #define MC_CMD_KR_TUNE_RECAL_IN_KR_TUNE_RSVD_OFST 1
  11906. #define MC_CMD_KR_TUNE_RECAL_IN_KR_TUNE_RSVD_LEN 3
  11907. /* MC_CMD_KR_TUNE_RECAL_OUT msgresponse */
  11908. #define MC_CMD_KR_TUNE_RECAL_OUT_LEN 0
  11909. /* MC_CMD_KR_TUNE_START_EYE_PLOT_IN msgrequest */
  11910. #define MC_CMD_KR_TUNE_START_EYE_PLOT_IN_LEN 8
  11911. /* Requested operation */
  11912. #define MC_CMD_KR_TUNE_START_EYE_PLOT_IN_KR_TUNE_OP_OFST 0
  11913. #define MC_CMD_KR_TUNE_START_EYE_PLOT_IN_KR_TUNE_OP_LEN 1
  11914. /* Align the arguments to 32 bits */
  11915. #define MC_CMD_KR_TUNE_START_EYE_PLOT_IN_KR_TUNE_RSVD_OFST 1
  11916. #define MC_CMD_KR_TUNE_START_EYE_PLOT_IN_KR_TUNE_RSVD_LEN 3
  11917. /* Port-relative lane to scan eye on */
  11918. #define MC_CMD_KR_TUNE_START_EYE_PLOT_IN_LANE_OFST 4
  11919. #define MC_CMD_KR_TUNE_START_EYE_PLOT_IN_LANE_LEN 4
  11920. /* MC_CMD_KR_TUNE_START_EYE_PLOT_V2_IN msgrequest */
  11921. #define MC_CMD_KR_TUNE_START_EYE_PLOT_V2_IN_LEN 12
  11922. /* Requested operation */
  11923. #define MC_CMD_KR_TUNE_START_EYE_PLOT_V2_IN_KR_TUNE_OP_OFST 0
  11924. #define MC_CMD_KR_TUNE_START_EYE_PLOT_V2_IN_KR_TUNE_OP_LEN 1
  11925. /* Align the arguments to 32 bits */
  11926. #define MC_CMD_KR_TUNE_START_EYE_PLOT_V2_IN_KR_TUNE_RSVD_OFST 1
  11927. #define MC_CMD_KR_TUNE_START_EYE_PLOT_V2_IN_KR_TUNE_RSVD_LEN 3
  11928. #define MC_CMD_KR_TUNE_START_EYE_PLOT_V2_IN_LANE_OFST 4
  11929. #define MC_CMD_KR_TUNE_START_EYE_PLOT_V2_IN_LANE_LEN 4
  11930. #define MC_CMD_KR_TUNE_START_EYE_PLOT_V2_IN_LANE_NUM_LBN 0
  11931. #define MC_CMD_KR_TUNE_START_EYE_PLOT_V2_IN_LANE_NUM_WIDTH 8
  11932. #define MC_CMD_KR_TUNE_START_EYE_PLOT_V2_IN_LANE_ABS_REL_LBN 31
  11933. #define MC_CMD_KR_TUNE_START_EYE_PLOT_V2_IN_LANE_ABS_REL_WIDTH 1
  11934. /* Scan duration / cycle count */
  11935. #define MC_CMD_KR_TUNE_START_EYE_PLOT_V2_IN_BER_OFST 8
  11936. #define MC_CMD_KR_TUNE_START_EYE_PLOT_V2_IN_BER_LEN 4
  11937. /* MC_CMD_KR_TUNE_START_EYE_PLOT_OUT msgresponse */
  11938. #define MC_CMD_KR_TUNE_START_EYE_PLOT_OUT_LEN 0
  11939. /* MC_CMD_KR_TUNE_POLL_EYE_PLOT_IN msgrequest */
  11940. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_IN_LEN 4
  11941. /* Requested operation */
  11942. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_IN_KR_TUNE_OP_OFST 0
  11943. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_IN_KR_TUNE_OP_LEN 1
  11944. /* Align the arguments to 32 bits */
  11945. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_IN_KR_TUNE_RSVD_OFST 1
  11946. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_IN_KR_TUNE_RSVD_LEN 3
  11947. /* MC_CMD_KR_TUNE_POLL_EYE_PLOT_OUT msgresponse */
  11948. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_OUT_LENMIN 0
  11949. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_OUT_LENMAX 252
  11950. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_OUT_LEN(num) (0+2*(num))
  11951. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_OUT_SAMPLES_OFST 0
  11952. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_OUT_SAMPLES_LEN 2
  11953. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_OUT_SAMPLES_MINNUM 0
  11954. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_OUT_SAMPLES_MAXNUM 126
  11955. /* MC_CMD_KR_TUNE_READ_FOM_IN msgrequest */
  11956. #define MC_CMD_KR_TUNE_READ_FOM_IN_LEN 8
  11957. /* Requested operation */
  11958. #define MC_CMD_KR_TUNE_READ_FOM_IN_KR_TUNE_OP_OFST 0
  11959. #define MC_CMD_KR_TUNE_READ_FOM_IN_KR_TUNE_OP_LEN 1
  11960. /* Align the arguments to 32 bits */
  11961. #define MC_CMD_KR_TUNE_READ_FOM_IN_KR_TUNE_RSVD_OFST 1
  11962. #define MC_CMD_KR_TUNE_READ_FOM_IN_KR_TUNE_RSVD_LEN 3
  11963. #define MC_CMD_KR_TUNE_READ_FOM_IN_LANE_OFST 4
  11964. #define MC_CMD_KR_TUNE_READ_FOM_IN_LANE_LEN 4
  11965. #define MC_CMD_KR_TUNE_READ_FOM_IN_LANE_NUM_LBN 0
  11966. #define MC_CMD_KR_TUNE_READ_FOM_IN_LANE_NUM_WIDTH 8
  11967. #define MC_CMD_KR_TUNE_READ_FOM_IN_LANE_ABS_REL_LBN 31
  11968. #define MC_CMD_KR_TUNE_READ_FOM_IN_LANE_ABS_REL_WIDTH 1
  11969. /* MC_CMD_KR_TUNE_READ_FOM_OUT msgresponse */
  11970. #define MC_CMD_KR_TUNE_READ_FOM_OUT_LEN 4
  11971. #define MC_CMD_KR_TUNE_READ_FOM_OUT_FOM_OFST 0
  11972. #define MC_CMD_KR_TUNE_READ_FOM_OUT_FOM_LEN 4
  11973. /* MC_CMD_KR_TUNE_LINK_TRAIN_RUN_IN msgrequest */
  11974. #define MC_CMD_KR_TUNE_LINK_TRAIN_RUN_IN_LEN 8
  11975. /* Requested operation */
  11976. #define MC_CMD_KR_TUNE_LINK_TRAIN_RUN_IN_KR_TUNE_OP_OFST 0
  11977. #define MC_CMD_KR_TUNE_LINK_TRAIN_RUN_IN_KR_TUNE_OP_LEN 1
  11978. /* Align the arguments to 32 bits */
  11979. #define MC_CMD_KR_TUNE_LINK_TRAIN_RUN_IN_KR_TUNE_RSVD_OFST 1
  11980. #define MC_CMD_KR_TUNE_LINK_TRAIN_RUN_IN_KR_TUNE_RSVD_LEN 3
  11981. #define MC_CMD_KR_TUNE_LINK_TRAIN_RUN_IN_RUN_OFST 4
  11982. #define MC_CMD_KR_TUNE_LINK_TRAIN_RUN_IN_RUN_LEN 4
  11983. #define MC_CMD_KR_TUNE_LINK_TRAIN_RUN_IN_STOP 0x0 /* enum */
  11984. #define MC_CMD_KR_TUNE_LINK_TRAIN_RUN_IN_START 0x1 /* enum */
  11985. /* MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN msgrequest */
  11986. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_LEN 28
  11987. /* Requested operation */
  11988. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_KR_TUNE_OP_OFST 0
  11989. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_KR_TUNE_OP_LEN 1
  11990. /* Align the arguments to 32 bits */
  11991. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_KR_TUNE_RSVD_OFST 1
  11992. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_KR_TUNE_RSVD_LEN 3
  11993. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_LANE_OFST 4
  11994. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_LANE_LEN 4
  11995. /* Set INITIALIZE state */
  11996. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_INITIALIZE_OFST 8
  11997. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_INITIALIZE_LEN 4
  11998. /* Set PRESET state */
  11999. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_PRESET_OFST 12
  12000. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_PRESET_LEN 4
  12001. /* C(-1) request */
  12002. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_CM1_OFST 16
  12003. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_CM1_LEN 4
  12004. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_REQ_HOLD 0x0 /* enum */
  12005. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_REQ_INCREMENT 0x1 /* enum */
  12006. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_REQ_DECREMENT 0x2 /* enum */
  12007. /* C(0) request */
  12008. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_C0_OFST 20
  12009. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_C0_LEN 4
  12010. /* Enum values, see field(s): */
  12011. /* MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN/CM1 */
  12012. /* C(+1) request */
  12013. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_CP1_OFST 24
  12014. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_CP1_LEN 4
  12015. /* Enum values, see field(s): */
  12016. /* MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN/CM1 */
  12017. /* MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT msgresponse */
  12018. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT_LEN 24
  12019. /* C(-1) status */
  12020. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT_CM1_STATUS_OFST 0
  12021. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT_CM1_STATUS_LEN 4
  12022. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT_STATUS_NOT_UPDATED 0x0 /* enum */
  12023. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT_STATUS_UPDATED 0x1 /* enum */
  12024. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT_STATUS_MINIMUM 0x2 /* enum */
  12025. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT_STATUS_MAXIMUM 0x3 /* enum */
  12026. /* C(0) status */
  12027. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT_C0_STATUS_OFST 4
  12028. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT_C0_STATUS_LEN 4
  12029. /* Enum values, see field(s): */
  12030. /* MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN/CM1 */
  12031. /* C(+1) status */
  12032. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT_CP1_STATUS_OFST 8
  12033. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT_CP1_STATUS_LEN 4
  12034. /* Enum values, see field(s): */
  12035. /* MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN/CM1 */
  12036. /* C(-1) value */
  12037. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT_CM1_VALUE_OFST 12
  12038. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT_CM1_VALUE_LEN 4
  12039. /* C(0) value */
  12040. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT_C0_VALUE_OFST 16
  12041. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT_C0_VALUE_LEN 4
  12042. /* C(+1) status */
  12043. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT_CP1_VALUE_OFST 20
  12044. #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT_CP1_VALUE_LEN 4
  12045. /***********************************/
  12046. /* MC_CMD_PCIE_TUNE
  12047. * Get or set PCIE Serdes RXEQ and TX Driver settings
  12048. */
  12049. #define MC_CMD_PCIE_TUNE 0xf2
  12050. #define MC_CMD_0xf2_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  12051. /* MC_CMD_PCIE_TUNE_IN msgrequest */
  12052. #define MC_CMD_PCIE_TUNE_IN_LENMIN 4
  12053. #define MC_CMD_PCIE_TUNE_IN_LENMAX 252
  12054. #define MC_CMD_PCIE_TUNE_IN_LEN(num) (4+4*(num))
  12055. /* Requested operation */
  12056. #define MC_CMD_PCIE_TUNE_IN_PCIE_TUNE_OP_OFST 0
  12057. #define MC_CMD_PCIE_TUNE_IN_PCIE_TUNE_OP_LEN 1
  12058. /* enum: Get current RXEQ settings */
  12059. #define MC_CMD_PCIE_TUNE_IN_RXEQ_GET 0x0
  12060. /* enum: Override RXEQ settings */
  12061. #define MC_CMD_PCIE_TUNE_IN_RXEQ_SET 0x1
  12062. /* enum: Get current TX Driver settings */
  12063. #define MC_CMD_PCIE_TUNE_IN_TXEQ_GET 0x2
  12064. /* enum: Override TX Driver settings */
  12065. #define MC_CMD_PCIE_TUNE_IN_TXEQ_SET 0x3
  12066. /* enum: Start PCIe Serdes Eye diagram plot on a given lane. */
  12067. #define MC_CMD_PCIE_TUNE_IN_START_EYE_PLOT 0x5
  12068. /* enum: Poll PCIe Serdes Eye diagram plot. Returns one row of BER data. The
  12069. * caller should call this command repeatedly after starting eye plot, until no
  12070. * more data is returned.
  12071. */
  12072. #define MC_CMD_PCIE_TUNE_IN_POLL_EYE_PLOT 0x6
  12073. /* enum: Enable the SERDES BIST and set it to generate a 200MHz square wave */
  12074. #define MC_CMD_PCIE_TUNE_IN_BIST_SQUARE_WAVE 0x7
  12075. /* Align the arguments to 32 bits */
  12076. #define MC_CMD_PCIE_TUNE_IN_PCIE_TUNE_RSVD_OFST 1
  12077. #define MC_CMD_PCIE_TUNE_IN_PCIE_TUNE_RSVD_LEN 3
  12078. /* Arguments specific to the operation */
  12079. #define MC_CMD_PCIE_TUNE_IN_PCIE_TUNE_ARGS_OFST 4
  12080. #define MC_CMD_PCIE_TUNE_IN_PCIE_TUNE_ARGS_LEN 4
  12081. #define MC_CMD_PCIE_TUNE_IN_PCIE_TUNE_ARGS_MINNUM 0
  12082. #define MC_CMD_PCIE_TUNE_IN_PCIE_TUNE_ARGS_MAXNUM 62
  12083. /* MC_CMD_PCIE_TUNE_OUT msgresponse */
  12084. #define MC_CMD_PCIE_TUNE_OUT_LEN 0
  12085. /* MC_CMD_PCIE_TUNE_RXEQ_GET_IN msgrequest */
  12086. #define MC_CMD_PCIE_TUNE_RXEQ_GET_IN_LEN 4
  12087. /* Requested operation */
  12088. #define MC_CMD_PCIE_TUNE_RXEQ_GET_IN_PCIE_TUNE_OP_OFST 0
  12089. #define MC_CMD_PCIE_TUNE_RXEQ_GET_IN_PCIE_TUNE_OP_LEN 1
  12090. /* Align the arguments to 32 bits */
  12091. #define MC_CMD_PCIE_TUNE_RXEQ_GET_IN_PCIE_TUNE_RSVD_OFST 1
  12092. #define MC_CMD_PCIE_TUNE_RXEQ_GET_IN_PCIE_TUNE_RSVD_LEN 3
  12093. /* MC_CMD_PCIE_TUNE_RXEQ_GET_OUT msgresponse */
  12094. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LENMIN 4
  12095. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LENMAX 252
  12096. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LEN(num) (0+4*(num))
  12097. /* RXEQ Parameter */
  12098. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_OFST 0
  12099. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_LEN 4
  12100. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_MINNUM 1
  12101. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_MAXNUM 63
  12102. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_ID_LBN 0
  12103. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_ID_WIDTH 8
  12104. /* enum: Attenuation (0-15) */
  12105. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_ATT 0x0
  12106. /* enum: CTLE Boost (0-15) */
  12107. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_BOOST 0x1
  12108. /* enum: DFE Tap1 (0 - max negative, 64 - zero, 127 - max positive) */
  12109. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_DFE_TAP1 0x2
  12110. /* enum: DFE Tap2 (0 - max negative, 32 - zero, 63 - max positive) */
  12111. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_DFE_TAP2 0x3
  12112. /* enum: DFE Tap3 (0 - max negative, 32 - zero, 63 - max positive) */
  12113. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_DFE_TAP3 0x4
  12114. /* enum: DFE Tap4 (0 - max negative, 32 - zero, 63 - max positive) */
  12115. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_DFE_TAP4 0x5
  12116. /* enum: DFE Tap5 (0 - max negative, 32 - zero, 63 - max positive) */
  12117. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_DFE_TAP5 0x6
  12118. /* enum: DFE DLev */
  12119. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_DFE_DLEV 0x7
  12120. /* enum: Figure of Merit */
  12121. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_FOM 0x8
  12122. /* enum: CTLE EQ Capacitor (HF Gain) */
  12123. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_CTLE_EQC 0x9
  12124. /* enum: CTLE EQ Resistor (DC Gain) */
  12125. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_CTLE_EQRES 0xa
  12126. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_LANE_LBN 8
  12127. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_LANE_WIDTH 5
  12128. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_0 0x0 /* enum */
  12129. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_1 0x1 /* enum */
  12130. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_2 0x2 /* enum */
  12131. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_3 0x3 /* enum */
  12132. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_4 0x4 /* enum */
  12133. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_5 0x5 /* enum */
  12134. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_6 0x6 /* enum */
  12135. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_7 0x7 /* enum */
  12136. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_8 0x8 /* enum */
  12137. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_9 0x9 /* enum */
  12138. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_10 0xa /* enum */
  12139. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_11 0xb /* enum */
  12140. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_12 0xc /* enum */
  12141. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_13 0xd /* enum */
  12142. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_14 0xe /* enum */
  12143. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_15 0xf /* enum */
  12144. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_ALL 0x10 /* enum */
  12145. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_AUTOCAL_LBN 13
  12146. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_AUTOCAL_WIDTH 1
  12147. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_RESERVED_LBN 14
  12148. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_RESERVED_WIDTH 10
  12149. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_CURRENT_LBN 24
  12150. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_CURRENT_WIDTH 8
  12151. /* MC_CMD_PCIE_TUNE_RXEQ_SET_IN msgrequest */
  12152. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_LENMIN 8
  12153. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_LENMAX 252
  12154. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_LEN(num) (4+4*(num))
  12155. /* Requested operation */
  12156. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PCIE_TUNE_OP_OFST 0
  12157. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PCIE_TUNE_OP_LEN 1
  12158. /* Align the arguments to 32 bits */
  12159. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PCIE_TUNE_RSVD_OFST 1
  12160. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PCIE_TUNE_RSVD_LEN 3
  12161. /* RXEQ Parameter */
  12162. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_OFST 4
  12163. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_LEN 4
  12164. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_MINNUM 1
  12165. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_MAXNUM 62
  12166. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_ID_LBN 0
  12167. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_ID_WIDTH 8
  12168. /* Enum values, see field(s): */
  12169. /* MC_CMD_PCIE_TUNE_RXEQ_GET_OUT/PARAM_ID */
  12170. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_LANE_LBN 8
  12171. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_LANE_WIDTH 5
  12172. /* Enum values, see field(s): */
  12173. /* MC_CMD_PCIE_TUNE_RXEQ_GET_OUT/PARAM_LANE */
  12174. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_AUTOCAL_LBN 13
  12175. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_AUTOCAL_WIDTH 1
  12176. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_RESERVED_LBN 14
  12177. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_RESERVED_WIDTH 2
  12178. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_INITIAL_LBN 16
  12179. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_INITIAL_WIDTH 8
  12180. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_RESERVED2_LBN 24
  12181. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_RESERVED2_WIDTH 8
  12182. /* MC_CMD_PCIE_TUNE_RXEQ_SET_OUT msgresponse */
  12183. #define MC_CMD_PCIE_TUNE_RXEQ_SET_OUT_LEN 0
  12184. /* MC_CMD_PCIE_TUNE_TXEQ_GET_IN msgrequest */
  12185. #define MC_CMD_PCIE_TUNE_TXEQ_GET_IN_LEN 4
  12186. /* Requested operation */
  12187. #define MC_CMD_PCIE_TUNE_TXEQ_GET_IN_PCIE_TUNE_OP_OFST 0
  12188. #define MC_CMD_PCIE_TUNE_TXEQ_GET_IN_PCIE_TUNE_OP_LEN 1
  12189. /* Align the arguments to 32 bits */
  12190. #define MC_CMD_PCIE_TUNE_TXEQ_GET_IN_PCIE_TUNE_RSVD_OFST 1
  12191. #define MC_CMD_PCIE_TUNE_TXEQ_GET_IN_PCIE_TUNE_RSVD_LEN 3
  12192. /* MC_CMD_PCIE_TUNE_TXEQ_GET_OUT msgresponse */
  12193. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_LENMIN 4
  12194. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_LENMAX 252
  12195. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_LEN(num) (0+4*(num))
  12196. /* RXEQ Parameter */
  12197. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_OFST 0
  12198. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_LEN 4
  12199. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_MINNUM 1
  12200. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_MAXNUM 63
  12201. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_ID_LBN 0
  12202. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_ID_WIDTH 8
  12203. /* enum: TxMargin (PIPE) */
  12204. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_TXMARGIN 0x0
  12205. /* enum: TxSwing (PIPE) */
  12206. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_TXSWING 0x1
  12207. /* enum: De-emphasis coefficient C(-1) (PIPE) */
  12208. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_CM1 0x2
  12209. /* enum: De-emphasis coefficient C(0) (PIPE) */
  12210. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_C0 0x3
  12211. /* enum: De-emphasis coefficient C(+1) (PIPE) */
  12212. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_CP1 0x4
  12213. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_LANE_LBN 8
  12214. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_LANE_WIDTH 4
  12215. /* Enum values, see field(s): */
  12216. /* MC_CMD_PCIE_TUNE_RXEQ_GET_OUT/PARAM_LANE */
  12217. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_RESERVED_LBN 12
  12218. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_RESERVED_WIDTH 12
  12219. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_CURRENT_LBN 24
  12220. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_CURRENT_WIDTH 8
  12221. /* MC_CMD_PCIE_TUNE_START_EYE_PLOT_IN msgrequest */
  12222. #define MC_CMD_PCIE_TUNE_START_EYE_PLOT_IN_LEN 8
  12223. /* Requested operation */
  12224. #define MC_CMD_PCIE_TUNE_START_EYE_PLOT_IN_PCIE_TUNE_OP_OFST 0
  12225. #define MC_CMD_PCIE_TUNE_START_EYE_PLOT_IN_PCIE_TUNE_OP_LEN 1
  12226. /* Align the arguments to 32 bits */
  12227. #define MC_CMD_PCIE_TUNE_START_EYE_PLOT_IN_PCIE_TUNE_RSVD_OFST 1
  12228. #define MC_CMD_PCIE_TUNE_START_EYE_PLOT_IN_PCIE_TUNE_RSVD_LEN 3
  12229. #define MC_CMD_PCIE_TUNE_START_EYE_PLOT_IN_LANE_OFST 4
  12230. #define MC_CMD_PCIE_TUNE_START_EYE_PLOT_IN_LANE_LEN 4
  12231. /* MC_CMD_PCIE_TUNE_START_EYE_PLOT_OUT msgresponse */
  12232. #define MC_CMD_PCIE_TUNE_START_EYE_PLOT_OUT_LEN 0
  12233. /* MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_IN msgrequest */
  12234. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_IN_LEN 4
  12235. /* Requested operation */
  12236. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_IN_PCIE_TUNE_OP_OFST 0
  12237. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_IN_PCIE_TUNE_OP_LEN 1
  12238. /* Align the arguments to 32 bits */
  12239. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_IN_PCIE_TUNE_RSVD_OFST 1
  12240. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_IN_PCIE_TUNE_RSVD_LEN 3
  12241. /* MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_OUT msgresponse */
  12242. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_OUT_LENMIN 0
  12243. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_OUT_LENMAX 252
  12244. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_OUT_LEN(num) (0+2*(num))
  12245. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_OUT_SAMPLES_OFST 0
  12246. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_OUT_SAMPLES_LEN 2
  12247. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_OUT_SAMPLES_MINNUM 0
  12248. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_OUT_SAMPLES_MAXNUM 126
  12249. /* MC_CMD_PCIE_TUNE_BIST_SQUARE_WAVE_IN msgrequest */
  12250. #define MC_CMD_PCIE_TUNE_BIST_SQUARE_WAVE_IN_LEN 0
  12251. /* MC_CMD_PCIE_TUNE_BIST_SQUARE_WAVE_OUT msgrequest */
  12252. #define MC_CMD_PCIE_TUNE_BIST_SQUARE_WAVE_OUT_LEN 0
  12253. /***********************************/
  12254. /* MC_CMD_LICENSING
  12255. * Operations on the NVRAM_PARTITION_TYPE_LICENSE application license partition
  12256. * - not used for V3 licensing
  12257. */
  12258. #define MC_CMD_LICENSING 0xf3
  12259. #define MC_CMD_0xf3_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  12260. /* MC_CMD_LICENSING_IN msgrequest */
  12261. #define MC_CMD_LICENSING_IN_LEN 4
  12262. /* identifies the type of operation requested */
  12263. #define MC_CMD_LICENSING_IN_OP_OFST 0
  12264. #define MC_CMD_LICENSING_IN_OP_LEN 4
  12265. /* enum: re-read and apply licenses after a license key partition update; note
  12266. * that this operation returns a zero-length response
  12267. */
  12268. #define MC_CMD_LICENSING_IN_OP_UPDATE_LICENSE 0x0
  12269. /* enum: report counts of installed licenses */
  12270. #define MC_CMD_LICENSING_IN_OP_GET_KEY_STATS 0x1
  12271. /* MC_CMD_LICENSING_OUT msgresponse */
  12272. #define MC_CMD_LICENSING_OUT_LEN 28
  12273. /* count of application keys which are valid */
  12274. #define MC_CMD_LICENSING_OUT_VALID_APP_KEYS_OFST 0
  12275. #define MC_CMD_LICENSING_OUT_VALID_APP_KEYS_LEN 4
  12276. /* sum of UNVERIFIABLE_APP_KEYS + WRONG_NODE_APP_KEYS (for compatibility with
  12277. * MC_CMD_FC_OP_LICENSE)
  12278. */
  12279. #define MC_CMD_LICENSING_OUT_INVALID_APP_KEYS_OFST 4
  12280. #define MC_CMD_LICENSING_OUT_INVALID_APP_KEYS_LEN 4
  12281. /* count of application keys which are invalid due to being blacklisted */
  12282. #define MC_CMD_LICENSING_OUT_BLACKLISTED_APP_KEYS_OFST 8
  12283. #define MC_CMD_LICENSING_OUT_BLACKLISTED_APP_KEYS_LEN 4
  12284. /* count of application keys which are invalid due to being unverifiable */
  12285. #define MC_CMD_LICENSING_OUT_UNVERIFIABLE_APP_KEYS_OFST 12
  12286. #define MC_CMD_LICENSING_OUT_UNVERIFIABLE_APP_KEYS_LEN 4
  12287. /* count of application keys which are invalid due to being for the wrong node
  12288. */
  12289. #define MC_CMD_LICENSING_OUT_WRONG_NODE_APP_KEYS_OFST 16
  12290. #define MC_CMD_LICENSING_OUT_WRONG_NODE_APP_KEYS_LEN 4
  12291. /* licensing state (for diagnostics; the exact meaning of the bits in this
  12292. * field are private to the firmware)
  12293. */
  12294. #define MC_CMD_LICENSING_OUT_LICENSING_STATE_OFST 20
  12295. #define MC_CMD_LICENSING_OUT_LICENSING_STATE_LEN 4
  12296. /* licensing subsystem self-test report (for manftest) */
  12297. #define MC_CMD_LICENSING_OUT_LICENSING_SELF_TEST_OFST 24
  12298. #define MC_CMD_LICENSING_OUT_LICENSING_SELF_TEST_LEN 4
  12299. /* enum: licensing subsystem self-test failed */
  12300. #define MC_CMD_LICENSING_OUT_SELF_TEST_FAIL 0x0
  12301. /* enum: licensing subsystem self-test passed */
  12302. #define MC_CMD_LICENSING_OUT_SELF_TEST_PASS 0x1
  12303. /***********************************/
  12304. /* MC_CMD_LICENSING_V3
  12305. * Operations on the NVRAM_PARTITION_TYPE_LICENSE application license partition
  12306. * - V3 licensing (Medford)
  12307. */
  12308. #define MC_CMD_LICENSING_V3 0xd0
  12309. #define MC_CMD_0xd0_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  12310. /* MC_CMD_LICENSING_V3_IN msgrequest */
  12311. #define MC_CMD_LICENSING_V3_IN_LEN 4
  12312. /* identifies the type of operation requested */
  12313. #define MC_CMD_LICENSING_V3_IN_OP_OFST 0
  12314. #define MC_CMD_LICENSING_V3_IN_OP_LEN 4
  12315. /* enum: re-read and apply licenses after a license key partition update; note
  12316. * that this operation returns a zero-length response
  12317. */
  12318. #define MC_CMD_LICENSING_V3_IN_OP_UPDATE_LICENSE 0x0
  12319. /* enum: report counts of installed licenses Returns EAGAIN if license
  12320. * processing (updating) has been started but not yet completed.
  12321. */
  12322. #define MC_CMD_LICENSING_V3_IN_OP_REPORT_LICENSE 0x1
  12323. /* MC_CMD_LICENSING_V3_OUT msgresponse */
  12324. #define MC_CMD_LICENSING_V3_OUT_LEN 88
  12325. /* count of keys which are valid */
  12326. #define MC_CMD_LICENSING_V3_OUT_VALID_KEYS_OFST 0
  12327. #define MC_CMD_LICENSING_V3_OUT_VALID_KEYS_LEN 4
  12328. /* sum of UNVERIFIABLE_KEYS + WRONG_NODE_KEYS (for compatibility with
  12329. * MC_CMD_FC_OP_LICENSE)
  12330. */
  12331. #define MC_CMD_LICENSING_V3_OUT_INVALID_KEYS_OFST 4
  12332. #define MC_CMD_LICENSING_V3_OUT_INVALID_KEYS_LEN 4
  12333. /* count of keys which are invalid due to being unverifiable */
  12334. #define MC_CMD_LICENSING_V3_OUT_UNVERIFIABLE_KEYS_OFST 8
  12335. #define MC_CMD_LICENSING_V3_OUT_UNVERIFIABLE_KEYS_LEN 4
  12336. /* count of keys which are invalid due to being for the wrong node */
  12337. #define MC_CMD_LICENSING_V3_OUT_WRONG_NODE_KEYS_OFST 12
  12338. #define MC_CMD_LICENSING_V3_OUT_WRONG_NODE_KEYS_LEN 4
  12339. /* licensing state (for diagnostics; the exact meaning of the bits in this
  12340. * field are private to the firmware)
  12341. */
  12342. #define MC_CMD_LICENSING_V3_OUT_LICENSING_STATE_OFST 16
  12343. #define MC_CMD_LICENSING_V3_OUT_LICENSING_STATE_LEN 4
  12344. /* licensing subsystem self-test report (for manftest) */
  12345. #define MC_CMD_LICENSING_V3_OUT_LICENSING_SELF_TEST_OFST 20
  12346. #define MC_CMD_LICENSING_V3_OUT_LICENSING_SELF_TEST_LEN 4
  12347. /* enum: licensing subsystem self-test failed */
  12348. #define MC_CMD_LICENSING_V3_OUT_SELF_TEST_FAIL 0x0
  12349. /* enum: licensing subsystem self-test passed */
  12350. #define MC_CMD_LICENSING_V3_OUT_SELF_TEST_PASS 0x1
  12351. /* bitmask of licensed applications */
  12352. #define MC_CMD_LICENSING_V3_OUT_LICENSED_APPS_OFST 24
  12353. #define MC_CMD_LICENSING_V3_OUT_LICENSED_APPS_LEN 8
  12354. #define MC_CMD_LICENSING_V3_OUT_LICENSED_APPS_LO_OFST 24
  12355. #define MC_CMD_LICENSING_V3_OUT_LICENSED_APPS_HI_OFST 28
  12356. /* reserved for future use */
  12357. #define MC_CMD_LICENSING_V3_OUT_RESERVED_0_OFST 32
  12358. #define MC_CMD_LICENSING_V3_OUT_RESERVED_0_LEN 24
  12359. /* bitmask of licensed features */
  12360. #define MC_CMD_LICENSING_V3_OUT_LICENSED_FEATURES_OFST 56
  12361. #define MC_CMD_LICENSING_V3_OUT_LICENSED_FEATURES_LEN 8
  12362. #define MC_CMD_LICENSING_V3_OUT_LICENSED_FEATURES_LO_OFST 56
  12363. #define MC_CMD_LICENSING_V3_OUT_LICENSED_FEATURES_HI_OFST 60
  12364. /* reserved for future use */
  12365. #define MC_CMD_LICENSING_V3_OUT_RESERVED_1_OFST 64
  12366. #define MC_CMD_LICENSING_V3_OUT_RESERVED_1_LEN 24
  12367. /***********************************/
  12368. /* MC_CMD_LICENSING_GET_ID_V3
  12369. * Get ID and type from the NVRAM_PARTITION_TYPE_LICENSE application license
  12370. * partition - V3 licensing (Medford)
  12371. */
  12372. #define MC_CMD_LICENSING_GET_ID_V3 0xd1
  12373. #define MC_CMD_0xd1_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  12374. /* MC_CMD_LICENSING_GET_ID_V3_IN msgrequest */
  12375. #define MC_CMD_LICENSING_GET_ID_V3_IN_LEN 0
  12376. /* MC_CMD_LICENSING_GET_ID_V3_OUT msgresponse */
  12377. #define MC_CMD_LICENSING_GET_ID_V3_OUT_LENMIN 8
  12378. #define MC_CMD_LICENSING_GET_ID_V3_OUT_LENMAX 252
  12379. #define MC_CMD_LICENSING_GET_ID_V3_OUT_LEN(num) (8+1*(num))
  12380. /* type of license (eg 3) */
  12381. #define MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_TYPE_OFST 0
  12382. #define MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_TYPE_LEN 4
  12383. /* length of the license ID (in bytes) */
  12384. #define MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_LENGTH_OFST 4
  12385. #define MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_LENGTH_LEN 4
  12386. /* the unique license ID of the adapter */
  12387. #define MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_OFST 8
  12388. #define MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_LEN 1
  12389. #define MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_MINNUM 0
  12390. #define MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_MAXNUM 244
  12391. /***********************************/
  12392. /* MC_CMD_MC2MC_PROXY
  12393. * Execute an arbitrary MCDI command on the slave MC of a dual-core device.
  12394. * This will fail on a single-core system.
  12395. */
  12396. #define MC_CMD_MC2MC_PROXY 0xf4
  12397. #define MC_CMD_0xf4_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  12398. /* MC_CMD_MC2MC_PROXY_IN msgrequest */
  12399. #define MC_CMD_MC2MC_PROXY_IN_LEN 0
  12400. /* MC_CMD_MC2MC_PROXY_OUT msgresponse */
  12401. #define MC_CMD_MC2MC_PROXY_OUT_LEN 0
  12402. /***********************************/
  12403. /* MC_CMD_GET_LICENSED_APP_STATE
  12404. * Query the state of an individual licensed application. (Note that the actual
  12405. * state may be invalidated by the MC_CMD_LICENSING OP_UPDATE_LICENSE operation
  12406. * or a reboot of the MC.) Not used for V3 licensing
  12407. */
  12408. #define MC_CMD_GET_LICENSED_APP_STATE 0xf5
  12409. #define MC_CMD_0xf5_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  12410. /* MC_CMD_GET_LICENSED_APP_STATE_IN msgrequest */
  12411. #define MC_CMD_GET_LICENSED_APP_STATE_IN_LEN 4
  12412. /* application ID to query (LICENSED_APP_ID_xxx) */
  12413. #define MC_CMD_GET_LICENSED_APP_STATE_IN_APP_ID_OFST 0
  12414. #define MC_CMD_GET_LICENSED_APP_STATE_IN_APP_ID_LEN 4
  12415. /* MC_CMD_GET_LICENSED_APP_STATE_OUT msgresponse */
  12416. #define MC_CMD_GET_LICENSED_APP_STATE_OUT_LEN 4
  12417. /* state of this application */
  12418. #define MC_CMD_GET_LICENSED_APP_STATE_OUT_STATE_OFST 0
  12419. #define MC_CMD_GET_LICENSED_APP_STATE_OUT_STATE_LEN 4
  12420. /* enum: no (or invalid) license is present for the application */
  12421. #define MC_CMD_GET_LICENSED_APP_STATE_OUT_NOT_LICENSED 0x0
  12422. /* enum: a valid license is present for the application */
  12423. #define MC_CMD_GET_LICENSED_APP_STATE_OUT_LICENSED 0x1
  12424. /***********************************/
  12425. /* MC_CMD_GET_LICENSED_V3_APP_STATE
  12426. * Query the state of an individual licensed application. (Note that the actual
  12427. * state may be invalidated by the MC_CMD_LICENSING_V3 OP_UPDATE_LICENSE
  12428. * operation or a reboot of the MC.) Used for V3 licensing (Medford)
  12429. */
  12430. #define MC_CMD_GET_LICENSED_V3_APP_STATE 0xd2
  12431. #define MC_CMD_0xd2_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  12432. /* MC_CMD_GET_LICENSED_V3_APP_STATE_IN msgrequest */
  12433. #define MC_CMD_GET_LICENSED_V3_APP_STATE_IN_LEN 8
  12434. /* application ID to query (LICENSED_V3_APPS_xxx) expressed as a single bit
  12435. * mask
  12436. */
  12437. #define MC_CMD_GET_LICENSED_V3_APP_STATE_IN_APP_ID_OFST 0
  12438. #define MC_CMD_GET_LICENSED_V3_APP_STATE_IN_APP_ID_LEN 8
  12439. #define MC_CMD_GET_LICENSED_V3_APP_STATE_IN_APP_ID_LO_OFST 0
  12440. #define MC_CMD_GET_LICENSED_V3_APP_STATE_IN_APP_ID_HI_OFST 4
  12441. /* MC_CMD_GET_LICENSED_V3_APP_STATE_OUT msgresponse */
  12442. #define MC_CMD_GET_LICENSED_V3_APP_STATE_OUT_LEN 4
  12443. /* state of this application */
  12444. #define MC_CMD_GET_LICENSED_V3_APP_STATE_OUT_STATE_OFST 0
  12445. #define MC_CMD_GET_LICENSED_V3_APP_STATE_OUT_STATE_LEN 4
  12446. /* enum: no (or invalid) license is present for the application */
  12447. #define MC_CMD_GET_LICENSED_V3_APP_STATE_OUT_NOT_LICENSED 0x0
  12448. /* enum: a valid license is present for the application */
  12449. #define MC_CMD_GET_LICENSED_V3_APP_STATE_OUT_LICENSED 0x1
  12450. /***********************************/
  12451. /* MC_CMD_GET_LICENSED_V3_FEATURE_STATES
  12452. * Query the state of one or more licensed features. (Note that the actual
  12453. * state may be invalidated by the MC_CMD_LICENSING_V3 OP_UPDATE_LICENSE
  12454. * operation or a reboot of the MC.) Used for V3 licensing (Medford)
  12455. */
  12456. #define MC_CMD_GET_LICENSED_V3_FEATURE_STATES 0xd3
  12457. #define MC_CMD_0xd3_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  12458. /* MC_CMD_GET_LICENSED_V3_FEATURE_STATES_IN msgrequest */
  12459. #define MC_CMD_GET_LICENSED_V3_FEATURE_STATES_IN_LEN 8
  12460. /* features to query (LICENSED_V3_FEATURES_xxx) expressed as a mask with one or
  12461. * more bits set
  12462. */
  12463. #define MC_CMD_GET_LICENSED_V3_FEATURE_STATES_IN_FEATURES_OFST 0
  12464. #define MC_CMD_GET_LICENSED_V3_FEATURE_STATES_IN_FEATURES_LEN 8
  12465. #define MC_CMD_GET_LICENSED_V3_FEATURE_STATES_IN_FEATURES_LO_OFST 0
  12466. #define MC_CMD_GET_LICENSED_V3_FEATURE_STATES_IN_FEATURES_HI_OFST 4
  12467. /* MC_CMD_GET_LICENSED_V3_FEATURE_STATES_OUT msgresponse */
  12468. #define MC_CMD_GET_LICENSED_V3_FEATURE_STATES_OUT_LEN 8
  12469. /* states of these features - bit set for licensed, clear for not licensed */
  12470. #define MC_CMD_GET_LICENSED_V3_FEATURE_STATES_OUT_STATES_OFST 0
  12471. #define MC_CMD_GET_LICENSED_V3_FEATURE_STATES_OUT_STATES_LEN 8
  12472. #define MC_CMD_GET_LICENSED_V3_FEATURE_STATES_OUT_STATES_LO_OFST 0
  12473. #define MC_CMD_GET_LICENSED_V3_FEATURE_STATES_OUT_STATES_HI_OFST 4
  12474. /***********************************/
  12475. /* MC_CMD_LICENSED_APP_OP
  12476. * Perform an action for an individual licensed application - not used for V3
  12477. * licensing.
  12478. */
  12479. #define MC_CMD_LICENSED_APP_OP 0xf6
  12480. #define MC_CMD_0xf6_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  12481. /* MC_CMD_LICENSED_APP_OP_IN msgrequest */
  12482. #define MC_CMD_LICENSED_APP_OP_IN_LENMIN 8
  12483. #define MC_CMD_LICENSED_APP_OP_IN_LENMAX 252
  12484. #define MC_CMD_LICENSED_APP_OP_IN_LEN(num) (8+4*(num))
  12485. /* application ID */
  12486. #define MC_CMD_LICENSED_APP_OP_IN_APP_ID_OFST 0
  12487. #define MC_CMD_LICENSED_APP_OP_IN_APP_ID_LEN 4
  12488. /* the type of operation requested */
  12489. #define MC_CMD_LICENSED_APP_OP_IN_OP_OFST 4
  12490. #define MC_CMD_LICENSED_APP_OP_IN_OP_LEN 4
  12491. /* enum: validate application */
  12492. #define MC_CMD_LICENSED_APP_OP_IN_OP_VALIDATE 0x0
  12493. /* enum: mask application */
  12494. #define MC_CMD_LICENSED_APP_OP_IN_OP_MASK 0x1
  12495. /* arguments specific to this particular operation */
  12496. #define MC_CMD_LICENSED_APP_OP_IN_ARGS_OFST 8
  12497. #define MC_CMD_LICENSED_APP_OP_IN_ARGS_LEN 4
  12498. #define MC_CMD_LICENSED_APP_OP_IN_ARGS_MINNUM 0
  12499. #define MC_CMD_LICENSED_APP_OP_IN_ARGS_MAXNUM 61
  12500. /* MC_CMD_LICENSED_APP_OP_OUT msgresponse */
  12501. #define MC_CMD_LICENSED_APP_OP_OUT_LENMIN 0
  12502. #define MC_CMD_LICENSED_APP_OP_OUT_LENMAX 252
  12503. #define MC_CMD_LICENSED_APP_OP_OUT_LEN(num) (0+4*(num))
  12504. /* result specific to this particular operation */
  12505. #define MC_CMD_LICENSED_APP_OP_OUT_RESULT_OFST 0
  12506. #define MC_CMD_LICENSED_APP_OP_OUT_RESULT_LEN 4
  12507. #define MC_CMD_LICENSED_APP_OP_OUT_RESULT_MINNUM 0
  12508. #define MC_CMD_LICENSED_APP_OP_OUT_RESULT_MAXNUM 63
  12509. /* MC_CMD_LICENSED_APP_OP_VALIDATE_IN msgrequest */
  12510. #define MC_CMD_LICENSED_APP_OP_VALIDATE_IN_LEN 72
  12511. /* application ID */
  12512. #define MC_CMD_LICENSED_APP_OP_VALIDATE_IN_APP_ID_OFST 0
  12513. #define MC_CMD_LICENSED_APP_OP_VALIDATE_IN_APP_ID_LEN 4
  12514. /* the type of operation requested */
  12515. #define MC_CMD_LICENSED_APP_OP_VALIDATE_IN_OP_OFST 4
  12516. #define MC_CMD_LICENSED_APP_OP_VALIDATE_IN_OP_LEN 4
  12517. /* validation challenge */
  12518. #define MC_CMD_LICENSED_APP_OP_VALIDATE_IN_CHALLENGE_OFST 8
  12519. #define MC_CMD_LICENSED_APP_OP_VALIDATE_IN_CHALLENGE_LEN 64
  12520. /* MC_CMD_LICENSED_APP_OP_VALIDATE_OUT msgresponse */
  12521. #define MC_CMD_LICENSED_APP_OP_VALIDATE_OUT_LEN 68
  12522. /* feature expiry (time_t) */
  12523. #define MC_CMD_LICENSED_APP_OP_VALIDATE_OUT_EXPIRY_OFST 0
  12524. #define MC_CMD_LICENSED_APP_OP_VALIDATE_OUT_EXPIRY_LEN 4
  12525. /* validation response */
  12526. #define MC_CMD_LICENSED_APP_OP_VALIDATE_OUT_RESPONSE_OFST 4
  12527. #define MC_CMD_LICENSED_APP_OP_VALIDATE_OUT_RESPONSE_LEN 64
  12528. /* MC_CMD_LICENSED_APP_OP_MASK_IN msgrequest */
  12529. #define MC_CMD_LICENSED_APP_OP_MASK_IN_LEN 12
  12530. /* application ID */
  12531. #define MC_CMD_LICENSED_APP_OP_MASK_IN_APP_ID_OFST 0
  12532. #define MC_CMD_LICENSED_APP_OP_MASK_IN_APP_ID_LEN 4
  12533. /* the type of operation requested */
  12534. #define MC_CMD_LICENSED_APP_OP_MASK_IN_OP_OFST 4
  12535. #define MC_CMD_LICENSED_APP_OP_MASK_IN_OP_LEN 4
  12536. /* flag */
  12537. #define MC_CMD_LICENSED_APP_OP_MASK_IN_FLAG_OFST 8
  12538. #define MC_CMD_LICENSED_APP_OP_MASK_IN_FLAG_LEN 4
  12539. /* MC_CMD_LICENSED_APP_OP_MASK_OUT msgresponse */
  12540. #define MC_CMD_LICENSED_APP_OP_MASK_OUT_LEN 0
  12541. /***********************************/
  12542. /* MC_CMD_LICENSED_V3_VALIDATE_APP
  12543. * Perform validation for an individual licensed application - V3 licensing
  12544. * (Medford)
  12545. */
  12546. #define MC_CMD_LICENSED_V3_VALIDATE_APP 0xd4
  12547. #define MC_CMD_0xd4_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  12548. /* MC_CMD_LICENSED_V3_VALIDATE_APP_IN msgrequest */
  12549. #define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_LEN 56
  12550. /* challenge for validation (384 bits) */
  12551. #define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_CHALLENGE_OFST 0
  12552. #define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_CHALLENGE_LEN 48
  12553. /* application ID expressed as a single bit mask */
  12554. #define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_APP_ID_OFST 48
  12555. #define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_APP_ID_LEN 8
  12556. #define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_APP_ID_LO_OFST 48
  12557. #define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_APP_ID_HI_OFST 52
  12558. /* MC_CMD_LICENSED_V3_VALIDATE_APP_OUT msgresponse */
  12559. #define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_LEN 116
  12560. /* validation response to challenge in the form of ECDSA signature consisting
  12561. * of two 384-bit integers, r and s, in big-endian order. The signature signs a
  12562. * SHA-384 digest of a message constructed from the concatenation of the input
  12563. * message and the remaining fields of this output message, e.g. challenge[48
  12564. * bytes] ... expiry_time[4 bytes] ...
  12565. */
  12566. #define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_RESPONSE_OFST 0
  12567. #define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_RESPONSE_LEN 96
  12568. /* application expiry time */
  12569. #define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_EXPIRY_TIME_OFST 96
  12570. #define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_EXPIRY_TIME_LEN 4
  12571. /* application expiry units */
  12572. #define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_EXPIRY_UNITS_OFST 100
  12573. #define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_EXPIRY_UNITS_LEN 4
  12574. /* enum: expiry units are accounting units */
  12575. #define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_EXPIRY_UNIT_ACC 0x0
  12576. /* enum: expiry units are calendar days */
  12577. #define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_EXPIRY_UNIT_DAYS 0x1
  12578. /* base MAC address of the NIC stored in NVRAM (note that this is a constant
  12579. * value for a given NIC regardless which function is calling, effectively this
  12580. * is PF0 base MAC address)
  12581. */
  12582. #define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_BASE_MACADDR_OFST 104
  12583. #define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_BASE_MACADDR_LEN 6
  12584. /* MAC address of v-adaptor associated with the client. If no such v-adapator
  12585. * exists, then the field is filled with 0xFF.
  12586. */
  12587. #define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_VADAPTOR_MACADDR_OFST 110
  12588. #define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_VADAPTOR_MACADDR_LEN 6
  12589. /***********************************/
  12590. /* MC_CMD_LICENSED_V3_MASK_FEATURES
  12591. * Mask features - V3 licensing (Medford)
  12592. */
  12593. #define MC_CMD_LICENSED_V3_MASK_FEATURES 0xd5
  12594. #define MC_CMD_0xd5_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  12595. /* MC_CMD_LICENSED_V3_MASK_FEATURES_IN msgrequest */
  12596. #define MC_CMD_LICENSED_V3_MASK_FEATURES_IN_LEN 12
  12597. /* mask to be applied to features to be changed */
  12598. #define MC_CMD_LICENSED_V3_MASK_FEATURES_IN_MASK_OFST 0
  12599. #define MC_CMD_LICENSED_V3_MASK_FEATURES_IN_MASK_LEN 8
  12600. #define MC_CMD_LICENSED_V3_MASK_FEATURES_IN_MASK_LO_OFST 0
  12601. #define MC_CMD_LICENSED_V3_MASK_FEATURES_IN_MASK_HI_OFST 4
  12602. /* whether to turn on or turn off the masked features */
  12603. #define MC_CMD_LICENSED_V3_MASK_FEATURES_IN_FLAG_OFST 8
  12604. #define MC_CMD_LICENSED_V3_MASK_FEATURES_IN_FLAG_LEN 4
  12605. /* enum: turn the features off */
  12606. #define MC_CMD_LICENSED_V3_MASK_FEATURES_IN_OFF 0x0
  12607. /* enum: turn the features back on */
  12608. #define MC_CMD_LICENSED_V3_MASK_FEATURES_IN_ON 0x1
  12609. /* MC_CMD_LICENSED_V3_MASK_FEATURES_OUT msgresponse */
  12610. #define MC_CMD_LICENSED_V3_MASK_FEATURES_OUT_LEN 0
  12611. /***********************************/
  12612. /* MC_CMD_LICENSING_V3_TEMPORARY
  12613. * Perform operations to support installation of a single temporary license in
  12614. * the adapter, in addition to those found in the licensing partition. See
  12615. * SF-116124-SW for an overview of how this could be used. The license is
  12616. * stored in MC persistent data and so will survive a MC reboot, but will be
  12617. * erased when the adapter is power cycled
  12618. */
  12619. #define MC_CMD_LICENSING_V3_TEMPORARY 0xd6
  12620. #define MC_CMD_0xd6_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  12621. /* MC_CMD_LICENSING_V3_TEMPORARY_IN msgrequest */
  12622. #define MC_CMD_LICENSING_V3_TEMPORARY_IN_LEN 4
  12623. /* operation code */
  12624. #define MC_CMD_LICENSING_V3_TEMPORARY_IN_OP_OFST 0
  12625. #define MC_CMD_LICENSING_V3_TEMPORARY_IN_OP_LEN 4
  12626. /* enum: install a new license, overwriting any existing temporary license.
  12627. * This is an asynchronous operation owing to the time taken to validate an
  12628. * ECDSA license
  12629. */
  12630. #define MC_CMD_LICENSING_V3_TEMPORARY_SET 0x0
  12631. /* enum: clear the license immediately rather than waiting for the next power
  12632. * cycle
  12633. */
  12634. #define MC_CMD_LICENSING_V3_TEMPORARY_CLEAR 0x1
  12635. /* enum: get the status of the asynchronous MC_CMD_LICENSING_V3_TEMPORARY_SET
  12636. * operation
  12637. */
  12638. #define MC_CMD_LICENSING_V3_TEMPORARY_STATUS 0x2
  12639. /* MC_CMD_LICENSING_V3_TEMPORARY_IN_SET msgrequest */
  12640. #define MC_CMD_LICENSING_V3_TEMPORARY_IN_SET_LEN 164
  12641. #define MC_CMD_LICENSING_V3_TEMPORARY_IN_SET_OP_OFST 0
  12642. #define MC_CMD_LICENSING_V3_TEMPORARY_IN_SET_OP_LEN 4
  12643. /* ECDSA license and signature */
  12644. #define MC_CMD_LICENSING_V3_TEMPORARY_IN_SET_LICENSE_OFST 4
  12645. #define MC_CMD_LICENSING_V3_TEMPORARY_IN_SET_LICENSE_LEN 160
  12646. /* MC_CMD_LICENSING_V3_TEMPORARY_IN_CLEAR msgrequest */
  12647. #define MC_CMD_LICENSING_V3_TEMPORARY_IN_CLEAR_LEN 4
  12648. #define MC_CMD_LICENSING_V3_TEMPORARY_IN_CLEAR_OP_OFST 0
  12649. #define MC_CMD_LICENSING_V3_TEMPORARY_IN_CLEAR_OP_LEN 4
  12650. /* MC_CMD_LICENSING_V3_TEMPORARY_IN_STATUS msgrequest */
  12651. #define MC_CMD_LICENSING_V3_TEMPORARY_IN_STATUS_LEN 4
  12652. #define MC_CMD_LICENSING_V3_TEMPORARY_IN_STATUS_OP_OFST 0
  12653. #define MC_CMD_LICENSING_V3_TEMPORARY_IN_STATUS_OP_LEN 4
  12654. /* MC_CMD_LICENSING_V3_TEMPORARY_OUT_STATUS msgresponse */
  12655. #define MC_CMD_LICENSING_V3_TEMPORARY_OUT_STATUS_LEN 12
  12656. /* status code */
  12657. #define MC_CMD_LICENSING_V3_TEMPORARY_OUT_STATUS_STATUS_OFST 0
  12658. #define MC_CMD_LICENSING_V3_TEMPORARY_OUT_STATUS_STATUS_LEN 4
  12659. /* enum: finished validating and installing license */
  12660. #define MC_CMD_LICENSING_V3_TEMPORARY_STATUS_OK 0x0
  12661. /* enum: license validation and installation in progress */
  12662. #define MC_CMD_LICENSING_V3_TEMPORARY_STATUS_IN_PROGRESS 0x1
  12663. /* enum: licensing error. More specific error messages are not provided to
  12664. * avoid exposing details of the licensing system to the client
  12665. */
  12666. #define MC_CMD_LICENSING_V3_TEMPORARY_STATUS_ERROR 0x2
  12667. /* bitmask of licensed features */
  12668. #define MC_CMD_LICENSING_V3_TEMPORARY_OUT_STATUS_LICENSED_FEATURES_OFST 4
  12669. #define MC_CMD_LICENSING_V3_TEMPORARY_OUT_STATUS_LICENSED_FEATURES_LEN 8
  12670. #define MC_CMD_LICENSING_V3_TEMPORARY_OUT_STATUS_LICENSED_FEATURES_LO_OFST 4
  12671. #define MC_CMD_LICENSING_V3_TEMPORARY_OUT_STATUS_LICENSED_FEATURES_HI_OFST 8
  12672. /***********************************/
  12673. /* MC_CMD_SET_PORT_SNIFF_CONFIG
  12674. * Configure RX port sniffing for the physical port associated with the calling
  12675. * function. Only a privileged function may change the port sniffing
  12676. * configuration. A copy of all traffic delivered to the host (non-promiscuous
  12677. * mode) or all traffic arriving at the port (promiscuous mode) may be
  12678. * delivered to a specific queue, or a set of queues with RSS.
  12679. */
  12680. #define MC_CMD_SET_PORT_SNIFF_CONFIG 0xf7
  12681. #define MC_CMD_0xf7_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  12682. /* MC_CMD_SET_PORT_SNIFF_CONFIG_IN msgrequest */
  12683. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_LEN 16
  12684. /* configuration flags */
  12685. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_FLAGS_OFST 0
  12686. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_FLAGS_LEN 4
  12687. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_ENABLE_LBN 0
  12688. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_ENABLE_WIDTH 1
  12689. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_PROMISCUOUS_LBN 1
  12690. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_PROMISCUOUS_WIDTH 1
  12691. /* receive queue handle (for RSS mode, this is the base queue) */
  12692. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_RX_QUEUE_OFST 4
  12693. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_RX_QUEUE_LEN 4
  12694. /* receive mode */
  12695. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_RX_MODE_OFST 8
  12696. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_RX_MODE_LEN 4
  12697. /* enum: receive to just the specified queue */
  12698. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_RX_MODE_SIMPLE 0x0
  12699. /* enum: receive to multiple queues using RSS context */
  12700. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_RX_MODE_RSS 0x1
  12701. /* RSS context (for RX_MODE_RSS) as returned by MC_CMD_RSS_CONTEXT_ALLOC. Note
  12702. * that these handles should be considered opaque to the host, although a value
  12703. * of 0xFFFFFFFF is guaranteed never to be a valid handle.
  12704. */
  12705. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_RX_CONTEXT_OFST 12
  12706. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_RX_CONTEXT_LEN 4
  12707. /* MC_CMD_SET_PORT_SNIFF_CONFIG_OUT msgresponse */
  12708. #define MC_CMD_SET_PORT_SNIFF_CONFIG_OUT_LEN 0
  12709. /***********************************/
  12710. /* MC_CMD_GET_PORT_SNIFF_CONFIG
  12711. * Obtain the current RX port sniffing configuration for the physical port
  12712. * associated with the calling function. Only a privileged function may read
  12713. * the configuration.
  12714. */
  12715. #define MC_CMD_GET_PORT_SNIFF_CONFIG 0xf8
  12716. #define MC_CMD_0xf8_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  12717. /* MC_CMD_GET_PORT_SNIFF_CONFIG_IN msgrequest */
  12718. #define MC_CMD_GET_PORT_SNIFF_CONFIG_IN_LEN 0
  12719. /* MC_CMD_GET_PORT_SNIFF_CONFIG_OUT msgresponse */
  12720. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_LEN 16
  12721. /* configuration flags */
  12722. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_FLAGS_OFST 0
  12723. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_FLAGS_LEN 4
  12724. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_ENABLE_LBN 0
  12725. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_ENABLE_WIDTH 1
  12726. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_PROMISCUOUS_LBN 1
  12727. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_PROMISCUOUS_WIDTH 1
  12728. /* receiving queue handle (for RSS mode, this is the base queue) */
  12729. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_RX_QUEUE_OFST 4
  12730. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_RX_QUEUE_LEN 4
  12731. /* receive mode */
  12732. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_RX_MODE_OFST 8
  12733. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_RX_MODE_LEN 4
  12734. /* enum: receiving to just the specified queue */
  12735. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_RX_MODE_SIMPLE 0x0
  12736. /* enum: receiving to multiple queues using RSS context */
  12737. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_RX_MODE_RSS 0x1
  12738. /* RSS context (for RX_MODE_RSS) */
  12739. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_RX_CONTEXT_OFST 12
  12740. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_RX_CONTEXT_LEN 4
  12741. /***********************************/
  12742. /* MC_CMD_SET_PARSER_DISP_CONFIG
  12743. * Change configuration related to the parser-dispatcher subsystem.
  12744. */
  12745. #define MC_CMD_SET_PARSER_DISP_CONFIG 0xf9
  12746. #define MC_CMD_0xf9_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  12747. /* MC_CMD_SET_PARSER_DISP_CONFIG_IN msgrequest */
  12748. #define MC_CMD_SET_PARSER_DISP_CONFIG_IN_LENMIN 12
  12749. #define MC_CMD_SET_PARSER_DISP_CONFIG_IN_LENMAX 252
  12750. #define MC_CMD_SET_PARSER_DISP_CONFIG_IN_LEN(num) (8+4*(num))
  12751. /* the type of configuration setting to change */
  12752. #define MC_CMD_SET_PARSER_DISP_CONFIG_IN_TYPE_OFST 0
  12753. #define MC_CMD_SET_PARSER_DISP_CONFIG_IN_TYPE_LEN 4
  12754. /* enum: Per-TXQ enable for multicast UDP destination lookup for possible
  12755. * internal loopback. (ENTITY is a queue handle, VALUE is a single boolean.)
  12756. */
  12757. #define MC_CMD_SET_PARSER_DISP_CONFIG_IN_TXQ_MCAST_UDP_DST_LOOKUP_EN 0x0
  12758. /* enum: Per-v-adaptor enable for suppression of self-transmissions on the
  12759. * internal loopback path. (ENTITY is an EVB_PORT_ID, VALUE is a single
  12760. * boolean.)
  12761. */
  12762. #define MC_CMD_SET_PARSER_DISP_CONFIG_IN_VADAPTOR_SUPPRESS_SELF_TX 0x1
  12763. /* handle for the entity to update: queue handle, EVB port ID, etc. depending
  12764. * on the type of configuration setting being changed
  12765. */
  12766. #define MC_CMD_SET_PARSER_DISP_CONFIG_IN_ENTITY_OFST 4
  12767. #define MC_CMD_SET_PARSER_DISP_CONFIG_IN_ENTITY_LEN 4
  12768. /* new value: the details depend on the type of configuration setting being
  12769. * changed
  12770. */
  12771. #define MC_CMD_SET_PARSER_DISP_CONFIG_IN_VALUE_OFST 8
  12772. #define MC_CMD_SET_PARSER_DISP_CONFIG_IN_VALUE_LEN 4
  12773. #define MC_CMD_SET_PARSER_DISP_CONFIG_IN_VALUE_MINNUM 1
  12774. #define MC_CMD_SET_PARSER_DISP_CONFIG_IN_VALUE_MAXNUM 61
  12775. /* MC_CMD_SET_PARSER_DISP_CONFIG_OUT msgresponse */
  12776. #define MC_CMD_SET_PARSER_DISP_CONFIG_OUT_LEN 0
  12777. /***********************************/
  12778. /* MC_CMD_GET_PARSER_DISP_CONFIG
  12779. * Read configuration related to the parser-dispatcher subsystem.
  12780. */
  12781. #define MC_CMD_GET_PARSER_DISP_CONFIG 0xfa
  12782. #define MC_CMD_0xfa_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  12783. /* MC_CMD_GET_PARSER_DISP_CONFIG_IN msgrequest */
  12784. #define MC_CMD_GET_PARSER_DISP_CONFIG_IN_LEN 8
  12785. /* the type of configuration setting to read */
  12786. #define MC_CMD_GET_PARSER_DISP_CONFIG_IN_TYPE_OFST 0
  12787. #define MC_CMD_GET_PARSER_DISP_CONFIG_IN_TYPE_LEN 4
  12788. /* Enum values, see field(s): */
  12789. /* MC_CMD_SET_PARSER_DISP_CONFIG/MC_CMD_SET_PARSER_DISP_CONFIG_IN/TYPE */
  12790. /* handle for the entity to query: queue handle, EVB port ID, etc. depending on
  12791. * the type of configuration setting being read
  12792. */
  12793. #define MC_CMD_GET_PARSER_DISP_CONFIG_IN_ENTITY_OFST 4
  12794. #define MC_CMD_GET_PARSER_DISP_CONFIG_IN_ENTITY_LEN 4
  12795. /* MC_CMD_GET_PARSER_DISP_CONFIG_OUT msgresponse */
  12796. #define MC_CMD_GET_PARSER_DISP_CONFIG_OUT_LENMIN 4
  12797. #define MC_CMD_GET_PARSER_DISP_CONFIG_OUT_LENMAX 252
  12798. #define MC_CMD_GET_PARSER_DISP_CONFIG_OUT_LEN(num) (0+4*(num))
  12799. /* current value: the details depend on the type of configuration setting being
  12800. * read
  12801. */
  12802. #define MC_CMD_GET_PARSER_DISP_CONFIG_OUT_VALUE_OFST 0
  12803. #define MC_CMD_GET_PARSER_DISP_CONFIG_OUT_VALUE_LEN 4
  12804. #define MC_CMD_GET_PARSER_DISP_CONFIG_OUT_VALUE_MINNUM 1
  12805. #define MC_CMD_GET_PARSER_DISP_CONFIG_OUT_VALUE_MAXNUM 63
  12806. /***********************************/
  12807. /* MC_CMD_SET_TX_PORT_SNIFF_CONFIG
  12808. * Configure TX port sniffing for the physical port associated with the calling
  12809. * function. Only a privileged function may change the port sniffing
  12810. * configuration. A copy of all traffic transmitted through the port may be
  12811. * delivered to a specific queue, or a set of queues with RSS. Note that these
  12812. * packets are delivered with transmit timestamps in the packet prefix, not
  12813. * receive timestamps, so it is likely that the queue(s) will need to be
  12814. * dedicated as TX sniff receivers.
  12815. */
  12816. #define MC_CMD_SET_TX_PORT_SNIFF_CONFIG 0xfb
  12817. #define MC_CMD_0xfb_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  12818. /* MC_CMD_SET_TX_PORT_SNIFF_CONFIG_IN msgrequest */
  12819. #define MC_CMD_SET_TX_PORT_SNIFF_CONFIG_IN_LEN 16
  12820. /* configuration flags */
  12821. #define MC_CMD_SET_TX_PORT_SNIFF_CONFIG_IN_FLAGS_OFST 0
  12822. #define MC_CMD_SET_TX_PORT_SNIFF_CONFIG_IN_FLAGS_LEN 4
  12823. #define MC_CMD_SET_TX_PORT_SNIFF_CONFIG_IN_ENABLE_LBN 0
  12824. #define MC_CMD_SET_TX_PORT_SNIFF_CONFIG_IN_ENABLE_WIDTH 1
  12825. /* receive queue handle (for RSS mode, this is the base queue) */
  12826. #define MC_CMD_SET_TX_PORT_SNIFF_CONFIG_IN_RX_QUEUE_OFST 4
  12827. #define MC_CMD_SET_TX_PORT_SNIFF_CONFIG_IN_RX_QUEUE_LEN 4
  12828. /* receive mode */
  12829. #define MC_CMD_SET_TX_PORT_SNIFF_CONFIG_IN_RX_MODE_OFST 8
  12830. #define MC_CMD_SET_TX_PORT_SNIFF_CONFIG_IN_RX_MODE_LEN 4
  12831. /* enum: receive to just the specified queue */
  12832. #define MC_CMD_SET_TX_PORT_SNIFF_CONFIG_IN_RX_MODE_SIMPLE 0x0
  12833. /* enum: receive to multiple queues using RSS context */
  12834. #define MC_CMD_SET_TX_PORT_SNIFF_CONFIG_IN_RX_MODE_RSS 0x1
  12835. /* RSS context (for RX_MODE_RSS) as returned by MC_CMD_RSS_CONTEXT_ALLOC. Note
  12836. * that these handles should be considered opaque to the host, although a value
  12837. * of 0xFFFFFFFF is guaranteed never to be a valid handle.
  12838. */
  12839. #define MC_CMD_SET_TX_PORT_SNIFF_CONFIG_IN_RX_CONTEXT_OFST 12
  12840. #define MC_CMD_SET_TX_PORT_SNIFF_CONFIG_IN_RX_CONTEXT_LEN 4
  12841. /* MC_CMD_SET_TX_PORT_SNIFF_CONFIG_OUT msgresponse */
  12842. #define MC_CMD_SET_TX_PORT_SNIFF_CONFIG_OUT_LEN 0
  12843. /***********************************/
  12844. /* MC_CMD_GET_TX_PORT_SNIFF_CONFIG
  12845. * Obtain the current TX port sniffing configuration for the physical port
  12846. * associated with the calling function. Only a privileged function may read
  12847. * the configuration.
  12848. */
  12849. #define MC_CMD_GET_TX_PORT_SNIFF_CONFIG 0xfc
  12850. #define MC_CMD_0xfc_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  12851. /* MC_CMD_GET_TX_PORT_SNIFF_CONFIG_IN msgrequest */
  12852. #define MC_CMD_GET_TX_PORT_SNIFF_CONFIG_IN_LEN 0
  12853. /* MC_CMD_GET_TX_PORT_SNIFF_CONFIG_OUT msgresponse */
  12854. #define MC_CMD_GET_TX_PORT_SNIFF_CONFIG_OUT_LEN 16
  12855. /* configuration flags */
  12856. #define MC_CMD_GET_TX_PORT_SNIFF_CONFIG_OUT_FLAGS_OFST 0
  12857. #define MC_CMD_GET_TX_PORT_SNIFF_CONFIG_OUT_FLAGS_LEN 4
  12858. #define MC_CMD_GET_TX_PORT_SNIFF_CONFIG_OUT_ENABLE_LBN 0
  12859. #define MC_CMD_GET_TX_PORT_SNIFF_CONFIG_OUT_ENABLE_WIDTH 1
  12860. /* receiving queue handle (for RSS mode, this is the base queue) */
  12861. #define MC_CMD_GET_TX_PORT_SNIFF_CONFIG_OUT_RX_QUEUE_OFST 4
  12862. #define MC_CMD_GET_TX_PORT_SNIFF_CONFIG_OUT_RX_QUEUE_LEN 4
  12863. /* receive mode */
  12864. #define MC_CMD_GET_TX_PORT_SNIFF_CONFIG_OUT_RX_MODE_OFST 8
  12865. #define MC_CMD_GET_TX_PORT_SNIFF_CONFIG_OUT_RX_MODE_LEN 4
  12866. /* enum: receiving to just the specified queue */
  12867. #define MC_CMD_GET_TX_PORT_SNIFF_CONFIG_OUT_RX_MODE_SIMPLE 0x0
  12868. /* enum: receiving to multiple queues using RSS context */
  12869. #define MC_CMD_GET_TX_PORT_SNIFF_CONFIG_OUT_RX_MODE_RSS 0x1
  12870. /* RSS context (for RX_MODE_RSS) */
  12871. #define MC_CMD_GET_TX_PORT_SNIFF_CONFIG_OUT_RX_CONTEXT_OFST 12
  12872. #define MC_CMD_GET_TX_PORT_SNIFF_CONFIG_OUT_RX_CONTEXT_LEN 4
  12873. /***********************************/
  12874. /* MC_CMD_RMON_STATS_RX_ERRORS
  12875. * Per queue rx error stats.
  12876. */
  12877. #define MC_CMD_RMON_STATS_RX_ERRORS 0xfe
  12878. #define MC_CMD_0xfe_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  12879. /* MC_CMD_RMON_STATS_RX_ERRORS_IN msgrequest */
  12880. #define MC_CMD_RMON_STATS_RX_ERRORS_IN_LEN 8
  12881. /* The rx queue to get stats for. */
  12882. #define MC_CMD_RMON_STATS_RX_ERRORS_IN_RX_QUEUE_OFST 0
  12883. #define MC_CMD_RMON_STATS_RX_ERRORS_IN_RX_QUEUE_LEN 4
  12884. #define MC_CMD_RMON_STATS_RX_ERRORS_IN_FLAGS_OFST 4
  12885. #define MC_CMD_RMON_STATS_RX_ERRORS_IN_FLAGS_LEN 4
  12886. #define MC_CMD_RMON_STATS_RX_ERRORS_IN_RST_LBN 0
  12887. #define MC_CMD_RMON_STATS_RX_ERRORS_IN_RST_WIDTH 1
  12888. /* MC_CMD_RMON_STATS_RX_ERRORS_OUT msgresponse */
  12889. #define MC_CMD_RMON_STATS_RX_ERRORS_OUT_LEN 16
  12890. #define MC_CMD_RMON_STATS_RX_ERRORS_OUT_CRC_ERRORS_OFST 0
  12891. #define MC_CMD_RMON_STATS_RX_ERRORS_OUT_CRC_ERRORS_LEN 4
  12892. #define MC_CMD_RMON_STATS_RX_ERRORS_OUT_TRUNC_ERRORS_OFST 4
  12893. #define MC_CMD_RMON_STATS_RX_ERRORS_OUT_TRUNC_ERRORS_LEN 4
  12894. #define MC_CMD_RMON_STATS_RX_ERRORS_OUT_RX_NO_DESC_DROPS_OFST 8
  12895. #define MC_CMD_RMON_STATS_RX_ERRORS_OUT_RX_NO_DESC_DROPS_LEN 4
  12896. #define MC_CMD_RMON_STATS_RX_ERRORS_OUT_RX_ABORT_OFST 12
  12897. #define MC_CMD_RMON_STATS_RX_ERRORS_OUT_RX_ABORT_LEN 4
  12898. /***********************************/
  12899. /* MC_CMD_GET_PCIE_RESOURCE_INFO
  12900. * Find out about available PCIE resources
  12901. */
  12902. #define MC_CMD_GET_PCIE_RESOURCE_INFO 0xfd
  12903. #define MC_CMD_0xfd_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  12904. /* MC_CMD_GET_PCIE_RESOURCE_INFO_IN msgrequest */
  12905. #define MC_CMD_GET_PCIE_RESOURCE_INFO_IN_LEN 0
  12906. /* MC_CMD_GET_PCIE_RESOURCE_INFO_OUT msgresponse */
  12907. #define MC_CMD_GET_PCIE_RESOURCE_INFO_OUT_LEN 28
  12908. /* The maximum number of PFs the device can expose */
  12909. #define MC_CMD_GET_PCIE_RESOURCE_INFO_OUT_MAX_PFS_OFST 0
  12910. #define MC_CMD_GET_PCIE_RESOURCE_INFO_OUT_MAX_PFS_LEN 4
  12911. /* The maximum number of VFs the device can expose in total */
  12912. #define MC_CMD_GET_PCIE_RESOURCE_INFO_OUT_MAX_VFS_OFST 4
  12913. #define MC_CMD_GET_PCIE_RESOURCE_INFO_OUT_MAX_VFS_LEN 4
  12914. /* The maximum number of MSI-X vectors the device can provide in total */
  12915. #define MC_CMD_GET_PCIE_RESOURCE_INFO_OUT_MAX_VECTORS_OFST 8
  12916. #define MC_CMD_GET_PCIE_RESOURCE_INFO_OUT_MAX_VECTORS_LEN 4
  12917. /* the number of MSI-X vectors the device will allocate by default to each PF
  12918. */
  12919. #define MC_CMD_GET_PCIE_RESOURCE_INFO_OUT_DEFAULT_PF_VECTORS_OFST 12
  12920. #define MC_CMD_GET_PCIE_RESOURCE_INFO_OUT_DEFAULT_PF_VECTORS_LEN 4
  12921. /* the number of MSI-X vectors the device will allocate by default to each VF
  12922. */
  12923. #define MC_CMD_GET_PCIE_RESOURCE_INFO_OUT_DEFAULT_VF_VECTORS_OFST 16
  12924. #define MC_CMD_GET_PCIE_RESOURCE_INFO_OUT_DEFAULT_VF_VECTORS_LEN 4
  12925. /* the maximum number of MSI-X vectors the device can allocate to any one PF */
  12926. #define MC_CMD_GET_PCIE_RESOURCE_INFO_OUT_MAX_PF_VECTORS_OFST 20
  12927. #define MC_CMD_GET_PCIE_RESOURCE_INFO_OUT_MAX_PF_VECTORS_LEN 4
  12928. /* the maximum number of MSI-X vectors the device can allocate to any one VF */
  12929. #define MC_CMD_GET_PCIE_RESOURCE_INFO_OUT_MAX_VF_VECTORS_OFST 24
  12930. #define MC_CMD_GET_PCIE_RESOURCE_INFO_OUT_MAX_VF_VECTORS_LEN 4
  12931. /***********************************/
  12932. /* MC_CMD_GET_PORT_MODES
  12933. * Find out about available port modes
  12934. */
  12935. #define MC_CMD_GET_PORT_MODES 0xff
  12936. #define MC_CMD_0xff_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  12937. /* MC_CMD_GET_PORT_MODES_IN msgrequest */
  12938. #define MC_CMD_GET_PORT_MODES_IN_LEN 0
  12939. /* MC_CMD_GET_PORT_MODES_OUT msgresponse */
  12940. #define MC_CMD_GET_PORT_MODES_OUT_LEN 12
  12941. /* Bitmask of port modes available on the board (indexed by TLV_PORT_MODE_*) */
  12942. #define MC_CMD_GET_PORT_MODES_OUT_MODES_OFST 0
  12943. #define MC_CMD_GET_PORT_MODES_OUT_MODES_LEN 4
  12944. /* Default (canonical) board mode */
  12945. #define MC_CMD_GET_PORT_MODES_OUT_DEFAULT_MODE_OFST 4
  12946. #define MC_CMD_GET_PORT_MODES_OUT_DEFAULT_MODE_LEN 4
  12947. /* Current board mode */
  12948. #define MC_CMD_GET_PORT_MODES_OUT_CURRENT_MODE_OFST 8
  12949. #define MC_CMD_GET_PORT_MODES_OUT_CURRENT_MODE_LEN 4
  12950. /***********************************/
  12951. /* MC_CMD_READ_ATB
  12952. * Sample voltages on the ATB
  12953. */
  12954. #define MC_CMD_READ_ATB 0x100
  12955. #define MC_CMD_0x100_PRIVILEGE_CTG SRIOV_CTG_INSECURE
  12956. /* MC_CMD_READ_ATB_IN msgrequest */
  12957. #define MC_CMD_READ_ATB_IN_LEN 16
  12958. #define MC_CMD_READ_ATB_IN_SIGNAL_BUS_OFST 0
  12959. #define MC_CMD_READ_ATB_IN_SIGNAL_BUS_LEN 4
  12960. #define MC_CMD_READ_ATB_IN_BUS_CCOM 0x0 /* enum */
  12961. #define MC_CMD_READ_ATB_IN_BUS_CKR 0x1 /* enum */
  12962. #define MC_CMD_READ_ATB_IN_BUS_CPCIE 0x8 /* enum */
  12963. #define MC_CMD_READ_ATB_IN_SIGNAL_EN_BITNO_OFST 4
  12964. #define MC_CMD_READ_ATB_IN_SIGNAL_EN_BITNO_LEN 4
  12965. #define MC_CMD_READ_ATB_IN_SIGNAL_SEL_OFST 8
  12966. #define MC_CMD_READ_ATB_IN_SIGNAL_SEL_LEN 4
  12967. #define MC_CMD_READ_ATB_IN_SETTLING_TIME_US_OFST 12
  12968. #define MC_CMD_READ_ATB_IN_SETTLING_TIME_US_LEN 4
  12969. /* MC_CMD_READ_ATB_OUT msgresponse */
  12970. #define MC_CMD_READ_ATB_OUT_LEN 4
  12971. #define MC_CMD_READ_ATB_OUT_SAMPLE_MV_OFST 0
  12972. #define MC_CMD_READ_ATB_OUT_SAMPLE_MV_LEN 4
  12973. /***********************************/
  12974. /* MC_CMD_GET_WORKAROUNDS
  12975. * Read the list of all implemented and all currently enabled workarounds. The
  12976. * enums here must correspond with those in MC_CMD_WORKAROUND.
  12977. */
  12978. #define MC_CMD_GET_WORKAROUNDS 0x59
  12979. #define MC_CMD_0x59_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  12980. /* MC_CMD_GET_WORKAROUNDS_OUT msgresponse */
  12981. #define MC_CMD_GET_WORKAROUNDS_OUT_LEN 8
  12982. /* Each workaround is represented by a single bit according to the enums below.
  12983. */
  12984. #define MC_CMD_GET_WORKAROUNDS_OUT_IMPLEMENTED_OFST 0
  12985. #define MC_CMD_GET_WORKAROUNDS_OUT_IMPLEMENTED_LEN 4
  12986. #define MC_CMD_GET_WORKAROUNDS_OUT_ENABLED_OFST 4
  12987. #define MC_CMD_GET_WORKAROUNDS_OUT_ENABLED_LEN 4
  12988. /* enum: Bug 17230 work around. */
  12989. #define MC_CMD_GET_WORKAROUNDS_OUT_BUG17230 0x2
  12990. /* enum: Bug 35388 work around (unsafe EVQ writes). */
  12991. #define MC_CMD_GET_WORKAROUNDS_OUT_BUG35388 0x4
  12992. /* enum: Bug35017 workaround (A64 tables must be identity map) */
  12993. #define MC_CMD_GET_WORKAROUNDS_OUT_BUG35017 0x8
  12994. /* enum: Bug 41750 present (MC_CMD_TRIGGER_INTERRUPT won't work) */
  12995. #define MC_CMD_GET_WORKAROUNDS_OUT_BUG41750 0x10
  12996. /* enum: Bug 42008 present (Interrupts can overtake associated events). Caution
  12997. * - before adding code that queries this workaround, remember that there's
  12998. * released Monza firmware that doesn't understand MC_CMD_WORKAROUND_BUG42008,
  12999. * and will hence (incorrectly) report that the bug doesn't exist.
  13000. */
  13001. #define MC_CMD_GET_WORKAROUNDS_OUT_BUG42008 0x20
  13002. /* enum: Bug 26807 features present in firmware (multicast filter chaining) */
  13003. #define MC_CMD_GET_WORKAROUNDS_OUT_BUG26807 0x40
  13004. /* enum: Bug 61265 work around (broken EVQ TMR writes). */
  13005. #define MC_CMD_GET_WORKAROUNDS_OUT_BUG61265 0x80
  13006. /***********************************/
  13007. /* MC_CMD_PRIVILEGE_MASK
  13008. * Read/set privileges of an arbitrary PCIe function
  13009. */
  13010. #define MC_CMD_PRIVILEGE_MASK 0x5a
  13011. #define MC_CMD_0x5a_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  13012. /* MC_CMD_PRIVILEGE_MASK_IN msgrequest */
  13013. #define MC_CMD_PRIVILEGE_MASK_IN_LEN 8
  13014. /* The target function to have its mask read or set e.g. PF 0 = 0xFFFF0000, VF
  13015. * 1,3 = 0x00030001
  13016. */
  13017. #define MC_CMD_PRIVILEGE_MASK_IN_FUNCTION_OFST 0
  13018. #define MC_CMD_PRIVILEGE_MASK_IN_FUNCTION_LEN 4
  13019. #define MC_CMD_PRIVILEGE_MASK_IN_FUNCTION_PF_LBN 0
  13020. #define MC_CMD_PRIVILEGE_MASK_IN_FUNCTION_PF_WIDTH 16
  13021. #define MC_CMD_PRIVILEGE_MASK_IN_FUNCTION_VF_LBN 16
  13022. #define MC_CMD_PRIVILEGE_MASK_IN_FUNCTION_VF_WIDTH 16
  13023. #define MC_CMD_PRIVILEGE_MASK_IN_VF_NULL 0xffff /* enum */
  13024. /* New privilege mask to be set. The mask will only be changed if the MSB is
  13025. * set to 1.
  13026. */
  13027. #define MC_CMD_PRIVILEGE_MASK_IN_NEW_MASK_OFST 4
  13028. #define MC_CMD_PRIVILEGE_MASK_IN_NEW_MASK_LEN 4
  13029. #define MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN 0x1 /* enum */
  13030. #define MC_CMD_PRIVILEGE_MASK_IN_GRP_LINK 0x2 /* enum */
  13031. #define MC_CMD_PRIVILEGE_MASK_IN_GRP_ONLOAD 0x4 /* enum */
  13032. #define MC_CMD_PRIVILEGE_MASK_IN_GRP_PTP 0x8 /* enum */
  13033. #define MC_CMD_PRIVILEGE_MASK_IN_GRP_INSECURE_FILTERS 0x10 /* enum */
  13034. /* enum: Deprecated. Equivalent to MAC_SPOOFING_TX combined with CHANGE_MAC. */
  13035. #define MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING 0x20
  13036. #define MC_CMD_PRIVILEGE_MASK_IN_GRP_UNICAST 0x40 /* enum */
  13037. #define MC_CMD_PRIVILEGE_MASK_IN_GRP_MULTICAST 0x80 /* enum */
  13038. #define MC_CMD_PRIVILEGE_MASK_IN_GRP_BROADCAST 0x100 /* enum */
  13039. #define MC_CMD_PRIVILEGE_MASK_IN_GRP_ALL_MULTICAST 0x200 /* enum */
  13040. #define MC_CMD_PRIVILEGE_MASK_IN_GRP_PROMISCUOUS 0x400 /* enum */
  13041. /* enum: Allows to set the TX packets' source MAC address to any arbitrary MAC
  13042. * adress.
  13043. */
  13044. #define MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING_TX 0x800
  13045. /* enum: Privilege that allows a Function to change the MAC address configured
  13046. * in its associated vAdapter/vPort.
  13047. */
  13048. #define MC_CMD_PRIVILEGE_MASK_IN_GRP_CHANGE_MAC 0x1000
  13049. /* enum: Privilege that allows a Function to install filters that specify VLANs
  13050. * that are not in the permit list for the associated vPort. This privilege is
  13051. * primarily to support ESX where vPorts are created that restrict traffic to
  13052. * only a set of permitted VLANs. See the vPort flag FLAG_VLAN_RESTRICT.
  13053. */
  13054. #define MC_CMD_PRIVILEGE_MASK_IN_GRP_UNRESTRICTED_VLAN 0x2000
  13055. /* enum: Privilege for insecure commands. Commands that belong to this group
  13056. * are not permitted on secure adapters regardless of the privilege mask.
  13057. */
  13058. #define MC_CMD_PRIVILEGE_MASK_IN_GRP_INSECURE 0x4000
  13059. /* enum: Set this bit to indicate that a new privilege mask is to be set,
  13060. * otherwise the command will only read the existing mask.
  13061. */
  13062. #define MC_CMD_PRIVILEGE_MASK_IN_DO_CHANGE 0x80000000
  13063. /* MC_CMD_PRIVILEGE_MASK_OUT msgresponse */
  13064. #define MC_CMD_PRIVILEGE_MASK_OUT_LEN 4
  13065. /* For an admin function, always all the privileges are reported. */
  13066. #define MC_CMD_PRIVILEGE_MASK_OUT_OLD_MASK_OFST 0
  13067. #define MC_CMD_PRIVILEGE_MASK_OUT_OLD_MASK_LEN 4
  13068. /***********************************/
  13069. /* MC_CMD_LINK_STATE_MODE
  13070. * Read/set link state mode of a VF
  13071. */
  13072. #define MC_CMD_LINK_STATE_MODE 0x5c
  13073. #define MC_CMD_0x5c_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  13074. /* MC_CMD_LINK_STATE_MODE_IN msgrequest */
  13075. #define MC_CMD_LINK_STATE_MODE_IN_LEN 8
  13076. /* The target function to have its link state mode read or set, must be a VF
  13077. * e.g. VF 1,3 = 0x00030001
  13078. */
  13079. #define MC_CMD_LINK_STATE_MODE_IN_FUNCTION_OFST 0
  13080. #define MC_CMD_LINK_STATE_MODE_IN_FUNCTION_LEN 4
  13081. #define MC_CMD_LINK_STATE_MODE_IN_FUNCTION_PF_LBN 0
  13082. #define MC_CMD_LINK_STATE_MODE_IN_FUNCTION_PF_WIDTH 16
  13083. #define MC_CMD_LINK_STATE_MODE_IN_FUNCTION_VF_LBN 16
  13084. #define MC_CMD_LINK_STATE_MODE_IN_FUNCTION_VF_WIDTH 16
  13085. /* New link state mode to be set */
  13086. #define MC_CMD_LINK_STATE_MODE_IN_NEW_MODE_OFST 4
  13087. #define MC_CMD_LINK_STATE_MODE_IN_NEW_MODE_LEN 4
  13088. #define MC_CMD_LINK_STATE_MODE_IN_LINK_STATE_AUTO 0x0 /* enum */
  13089. #define MC_CMD_LINK_STATE_MODE_IN_LINK_STATE_UP 0x1 /* enum */
  13090. #define MC_CMD_LINK_STATE_MODE_IN_LINK_STATE_DOWN 0x2 /* enum */
  13091. /* enum: Use this value to just read the existing setting without modifying it.
  13092. */
  13093. #define MC_CMD_LINK_STATE_MODE_IN_DO_NOT_CHANGE 0xffffffff
  13094. /* MC_CMD_LINK_STATE_MODE_OUT msgresponse */
  13095. #define MC_CMD_LINK_STATE_MODE_OUT_LEN 4
  13096. #define MC_CMD_LINK_STATE_MODE_OUT_OLD_MODE_OFST 0
  13097. #define MC_CMD_LINK_STATE_MODE_OUT_OLD_MODE_LEN 4
  13098. /***********************************/
  13099. /* MC_CMD_GET_SNAPSHOT_LENGTH
  13100. * Obtain the current range of allowable values for the SNAPSHOT_LENGTH
  13101. * parameter to MC_CMD_INIT_RXQ.
  13102. */
  13103. #define MC_CMD_GET_SNAPSHOT_LENGTH 0x101
  13104. #define MC_CMD_0x101_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  13105. /* MC_CMD_GET_SNAPSHOT_LENGTH_IN msgrequest */
  13106. #define MC_CMD_GET_SNAPSHOT_LENGTH_IN_LEN 0
  13107. /* MC_CMD_GET_SNAPSHOT_LENGTH_OUT msgresponse */
  13108. #define MC_CMD_GET_SNAPSHOT_LENGTH_OUT_LEN 8
  13109. /* Minimum acceptable snapshot length. */
  13110. #define MC_CMD_GET_SNAPSHOT_LENGTH_OUT_RX_SNAPLEN_MIN_OFST 0
  13111. #define MC_CMD_GET_SNAPSHOT_LENGTH_OUT_RX_SNAPLEN_MIN_LEN 4
  13112. /* Maximum acceptable snapshot length. */
  13113. #define MC_CMD_GET_SNAPSHOT_LENGTH_OUT_RX_SNAPLEN_MAX_OFST 4
  13114. #define MC_CMD_GET_SNAPSHOT_LENGTH_OUT_RX_SNAPLEN_MAX_LEN 4
  13115. /***********************************/
  13116. /* MC_CMD_FUSE_DIAGS
  13117. * Additional fuse diagnostics
  13118. */
  13119. #define MC_CMD_FUSE_DIAGS 0x102
  13120. #define MC_CMD_0x102_PRIVILEGE_CTG SRIOV_CTG_INSECURE
  13121. /* MC_CMD_FUSE_DIAGS_IN msgrequest */
  13122. #define MC_CMD_FUSE_DIAGS_IN_LEN 0
  13123. /* MC_CMD_FUSE_DIAGS_OUT msgresponse */
  13124. #define MC_CMD_FUSE_DIAGS_OUT_LEN 48
  13125. /* Total number of mismatched bits between pairs in area 0 */
  13126. #define MC_CMD_FUSE_DIAGS_OUT_AREA0_MISMATCH_BITS_OFST 0
  13127. #define MC_CMD_FUSE_DIAGS_OUT_AREA0_MISMATCH_BITS_LEN 4
  13128. /* Total number of unexpectedly clear (set in B but not A) bits in area 0 */
  13129. #define MC_CMD_FUSE_DIAGS_OUT_AREA0_PAIR_A_BAD_BITS_OFST 4
  13130. #define MC_CMD_FUSE_DIAGS_OUT_AREA0_PAIR_A_BAD_BITS_LEN 4
  13131. /* Total number of unexpectedly clear (set in A but not B) bits in area 0 */
  13132. #define MC_CMD_FUSE_DIAGS_OUT_AREA0_PAIR_B_BAD_BITS_OFST 8
  13133. #define MC_CMD_FUSE_DIAGS_OUT_AREA0_PAIR_B_BAD_BITS_LEN 4
  13134. /* Checksum of data after logical OR of pairs in area 0 */
  13135. #define MC_CMD_FUSE_DIAGS_OUT_AREA0_CHECKSUM_OFST 12
  13136. #define MC_CMD_FUSE_DIAGS_OUT_AREA0_CHECKSUM_LEN 4
  13137. /* Total number of mismatched bits between pairs in area 1 */
  13138. #define MC_CMD_FUSE_DIAGS_OUT_AREA1_MISMATCH_BITS_OFST 16
  13139. #define MC_CMD_FUSE_DIAGS_OUT_AREA1_MISMATCH_BITS_LEN 4
  13140. /* Total number of unexpectedly clear (set in B but not A) bits in area 1 */
  13141. #define MC_CMD_FUSE_DIAGS_OUT_AREA1_PAIR_A_BAD_BITS_OFST 20
  13142. #define MC_CMD_FUSE_DIAGS_OUT_AREA1_PAIR_A_BAD_BITS_LEN 4
  13143. /* Total number of unexpectedly clear (set in A but not B) bits in area 1 */
  13144. #define MC_CMD_FUSE_DIAGS_OUT_AREA1_PAIR_B_BAD_BITS_OFST 24
  13145. #define MC_CMD_FUSE_DIAGS_OUT_AREA1_PAIR_B_BAD_BITS_LEN 4
  13146. /* Checksum of data after logical OR of pairs in area 1 */
  13147. #define MC_CMD_FUSE_DIAGS_OUT_AREA1_CHECKSUM_OFST 28
  13148. #define MC_CMD_FUSE_DIAGS_OUT_AREA1_CHECKSUM_LEN 4
  13149. /* Total number of mismatched bits between pairs in area 2 */
  13150. #define MC_CMD_FUSE_DIAGS_OUT_AREA2_MISMATCH_BITS_OFST 32
  13151. #define MC_CMD_FUSE_DIAGS_OUT_AREA2_MISMATCH_BITS_LEN 4
  13152. /* Total number of unexpectedly clear (set in B but not A) bits in area 2 */
  13153. #define MC_CMD_FUSE_DIAGS_OUT_AREA2_PAIR_A_BAD_BITS_OFST 36
  13154. #define MC_CMD_FUSE_DIAGS_OUT_AREA2_PAIR_A_BAD_BITS_LEN 4
  13155. /* Total number of unexpectedly clear (set in A but not B) bits in area 2 */
  13156. #define MC_CMD_FUSE_DIAGS_OUT_AREA2_PAIR_B_BAD_BITS_OFST 40
  13157. #define MC_CMD_FUSE_DIAGS_OUT_AREA2_PAIR_B_BAD_BITS_LEN 4
  13158. /* Checksum of data after logical OR of pairs in area 2 */
  13159. #define MC_CMD_FUSE_DIAGS_OUT_AREA2_CHECKSUM_OFST 44
  13160. #define MC_CMD_FUSE_DIAGS_OUT_AREA2_CHECKSUM_LEN 4
  13161. /***********************************/
  13162. /* MC_CMD_PRIVILEGE_MODIFY
  13163. * Modify the privileges of a set of PCIe functions. Note that this operation
  13164. * only effects non-admin functions unless the admin privilege itself is
  13165. * included in one of the masks provided.
  13166. */
  13167. #define MC_CMD_PRIVILEGE_MODIFY 0x60
  13168. #define MC_CMD_0x60_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  13169. /* MC_CMD_PRIVILEGE_MODIFY_IN msgrequest */
  13170. #define MC_CMD_PRIVILEGE_MODIFY_IN_LEN 16
  13171. /* The groups of functions to have their privilege masks modified. */
  13172. #define MC_CMD_PRIVILEGE_MODIFY_IN_FN_GROUP_OFST 0
  13173. #define MC_CMD_PRIVILEGE_MODIFY_IN_FN_GROUP_LEN 4
  13174. #define MC_CMD_PRIVILEGE_MODIFY_IN_NONE 0x0 /* enum */
  13175. #define MC_CMD_PRIVILEGE_MODIFY_IN_ALL 0x1 /* enum */
  13176. #define MC_CMD_PRIVILEGE_MODIFY_IN_PFS_ONLY 0x2 /* enum */
  13177. #define MC_CMD_PRIVILEGE_MODIFY_IN_VFS_ONLY 0x3 /* enum */
  13178. #define MC_CMD_PRIVILEGE_MODIFY_IN_VFS_OF_PF 0x4 /* enum */
  13179. #define MC_CMD_PRIVILEGE_MODIFY_IN_ONE 0x5 /* enum */
  13180. /* For VFS_OF_PF specify the PF, for ONE specify the target function */
  13181. #define MC_CMD_PRIVILEGE_MODIFY_IN_FUNCTION_OFST 4
  13182. #define MC_CMD_PRIVILEGE_MODIFY_IN_FUNCTION_LEN 4
  13183. #define MC_CMD_PRIVILEGE_MODIFY_IN_FUNCTION_PF_LBN 0
  13184. #define MC_CMD_PRIVILEGE_MODIFY_IN_FUNCTION_PF_WIDTH 16
  13185. #define MC_CMD_PRIVILEGE_MODIFY_IN_FUNCTION_VF_LBN 16
  13186. #define MC_CMD_PRIVILEGE_MODIFY_IN_FUNCTION_VF_WIDTH 16
  13187. /* Privileges to be added to the target functions. For privilege definitions
  13188. * refer to the command MC_CMD_PRIVILEGE_MASK
  13189. */
  13190. #define MC_CMD_PRIVILEGE_MODIFY_IN_ADD_MASK_OFST 8
  13191. #define MC_CMD_PRIVILEGE_MODIFY_IN_ADD_MASK_LEN 4
  13192. /* Privileges to be removed from the target functions. For privilege
  13193. * definitions refer to the command MC_CMD_PRIVILEGE_MASK
  13194. */
  13195. #define MC_CMD_PRIVILEGE_MODIFY_IN_REMOVE_MASK_OFST 12
  13196. #define MC_CMD_PRIVILEGE_MODIFY_IN_REMOVE_MASK_LEN 4
  13197. /* MC_CMD_PRIVILEGE_MODIFY_OUT msgresponse */
  13198. #define MC_CMD_PRIVILEGE_MODIFY_OUT_LEN 0
  13199. /***********************************/
  13200. /* MC_CMD_XPM_READ_BYTES
  13201. * Read XPM memory
  13202. */
  13203. #define MC_CMD_XPM_READ_BYTES 0x103
  13204. #define MC_CMD_0x103_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  13205. /* MC_CMD_XPM_READ_BYTES_IN msgrequest */
  13206. #define MC_CMD_XPM_READ_BYTES_IN_LEN 8
  13207. /* Start address (byte) */
  13208. #define MC_CMD_XPM_READ_BYTES_IN_ADDR_OFST 0
  13209. #define MC_CMD_XPM_READ_BYTES_IN_ADDR_LEN 4
  13210. /* Count (bytes) */
  13211. #define MC_CMD_XPM_READ_BYTES_IN_COUNT_OFST 4
  13212. #define MC_CMD_XPM_READ_BYTES_IN_COUNT_LEN 4
  13213. /* MC_CMD_XPM_READ_BYTES_OUT msgresponse */
  13214. #define MC_CMD_XPM_READ_BYTES_OUT_LENMIN 0
  13215. #define MC_CMD_XPM_READ_BYTES_OUT_LENMAX 252
  13216. #define MC_CMD_XPM_READ_BYTES_OUT_LEN(num) (0+1*(num))
  13217. /* Data */
  13218. #define MC_CMD_XPM_READ_BYTES_OUT_DATA_OFST 0
  13219. #define MC_CMD_XPM_READ_BYTES_OUT_DATA_LEN 1
  13220. #define MC_CMD_XPM_READ_BYTES_OUT_DATA_MINNUM 0
  13221. #define MC_CMD_XPM_READ_BYTES_OUT_DATA_MAXNUM 252
  13222. /***********************************/
  13223. /* MC_CMD_XPM_WRITE_BYTES
  13224. * Write XPM memory
  13225. */
  13226. #define MC_CMD_XPM_WRITE_BYTES 0x104
  13227. #define MC_CMD_0x104_PRIVILEGE_CTG SRIOV_CTG_INSECURE
  13228. /* MC_CMD_XPM_WRITE_BYTES_IN msgrequest */
  13229. #define MC_CMD_XPM_WRITE_BYTES_IN_LENMIN 8
  13230. #define MC_CMD_XPM_WRITE_BYTES_IN_LENMAX 252
  13231. #define MC_CMD_XPM_WRITE_BYTES_IN_LEN(num) (8+1*(num))
  13232. /* Start address (byte) */
  13233. #define MC_CMD_XPM_WRITE_BYTES_IN_ADDR_OFST 0
  13234. #define MC_CMD_XPM_WRITE_BYTES_IN_ADDR_LEN 4
  13235. /* Count (bytes) */
  13236. #define MC_CMD_XPM_WRITE_BYTES_IN_COUNT_OFST 4
  13237. #define MC_CMD_XPM_WRITE_BYTES_IN_COUNT_LEN 4
  13238. /* Data */
  13239. #define MC_CMD_XPM_WRITE_BYTES_IN_DATA_OFST 8
  13240. #define MC_CMD_XPM_WRITE_BYTES_IN_DATA_LEN 1
  13241. #define MC_CMD_XPM_WRITE_BYTES_IN_DATA_MINNUM 0
  13242. #define MC_CMD_XPM_WRITE_BYTES_IN_DATA_MAXNUM 244
  13243. /* MC_CMD_XPM_WRITE_BYTES_OUT msgresponse */
  13244. #define MC_CMD_XPM_WRITE_BYTES_OUT_LEN 0
  13245. /***********************************/
  13246. /* MC_CMD_XPM_READ_SECTOR
  13247. * Read XPM sector
  13248. */
  13249. #define MC_CMD_XPM_READ_SECTOR 0x105
  13250. #define MC_CMD_0x105_PRIVILEGE_CTG SRIOV_CTG_INSECURE
  13251. /* MC_CMD_XPM_READ_SECTOR_IN msgrequest */
  13252. #define MC_CMD_XPM_READ_SECTOR_IN_LEN 8
  13253. /* Sector index */
  13254. #define MC_CMD_XPM_READ_SECTOR_IN_INDEX_OFST 0
  13255. #define MC_CMD_XPM_READ_SECTOR_IN_INDEX_LEN 4
  13256. /* Sector size */
  13257. #define MC_CMD_XPM_READ_SECTOR_IN_SIZE_OFST 4
  13258. #define MC_CMD_XPM_READ_SECTOR_IN_SIZE_LEN 4
  13259. /* MC_CMD_XPM_READ_SECTOR_OUT msgresponse */
  13260. #define MC_CMD_XPM_READ_SECTOR_OUT_LENMIN 4
  13261. #define MC_CMD_XPM_READ_SECTOR_OUT_LENMAX 36
  13262. #define MC_CMD_XPM_READ_SECTOR_OUT_LEN(num) (4+1*(num))
  13263. /* Sector type */
  13264. #define MC_CMD_XPM_READ_SECTOR_OUT_TYPE_OFST 0
  13265. #define MC_CMD_XPM_READ_SECTOR_OUT_TYPE_LEN 4
  13266. #define MC_CMD_XPM_READ_SECTOR_OUT_BLANK 0x0 /* enum */
  13267. #define MC_CMD_XPM_READ_SECTOR_OUT_CRYPTO_KEY_128 0x1 /* enum */
  13268. #define MC_CMD_XPM_READ_SECTOR_OUT_CRYPTO_KEY_256 0x2 /* enum */
  13269. #define MC_CMD_XPM_READ_SECTOR_OUT_CRYPTO_DATA 0x3 /* enum */
  13270. #define MC_CMD_XPM_READ_SECTOR_OUT_INVALID 0xff /* enum */
  13271. /* Sector data */
  13272. #define MC_CMD_XPM_READ_SECTOR_OUT_DATA_OFST 4
  13273. #define MC_CMD_XPM_READ_SECTOR_OUT_DATA_LEN 1
  13274. #define MC_CMD_XPM_READ_SECTOR_OUT_DATA_MINNUM 0
  13275. #define MC_CMD_XPM_READ_SECTOR_OUT_DATA_MAXNUM 32
  13276. /***********************************/
  13277. /* MC_CMD_XPM_WRITE_SECTOR
  13278. * Write XPM sector
  13279. */
  13280. #define MC_CMD_XPM_WRITE_SECTOR 0x106
  13281. #define MC_CMD_0x106_PRIVILEGE_CTG SRIOV_CTG_INSECURE
  13282. /* MC_CMD_XPM_WRITE_SECTOR_IN msgrequest */
  13283. #define MC_CMD_XPM_WRITE_SECTOR_IN_LENMIN 12
  13284. #define MC_CMD_XPM_WRITE_SECTOR_IN_LENMAX 44
  13285. #define MC_CMD_XPM_WRITE_SECTOR_IN_LEN(num) (12+1*(num))
  13286. /* If writing fails due to an uncorrectable error, try up to RETRIES following
  13287. * sectors (or until no more space available). If 0, only one write attempt is
  13288. * made. Note that uncorrectable errors are unlikely, thanks to XPM self-repair
  13289. * mechanism.
  13290. */
  13291. #define MC_CMD_XPM_WRITE_SECTOR_IN_RETRIES_OFST 0
  13292. #define MC_CMD_XPM_WRITE_SECTOR_IN_RETRIES_LEN 1
  13293. #define MC_CMD_XPM_WRITE_SECTOR_IN_RESERVED_OFST 1
  13294. #define MC_CMD_XPM_WRITE_SECTOR_IN_RESERVED_LEN 3
  13295. /* Sector type */
  13296. #define MC_CMD_XPM_WRITE_SECTOR_IN_TYPE_OFST 4
  13297. #define MC_CMD_XPM_WRITE_SECTOR_IN_TYPE_LEN 4
  13298. /* Enum values, see field(s): */
  13299. /* MC_CMD_XPM_READ_SECTOR/MC_CMD_XPM_READ_SECTOR_OUT/TYPE */
  13300. /* Sector size */
  13301. #define MC_CMD_XPM_WRITE_SECTOR_IN_SIZE_OFST 8
  13302. #define MC_CMD_XPM_WRITE_SECTOR_IN_SIZE_LEN 4
  13303. /* Sector data */
  13304. #define MC_CMD_XPM_WRITE_SECTOR_IN_DATA_OFST 12
  13305. #define MC_CMD_XPM_WRITE_SECTOR_IN_DATA_LEN 1
  13306. #define MC_CMD_XPM_WRITE_SECTOR_IN_DATA_MINNUM 0
  13307. #define MC_CMD_XPM_WRITE_SECTOR_IN_DATA_MAXNUM 32
  13308. /* MC_CMD_XPM_WRITE_SECTOR_OUT msgresponse */
  13309. #define MC_CMD_XPM_WRITE_SECTOR_OUT_LEN 4
  13310. /* New sector index */
  13311. #define MC_CMD_XPM_WRITE_SECTOR_OUT_INDEX_OFST 0
  13312. #define MC_CMD_XPM_WRITE_SECTOR_OUT_INDEX_LEN 4
  13313. /***********************************/
  13314. /* MC_CMD_XPM_INVALIDATE_SECTOR
  13315. * Invalidate XPM sector
  13316. */
  13317. #define MC_CMD_XPM_INVALIDATE_SECTOR 0x107
  13318. #define MC_CMD_0x107_PRIVILEGE_CTG SRIOV_CTG_INSECURE
  13319. /* MC_CMD_XPM_INVALIDATE_SECTOR_IN msgrequest */
  13320. #define MC_CMD_XPM_INVALIDATE_SECTOR_IN_LEN 4
  13321. /* Sector index */
  13322. #define MC_CMD_XPM_INVALIDATE_SECTOR_IN_INDEX_OFST 0
  13323. #define MC_CMD_XPM_INVALIDATE_SECTOR_IN_INDEX_LEN 4
  13324. /* MC_CMD_XPM_INVALIDATE_SECTOR_OUT msgresponse */
  13325. #define MC_CMD_XPM_INVALIDATE_SECTOR_OUT_LEN 0
  13326. /***********************************/
  13327. /* MC_CMD_XPM_BLANK_CHECK
  13328. * Blank-check XPM memory and report bad locations
  13329. */
  13330. #define MC_CMD_XPM_BLANK_CHECK 0x108
  13331. #define MC_CMD_0x108_PRIVILEGE_CTG SRIOV_CTG_INSECURE
  13332. /* MC_CMD_XPM_BLANK_CHECK_IN msgrequest */
  13333. #define MC_CMD_XPM_BLANK_CHECK_IN_LEN 8
  13334. /* Start address (byte) */
  13335. #define MC_CMD_XPM_BLANK_CHECK_IN_ADDR_OFST 0
  13336. #define MC_CMD_XPM_BLANK_CHECK_IN_ADDR_LEN 4
  13337. /* Count (bytes) */
  13338. #define MC_CMD_XPM_BLANK_CHECK_IN_COUNT_OFST 4
  13339. #define MC_CMD_XPM_BLANK_CHECK_IN_COUNT_LEN 4
  13340. /* MC_CMD_XPM_BLANK_CHECK_OUT msgresponse */
  13341. #define MC_CMD_XPM_BLANK_CHECK_OUT_LENMIN 4
  13342. #define MC_CMD_XPM_BLANK_CHECK_OUT_LENMAX 252
  13343. #define MC_CMD_XPM_BLANK_CHECK_OUT_LEN(num) (4+2*(num))
  13344. /* Total number of bad (non-blank) locations */
  13345. #define MC_CMD_XPM_BLANK_CHECK_OUT_BAD_COUNT_OFST 0
  13346. #define MC_CMD_XPM_BLANK_CHECK_OUT_BAD_COUNT_LEN 4
  13347. /* Addresses of bad locations (may be less than BAD_COUNT, if all cannot fit
  13348. * into MCDI response)
  13349. */
  13350. #define MC_CMD_XPM_BLANK_CHECK_OUT_BAD_ADDR_OFST 4
  13351. #define MC_CMD_XPM_BLANK_CHECK_OUT_BAD_ADDR_LEN 2
  13352. #define MC_CMD_XPM_BLANK_CHECK_OUT_BAD_ADDR_MINNUM 0
  13353. #define MC_CMD_XPM_BLANK_CHECK_OUT_BAD_ADDR_MAXNUM 124
  13354. /***********************************/
  13355. /* MC_CMD_XPM_REPAIR
  13356. * Blank-check and repair XPM memory
  13357. */
  13358. #define MC_CMD_XPM_REPAIR 0x109
  13359. #define MC_CMD_0x109_PRIVILEGE_CTG SRIOV_CTG_INSECURE
  13360. /* MC_CMD_XPM_REPAIR_IN msgrequest */
  13361. #define MC_CMD_XPM_REPAIR_IN_LEN 8
  13362. /* Start address (byte) */
  13363. #define MC_CMD_XPM_REPAIR_IN_ADDR_OFST 0
  13364. #define MC_CMD_XPM_REPAIR_IN_ADDR_LEN 4
  13365. /* Count (bytes) */
  13366. #define MC_CMD_XPM_REPAIR_IN_COUNT_OFST 4
  13367. #define MC_CMD_XPM_REPAIR_IN_COUNT_LEN 4
  13368. /* MC_CMD_XPM_REPAIR_OUT msgresponse */
  13369. #define MC_CMD_XPM_REPAIR_OUT_LEN 0
  13370. /***********************************/
  13371. /* MC_CMD_XPM_DECODER_TEST
  13372. * Test XPM memory address decoders for gross manufacturing defects. Can only
  13373. * be performed on an unprogrammed part.
  13374. */
  13375. #define MC_CMD_XPM_DECODER_TEST 0x10a
  13376. #define MC_CMD_0x10a_PRIVILEGE_CTG SRIOV_CTG_INSECURE
  13377. /* MC_CMD_XPM_DECODER_TEST_IN msgrequest */
  13378. #define MC_CMD_XPM_DECODER_TEST_IN_LEN 0
  13379. /* MC_CMD_XPM_DECODER_TEST_OUT msgresponse */
  13380. #define MC_CMD_XPM_DECODER_TEST_OUT_LEN 0
  13381. /***********************************/
  13382. /* MC_CMD_XPM_WRITE_TEST
  13383. * XPM memory write test. Test XPM write logic for gross manufacturing defects
  13384. * by writing to a dedicated test row. There are 16 locations in the test row
  13385. * and the test can only be performed on locations that have not been
  13386. * previously used (i.e. can be run at most 16 times). The test will pick the
  13387. * first available location to use, or fail with ENOSPC if none left.
  13388. */
  13389. #define MC_CMD_XPM_WRITE_TEST 0x10b
  13390. #define MC_CMD_0x10b_PRIVILEGE_CTG SRIOV_CTG_INSECURE
  13391. /* MC_CMD_XPM_WRITE_TEST_IN msgrequest */
  13392. #define MC_CMD_XPM_WRITE_TEST_IN_LEN 0
  13393. /* MC_CMD_XPM_WRITE_TEST_OUT msgresponse */
  13394. #define MC_CMD_XPM_WRITE_TEST_OUT_LEN 0
  13395. /***********************************/
  13396. /* MC_CMD_EXEC_SIGNED
  13397. * Check the CMAC of the contents of IMEM and DMEM against the value supplied
  13398. * and if correct begin execution from the start of IMEM. The caller supplies a
  13399. * key ID, the length of IMEM and DMEM to validate and the expected CMAC. CMAC
  13400. * computation runs from the start of IMEM, and from the start of DMEM + 16k,
  13401. * to match flash booting. The command will respond with EINVAL if the CMAC
  13402. * does match, otherwise it will respond with success before it jumps to IMEM.
  13403. */
  13404. #define MC_CMD_EXEC_SIGNED 0x10c
  13405. #define MC_CMD_0x10c_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  13406. /* MC_CMD_EXEC_SIGNED_IN msgrequest */
  13407. #define MC_CMD_EXEC_SIGNED_IN_LEN 28
  13408. /* the length of code to include in the CMAC */
  13409. #define MC_CMD_EXEC_SIGNED_IN_CODELEN_OFST 0
  13410. #define MC_CMD_EXEC_SIGNED_IN_CODELEN_LEN 4
  13411. /* the length of date to include in the CMAC */
  13412. #define MC_CMD_EXEC_SIGNED_IN_DATALEN_OFST 4
  13413. #define MC_CMD_EXEC_SIGNED_IN_DATALEN_LEN 4
  13414. /* the XPM sector containing the key to use */
  13415. #define MC_CMD_EXEC_SIGNED_IN_KEYSECTOR_OFST 8
  13416. #define MC_CMD_EXEC_SIGNED_IN_KEYSECTOR_LEN 4
  13417. /* the expected CMAC value */
  13418. #define MC_CMD_EXEC_SIGNED_IN_CMAC_OFST 12
  13419. #define MC_CMD_EXEC_SIGNED_IN_CMAC_LEN 16
  13420. /* MC_CMD_EXEC_SIGNED_OUT msgresponse */
  13421. #define MC_CMD_EXEC_SIGNED_OUT_LEN 0
  13422. /***********************************/
  13423. /* MC_CMD_PREPARE_SIGNED
  13424. * Prepare to upload a signed image. This will scrub the specified length of
  13425. * the data region, which must be at least as large as the DATALEN supplied to
  13426. * MC_CMD_EXEC_SIGNED.
  13427. */
  13428. #define MC_CMD_PREPARE_SIGNED 0x10d
  13429. #define MC_CMD_0x10d_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  13430. /* MC_CMD_PREPARE_SIGNED_IN msgrequest */
  13431. #define MC_CMD_PREPARE_SIGNED_IN_LEN 4
  13432. /* the length of data area to clear */
  13433. #define MC_CMD_PREPARE_SIGNED_IN_DATALEN_OFST 0
  13434. #define MC_CMD_PREPARE_SIGNED_IN_DATALEN_LEN 4
  13435. /* MC_CMD_PREPARE_SIGNED_OUT msgresponse */
  13436. #define MC_CMD_PREPARE_SIGNED_OUT_LEN 0
  13437. /* TUNNEL_ENCAP_UDP_PORT_ENTRY structuredef */
  13438. #define TUNNEL_ENCAP_UDP_PORT_ENTRY_LEN 4
  13439. /* UDP port (the standard ports are named below but any port may be used) */
  13440. #define TUNNEL_ENCAP_UDP_PORT_ENTRY_UDP_PORT_OFST 0
  13441. #define TUNNEL_ENCAP_UDP_PORT_ENTRY_UDP_PORT_LEN 2
  13442. /* enum: the IANA allocated UDP port for VXLAN */
  13443. #define TUNNEL_ENCAP_UDP_PORT_ENTRY_IANA_VXLAN_UDP_PORT 0x12b5
  13444. /* enum: the IANA allocated UDP port for Geneve */
  13445. #define TUNNEL_ENCAP_UDP_PORT_ENTRY_IANA_GENEVE_UDP_PORT 0x17c1
  13446. #define TUNNEL_ENCAP_UDP_PORT_ENTRY_UDP_PORT_LBN 0
  13447. #define TUNNEL_ENCAP_UDP_PORT_ENTRY_UDP_PORT_WIDTH 16
  13448. /* tunnel encapsulation protocol (only those named below are supported) */
  13449. #define TUNNEL_ENCAP_UDP_PORT_ENTRY_PROTOCOL_OFST 2
  13450. #define TUNNEL_ENCAP_UDP_PORT_ENTRY_PROTOCOL_LEN 2
  13451. /* enum: This port will be used for VXLAN on both IPv4 and IPv6 */
  13452. #define TUNNEL_ENCAP_UDP_PORT_ENTRY_VXLAN 0x0
  13453. /* enum: This port will be used for Geneve on both IPv4 and IPv6 */
  13454. #define TUNNEL_ENCAP_UDP_PORT_ENTRY_GENEVE 0x1
  13455. #define TUNNEL_ENCAP_UDP_PORT_ENTRY_PROTOCOL_LBN 16
  13456. #define TUNNEL_ENCAP_UDP_PORT_ENTRY_PROTOCOL_WIDTH 16
  13457. /***********************************/
  13458. /* MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS
  13459. * Configure UDP ports for tunnel encapsulation hardware acceleration. The
  13460. * parser-dispatcher will attempt to parse traffic on these ports as tunnel
  13461. * encapsulation PDUs and filter them using the tunnel encapsulation filter
  13462. * chain rather than the standard filter chain. Note that this command can
  13463. * cause all functions to see a reset. (Available on Medford only.)
  13464. */
  13465. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS 0x117
  13466. #define MC_CMD_0x117_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  13467. /* MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN msgrequest */
  13468. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_LENMIN 4
  13469. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_LENMAX 68
  13470. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_LEN(num) (4+4*(num))
  13471. /* Flags */
  13472. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_FLAGS_OFST 0
  13473. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_FLAGS_LEN 2
  13474. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_UNLOADING_LBN 0
  13475. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_UNLOADING_WIDTH 1
  13476. /* The number of entries in the ENTRIES array */
  13477. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_NUM_ENTRIES_OFST 2
  13478. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_NUM_ENTRIES_LEN 2
  13479. /* Entries defining the UDP port to protocol mapping, each laid out as a
  13480. * TUNNEL_ENCAP_UDP_PORT_ENTRY
  13481. */
  13482. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_ENTRIES_OFST 4
  13483. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_ENTRIES_LEN 4
  13484. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_ENTRIES_MINNUM 0
  13485. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_ENTRIES_MAXNUM 16
  13486. /* MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_OUT msgresponse */
  13487. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_OUT_LEN 2
  13488. /* Flags */
  13489. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_OUT_FLAGS_OFST 0
  13490. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_OUT_FLAGS_LEN 2
  13491. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_OUT_RESETTING_LBN 0
  13492. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_OUT_RESETTING_WIDTH 1
  13493. /***********************************/
  13494. /* MC_CMD_RX_BALANCING
  13495. * Configure a port upconverter to distribute the packets on both RX engines.
  13496. * Packets are distributed based on a table with the destination vFIFO. The
  13497. * index of the table is a hash of source and destination of IPV4 and VLAN
  13498. * priority.
  13499. */
  13500. #define MC_CMD_RX_BALANCING 0x118
  13501. #define MC_CMD_0x118_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  13502. /* MC_CMD_RX_BALANCING_IN msgrequest */
  13503. #define MC_CMD_RX_BALANCING_IN_LEN 16
  13504. /* The RX port whose upconverter table will be modified */
  13505. #define MC_CMD_RX_BALANCING_IN_PORT_OFST 0
  13506. #define MC_CMD_RX_BALANCING_IN_PORT_LEN 4
  13507. /* The VLAN priority associated to the table index and vFIFO */
  13508. #define MC_CMD_RX_BALANCING_IN_PRIORITY_OFST 4
  13509. #define MC_CMD_RX_BALANCING_IN_PRIORITY_LEN 4
  13510. /* The resulting bit of SRC^DST for indexing the table */
  13511. #define MC_CMD_RX_BALANCING_IN_SRC_DST_OFST 8
  13512. #define MC_CMD_RX_BALANCING_IN_SRC_DST_LEN 4
  13513. /* The RX engine to which the vFIFO in the table entry will point to */
  13514. #define MC_CMD_RX_BALANCING_IN_ENG_OFST 12
  13515. #define MC_CMD_RX_BALANCING_IN_ENG_LEN 4
  13516. /* MC_CMD_RX_BALANCING_OUT msgresponse */
  13517. #define MC_CMD_RX_BALANCING_OUT_LEN 0
  13518. /***********************************/
  13519. /* MC_CMD_NVRAM_PRIVATE_APPEND
  13520. * Append a single TLV to the MC_USAGE_TLV partition. Returns MC_CMD_ERR_EEXIST
  13521. * if the tag is already present.
  13522. */
  13523. #define MC_CMD_NVRAM_PRIVATE_APPEND 0x11c
  13524. #define MC_CMD_0x11c_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  13525. /* MC_CMD_NVRAM_PRIVATE_APPEND_IN msgrequest */
  13526. #define MC_CMD_NVRAM_PRIVATE_APPEND_IN_LENMIN 9
  13527. #define MC_CMD_NVRAM_PRIVATE_APPEND_IN_LENMAX 252
  13528. #define MC_CMD_NVRAM_PRIVATE_APPEND_IN_LEN(num) (8+1*(num))
  13529. /* The tag to be appended */
  13530. #define MC_CMD_NVRAM_PRIVATE_APPEND_IN_TAG_OFST 0
  13531. #define MC_CMD_NVRAM_PRIVATE_APPEND_IN_TAG_LEN 4
  13532. /* The length of the data */
  13533. #define MC_CMD_NVRAM_PRIVATE_APPEND_IN_LENGTH_OFST 4
  13534. #define MC_CMD_NVRAM_PRIVATE_APPEND_IN_LENGTH_LEN 4
  13535. /* The data to be contained in the TLV structure */
  13536. #define MC_CMD_NVRAM_PRIVATE_APPEND_IN_DATA_BUFFER_OFST 8
  13537. #define MC_CMD_NVRAM_PRIVATE_APPEND_IN_DATA_BUFFER_LEN 1
  13538. #define MC_CMD_NVRAM_PRIVATE_APPEND_IN_DATA_BUFFER_MINNUM 1
  13539. #define MC_CMD_NVRAM_PRIVATE_APPEND_IN_DATA_BUFFER_MAXNUM 244
  13540. /* MC_CMD_NVRAM_PRIVATE_APPEND_OUT msgresponse */
  13541. #define MC_CMD_NVRAM_PRIVATE_APPEND_OUT_LEN 0
  13542. /***********************************/
  13543. /* MC_CMD_XPM_VERIFY_CONTENTS
  13544. * Verify that the contents of the XPM memory is correct (Medford only). This
  13545. * is used during manufacture to check that the XPM memory has been programmed
  13546. * correctly at ATE.
  13547. */
  13548. #define MC_CMD_XPM_VERIFY_CONTENTS 0x11b
  13549. #define MC_CMD_0x11b_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  13550. /* MC_CMD_XPM_VERIFY_CONTENTS_IN msgrequest */
  13551. #define MC_CMD_XPM_VERIFY_CONTENTS_IN_LEN 4
  13552. /* Data type to be checked */
  13553. #define MC_CMD_XPM_VERIFY_CONTENTS_IN_DATA_TYPE_OFST 0
  13554. #define MC_CMD_XPM_VERIFY_CONTENTS_IN_DATA_TYPE_LEN 4
  13555. /* MC_CMD_XPM_VERIFY_CONTENTS_OUT msgresponse */
  13556. #define MC_CMD_XPM_VERIFY_CONTENTS_OUT_LENMIN 12
  13557. #define MC_CMD_XPM_VERIFY_CONTENTS_OUT_LENMAX 252
  13558. #define MC_CMD_XPM_VERIFY_CONTENTS_OUT_LEN(num) (12+1*(num))
  13559. /* Number of sectors found (test builds only) */
  13560. #define MC_CMD_XPM_VERIFY_CONTENTS_OUT_NUM_SECTORS_OFST 0
  13561. #define MC_CMD_XPM_VERIFY_CONTENTS_OUT_NUM_SECTORS_LEN 4
  13562. /* Number of bytes found (test builds only) */
  13563. #define MC_CMD_XPM_VERIFY_CONTENTS_OUT_NUM_BYTES_OFST 4
  13564. #define MC_CMD_XPM_VERIFY_CONTENTS_OUT_NUM_BYTES_LEN 4
  13565. /* Length of signature */
  13566. #define MC_CMD_XPM_VERIFY_CONTENTS_OUT_SIG_LENGTH_OFST 8
  13567. #define MC_CMD_XPM_VERIFY_CONTENTS_OUT_SIG_LENGTH_LEN 4
  13568. /* Signature */
  13569. #define MC_CMD_XPM_VERIFY_CONTENTS_OUT_SIGNATURE_OFST 12
  13570. #define MC_CMD_XPM_VERIFY_CONTENTS_OUT_SIGNATURE_LEN 1
  13571. #define MC_CMD_XPM_VERIFY_CONTENTS_OUT_SIGNATURE_MINNUM 0
  13572. #define MC_CMD_XPM_VERIFY_CONTENTS_OUT_SIGNATURE_MAXNUM 240
  13573. /***********************************/
  13574. /* MC_CMD_SET_EVQ_TMR
  13575. * Update the timer load, timer reload and timer mode values for a given EVQ.
  13576. * The requested timer values (in TMR_LOAD_REQ_NS and TMR_RELOAD_REQ_NS) will
  13577. * be rounded up to the granularity supported by the hardware, then truncated
  13578. * to the range supported by the hardware. The resulting value after the
  13579. * rounding and truncation will be returned to the caller (in TMR_LOAD_ACT_NS
  13580. * and TMR_RELOAD_ACT_NS).
  13581. */
  13582. #define MC_CMD_SET_EVQ_TMR 0x120
  13583. #define MC_CMD_0x120_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  13584. /* MC_CMD_SET_EVQ_TMR_IN msgrequest */
  13585. #define MC_CMD_SET_EVQ_TMR_IN_LEN 16
  13586. /* Function-relative queue instance */
  13587. #define MC_CMD_SET_EVQ_TMR_IN_INSTANCE_OFST 0
  13588. #define MC_CMD_SET_EVQ_TMR_IN_INSTANCE_LEN 4
  13589. /* Requested value for timer load (in nanoseconds) */
  13590. #define MC_CMD_SET_EVQ_TMR_IN_TMR_LOAD_REQ_NS_OFST 4
  13591. #define MC_CMD_SET_EVQ_TMR_IN_TMR_LOAD_REQ_NS_LEN 4
  13592. /* Requested value for timer reload (in nanoseconds) */
  13593. #define MC_CMD_SET_EVQ_TMR_IN_TMR_RELOAD_REQ_NS_OFST 8
  13594. #define MC_CMD_SET_EVQ_TMR_IN_TMR_RELOAD_REQ_NS_LEN 4
  13595. /* Timer mode. Meanings as per EVQ_TMR_REG.TC_TIMER_VAL */
  13596. #define MC_CMD_SET_EVQ_TMR_IN_TMR_MODE_OFST 12
  13597. #define MC_CMD_SET_EVQ_TMR_IN_TMR_MODE_LEN 4
  13598. #define MC_CMD_SET_EVQ_TMR_IN_TIMER_MODE_DIS 0x0 /* enum */
  13599. #define MC_CMD_SET_EVQ_TMR_IN_TIMER_MODE_IMMED_START 0x1 /* enum */
  13600. #define MC_CMD_SET_EVQ_TMR_IN_TIMER_MODE_TRIG_START 0x2 /* enum */
  13601. #define MC_CMD_SET_EVQ_TMR_IN_TIMER_MODE_INT_HLDOFF 0x3 /* enum */
  13602. /* MC_CMD_SET_EVQ_TMR_OUT msgresponse */
  13603. #define MC_CMD_SET_EVQ_TMR_OUT_LEN 8
  13604. /* Actual value for timer load (in nanoseconds) */
  13605. #define MC_CMD_SET_EVQ_TMR_OUT_TMR_LOAD_ACT_NS_OFST 0
  13606. #define MC_CMD_SET_EVQ_TMR_OUT_TMR_LOAD_ACT_NS_LEN 4
  13607. /* Actual value for timer reload (in nanoseconds) */
  13608. #define MC_CMD_SET_EVQ_TMR_OUT_TMR_RELOAD_ACT_NS_OFST 4
  13609. #define MC_CMD_SET_EVQ_TMR_OUT_TMR_RELOAD_ACT_NS_LEN 4
  13610. /***********************************/
  13611. /* MC_CMD_GET_EVQ_TMR_PROPERTIES
  13612. * Query properties about the event queue timers.
  13613. */
  13614. #define MC_CMD_GET_EVQ_TMR_PROPERTIES 0x122
  13615. #define MC_CMD_0x122_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  13616. /* MC_CMD_GET_EVQ_TMR_PROPERTIES_IN msgrequest */
  13617. #define MC_CMD_GET_EVQ_TMR_PROPERTIES_IN_LEN 0
  13618. /* MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT msgresponse */
  13619. #define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_LEN 36
  13620. /* Reserved for future use. */
  13621. #define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_FLAGS_OFST 0
  13622. #define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_FLAGS_LEN 4
  13623. /* For timers updated via writes to EVQ_TMR_REG, this is the time interval (in
  13624. * nanoseconds) for each increment of the timer load/reload count. The
  13625. * requested duration of a timer is this value multiplied by the timer
  13626. * load/reload count.
  13627. */
  13628. #define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_TMR_REG_NS_PER_COUNT_OFST 4
  13629. #define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_TMR_REG_NS_PER_COUNT_LEN 4
  13630. /* For timers updated via writes to EVQ_TMR_REG, this is the maximum value
  13631. * allowed for timer load/reload counts.
  13632. */
  13633. #define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_TMR_REG_MAX_COUNT_OFST 8
  13634. #define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_TMR_REG_MAX_COUNT_LEN 4
  13635. /* For timers updated via writes to EVQ_TMR_REG, timer load/reload counts not a
  13636. * multiple of this step size will be rounded in an implementation defined
  13637. * manner.
  13638. */
  13639. #define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_TMR_REG_STEP_OFST 12
  13640. #define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_TMR_REG_STEP_LEN 4
  13641. /* Maximum timer duration (in nanoseconds) for timers updated via MCDI. Only
  13642. * meaningful if MC_CMD_SET_EVQ_TMR is implemented.
  13643. */
  13644. #define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_MCDI_TMR_MAX_NS_OFST 16
  13645. #define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_MCDI_TMR_MAX_NS_LEN 4
  13646. /* Timer durations requested via MCDI that are not a multiple of this step size
  13647. * will be rounded up. Only meaningful if MC_CMD_SET_EVQ_TMR is implemented.
  13648. */
  13649. #define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_MCDI_TMR_STEP_NS_OFST 20
  13650. #define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_MCDI_TMR_STEP_NS_LEN 4
  13651. /* For timers updated using the bug35388 workaround, this is the time interval
  13652. * (in nanoseconds) for each increment of the timer load/reload count. The
  13653. * requested duration of a timer is this value multiplied by the timer
  13654. * load/reload count. This field is only meaningful if the bug35388 workaround
  13655. * is enabled.
  13656. */
  13657. #define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_BUG35388_TMR_NS_PER_COUNT_OFST 24
  13658. #define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_BUG35388_TMR_NS_PER_COUNT_LEN 4
  13659. /* For timers updated using the bug35388 workaround, this is the maximum value
  13660. * allowed for timer load/reload counts. This field is only meaningful if the
  13661. * bug35388 workaround is enabled.
  13662. */
  13663. #define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_BUG35388_TMR_MAX_COUNT_OFST 28
  13664. #define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_BUG35388_TMR_MAX_COUNT_LEN 4
  13665. /* For timers updated using the bug35388 workaround, timer load/reload counts
  13666. * not a multiple of this step size will be rounded in an implementation
  13667. * defined manner. This field is only meaningful if the bug35388 workaround is
  13668. * enabled.
  13669. */
  13670. #define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_BUG35388_TMR_STEP_OFST 32
  13671. #define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_BUG35388_TMR_STEP_LEN 4
  13672. /***********************************/
  13673. /* MC_CMD_ALLOCATE_TX_VFIFO_CP
  13674. * When we use the TX_vFIFO_ULL mode, we can allocate common pools using the
  13675. * non used switch buffers.
  13676. */
  13677. #define MC_CMD_ALLOCATE_TX_VFIFO_CP 0x11d
  13678. #define MC_CMD_0x11d_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  13679. /* MC_CMD_ALLOCATE_TX_VFIFO_CP_IN msgrequest */
  13680. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_LEN 20
  13681. /* Desired instance. Must be set to a specific instance, which is a function
  13682. * local queue index.
  13683. */
  13684. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_INSTANCE_OFST 0
  13685. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_INSTANCE_LEN 4
  13686. /* Will the common pool be used as TX_vFIFO_ULL (1) */
  13687. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_MODE_OFST 4
  13688. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_MODE_LEN 4
  13689. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_ENABLED 0x1 /* enum */
  13690. /* enum: Using this interface without TX_vFIFO_ULL is not supported for now */
  13691. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_DISABLED 0x0
  13692. /* Number of buffers to reserve for the common pool */
  13693. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_SIZE_OFST 8
  13694. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_SIZE_LEN 4
  13695. /* TX datapath to which the Common Pool is connected to. */
  13696. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_INGRESS_OFST 12
  13697. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_INGRESS_LEN 4
  13698. /* enum: Extracts information from function */
  13699. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_USE_FUNCTION_VALUE -0x1
  13700. /* Network port or RX Engine to which the common pool connects. */
  13701. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_EGRESS_OFST 16
  13702. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_EGRESS_LEN 4
  13703. /* enum: Extracts information from function */
  13704. /* MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_USE_FUNCTION_VALUE -0x1 */
  13705. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_PORT0 0x0 /* enum */
  13706. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_PORT1 0x1 /* enum */
  13707. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_PORT2 0x2 /* enum */
  13708. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_PORT3 0x3 /* enum */
  13709. /* enum: To enable Switch loopback with Rx engine 0 */
  13710. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_RX_ENGINE0 0x4
  13711. /* enum: To enable Switch loopback with Rx engine 1 */
  13712. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_RX_ENGINE1 0x5
  13713. /* MC_CMD_ALLOCATE_TX_VFIFO_CP_OUT msgresponse */
  13714. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_OUT_LEN 4
  13715. /* ID of the common pool allocated */
  13716. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_OUT_CP_ID_OFST 0
  13717. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_OUT_CP_ID_LEN 4
  13718. /***********************************/
  13719. /* MC_CMD_ALLOCATE_TX_VFIFO_VFIFO
  13720. * When we use the TX_vFIFO_ULL mode, we can allocate vFIFOs using the
  13721. * previously allocated common pools.
  13722. */
  13723. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO 0x11e
  13724. #define MC_CMD_0x11e_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  13725. /* MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN msgrequest */
  13726. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_LEN 20
  13727. /* Common pool previously allocated to which the new vFIFO will be associated
  13728. */
  13729. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_CP_OFST 0
  13730. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_CP_LEN 4
  13731. /* Port or RX engine to associate the vFIFO egress */
  13732. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_EGRESS_OFST 4
  13733. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_EGRESS_LEN 4
  13734. /* enum: Extracts information from common pool */
  13735. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_USE_CP_VALUE -0x1
  13736. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_PORT0 0x0 /* enum */
  13737. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_PORT1 0x1 /* enum */
  13738. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_PORT2 0x2 /* enum */
  13739. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_PORT3 0x3 /* enum */
  13740. /* enum: To enable Switch loopback with Rx engine 0 */
  13741. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_RX_ENGINE0 0x4
  13742. /* enum: To enable Switch loopback with Rx engine 1 */
  13743. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_RX_ENGINE1 0x5
  13744. /* Minimum number of buffers that the pool must have */
  13745. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_SIZE_OFST 8
  13746. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_SIZE_LEN 4
  13747. /* enum: Do not check the space available */
  13748. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_NO_MINIMUM 0x0
  13749. /* Will the vFIFO be used as TX_vFIFO_ULL */
  13750. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_MODE_OFST 12
  13751. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_MODE_LEN 4
  13752. /* Network priority of the vFIFO,if applicable */
  13753. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_PRIORITY_OFST 16
  13754. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_PRIORITY_LEN 4
  13755. /* enum: Search for the lowest unused priority */
  13756. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_LOWEST_AVAILABLE -0x1
  13757. /* MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_OUT msgresponse */
  13758. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_OUT_LEN 8
  13759. /* Short vFIFO ID */
  13760. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_OUT_VID_OFST 0
  13761. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_OUT_VID_LEN 4
  13762. /* Network priority of the vFIFO */
  13763. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_OUT_PRIORITY_OFST 4
  13764. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_OUT_PRIORITY_LEN 4
  13765. /***********************************/
  13766. /* MC_CMD_TEARDOWN_TX_VFIFO_VF
  13767. * This interface clears the configuration of the given vFIFO and leaves it
  13768. * ready to be re-used.
  13769. */
  13770. #define MC_CMD_TEARDOWN_TX_VFIFO_VF 0x11f
  13771. #define MC_CMD_0x11f_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  13772. /* MC_CMD_TEARDOWN_TX_VFIFO_VF_IN msgrequest */
  13773. #define MC_CMD_TEARDOWN_TX_VFIFO_VF_IN_LEN 4
  13774. /* Short vFIFO ID */
  13775. #define MC_CMD_TEARDOWN_TX_VFIFO_VF_IN_VFIFO_OFST 0
  13776. #define MC_CMD_TEARDOWN_TX_VFIFO_VF_IN_VFIFO_LEN 4
  13777. /* MC_CMD_TEARDOWN_TX_VFIFO_VF_OUT msgresponse */
  13778. #define MC_CMD_TEARDOWN_TX_VFIFO_VF_OUT_LEN 0
  13779. /***********************************/
  13780. /* MC_CMD_DEALLOCATE_TX_VFIFO_CP
  13781. * This interface clears the configuration of the given common pool and leaves
  13782. * it ready to be re-used.
  13783. */
  13784. #define MC_CMD_DEALLOCATE_TX_VFIFO_CP 0x121
  13785. #define MC_CMD_0x121_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  13786. /* MC_CMD_DEALLOCATE_TX_VFIFO_CP_IN msgrequest */
  13787. #define MC_CMD_DEALLOCATE_TX_VFIFO_CP_IN_LEN 4
  13788. /* Common pool ID given when pool allocated */
  13789. #define MC_CMD_DEALLOCATE_TX_VFIFO_CP_IN_POOL_ID_OFST 0
  13790. #define MC_CMD_DEALLOCATE_TX_VFIFO_CP_IN_POOL_ID_LEN 4
  13791. /* MC_CMD_DEALLOCATE_TX_VFIFO_CP_OUT msgresponse */
  13792. #define MC_CMD_DEALLOCATE_TX_VFIFO_CP_OUT_LEN 0
  13793. /***********************************/
  13794. /* MC_CMD_SWITCH_GET_UNASSIGNED_BUFFERS
  13795. * This interface allows the host to find out how many common pool buffers are
  13796. * not yet assigned.
  13797. */
  13798. #define MC_CMD_SWITCH_GET_UNASSIGNED_BUFFERS 0x124
  13799. #define MC_CMD_0x124_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  13800. /* MC_CMD_SWITCH_GET_UNASSIGNED_BUFFERS_IN msgrequest */
  13801. #define MC_CMD_SWITCH_GET_UNASSIGNED_BUFFERS_IN_LEN 0
  13802. /* MC_CMD_SWITCH_GET_UNASSIGNED_BUFFERS_OUT msgresponse */
  13803. #define MC_CMD_SWITCH_GET_UNASSIGNED_BUFFERS_OUT_LEN 8
  13804. /* Available buffers for the ENG to NET vFIFOs. */
  13805. #define MC_CMD_SWITCH_GET_UNASSIGNED_BUFFERS_OUT_NET_OFST 0
  13806. #define MC_CMD_SWITCH_GET_UNASSIGNED_BUFFERS_OUT_NET_LEN 4
  13807. /* Available buffers for the ENG to ENG and NET to ENG vFIFOs. */
  13808. #define MC_CMD_SWITCH_GET_UNASSIGNED_BUFFERS_OUT_ENG_OFST 4
  13809. #define MC_CMD_SWITCH_GET_UNASSIGNED_BUFFERS_OUT_ENG_LEN 4
  13810. #endif /* MCDI_PCOL_H */