htt.h 663 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773
  1. /*
  2. * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /**
  27. * @file htt.h
  28. *
  29. * @details the public header file of HTT layer
  30. */
  31. #ifndef _HTT_H_
  32. #define _HTT_H_
  33. #include <htt_deps.h>
  34. #include <htt_common.h>
  35. /*
  36. * Unless explicitly specified to use 64 bits to represent physical addresses
  37. * (or more precisely, bus addresses), default to 32 bits.
  38. */
  39. #ifndef HTT_PADDR64
  40. #define HTT_PADDR64 0
  41. #endif
  42. #ifndef offsetof
  43. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  44. #endif
  45. /*
  46. * HTT version history:
  47. * 1.0 initial numbered version
  48. * 1.1 modifications to STATS messages.
  49. * These modifications are not backwards compatible, but since the
  50. * STATS messages themselves are non-essential (they are for debugging),
  51. * the 1.1 version of the HTT message library as a whole is compatible
  52. * with the 1.0 version.
  53. * 1.2 reset mask IE added to STATS_REQ message
  54. * 1.3 stat config IE added to STATS_REQ message
  55. *----
  56. * 2.0 FW rx PPDU desc added to RX_IND message
  57. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  58. *----
  59. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  60. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  61. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  62. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  63. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  64. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  65. * 3.5 Added flush and fail stats in rx_reorder stats structure
  66. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  67. * 3.7 Made changes to support EOS Mac_core 3.0
  68. * 3.8 Added txq_group information element definition;
  69. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  70. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  71. * Allow buffer addresses in bus-address format to be stored as
  72. * either 32 bits or 64 bits.
  73. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  74. * messages to specify which HTT options to use.
  75. * Initial TLV options cover:
  76. * - whether to use 32 or 64 bits to represent LL bus addresses
  77. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  78. * - how many tx queue groups to use
  79. * 3.11 Expand rx debug stats:
  80. * - Expand the rx_reorder_stats struct with stats about successful and
  81. * failed rx buffer allcoations.
  82. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  83. * the supply, allocation, use, and recycling of rx buffers for the
  84. * "remote ring" of rx buffers in host member in LL systems.
  85. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  86. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  87. * 3.13 Add constants + macros to support 64-bit address format for the
  88. * tx fragments descriptor, the rx ring buffer, and the rx ring
  89. * index shadow register.
  90. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  91. * - Add htt_tx_msdu_desc_ext_t struct def.
  92. * - Add TLV to specify whether the target supports the HTT tx MSDU
  93. * extension descriptor.
  94. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  95. * "extension" bit, to specify whether a HTT tx MSDU extension
  96. * descriptor is present.
  97. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  98. * (This allows the host to obtain key information about the MSDU
  99. * from a memory location already in the cache, rather than taking a
  100. * cache miss for each MSDU by reading the HW rx descs.)
  101. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  102. * whether a copy-engine classification result is appended to TX_FRM.
  103. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  104. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  105. * tx frames in the target after the peer has already been deleted.
  106. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  107. * 3.20 Expand rx_reorder_stats.
  108. * 3.21 Add optional rx channel spec to HL RX_IND.
  109. * 3.22 Expand rx_reorder_stats
  110. * (distinguish duplicates within vs. outside block ack window)
  111. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  112. * The justified rate is calculated by two steps. The first is to multiply
  113. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  114. * by a low pass filter.
  115. * This change allows HL download scheduling to consider the WLAN rate
  116. * that will be used for transmitting the downloaded frames.
  117. * 3.24 Expand rx_reorder_stats
  118. * (add counter for decrypt / MIC errors)
  119. * 3.25 Expand rx_reorder_stats
  120. * (add counter of frames received into both local + remote rings)
  121. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  122. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  123. * 3.27 Add a new interface for flow-control. The following t2h messages have
  124. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  125. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  126. * 3.28 Add a new interface for ring interface change. The following two h2t
  127. * and one t2h messages have been included:
  128. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  129. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  130. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  131. * information elements passed from the host to a Lithium target,
  132. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  133. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  134. * targets).
  135. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  136. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  137. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  138. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  139. * sharing stats
  140. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  141. * 3.34 Add HW_PEER_ID field to PEER_MAP
  142. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  143. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  144. * not yet in use)
  145. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  146. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  147. * 3.38 Add holes_no_filled field to rx_reorder_stats
  148. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  149. * 3.40 Add optional timestamps in the HTT tx completion
  150. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  151. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  152. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  153. * 3.44 Add htt_tx_wbm_completion_v2
  154. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  155. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  156. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  157. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  158. * HTT_T2H_MSG_TYPE_PKTLOG
  159. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  160. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  161. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  162. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  163. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  165. * 3.55 Add initiator / responder flags to RX_DELBA indication
  166. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  167. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  168. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  169. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  170. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  171. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  172. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  173. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  174. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  175. * array to the end of HTT_T2H TX_COMPL_IND msg
  176. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  177. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  178. * for a MSDU.
  179. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  180. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  181. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  182. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  183. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  184. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  185. * 3.71 Add rx offload engine / flow search engine htt setup message defs for
  186. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  187. * 3.72 Add tx_retry_cnt fields to htt_tx_offload_deliver_ind_hdr_t and
  188. * htt_tx_data_hdr_information
  189. * 3.73 Add channel pre-calibration data upload and download messages defs for
  190. * HTT_T2H_MSG_TYPE_CHAN_CALDATA and HTT_H2T_MSG_TYPE_CHAN_CALDATA
  191. * 3.74 Add HTT_T2H_MSG_TYPE_RX_FISA_CFG msg.
  192. * 3.75 Add fp_ndp and mo_ndp flags in HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG.
  193. * 3.76 Add HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG msg.
  194. * 3.77 Add HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE msg.
  195. * 3.78 Add htt_ppdu_id def.
  196. * 3.79 Add HTT_NUM_AC_WMM def.
  197. * 3.80 Add add WDS_FREE_COUNT bitfield in T2H PEER_UNMAP_V2 msg.
  198. * 3.81 Add ppdu_start_tsf field in HTT_TX_WBM_COMPLETION_V2.
  199. * 3.82 Add WIN_SIZE field to HTT_T2H_MSG_TYPE_RX_DELBA msg.
  200. * 3.83 Shrink seq_idx field in HTT PPDU ID from 3 bits to 2.
  201. * 3.84 Add fisa_control_bits_v2 def.
  202. * 3.85 Add HTT_RX_PEER_META_DATA defs.
  203. * 3.86 Add HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND def.
  204. * 3.87 Add on-chip AST index field to PEER_MAP_V2 msg.
  205. * 3.88 Add HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE def.
  206. * 3.89 Add MSDU queue enumerations.
  207. * 3.90 Add HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND def.
  208. */
  209. #define HTT_CURRENT_VERSION_MAJOR 3
  210. #define HTT_CURRENT_VERSION_MINOR 90
  211. #define HTT_NUM_TX_FRAG_DESC 1024
  212. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  213. #define HTT_CHECK_SET_VAL(field, val) \
  214. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  215. /* macros to assist in sign-extending fields from HTT messages */
  216. #define HTT_SIGN_BIT_MASK(field) \
  217. ((field ## _M + (1 << field ## _S)) >> 1)
  218. #define HTT_SIGN_BIT(_val, field) \
  219. (_val & HTT_SIGN_BIT_MASK(field))
  220. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  221. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  222. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  223. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  224. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  225. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  226. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  227. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  228. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  229. /*
  230. * TEMPORARY:
  231. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  232. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  233. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  234. * updated.
  235. */
  236. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  237. /*
  238. * TEMPORARY:
  239. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  240. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  241. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  242. * updated.
  243. */
  244. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  245. /*
  246. * htt_dbg_stats_type -
  247. * bit positions for each stats type within a stats type bitmask
  248. * The bitmask contains 24 bits.
  249. */
  250. enum htt_dbg_stats_type {
  251. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  252. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  253. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  254. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  255. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  256. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  257. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  258. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  259. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  260. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  261. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  262. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  263. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  264. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  265. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  266. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  267. /* bits 16-23 currently reserved */
  268. /* keep this last */
  269. HTT_DBG_NUM_STATS
  270. };
  271. /*=== HTT option selection TLVs ===
  272. * Certain HTT messages have alternatives or options.
  273. * For such cases, the host and target need to agree on which option to use.
  274. * Option specification TLVs can be appended to the VERSION_REQ and
  275. * VERSION_CONF messages to select options other than the default.
  276. * These TLVs are entirely optional - if they are not provided, there is a
  277. * well-defined default for each option. If they are provided, they can be
  278. * provided in any order. Each TLV can be present or absent independent of
  279. * the presence / absence of other TLVs.
  280. *
  281. * The HTT option selection TLVs use the following format:
  282. * |31 16|15 8|7 0|
  283. * |---------------------------------+----------------+----------------|
  284. * | value (payload) | length | tag |
  285. * |-------------------------------------------------------------------|
  286. * The value portion need not be only 2 bytes; it can be extended by any
  287. * integer number of 4-byte units. The total length of the TLV, including
  288. * the tag and length fields, must be a multiple of 4 bytes. The length
  289. * field specifies the total TLV size in 4-byte units. Thus, the typical
  290. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  291. * field, would store 0x1 in its length field, to show that the TLV occupies
  292. * a single 4-byte unit.
  293. */
  294. /*--- TLV header format - applies to all HTT option TLVs ---*/
  295. enum HTT_OPTION_TLV_TAGS {
  296. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  297. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  298. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  299. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  300. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  301. };
  302. PREPACK struct htt_option_tlv_header_t {
  303. A_UINT8 tag;
  304. A_UINT8 length;
  305. } POSTPACK;
  306. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  307. #define HTT_OPTION_TLV_TAG_S 0
  308. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  309. #define HTT_OPTION_TLV_LENGTH_S 8
  310. /*
  311. * value0 - 16 bit value field stored in word0
  312. * The TLV's value field may be longer than 2 bytes, in which case
  313. * the remainder of the value is stored in word1, word2, etc.
  314. */
  315. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  316. #define HTT_OPTION_TLV_VALUE0_S 16
  317. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  318. do { \
  319. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  320. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  321. } while (0)
  322. #define HTT_OPTION_TLV_TAG_GET(word) \
  323. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  324. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  325. do { \
  326. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  327. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  328. } while (0)
  329. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  330. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  331. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  332. do { \
  333. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  334. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  335. } while (0)
  336. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  337. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  338. /*--- format of specific HTT option TLVs ---*/
  339. /*
  340. * HTT option TLV for specifying LL bus address size
  341. * Some chips require bus addresses used by the target to access buffers
  342. * within the host's memory to be 32 bits; others require bus addresses
  343. * used by the target to access buffers within the host's memory to be
  344. * 64 bits.
  345. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  346. * a suffix to the VERSION_CONF message to specify which bus address format
  347. * the target requires.
  348. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  349. * default to providing bus addresses to the target in 32-bit format.
  350. */
  351. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  352. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  353. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  354. };
  355. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  356. struct htt_option_tlv_header_t hdr;
  357. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  358. } POSTPACK;
  359. /*
  360. * HTT option TLV for specifying whether HL systems should indicate
  361. * over-the-air tx completion for individual frames, or should instead
  362. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  363. * requests an OTA tx completion for a particular tx frame.
  364. * This option does not apply to LL systems, where the TX_COMPL_IND
  365. * is mandatory.
  366. * This option is primarily intended for HL systems in which the tx frame
  367. * downloads over the host --> target bus are as slow as or slower than
  368. * the transmissions over the WLAN PHY. For cases where the bus is faster
  369. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  370. * and consquently will send one TX_COMPL_IND message that covers several
  371. * tx frames. For cases where the WLAN PHY is faster than the bus,
  372. * the target will end up transmitting very short A-MPDUs, and consequently
  373. * sending many TX_COMPL_IND messages, which each cover a very small number
  374. * of tx frames.
  375. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  376. * a suffix to the VERSION_REQ message to request whether the host desires to
  377. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  378. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  379. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  380. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  381. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  382. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  383. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  384. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  385. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  386. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  387. * TLV.
  388. */
  389. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  390. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  391. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  392. };
  393. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  394. struct htt_option_tlv_header_t hdr;
  395. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  396. } POSTPACK;
  397. /*
  398. * HTT option TLV for specifying how many tx queue groups the target
  399. * may establish.
  400. * This TLV specifies the maximum value the target may send in the
  401. * txq_group_id field of any TXQ_GROUP information elements sent by
  402. * the target to the host. This allows the host to pre-allocate an
  403. * appropriate number of tx queue group structs.
  404. *
  405. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  406. * a suffix to the VERSION_REQ message to specify whether the host supports
  407. * tx queue groups at all, and if so if there is any limit on the number of
  408. * tx queue groups that the host supports.
  409. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  410. * a suffix to the VERSION_CONF message. If the host has specified in the
  411. * VER_REQ message a limit on the number of tx queue groups the host can
  412. * supprt, the target shall limit its specification of the maximum tx groups
  413. * to be no larger than this host-specified limit.
  414. *
  415. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  416. * shall preallocate 4 tx queue group structs, and the target shall not
  417. * specify a txq_group_id larger than 3.
  418. */
  419. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  420. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  421. /*
  422. * values 1 through N specify the max number of tx queue groups
  423. * the sender supports
  424. */
  425. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  426. };
  427. /* TEMPORARY backwards-compatibility alias for a typo fix -
  428. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  429. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  430. * to support the old name (with the typo) until all references to the
  431. * old name are replaced with the new name.
  432. */
  433. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  434. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  435. struct htt_option_tlv_header_t hdr;
  436. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  437. } POSTPACK;
  438. /*
  439. * HTT option TLV for specifying whether the target supports an extended
  440. * version of the HTT tx descriptor. If the target provides this TLV
  441. * and specifies in the TLV that the target supports an extended version
  442. * of the HTT tx descriptor, the target must check the "extension" bit in
  443. * the HTT tx descriptor, and if the extension bit is set, to expect a
  444. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  445. * descriptor. Furthermore, the target must provide room for the HTT
  446. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  447. * This option is intended for systems where the host needs to explicitly
  448. * control the transmission parameters such as tx power for individual
  449. * tx frames.
  450. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  451. * as a suffix to the VERSION_CONF message to explicitly specify whether
  452. * the target supports the HTT tx MSDU extension descriptor.
  453. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  454. * by the host as lack of target support for the HTT tx MSDU extension
  455. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  456. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  457. * the HTT tx MSDU extension descriptor.
  458. * The host is not required to provide the HTT tx MSDU extension descriptor
  459. * just because the target supports it; the target must check the
  460. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  461. * extension descriptor is present.
  462. */
  463. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  464. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  465. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  466. };
  467. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  468. struct htt_option_tlv_header_t hdr;
  469. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  470. } POSTPACK;
  471. /*=== host -> target messages ===============================================*/
  472. enum htt_h2t_msg_type {
  473. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  474. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  475. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  476. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  477. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  478. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  479. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  480. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  481. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  482. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  483. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  484. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  485. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  486. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  487. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  488. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  489. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  490. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  491. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  492. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  493. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  494. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  495. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  496. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  497. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  498. /* keep this last */
  499. HTT_H2T_NUM_MSGS
  500. };
  501. /*
  502. * HTT host to target message type -
  503. * stored in bits 7:0 of the first word of the message
  504. */
  505. #define HTT_H2T_MSG_TYPE_M 0xff
  506. #define HTT_H2T_MSG_TYPE_S 0
  507. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  508. do { \
  509. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  510. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  511. } while (0)
  512. #define HTT_H2T_MSG_TYPE_GET(word) \
  513. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  514. /**
  515. * @brief host -> target version number request message definition
  516. *
  517. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  518. *
  519. *
  520. * |31 24|23 16|15 8|7 0|
  521. * |----------------+----------------+----------------+----------------|
  522. * | reserved | msg type |
  523. * |-------------------------------------------------------------------|
  524. * : option request TLV (optional) |
  525. * :...................................................................:
  526. *
  527. * The VER_REQ message may consist of a single 4-byte word, or may be
  528. * extended with TLVs that specify which HTT options the host is requesting
  529. * from the target.
  530. * The following option TLVs may be appended to the VER_REQ message:
  531. * - HL_SUPPRESS_TX_COMPL_IND
  532. * - HL_MAX_TX_QUEUE_GROUPS
  533. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  534. * may be appended to the VER_REQ message (but only one TLV of each type).
  535. *
  536. * Header fields:
  537. * - MSG_TYPE
  538. * Bits 7:0
  539. * Purpose: identifies this as a version number request message
  540. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  541. */
  542. #define HTT_VER_REQ_BYTES 4
  543. /* TBDXXX: figure out a reasonable number */
  544. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  545. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  546. /**
  547. * @brief HTT tx MSDU descriptor
  548. *
  549. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  550. *
  551. * @details
  552. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  553. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  554. * the target firmware needs for the FW's tx processing, particularly
  555. * for creating the HW msdu descriptor.
  556. * The same HTT tx descriptor is used for HL and LL systems, though
  557. * a few fields within the tx descriptor are used only by LL or
  558. * only by HL.
  559. * The HTT tx descriptor is defined in two manners: by a struct with
  560. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  561. * definitions.
  562. * The target should use the struct def, for simplicitly and clarity,
  563. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  564. * neutral. Specifically, the host shall use the get/set macros built
  565. * around the mask + shift defs.
  566. */
  567. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  568. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  569. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  570. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  571. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  572. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  573. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  574. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  575. #define HTT_TX_VDEV_ID_WORD 0
  576. #define HTT_TX_VDEV_ID_MASK 0x3f
  577. #define HTT_TX_VDEV_ID_SHIFT 16
  578. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  579. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  580. #define HTT_TX_MSDU_LEN_DWORD 1
  581. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  582. /*
  583. * HTT_VAR_PADDR macros
  584. * Allow physical / bus addresses to be either a single 32-bit value,
  585. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  586. */
  587. #define HTT_VAR_PADDR32(var_name) \
  588. A_UINT32 var_name
  589. #define HTT_VAR_PADDR64_LE(var_name) \
  590. struct { \
  591. /* little-endian: lo precedes hi */ \
  592. A_UINT32 lo; \
  593. A_UINT32 hi; \
  594. } var_name
  595. /*
  596. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  597. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  598. * addresses are stored in a XXX-bit field.
  599. * This macro is used to define both htt_tx_msdu_desc32_t and
  600. * htt_tx_msdu_desc64_t structs.
  601. */
  602. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  603. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  604. { \
  605. /* DWORD 0: flags and meta-data */ \
  606. A_UINT32 \
  607. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  608. \
  609. /* pkt_subtype - \
  610. * Detailed specification of the tx frame contents, extending the \
  611. * general specification provided by pkt_type. \
  612. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  613. * pkt_type | pkt_subtype \
  614. * ============================================================== \
  615. * 802.3 | bit 0:3 - Reserved \
  616. * | bit 4: 0x0 - Copy-Engine Classification Results \
  617. * | not appended to the HTT message \
  618. * | 0x1 - Copy-Engine Classification Results \
  619. * | appended to the HTT message in the \
  620. * | format: \
  621. * | [HTT tx desc, frame header, \
  622. * | CE classification results] \
  623. * | The CE classification results begin \
  624. * | at the next 4-byte boundary after \
  625. * | the frame header. \
  626. * ------------+------------------------------------------------- \
  627. * Eth2 | bit 0:3 - Reserved \
  628. * | bit 4: 0x0 - Copy-Engine Classification Results \
  629. * | not appended to the HTT message \
  630. * | 0x1 - Copy-Engine Classification Results \
  631. * | appended to the HTT message. \
  632. * | See the above specification of the \
  633. * | CE classification results location. \
  634. * ------------+------------------------------------------------- \
  635. * native WiFi | bit 0:3 - Reserved \
  636. * | bit 4: 0x0 - Copy-Engine Classification Results \
  637. * | not appended to the HTT message \
  638. * | 0x1 - Copy-Engine Classification Results \
  639. * | appended to the HTT message. \
  640. * | See the above specification of the \
  641. * | CE classification results location. \
  642. * ------------+------------------------------------------------- \
  643. * mgmt | 0x0 - 802.11 MAC header absent \
  644. * | 0x1 - 802.11 MAC header present \
  645. * ------------+------------------------------------------------- \
  646. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  647. * | 0x1 - 802.11 MAC header present \
  648. * | bit 1: 0x0 - allow aggregation \
  649. * | 0x1 - don't allow aggregation \
  650. * | bit 2: 0x0 - perform encryption \
  651. * | 0x1 - don't perform encryption \
  652. * | bit 3: 0x0 - perform tx classification / queuing \
  653. * | 0x1 - don't perform tx classification; \
  654. * | insert the frame into the "misc" \
  655. * | tx queue \
  656. * | bit 4: 0x0 - Copy-Engine Classification Results \
  657. * | not appended to the HTT message \
  658. * | 0x1 - Copy-Engine Classification Results \
  659. * | appended to the HTT message. \
  660. * | See the above specification of the \
  661. * | CE classification results location. \
  662. */ \
  663. pkt_subtype: 5, \
  664. \
  665. /* pkt_type - \
  666. * General specification of the tx frame contents. \
  667. * The htt_pkt_type enum should be used to specify and check the \
  668. * value of this field. \
  669. */ \
  670. pkt_type: 3, \
  671. \
  672. /* vdev_id - \
  673. * ID for the vdev that is sending this tx frame. \
  674. * For certain non-standard packet types, e.g. pkt_type == raw \
  675. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  676. * This field is used primarily for determining where to queue \
  677. * broadcast and multicast frames. \
  678. */ \
  679. vdev_id: 6, \
  680. /* ext_tid - \
  681. * The extended traffic ID. \
  682. * If the TID is unknown, the extended TID is set to \
  683. * HTT_TX_EXT_TID_INVALID. \
  684. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  685. * value of the QoS TID. \
  686. * If the tx frame is non-QoS data, then the extended TID is set to \
  687. * HTT_TX_EXT_TID_NON_QOS. \
  688. * If the tx frame is multicast or broadcast, then the extended TID \
  689. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  690. */ \
  691. ext_tid: 5, \
  692. \
  693. /* postponed - \
  694. * This flag indicates whether the tx frame has been downloaded to \
  695. * the target before but discarded by the target, and now is being \
  696. * downloaded again; or if this is a new frame that is being \
  697. * downloaded for the first time. \
  698. * This flag allows the target to determine the correct order for \
  699. * transmitting new vs. old frames. \
  700. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  701. * This flag only applies to HL systems, since in LL systems, \
  702. * the tx flow control is handled entirely within the target. \
  703. */ \
  704. postponed: 1, \
  705. \
  706. /* extension - \
  707. * This flag indicates whether a HTT tx MSDU extension descriptor \
  708. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  709. * \
  710. * 0x0 - no extension MSDU descriptor is present \
  711. * 0x1 - an extension MSDU descriptor immediately follows the \
  712. * regular MSDU descriptor \
  713. */ \
  714. extension: 1, \
  715. \
  716. /* cksum_offload - \
  717. * This flag indicates whether checksum offload is enabled or not \
  718. * for this frame. Target FW use this flag to turn on HW checksumming \
  719. * 0x0 - No checksum offload \
  720. * 0x1 - L3 header checksum only \
  721. * 0x2 - L4 checksum only \
  722. * 0x3 - L3 header checksum + L4 checksum \
  723. */ \
  724. cksum_offload: 2, \
  725. \
  726. /* tx_comp_req - \
  727. * This flag indicates whether Tx Completion \
  728. * from fw is required or not. \
  729. * This flag is only relevant if tx completion is not \
  730. * universally enabled. \
  731. * For all LL systems, tx completion is mandatory, \
  732. * so this flag will be irrelevant. \
  733. * For HL systems tx completion is optional, but HL systems in which \
  734. * the bus throughput exceeds the WLAN throughput will \
  735. * probably want to always use tx completion, and thus \
  736. * would not check this flag. \
  737. * This flag is required when tx completions are not used universally, \
  738. * but are still required for certain tx frames for which \
  739. * an OTA delivery acknowledgment is needed by the host. \
  740. * In practice, this would be for HL systems in which the \
  741. * bus throughput is less than the WLAN throughput. \
  742. * \
  743. * 0x0 - Tx Completion Indication from Fw not required \
  744. * 0x1 - Tx Completion Indication from Fw is required \
  745. */ \
  746. tx_compl_req: 1; \
  747. \
  748. \
  749. /* DWORD 1: MSDU length and ID */ \
  750. A_UINT32 \
  751. len: 16, /* MSDU length, in bytes */ \
  752. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  753. * and this id is used to calculate fragmentation \
  754. * descriptor pointer inside the target based on \
  755. * the base address, configured inside the target. \
  756. */ \
  757. \
  758. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  759. /* frags_desc_ptr - \
  760. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  761. * where the tx frame's fragments reside in memory. \
  762. * This field only applies to LL systems, since in HL systems the \
  763. * (degenerate single-fragment) fragmentation descriptor is created \
  764. * within the target. \
  765. */ \
  766. _paddr__frags_desc_ptr_; \
  767. \
  768. /* DWORD 3 (or 4): peerid, chanfreq */ \
  769. /* \
  770. * Peer ID : Target can use this value to know which peer-id packet \
  771. * destined to. \
  772. * It's intended to be specified by host in case of NAWDS. \
  773. */ \
  774. A_UINT16 peerid; \
  775. \
  776. /* \
  777. * Channel frequency: This identifies the desired channel \
  778. * frequency (in mhz) for tx frames. This is used by FW to help \
  779. * determine when it is safe to transmit or drop frames for \
  780. * off-channel operation. \
  781. * The default value of zero indicates to FW that the corresponding \
  782. * VDEV's home channel (if there is one) is the desired channel \
  783. * frequency. \
  784. */ \
  785. A_UINT16 chanfreq; \
  786. \
  787. /* Reason reserved is commented is increasing the htt structure size \
  788. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  789. * A_UINT32 reserved_dword3_bits0_31; \
  790. */ \
  791. } POSTPACK
  792. /* define a htt_tx_msdu_desc32_t type */
  793. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  794. /* define a htt_tx_msdu_desc64_t type */
  795. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  796. /*
  797. * Make htt_tx_msdu_desc_t be an alias for either
  798. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  799. */
  800. #if HTT_PADDR64
  801. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  802. #else
  803. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  804. #endif
  805. /* decriptor information for Management frame*/
  806. /*
  807. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  808. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  809. */
  810. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  811. extern A_UINT32 mgmt_hdr_len;
  812. PREPACK struct htt_mgmt_tx_desc_t {
  813. A_UINT32 msg_type;
  814. #if HTT_PADDR64
  815. A_UINT64 frag_paddr; /* DMAble address of the data */
  816. #else
  817. A_UINT32 frag_paddr; /* DMAble address of the data */
  818. #endif
  819. A_UINT32 desc_id; /* returned to host during completion
  820. * to free the meory*/
  821. A_UINT32 len; /* Fragment length */
  822. A_UINT32 vdev_id; /* virtual device ID*/
  823. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  824. } POSTPACK;
  825. PREPACK struct htt_mgmt_tx_compl_ind {
  826. A_UINT32 desc_id;
  827. A_UINT32 status;
  828. } POSTPACK;
  829. /*
  830. * This SDU header size comes from the summation of the following:
  831. * 1. Max of:
  832. * a. Native WiFi header, for native WiFi frames: 24 bytes
  833. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  834. * b. 802.11 header, for raw frames: 36 bytes
  835. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  836. * QoS header, HT header)
  837. * c. 802.3 header, for ethernet frames: 14 bytes
  838. * (destination address, source address, ethertype / length)
  839. * 2. Max of:
  840. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  841. * b. IPv6 header, up through the Traffic Class: 2 bytes
  842. * 3. 802.1Q VLAN header: 4 bytes
  843. * 4. LLC/SNAP header: 8 bytes
  844. */
  845. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  846. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  847. #define HTT_TX_HDR_SIZE_ETHERNET 14
  848. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  849. A_COMPILE_TIME_ASSERT(
  850. htt_encap_hdr_size_max_check_nwifi,
  851. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  852. A_COMPILE_TIME_ASSERT(
  853. htt_encap_hdr_size_max_check_enet,
  854. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  855. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  856. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  857. #define HTT_TX_HDR_SIZE_802_1Q 4
  858. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  859. #define HTT_COMMON_TX_FRM_HDR_LEN \
  860. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  861. HTT_TX_HDR_SIZE_802_1Q + \
  862. HTT_TX_HDR_SIZE_LLC_SNAP)
  863. #define HTT_HL_TX_FRM_HDR_LEN \
  864. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  865. #define HTT_LL_TX_FRM_HDR_LEN \
  866. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  867. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  868. /* dword 0 */
  869. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  870. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  871. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  872. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  873. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  874. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  875. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  876. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  877. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  878. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  879. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  880. #define HTT_TX_DESC_PKT_TYPE_S 13
  881. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  882. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  883. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  884. #define HTT_TX_DESC_VDEV_ID_S 16
  885. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  886. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  887. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  888. #define HTT_TX_DESC_EXT_TID_S 22
  889. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  890. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  891. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  892. #define HTT_TX_DESC_POSTPONED_S 27
  893. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  894. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  895. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  896. #define HTT_TX_DESC_EXTENSION_S 28
  897. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  898. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  899. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  900. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  901. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  902. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  903. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  904. #define HTT_TX_DESC_TX_COMP_S 31
  905. /* dword 1 */
  906. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  907. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  908. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  909. #define HTT_TX_DESC_FRM_LEN_S 0
  910. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  911. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  912. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  913. #define HTT_TX_DESC_FRM_ID_S 16
  914. /* dword 2 */
  915. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  916. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  917. /* for systems using 64-bit format for bus addresses */
  918. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  919. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  920. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  921. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  922. /* for systems using 32-bit format for bus addresses */
  923. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  924. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  925. /* dword 3 */
  926. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  927. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  928. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  929. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  930. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  931. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  932. #if HTT_PADDR64
  933. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  934. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  935. #else
  936. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  937. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  938. #endif
  939. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  940. #define HTT_TX_DESC_PEER_ID_S 0
  941. /*
  942. * TEMPORARY:
  943. * The original definitions for the PEER_ID fields contained typos
  944. * (with _DESC_PADDR appended to this PEER_ID field name).
  945. * Retain deprecated original names for PEER_ID fields until all code that
  946. * refers to them has been updated.
  947. */
  948. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  949. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  950. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  951. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  952. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  953. HTT_TX_DESC_PEER_ID_M
  954. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  955. HTT_TX_DESC_PEER_ID_S
  956. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  957. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  958. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  959. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  960. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  961. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  962. #if HTT_PADDR64
  963. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  964. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  965. #else
  966. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  967. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  968. #endif
  969. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  970. #define HTT_TX_DESC_CHAN_FREQ_S 16
  971. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  972. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  973. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  974. do { \
  975. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  976. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  977. } while (0)
  978. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  979. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  980. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  981. do { \
  982. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  983. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  984. } while (0)
  985. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  986. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  987. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  988. do { \
  989. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  990. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  991. } while (0)
  992. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  993. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  994. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  995. do { \
  996. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  997. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  998. } while (0)
  999. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1000. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1001. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1002. do { \
  1003. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1004. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1005. } while (0)
  1006. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1007. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1008. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1009. do { \
  1010. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1011. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1012. } while (0)
  1013. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1014. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1015. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1016. do { \
  1017. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1018. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1019. } while (0)
  1020. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1021. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1022. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1023. do { \
  1024. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1025. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1026. } while (0)
  1027. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1028. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1029. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1030. do { \
  1031. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1032. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1033. } while (0)
  1034. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1035. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1036. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1037. do { \
  1038. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1039. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1040. } while (0)
  1041. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1042. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1043. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1044. do { \
  1045. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1046. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1047. } while (0)
  1048. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1049. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1050. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1051. do { \
  1052. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1053. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1054. } while (0)
  1055. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1056. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1057. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1058. do { \
  1059. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1060. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1061. } while (0)
  1062. /* enums used in the HTT tx MSDU extension descriptor */
  1063. enum {
  1064. htt_tx_guard_interval_regular = 0,
  1065. htt_tx_guard_interval_short = 1,
  1066. };
  1067. enum {
  1068. htt_tx_preamble_type_ofdm = 0,
  1069. htt_tx_preamble_type_cck = 1,
  1070. htt_tx_preamble_type_ht = 2,
  1071. htt_tx_preamble_type_vht = 3,
  1072. };
  1073. enum {
  1074. htt_tx_bandwidth_5MHz = 0,
  1075. htt_tx_bandwidth_10MHz = 1,
  1076. htt_tx_bandwidth_20MHz = 2,
  1077. htt_tx_bandwidth_40MHz = 3,
  1078. htt_tx_bandwidth_80MHz = 4,
  1079. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1080. };
  1081. /**
  1082. * @brief HTT tx MSDU extension descriptor
  1083. * @details
  1084. * If the target supports HTT tx MSDU extension descriptors, the host has
  1085. * the option of appending the following struct following the regular
  1086. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1087. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1088. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1089. * tx specs for each frame.
  1090. */
  1091. PREPACK struct htt_tx_msdu_desc_ext_t {
  1092. /* DWORD 0: flags */
  1093. A_UINT32
  1094. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1095. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1096. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1097. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1098. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1099. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1100. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1101. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1102. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1103. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1104. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1105. /* DWORD 1: tx power, tx rate, tx BW */
  1106. A_UINT32
  1107. /* pwr -
  1108. * Specify what power the tx frame needs to be transmitted at.
  1109. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1110. * The value needs to be appropriately sign-extended when extracting
  1111. * the value from the message and storing it in a variable that is
  1112. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1113. * automatically handles this sign-extension.)
  1114. * If the transmission uses multiple tx chains, this power spec is
  1115. * the total transmit power, assuming incoherent combination of
  1116. * per-chain power to produce the total power.
  1117. */
  1118. pwr: 8,
  1119. /* mcs_mask -
  1120. * Specify the allowable values for MCS index (modulation and coding)
  1121. * to use for transmitting the frame.
  1122. *
  1123. * For HT / VHT preamble types, this mask directly corresponds to
  1124. * the HT or VHT MCS indices that are allowed. For each bit N set
  1125. * within the mask, MCS index N is allowed for transmitting the frame.
  1126. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1127. * rates versus OFDM rates, so the host has the option of specifying
  1128. * that the target must transmit the frame with CCK or OFDM rates
  1129. * (not HT or VHT), but leaving the decision to the target whether
  1130. * to use CCK or OFDM.
  1131. *
  1132. * For CCK and OFDM, the bits within this mask are interpreted as
  1133. * follows:
  1134. * bit 0 -> CCK 1 Mbps rate is allowed
  1135. * bit 1 -> CCK 2 Mbps rate is allowed
  1136. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1137. * bit 3 -> CCK 11 Mbps rate is allowed
  1138. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1139. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1140. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1141. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1142. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1143. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1144. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1145. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1146. *
  1147. * The MCS index specification needs to be compatible with the
  1148. * bandwidth mask specification. For example, a MCS index == 9
  1149. * specification is inconsistent with a preamble type == VHT,
  1150. * Nss == 1, and channel bandwidth == 20 MHz.
  1151. *
  1152. * Furthermore, the host has only a limited ability to specify to
  1153. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1154. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1155. */
  1156. mcs_mask: 12,
  1157. /* nss_mask -
  1158. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1159. * Each bit in this mask corresponds to a Nss value:
  1160. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1161. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1162. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1163. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1164. * The values in the Nss mask must be suitable for the recipient, e.g.
  1165. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1166. * recipient which only supports 2x2 MIMO.
  1167. */
  1168. nss_mask: 4,
  1169. /* guard_interval -
  1170. * Specify a htt_tx_guard_interval enum value to indicate whether
  1171. * the transmission should use a regular guard interval or a
  1172. * short guard interval.
  1173. */
  1174. guard_interval: 1,
  1175. /* preamble_type_mask -
  1176. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1177. * may choose from for transmitting this frame.
  1178. * The bits in this mask correspond to the values in the
  1179. * htt_tx_preamble_type enum. For example, to allow the target
  1180. * to transmit the frame as either CCK or OFDM, this field would
  1181. * be set to
  1182. * (1 << htt_tx_preamble_type_ofdm) |
  1183. * (1 << htt_tx_preamble_type_cck)
  1184. */
  1185. preamble_type_mask: 4,
  1186. reserved1_31_29: 3; /* unused, set to 0x0 */
  1187. /* DWORD 2: tx chain mask, tx retries */
  1188. A_UINT32
  1189. /* chain_mask - specify which chains to transmit from */
  1190. chain_mask: 4,
  1191. /* retry_limit -
  1192. * Specify the maximum number of transmissions, including the
  1193. * initial transmission, to attempt before giving up if no ack
  1194. * is received.
  1195. * If the tx rate is specified, then all retries shall use the
  1196. * same rate as the initial transmission.
  1197. * If no tx rate is specified, the target can choose whether to
  1198. * retain the original rate during the retransmissions, or to
  1199. * fall back to a more robust rate.
  1200. */
  1201. retry_limit: 4,
  1202. /* bandwidth_mask -
  1203. * Specify what channel widths may be used for the transmission.
  1204. * A value of zero indicates "don't care" - the target may choose
  1205. * the transmission bandwidth.
  1206. * The bits within this mask correspond to the htt_tx_bandwidth
  1207. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1208. * The bandwidth_mask must be consistent with the preamble_type_mask
  1209. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1210. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1211. */
  1212. bandwidth_mask: 6,
  1213. reserved2_31_14: 18; /* unused, set to 0x0 */
  1214. /* DWORD 3: tx expiry time (TSF) LSBs */
  1215. A_UINT32 expire_tsf_lo;
  1216. /* DWORD 4: tx expiry time (TSF) MSBs */
  1217. A_UINT32 expire_tsf_hi;
  1218. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1219. } POSTPACK;
  1220. /* DWORD 0 */
  1221. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1222. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1223. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1224. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1225. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1226. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1227. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1228. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1229. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1230. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1231. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1232. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1233. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1234. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1235. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1236. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1237. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1238. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1239. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1240. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1241. /* DWORD 1 */
  1242. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1243. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1244. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1245. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1246. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1247. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1248. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1249. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1250. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1251. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1252. /* DWORD 2 */
  1253. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1254. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1255. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1256. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1257. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1258. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1259. /* DWORD 0 */
  1260. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1261. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1262. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1263. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1264. do { \
  1265. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1266. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1267. } while (0)
  1268. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1269. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1270. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1271. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1272. do { \
  1273. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1274. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1275. } while (0)
  1276. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1277. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1278. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1279. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1280. do { \
  1281. HTT_CHECK_SET_VAL( \
  1282. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1283. ((_var) |= ((_val) \
  1284. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1285. } while (0)
  1286. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1287. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1288. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1289. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1290. do { \
  1291. HTT_CHECK_SET_VAL( \
  1292. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1293. ((_var) |= ((_val) \
  1294. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1295. } while (0)
  1296. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1297. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1298. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1299. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1300. do { \
  1301. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1302. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1303. } while (0)
  1304. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1305. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1306. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1307. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1308. do { \
  1309. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1310. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1311. } while (0)
  1312. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1313. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1314. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1315. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1316. do { \
  1317. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1318. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1319. } while (0)
  1320. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1321. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1322. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1323. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1324. do { \
  1325. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1326. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1327. } while (0)
  1328. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1329. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1330. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1331. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1332. do { \
  1333. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1334. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1335. } while (0)
  1336. /* DWORD 1 */
  1337. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1338. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1339. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1340. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1341. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1342. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1343. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1344. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1345. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1346. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1347. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1348. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1349. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1350. do { \
  1351. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1352. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1353. } while (0)
  1354. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1355. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1356. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1357. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1358. do { \
  1359. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1360. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1361. } while (0)
  1362. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1363. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1364. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1365. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1366. do { \
  1367. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1368. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1369. } while (0)
  1370. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1371. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1372. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1373. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1374. do { \
  1375. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1376. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1377. } while (0)
  1378. /* DWORD 2 */
  1379. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1380. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1381. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1382. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1383. do { \
  1384. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1385. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1386. } while (0)
  1387. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1388. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1389. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1390. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1391. do { \
  1392. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1393. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1394. } while (0)
  1395. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1396. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1397. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1398. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1399. do { \
  1400. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1401. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1402. } while (0)
  1403. typedef enum {
  1404. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1405. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1406. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1407. } htt_11ax_ltf_subtype_t;
  1408. typedef enum {
  1409. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1410. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1411. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1412. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1413. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1414. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1415. } htt_tx_ext2_preamble_type_t;
  1416. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1417. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1418. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1419. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1420. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1421. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1422. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1423. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1424. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1425. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1426. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1427. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1428. /**
  1429. * @brief HTT tx MSDU extension descriptor v2
  1430. * @details
  1431. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1432. * is received as tcl_exit_base->host_meta_info in firmware.
  1433. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1434. * are already part of tcl_exit_base.
  1435. */
  1436. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1437. /* DWORD 0: flags */
  1438. A_UINT32
  1439. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1440. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1441. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1442. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1443. valid_retries : 1, /* if set, tx retries spec is valid */
  1444. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1445. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1446. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1447. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1448. valid_key_flags : 1, /* if set, key flags is valid */
  1449. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1450. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1451. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1452. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1453. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1454. 1 = ENCRYPT,
  1455. 2 ~ 3 - Reserved */
  1456. /* retry_limit -
  1457. * Specify the maximum number of transmissions, including the
  1458. * initial transmission, to attempt before giving up if no ack
  1459. * is received.
  1460. * If the tx rate is specified, then all retries shall use the
  1461. * same rate as the initial transmission.
  1462. * If no tx rate is specified, the target can choose whether to
  1463. * retain the original rate during the retransmissions, or to
  1464. * fall back to a more robust rate.
  1465. */
  1466. retry_limit : 4,
  1467. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1468. * Valid only for 11ax preamble types HE_SU
  1469. * and HE_EXT_SU
  1470. */
  1471. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1472. * Valid only for 11ax preamble types HE_SU
  1473. * and HE_EXT_SU
  1474. */
  1475. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1476. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1477. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1478. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1479. */
  1480. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1481. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1482. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1483. * Use cases:
  1484. * Any time firmware uses TQM-BYPASS for Data
  1485. * TID, firmware expect host to set this bit.
  1486. */
  1487. /* DWORD 1: tx power, tx rate */
  1488. A_UINT32
  1489. power : 8, /* unit of the power field is 0.5 dbm
  1490. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1491. * signed value ranging from -64dbm to 63.5 dbm
  1492. */
  1493. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1494. * Setting more than one MCS isn't currently
  1495. * supported by the target (but is supported
  1496. * in the interface in case in the future
  1497. * the target supports specifications of
  1498. * a limited set of MCS values.
  1499. */
  1500. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1501. * Setting more than one Nss isn't currently
  1502. * supported by the target (but is supported
  1503. * in the interface in case in the future
  1504. * the target supports specifications of
  1505. * a limited set of Nss values.
  1506. */
  1507. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1508. update_peer_cache : 1; /* When set these custom values will be
  1509. * used for all packets, until the next
  1510. * update via this ext header.
  1511. * This is to make sure not all packets
  1512. * need to include this header.
  1513. */
  1514. /* DWORD 2: tx chain mask, tx retries */
  1515. A_UINT32
  1516. /* chain_mask - specify which chains to transmit from */
  1517. chain_mask : 8,
  1518. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1519. * TODO: Update Enum values for key_flags
  1520. */
  1521. /*
  1522. * Channel frequency: This identifies the desired channel
  1523. * frequency (in MHz) for tx frames. This is used by FW to help
  1524. * determine when it is safe to transmit or drop frames for
  1525. * off-channel operation.
  1526. * The default value of zero indicates to FW that the corresponding
  1527. * VDEV's home channel (if there is one) is the desired channel
  1528. * frequency.
  1529. */
  1530. chanfreq : 16;
  1531. /* DWORD 3: tx expiry time (TSF) LSBs */
  1532. A_UINT32 expire_tsf_lo;
  1533. /* DWORD 4: tx expiry time (TSF) MSBs */
  1534. A_UINT32 expire_tsf_hi;
  1535. /* DWORD 5: flags to control routing / processing of the MSDU */
  1536. A_UINT32
  1537. /* learning_frame
  1538. * When this flag is set, this frame will be dropped by FW
  1539. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1540. */
  1541. learning_frame : 1,
  1542. /* send_as_standalone
  1543. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1544. * i.e. with no A-MSDU or A-MPDU aggregation.
  1545. * The scope is extended to other use-cases.
  1546. */
  1547. send_as_standalone : 1,
  1548. /* is_host_opaque_valid
  1549. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1550. * with valid information.
  1551. */
  1552. is_host_opaque_valid : 1,
  1553. rsvd0 : 29;
  1554. /* DWORD 6 : Host opaque cookie for special frames */
  1555. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1556. rsvd1 : 16;
  1557. /*
  1558. * This structure can be expanded further up to 40 bytes
  1559. * by adding further DWORDs as needed.
  1560. */
  1561. } POSTPACK;
  1562. /* DWORD 0 */
  1563. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1564. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1565. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1566. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1567. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1568. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1569. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1570. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1571. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1572. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1573. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1574. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1575. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1576. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1577. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1578. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1579. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1580. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1581. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1582. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1583. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1584. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1585. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1586. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1587. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1588. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1589. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1590. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1591. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1592. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1593. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1594. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1595. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1596. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1597. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1598. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1599. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1600. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1601. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1602. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1603. /* DWORD 1 */
  1604. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1605. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1606. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1607. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1608. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1609. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1610. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1611. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1612. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1613. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1614. /* DWORD 2 */
  1615. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1616. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1617. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1618. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1619. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1620. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1621. /* DWORD 5 */
  1622. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1623. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1624. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1625. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1626. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1627. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1628. /* DWORD 6 */
  1629. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1630. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1631. /* DWORD 0 */
  1632. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1633. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1634. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1635. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1636. do { \
  1637. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1638. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1639. } while (0)
  1640. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1641. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1642. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1643. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1644. do { \
  1645. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1646. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1647. } while (0)
  1648. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1649. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1650. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1651. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1652. do { \
  1653. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1654. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1655. } while (0)
  1656. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1657. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1658. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1659. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1660. do { \
  1661. HTT_CHECK_SET_VAL( \
  1662. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1663. ((_var) |= ((_val) \
  1664. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1665. } while (0)
  1666. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1667. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1668. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1669. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1670. do { \
  1671. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1672. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1673. } while (0)
  1674. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1675. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1676. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1677. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1678. do { \
  1679. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1680. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1681. } while (0)
  1682. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1683. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1684. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1685. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1686. do { \
  1687. HTT_CHECK_SET_VAL( \
  1688. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1689. ((_var) |= ((_val) \
  1690. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1691. } while (0)
  1692. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1693. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1694. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1695. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1696. do { \
  1697. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1698. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1699. } while (0)
  1700. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1701. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1702. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1703. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1704. do { \
  1705. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1706. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1707. } while (0)
  1708. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1709. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1710. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1711. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1712. do { \
  1713. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1714. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1715. } while (0)
  1716. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1717. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1718. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1719. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1720. do { \
  1721. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1722. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1723. } while (0)
  1724. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1725. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1726. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1727. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1728. do { \
  1729. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1730. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1731. } while (0)
  1732. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1733. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1734. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1735. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1736. do { \
  1737. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1738. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1739. } while (0)
  1740. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1741. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1742. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1743. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1744. do { \
  1745. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1746. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1747. } while (0)
  1748. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1749. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1750. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1751. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1752. do { \
  1753. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1754. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1755. } while (0)
  1756. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1757. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1758. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1759. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1760. do { \
  1761. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1762. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1763. } while (0)
  1764. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1765. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1766. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1767. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1768. do { \
  1769. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1770. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1771. } while (0)
  1772. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1773. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1774. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1775. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1776. do { \
  1777. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1778. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1779. } while (0)
  1780. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1781. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1782. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1783. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1784. do { \
  1785. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1786. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1787. } while (0)
  1788. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1789. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1790. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1791. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1792. do { \
  1793. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1794. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1795. } while (0)
  1796. /* DWORD 1 */
  1797. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1798. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1799. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1800. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1801. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1802. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1803. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1804. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1805. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1806. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1807. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1808. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1809. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1810. do { \
  1811. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1812. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1813. } while (0)
  1814. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1815. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1816. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1817. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1818. do { \
  1819. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1820. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1821. } while (0)
  1822. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1823. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1824. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1825. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1826. do { \
  1827. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1828. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1829. } while (0)
  1830. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1831. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1832. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1833. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1834. do { \
  1835. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1836. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1837. } while (0)
  1838. /* DWORD 2 */
  1839. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1840. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1841. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1842. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1843. do { \
  1844. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1845. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1846. } while (0)
  1847. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1848. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1849. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1850. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1851. do { \
  1852. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1853. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1854. } while (0)
  1855. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1856. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1857. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1858. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1859. do { \
  1860. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1861. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1862. } while (0)
  1863. /* DWORD 5 */
  1864. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  1865. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  1866. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  1867. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  1868. do { \
  1869. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  1870. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  1871. } while (0)
  1872. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  1873. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  1874. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  1875. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  1876. do { \
  1877. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  1878. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  1879. } while (0)
  1880. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  1881. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  1882. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  1883. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  1884. do { \
  1885. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  1886. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  1887. } while (0)
  1888. /* DWORD 6 */
  1889. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  1890. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  1891. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  1892. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  1893. do { \
  1894. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  1895. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  1896. } while (0)
  1897. typedef enum {
  1898. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1899. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1900. } htt_tcl_metadata_type;
  1901. /**
  1902. * @brief HTT TCL command number format
  1903. * @details
  1904. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1905. * available to firmware as tcl_exit_base->tcl_status_number.
  1906. * For regular / multicast packets host will send vdev and mac id and for
  1907. * NAWDS packets, host will send peer id.
  1908. * A_UINT32 is used to avoid endianness conversion problems.
  1909. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1910. */
  1911. typedef struct {
  1912. A_UINT32
  1913. type: 1, /* vdev_id based or peer_id based */
  1914. rsvd: 31;
  1915. } htt_tx_tcl_vdev_or_peer_t;
  1916. typedef struct {
  1917. A_UINT32
  1918. type: 1, /* vdev_id based or peer_id based */
  1919. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1920. vdev_id: 8,
  1921. pdev_id: 2,
  1922. host_inspected:1,
  1923. rsvd: 19;
  1924. } htt_tx_tcl_vdev_metadata;
  1925. typedef struct {
  1926. A_UINT32
  1927. type: 1, /* vdev_id based or peer_id based */
  1928. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1929. peer_id: 14,
  1930. rsvd: 16;
  1931. } htt_tx_tcl_peer_metadata;
  1932. PREPACK struct htt_tx_tcl_metadata {
  1933. union {
  1934. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1935. htt_tx_tcl_vdev_metadata vdev_meta;
  1936. htt_tx_tcl_peer_metadata peer_meta;
  1937. };
  1938. } POSTPACK;
  1939. /* DWORD 0 */
  1940. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1941. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1942. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1943. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1944. /* VDEV metadata */
  1945. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1946. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1947. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1948. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1949. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1950. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1951. /* PEER metadata */
  1952. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1953. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1954. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1955. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1956. HTT_TX_TCL_METADATA_TYPE_S)
  1957. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1958. do { \
  1959. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1960. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1961. } while (0)
  1962. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1963. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1964. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1965. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1966. do { \
  1967. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1968. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1969. } while (0)
  1970. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1971. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1972. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1973. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1974. do { \
  1975. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1976. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1977. } while (0)
  1978. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1979. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1980. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1981. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1982. do { \
  1983. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1984. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1985. } while (0)
  1986. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1987. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1988. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  1989. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  1990. do { \
  1991. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  1992. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  1993. } while (0)
  1994. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1995. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  1996. HTT_TX_TCL_METADATA_PEER_ID_S)
  1997. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  1998. do { \
  1999. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2000. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2001. } while (0)
  2002. typedef enum {
  2003. HTT_TX_FW2WBM_TX_STATUS_OK,
  2004. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2005. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2006. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2007. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2008. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2009. HTT_TX_FW2WBM_TX_STATUS_MAX
  2010. } htt_tx_fw2wbm_tx_status_t;
  2011. typedef enum {
  2012. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2013. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2014. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2015. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2016. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2017. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2018. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2019. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2020. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2021. } htt_tx_fw2wbm_reinject_reason_t;
  2022. /**
  2023. * @brief HTT TX WBM Completion from firmware to host
  2024. * @details
  2025. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2026. * DWORD 3 and 4 for software based completions (Exception frames and
  2027. * TQM bypass frames)
  2028. * For software based completions, wbm_release_ring->release_source_module will
  2029. * be set to release_source_fw
  2030. */
  2031. PREPACK struct htt_tx_wbm_completion {
  2032. A_UINT32
  2033. sch_cmd_id: 24,
  2034. exception_frame: 1, /* If set, this packet was queued via exception path */
  2035. rsvd0_31_25: 7;
  2036. A_UINT32
  2037. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2038. * reception of an ACK or BA, this field indicates
  2039. * the RSSI of the received ACK or BA frame.
  2040. * When the frame is removed as result of a direct
  2041. * remove command from the SW, this field is set
  2042. * to 0x0 (which is never a valid value when real
  2043. * RSSI is available).
  2044. * Units: dB w.r.t noise floor
  2045. */
  2046. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2047. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2048. rsvd1_31_16: 16;
  2049. } POSTPACK;
  2050. /* DWORD 0 */
  2051. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2052. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2053. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2054. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2055. /* DWORD 1 */
  2056. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2057. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2058. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2059. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2060. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2061. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2062. /* DWORD 0 */
  2063. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2064. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2065. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2066. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2067. do { \
  2068. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2069. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2070. } while (0)
  2071. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2072. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2073. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2074. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2075. do { \
  2076. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2077. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2078. } while (0)
  2079. /* DWORD 1 */
  2080. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2081. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2082. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2083. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2084. do { \
  2085. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2086. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2087. } while (0)
  2088. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2089. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2090. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2091. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2092. do { \
  2093. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2094. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2095. } while (0)
  2096. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2097. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2098. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2099. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2100. do { \
  2101. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2102. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2103. } while (0)
  2104. /**
  2105. * @brief HTT TX WBM Completion from firmware to host
  2106. * @details
  2107. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2108. * (WBM) offload HW.
  2109. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2110. * For software based completions, release_source_module will
  2111. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2112. * struct wbm_release_ring and then switch to this after looking at
  2113. * release_source_module.
  2114. */
  2115. PREPACK struct htt_tx_wbm_completion_v2 {
  2116. A_UINT32
  2117. used_by_hw0; /* Refer to struct wbm_release_ring */
  2118. A_UINT32
  2119. used_by_hw1; /* Refer to struct wbm_release_ring */
  2120. A_UINT32
  2121. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2122. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2123. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2124. exception_frame: 1,
  2125. rsvd0: 12, /* For future use */
  2126. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2127. rsvd1: 1; /* For future use */
  2128. A_UINT32
  2129. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2130. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2131. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2132. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2133. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2134. */
  2135. A_UINT32
  2136. data1: 32;
  2137. A_UINT32
  2138. data2: 32;
  2139. A_UINT32
  2140. used_by_hw3; /* Refer to struct wbm_release_ring */
  2141. } POSTPACK;
  2142. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2143. /* DWORD 3 */
  2144. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2145. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2146. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2147. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2148. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2149. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2150. /* DWORD 3 */
  2151. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2152. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2153. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2154. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2155. do { \
  2156. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2157. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2158. } while (0)
  2159. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2160. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2161. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2162. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2163. do { \
  2164. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2165. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2166. } while (0)
  2167. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2168. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2169. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2170. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2171. do { \
  2172. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2173. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2174. } while (0)
  2175. /**
  2176. * @brief HTT TX WBM transmit status from firmware to host
  2177. * @details
  2178. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2179. * (WBM) offload HW.
  2180. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2181. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2182. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2183. */
  2184. PREPACK struct htt_tx_wbm_transmit_status {
  2185. A_UINT32
  2186. sch_cmd_id: 24,
  2187. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2188. * reception of an ACK or BA, this field indicates
  2189. * the RSSI of the received ACK or BA frame.
  2190. * When the frame is removed as result of a direct
  2191. * remove command from the SW, this field is set
  2192. * to 0x0 (which is never a valid value when real
  2193. * RSSI is available).
  2194. * Units: dB w.r.t noise floor
  2195. */
  2196. A_UINT32
  2197. sw_peer_id: 16,
  2198. tid_num: 5,
  2199. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2200. * and tid_num fields contain valid data.
  2201. * If this "valid" flag is not set, the
  2202. * sw_peer_id and tid_num fields must be ignored.
  2203. */
  2204. mcast: 1,
  2205. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2206. * contains valid data.
  2207. */
  2208. reserved0: 8;
  2209. A_UINT32
  2210. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2211. * packets in the wbm completion path
  2212. */
  2213. } POSTPACK;
  2214. /* DWORD 4 */
  2215. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2216. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2217. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2218. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2219. /* DWORD 5 */
  2220. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2221. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2222. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2223. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2224. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2225. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2226. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2227. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2228. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2229. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2230. /* DWORD 4 */
  2231. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2232. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2233. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2234. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2235. do { \
  2236. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2237. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2238. } while (0)
  2239. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2240. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2241. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2242. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2243. do { \
  2244. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2245. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2246. } while (0)
  2247. /* DWORD 5 */
  2248. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2249. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2250. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2251. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2252. do { \
  2253. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2254. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2255. } while (0)
  2256. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2257. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2258. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2259. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2260. do { \
  2261. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2262. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2263. } while (0)
  2264. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2265. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2266. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2267. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2268. do { \
  2269. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2270. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2271. } while (0)
  2272. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2273. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2274. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2275. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2276. do { \
  2277. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2278. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2279. } while (0)
  2280. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2281. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2282. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2283. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2284. do { \
  2285. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2286. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2287. } while (0)
  2288. /**
  2289. * @brief HTT TX WBM reinject status from firmware to host
  2290. * @details
  2291. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2292. * (WBM) offload HW.
  2293. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2294. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2295. */
  2296. PREPACK struct htt_tx_wbm_reinject_status {
  2297. A_UINT32
  2298. reserved0: 32;
  2299. A_UINT32
  2300. reserved1: 32;
  2301. A_UINT32
  2302. reserved2: 32;
  2303. } POSTPACK;
  2304. /**
  2305. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2306. * @details
  2307. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2308. * (WBM) offload HW.
  2309. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2310. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2311. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2312. * STA side.
  2313. */
  2314. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2315. A_UINT32
  2316. mec_sa_addr_31_0;
  2317. A_UINT32
  2318. mec_sa_addr_47_32: 16,
  2319. sa_ast_index: 16;
  2320. A_UINT32
  2321. vdev_id: 8,
  2322. reserved0: 24;
  2323. } POSTPACK;
  2324. /* DWORD 4 - mec_sa_addr_31_0 */
  2325. /* DWORD 5 */
  2326. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2327. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2328. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2329. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2330. /* DWORD 6 */
  2331. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2332. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2333. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2334. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2335. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2336. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2337. do { \
  2338. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2339. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2340. } while (0)
  2341. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2342. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2343. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2344. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2345. do { \
  2346. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2347. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2348. } while (0)
  2349. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2350. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2351. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2352. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2353. do { \
  2354. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2355. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2356. } while (0)
  2357. typedef enum {
  2358. TX_FLOW_PRIORITY_BE,
  2359. TX_FLOW_PRIORITY_HIGH,
  2360. TX_FLOW_PRIORITY_LOW,
  2361. } htt_tx_flow_priority_t;
  2362. typedef enum {
  2363. TX_FLOW_LATENCY_SENSITIVE,
  2364. TX_FLOW_LATENCY_INSENSITIVE,
  2365. } htt_tx_flow_latency_t;
  2366. typedef enum {
  2367. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2368. TX_FLOW_INTERACTIVE_TRAFFIC,
  2369. TX_FLOW_PERIODIC_TRAFFIC,
  2370. TX_FLOW_BURSTY_TRAFFIC,
  2371. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2372. } htt_tx_flow_traffic_pattern_t;
  2373. /**
  2374. * @brief HTT TX Flow search metadata format
  2375. * @details
  2376. * Host will set this metadata in flow table's flow search entry along with
  2377. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2378. * firmware and TQM ring if the flow search entry wins.
  2379. * This metadata is available to firmware in that first MSDU's
  2380. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2381. * to one of the available flows for specific tid and returns the tqm flow
  2382. * pointer as part of htt_tx_map_flow_info message.
  2383. */
  2384. PREPACK struct htt_tx_flow_metadata {
  2385. A_UINT32
  2386. rsvd0_1_0: 2,
  2387. tid: 4,
  2388. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2389. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2390. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2391. * Else choose final tid based on latency, priority.
  2392. */
  2393. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2394. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2395. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2396. } POSTPACK;
  2397. /* DWORD 0 */
  2398. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2399. #define HTT_TX_FLOW_METADATA_TID_S 2
  2400. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2401. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2402. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2403. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2404. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2405. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2406. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2407. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2408. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2409. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2410. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2411. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2412. /* DWORD 0 */
  2413. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2414. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2415. HTT_TX_FLOW_METADATA_TID_S)
  2416. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2417. do { \
  2418. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2419. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2420. } while (0)
  2421. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2422. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2423. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2424. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2425. do { \
  2426. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2427. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2428. } while (0)
  2429. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2430. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2431. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2432. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2433. do { \
  2434. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2435. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2436. } while (0)
  2437. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2438. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2439. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2440. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2441. do { \
  2442. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2443. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2444. } while (0)
  2445. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2446. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2447. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2448. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2449. do { \
  2450. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2451. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2452. } while (0)
  2453. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2454. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2455. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2456. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2457. do { \
  2458. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2459. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2460. } while (0)
  2461. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2462. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2463. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2464. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2465. do { \
  2466. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2467. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2468. } while (0)
  2469. /**
  2470. * @brief host -> target ADD WDS Entry
  2471. *
  2472. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  2473. *
  2474. * @brief host -> target DELETE WDS Entry
  2475. *
  2476. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2477. *
  2478. * @details
  2479. * HTT wds entry from source port learning
  2480. * Host will learn wds entries from rx and send this message to firmware
  2481. * to enable firmware to configure/delete AST entries for wds clients.
  2482. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2483. * and when SA's entry is deleted, firmware removes this AST entry
  2484. *
  2485. * The message would appear as follows:
  2486. *
  2487. * |31 30|29 |17 16|15 8|7 0|
  2488. * |----------------+----------------+----------------+----------------|
  2489. * | rsvd0 |PDVID| vdev_id | msg_type |
  2490. * |-------------------------------------------------------------------|
  2491. * | sa_addr_31_0 |
  2492. * |-------------------------------------------------------------------|
  2493. * | | ta_peer_id | sa_addr_47_32 |
  2494. * |-------------------------------------------------------------------|
  2495. * Where PDVID = pdev_id
  2496. *
  2497. * The message is interpreted as follows:
  2498. *
  2499. * dword0 - b'0:7 - msg_type: This will be set to
  2500. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  2501. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  2502. *
  2503. * dword0 - b'8:15 - vdev_id
  2504. *
  2505. * dword0 - b'16:17 - pdev_id
  2506. *
  2507. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2508. *
  2509. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2510. *
  2511. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2512. *
  2513. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2514. */
  2515. PREPACK struct htt_wds_entry {
  2516. A_UINT32
  2517. msg_type: 8,
  2518. vdev_id: 8,
  2519. pdev_id: 2,
  2520. rsvd0: 14;
  2521. A_UINT32 sa_addr_31_0;
  2522. A_UINT32
  2523. sa_addr_47_32: 16,
  2524. ta_peer_id: 14,
  2525. rsvd2: 2;
  2526. } POSTPACK;
  2527. /* DWORD 0 */
  2528. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2529. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2530. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2531. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2532. /* DWORD 2 */
  2533. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2534. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2535. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2536. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2537. /* DWORD 0 */
  2538. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2539. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2540. HTT_WDS_ENTRY_VDEV_ID_S)
  2541. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2542. do { \
  2543. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2544. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2545. } while (0)
  2546. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2547. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2548. HTT_WDS_ENTRY_PDEV_ID_S)
  2549. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2550. do { \
  2551. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2552. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2553. } while (0)
  2554. /* DWORD 2 */
  2555. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2556. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2557. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2558. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2559. do { \
  2560. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2561. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2562. } while (0)
  2563. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2564. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2565. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2566. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2567. do { \
  2568. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2569. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2570. } while (0)
  2571. /**
  2572. * @brief MAC DMA rx ring setup specification
  2573. *
  2574. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  2575. *
  2576. * @details
  2577. * To allow for dynamic rx ring reconfiguration and to avoid race
  2578. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2579. * it uses. Instead, it sends this message to the target, indicating how
  2580. * the rx ring used by the host should be set up and maintained.
  2581. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2582. * specifications.
  2583. *
  2584. * |31 16|15 8|7 0|
  2585. * |---------------------------------------------------------------|
  2586. * header: | reserved | num rings | msg type |
  2587. * |---------------------------------------------------------------|
  2588. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2589. #if HTT_PADDR64
  2590. * | FW_IDX shadow register physical address (bits 63:32) |
  2591. #endif
  2592. * |---------------------------------------------------------------|
  2593. * | rx ring base physical address (bits 31:0) |
  2594. #if HTT_PADDR64
  2595. * | rx ring base physical address (bits 63:32) |
  2596. #endif
  2597. * |---------------------------------------------------------------|
  2598. * | rx ring buffer size | rx ring length |
  2599. * |---------------------------------------------------------------|
  2600. * | FW_IDX initial value | enabled flags |
  2601. * |---------------------------------------------------------------|
  2602. * | MSDU payload offset | 802.11 header offset |
  2603. * |---------------------------------------------------------------|
  2604. * | PPDU end offset | PPDU start offset |
  2605. * |---------------------------------------------------------------|
  2606. * | MPDU end offset | MPDU start offset |
  2607. * |---------------------------------------------------------------|
  2608. * | MSDU end offset | MSDU start offset |
  2609. * |---------------------------------------------------------------|
  2610. * | frag info offset | rx attention offset |
  2611. * |---------------------------------------------------------------|
  2612. * payload 2, if present, has the same format as payload 1
  2613. * Header fields:
  2614. * - MSG_TYPE
  2615. * Bits 7:0
  2616. * Purpose: identifies this as an rx ring configuration message
  2617. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  2618. * - NUM_RINGS
  2619. * Bits 15:8
  2620. * Purpose: indicates whether the host is setting up one rx ring or two
  2621. * Value: 1 or 2
  2622. * Payload:
  2623. * for systems using 64-bit format for bus addresses:
  2624. * - IDX_SHADOW_REG_PADDR_LO
  2625. * Bits 31:0
  2626. * Value: lower 4 bytes of physical address of the host's
  2627. * FW_IDX shadow register
  2628. * - IDX_SHADOW_REG_PADDR_HI
  2629. * Bits 31:0
  2630. * Value: upper 4 bytes of physical address of the host's
  2631. * FW_IDX shadow register
  2632. * - RING_BASE_PADDR_LO
  2633. * Bits 31:0
  2634. * Value: lower 4 bytes of physical address of the host's rx ring
  2635. * - RING_BASE_PADDR_HI
  2636. * Bits 31:0
  2637. * Value: uppper 4 bytes of physical address of the host's rx ring
  2638. * for systems using 32-bit format for bus addresses:
  2639. * - IDX_SHADOW_REG_PADDR
  2640. * Bits 31:0
  2641. * Value: physical address of the host's FW_IDX shadow register
  2642. * - RING_BASE_PADDR
  2643. * Bits 31:0
  2644. * Value: physical address of the host's rx ring
  2645. * - RING_LEN
  2646. * Bits 15:0
  2647. * Value: number of elements in the rx ring
  2648. * - RING_BUF_SZ
  2649. * Bits 31:16
  2650. * Value: size of the buffers referenced by the rx ring, in byte units
  2651. * - ENABLED_FLAGS
  2652. * Bits 15:0
  2653. * Value: 1-bit flags to show whether different rx fields are enabled
  2654. * bit 0: 802.11 header enabled (1) or disabled (0)
  2655. * bit 1: MSDU payload enabled (1) or disabled (0)
  2656. * bit 2: PPDU start enabled (1) or disabled (0)
  2657. * bit 3: PPDU end enabled (1) or disabled (0)
  2658. * bit 4: MPDU start enabled (1) or disabled (0)
  2659. * bit 5: MPDU end enabled (1) or disabled (0)
  2660. * bit 6: MSDU start enabled (1) or disabled (0)
  2661. * bit 7: MSDU end enabled (1) or disabled (0)
  2662. * bit 8: rx attention enabled (1) or disabled (0)
  2663. * bit 9: frag info enabled (1) or disabled (0)
  2664. * bit 10: unicast rx enabled (1) or disabled (0)
  2665. * bit 11: multicast rx enabled (1) or disabled (0)
  2666. * bit 12: ctrl rx enabled (1) or disabled (0)
  2667. * bit 13: mgmt rx enabled (1) or disabled (0)
  2668. * bit 14: null rx enabled (1) or disabled (0)
  2669. * bit 15: phy data rx enabled (1) or disabled (0)
  2670. * - IDX_INIT_VAL
  2671. * Bits 31:16
  2672. * Purpose: Specify the initial value for the FW_IDX.
  2673. * Value: the number of buffers initially present in the host's rx ring
  2674. * - OFFSET_802_11_HDR
  2675. * Bits 15:0
  2676. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2677. * - OFFSET_MSDU_PAYLOAD
  2678. * Bits 31:16
  2679. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2680. * - OFFSET_PPDU_START
  2681. * Bits 15:0
  2682. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2683. * - OFFSET_PPDU_END
  2684. * Bits 31:16
  2685. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2686. * - OFFSET_MPDU_START
  2687. * Bits 15:0
  2688. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2689. * - OFFSET_MPDU_END
  2690. * Bits 31:16
  2691. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2692. * - OFFSET_MSDU_START
  2693. * Bits 15:0
  2694. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2695. * - OFFSET_MSDU_END
  2696. * Bits 31:16
  2697. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2698. * - OFFSET_RX_ATTN
  2699. * Bits 15:0
  2700. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2701. * - OFFSET_FRAG_INFO
  2702. * Bits 31:16
  2703. * Value: offset in QUAD-bytes of frag info table
  2704. */
  2705. /* header fields */
  2706. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2707. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2708. /* payload fields */
  2709. /* for systems using a 64-bit format for bus addresses */
  2710. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2711. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2712. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2713. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2714. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2715. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2716. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2717. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2718. /* for systems using a 32-bit format for bus addresses */
  2719. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2720. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2721. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2722. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2723. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2724. #define HTT_RX_RING_CFG_LEN_S 0
  2725. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2726. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2727. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2728. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2729. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2730. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2731. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2732. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2733. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2734. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2735. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2736. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2737. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2738. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2739. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2740. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2741. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2742. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2743. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2744. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2745. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2746. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2747. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2748. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2749. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2750. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2751. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2752. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2753. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2754. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2755. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2756. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2757. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2758. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2759. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2760. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2761. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2762. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2763. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2764. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2765. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2766. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2767. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2768. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2769. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2770. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2771. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2772. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2773. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2774. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2775. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2776. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2777. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2778. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2779. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2780. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2781. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2782. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2783. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2784. #if HTT_PADDR64
  2785. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2786. #else
  2787. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2788. #endif
  2789. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2790. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2791. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2792. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2793. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2794. do { \
  2795. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2796. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2797. } while (0)
  2798. /* degenerate case for 32-bit fields */
  2799. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2800. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2801. ((_var) = (_val))
  2802. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2803. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2804. ((_var) = (_val))
  2805. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2806. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2807. ((_var) = (_val))
  2808. /* degenerate case for 32-bit fields */
  2809. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2810. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2811. ((_var) = (_val))
  2812. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2813. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2814. ((_var) = (_val))
  2815. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2816. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2817. ((_var) = (_val))
  2818. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2819. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2820. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2821. do { \
  2822. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2823. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2824. } while (0)
  2825. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2826. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2827. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2828. do { \
  2829. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2830. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2831. } while (0)
  2832. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2833. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2834. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2835. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2836. do { \
  2837. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2838. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2839. } while (0)
  2840. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2841. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2842. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2843. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2844. do { \
  2845. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2846. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2847. } while (0)
  2848. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2849. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2850. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2851. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2852. do { \
  2853. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2854. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2855. } while (0)
  2856. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2857. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2858. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2859. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2860. do { \
  2861. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2862. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2863. } while (0)
  2864. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2865. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2866. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2867. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2868. do { \
  2869. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2870. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2871. } while (0)
  2872. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2873. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2874. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2875. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2876. do { \
  2877. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2878. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2879. } while (0)
  2880. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2881. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2882. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2883. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2884. do { \
  2885. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2886. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2887. } while (0)
  2888. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2889. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2890. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2891. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2892. do { \
  2893. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2894. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2895. } while (0)
  2896. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2897. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2898. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2899. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2900. do { \
  2901. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2902. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2903. } while (0)
  2904. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2905. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2906. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2907. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2908. do { \
  2909. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2910. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2911. } while (0)
  2912. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2913. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2914. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2915. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2916. do { \
  2917. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2918. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2919. } while (0)
  2920. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2921. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2922. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2923. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2924. do { \
  2925. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2926. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2927. } while (0)
  2928. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2929. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2930. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2931. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2932. do { \
  2933. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2934. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2935. } while (0)
  2936. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2937. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2938. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2939. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2940. do { \
  2941. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2942. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2943. } while (0)
  2944. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2945. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2946. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2947. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2948. do { \
  2949. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2950. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2951. } while (0)
  2952. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2953. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2954. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2955. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2956. do { \
  2957. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2958. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2959. } while (0)
  2960. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2961. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2962. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2963. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2964. do { \
  2965. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2966. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2967. } while (0)
  2968. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2969. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2970. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2971. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2972. do { \
  2973. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2974. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2975. } while (0)
  2976. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2977. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2978. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2979. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2980. do { \
  2981. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2982. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2983. } while (0)
  2984. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2985. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2986. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2987. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2988. do { \
  2989. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2990. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2991. } while (0)
  2992. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2993. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2994. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2995. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2996. do { \
  2997. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2998. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2999. } while (0)
  3000. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3001. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3002. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3003. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3004. do { \
  3005. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3006. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3007. } while (0)
  3008. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3009. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3010. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3011. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3012. do { \
  3013. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3014. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3015. } while (0)
  3016. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3017. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3018. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3019. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3020. do { \
  3021. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3022. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3023. } while (0)
  3024. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3025. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3026. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3027. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3028. do { \
  3029. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3030. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3031. } while (0)
  3032. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3033. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3034. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3035. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3036. do { \
  3037. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3038. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3039. } while (0)
  3040. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3041. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3042. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3043. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3044. do { \
  3045. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3046. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3047. } while (0)
  3048. /**
  3049. * @brief host -> target FW statistics retrieve
  3050. *
  3051. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3052. *
  3053. * @details
  3054. * The following field definitions describe the format of the HTT host
  3055. * to target FW stats retrieve message. The message specifies the type of
  3056. * stats host wants to retrieve.
  3057. *
  3058. * |31 24|23 16|15 8|7 0|
  3059. * |-----------------------------------------------------------|
  3060. * | stats types request bitmask | msg type |
  3061. * |-----------------------------------------------------------|
  3062. * | stats types reset bitmask | reserved |
  3063. * |-----------------------------------------------------------|
  3064. * | stats type | config value |
  3065. * |-----------------------------------------------------------|
  3066. * | cookie LSBs |
  3067. * |-----------------------------------------------------------|
  3068. * | cookie MSBs |
  3069. * |-----------------------------------------------------------|
  3070. * Header fields:
  3071. * - MSG_TYPE
  3072. * Bits 7:0
  3073. * Purpose: identifies this is a stats upload request message
  3074. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3075. * - UPLOAD_TYPES
  3076. * Bits 31:8
  3077. * Purpose: identifies which types of FW statistics to upload
  3078. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3079. * - RESET_TYPES
  3080. * Bits 31:8
  3081. * Purpose: identifies which types of FW statistics to reset
  3082. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3083. * - CFG_VAL
  3084. * Bits 23:0
  3085. * Purpose: give an opaque configuration value to the specified stats type
  3086. * Value: stats-type specific configuration value
  3087. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3088. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3089. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3090. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3091. * - CFG_STAT_TYPE
  3092. * Bits 31:24
  3093. * Purpose: specify which stats type (if any) the config value applies to
  3094. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3095. * a valid configuration specification
  3096. * - COOKIE_LSBS
  3097. * Bits 31:0
  3098. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3099. * message with its preceding host->target stats request message.
  3100. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3101. * - COOKIE_MSBS
  3102. * Bits 31:0
  3103. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3104. * message with its preceding host->target stats request message.
  3105. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3106. */
  3107. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3108. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3109. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3110. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3111. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3112. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3113. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3114. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3115. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3116. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3117. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3118. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3119. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3120. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3121. do { \
  3122. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3123. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3124. } while (0)
  3125. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3126. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3127. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3128. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3129. do { \
  3130. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3131. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3132. } while (0)
  3133. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3134. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3135. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3136. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3137. do { \
  3138. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3139. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3140. } while (0)
  3141. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3142. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3143. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3144. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3145. do { \
  3146. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3147. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3148. } while (0)
  3149. /**
  3150. * @brief host -> target HTT out-of-band sync request
  3151. *
  3152. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3153. *
  3154. * @details
  3155. * The HTT SYNC tells the target to suspend processing of subsequent
  3156. * HTT host-to-target messages until some other target agent locally
  3157. * informs the target HTT FW that the current sync counter is equal to
  3158. * or greater than (in a modulo sense) the sync counter specified in
  3159. * the SYNC message.
  3160. * This allows other host-target components to synchronize their operation
  3161. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3162. * security key has been downloaded to and activated by the target.
  3163. * In the absence of any explicit synchronization counter value
  3164. * specification, the target HTT FW will use zero as the default current
  3165. * sync value.
  3166. *
  3167. * |31 24|23 16|15 8|7 0|
  3168. * |-----------------------------------------------------------|
  3169. * | reserved | sync count | msg type |
  3170. * |-----------------------------------------------------------|
  3171. * Header fields:
  3172. * - MSG_TYPE
  3173. * Bits 7:0
  3174. * Purpose: identifies this as a sync message
  3175. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3176. * - SYNC_COUNT
  3177. * Bits 15:8
  3178. * Purpose: specifies what sync value the HTT FW will wait for from
  3179. * an out-of-band specification to resume its operation
  3180. * Value: in-band sync counter value to compare against the out-of-band
  3181. * counter spec.
  3182. * The HTT target FW will suspend its host->target message processing
  3183. * as long as
  3184. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3185. */
  3186. #define HTT_H2T_SYNC_MSG_SZ 4
  3187. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3188. #define HTT_H2T_SYNC_COUNT_S 8
  3189. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3190. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3191. HTT_H2T_SYNC_COUNT_S)
  3192. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3193. do { \
  3194. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3195. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3196. } while (0)
  3197. /**
  3198. * @brief host -> target HTT aggregation configuration
  3199. *
  3200. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3201. */
  3202. #define HTT_AGGR_CFG_MSG_SZ 4
  3203. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3204. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3205. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3206. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3207. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3208. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3209. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3210. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3211. do { \
  3212. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3213. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3214. } while (0)
  3215. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3216. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3217. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3218. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3219. do { \
  3220. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3221. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3222. } while (0)
  3223. /**
  3224. * @brief host -> target HTT configure max amsdu info per vdev
  3225. *
  3226. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3227. *
  3228. * @details
  3229. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3230. *
  3231. * |31 21|20 16|15 8|7 0|
  3232. * |-----------------------------------------------------------|
  3233. * | reserved | vdev id | max amsdu | msg type |
  3234. * |-----------------------------------------------------------|
  3235. * Header fields:
  3236. * - MSG_TYPE
  3237. * Bits 7:0
  3238. * Purpose: identifies this as a aggr cfg ex message
  3239. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3240. * - MAX_NUM_AMSDU_SUBFRM
  3241. * Bits 15:8
  3242. * Purpose: max MSDUs per A-MSDU
  3243. * - VDEV_ID
  3244. * Bits 20:16
  3245. * Purpose: ID of the vdev to which this limit is applied
  3246. */
  3247. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3248. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3249. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3250. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3251. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3252. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3253. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3254. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3255. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3256. do { \
  3257. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3258. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3259. } while (0)
  3260. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3261. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3262. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3263. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3264. do { \
  3265. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3266. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3267. } while (0)
  3268. /**
  3269. * @brief HTT WDI_IPA Config Message
  3270. *
  3271. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3272. *
  3273. * @details
  3274. * The HTT WDI_IPA config message is created/sent by host at driver
  3275. * init time. It contains information about data structures used on
  3276. * WDI_IPA TX and RX path.
  3277. * TX CE ring is used for pushing packet metadata from IPA uC
  3278. * to WLAN FW
  3279. * TX Completion ring is used for generating TX completions from
  3280. * WLAN FW to IPA uC
  3281. * RX Indication ring is used for indicating RX packets from FW
  3282. * to IPA uC
  3283. * RX Ring2 is used as either completion ring or as second
  3284. * indication ring. when Ring2 is used as completion ring, IPA uC
  3285. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3286. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3287. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3288. * indicated in RX Indication ring. Please see WDI_IPA specification
  3289. * for more details.
  3290. * |31 24|23 16|15 8|7 0|
  3291. * |----------------+----------------+----------------+----------------|
  3292. * | tx pkt pool size | Rsvd | msg_type |
  3293. * |-------------------------------------------------------------------|
  3294. * | tx comp ring base (bits 31:0) |
  3295. #if HTT_PADDR64
  3296. * | tx comp ring base (bits 63:32) |
  3297. #endif
  3298. * |-------------------------------------------------------------------|
  3299. * | tx comp ring size |
  3300. * |-------------------------------------------------------------------|
  3301. * | tx comp WR_IDX physical address (bits 31:0) |
  3302. #if HTT_PADDR64
  3303. * | tx comp WR_IDX physical address (bits 63:32) |
  3304. #endif
  3305. * |-------------------------------------------------------------------|
  3306. * | tx CE WR_IDX physical address (bits 31:0) |
  3307. #if HTT_PADDR64
  3308. * | tx CE WR_IDX physical address (bits 63:32) |
  3309. #endif
  3310. * |-------------------------------------------------------------------|
  3311. * | rx indication ring base (bits 31:0) |
  3312. #if HTT_PADDR64
  3313. * | rx indication ring base (bits 63:32) |
  3314. #endif
  3315. * |-------------------------------------------------------------------|
  3316. * | rx indication ring size |
  3317. * |-------------------------------------------------------------------|
  3318. * | rx ind RD_IDX physical address (bits 31:0) |
  3319. #if HTT_PADDR64
  3320. * | rx ind RD_IDX physical address (bits 63:32) |
  3321. #endif
  3322. * |-------------------------------------------------------------------|
  3323. * | rx ind WR_IDX physical address (bits 31:0) |
  3324. #if HTT_PADDR64
  3325. * | rx ind WR_IDX physical address (bits 63:32) |
  3326. #endif
  3327. * |-------------------------------------------------------------------|
  3328. * |-------------------------------------------------------------------|
  3329. * | rx ring2 base (bits 31:0) |
  3330. #if HTT_PADDR64
  3331. * | rx ring2 base (bits 63:32) |
  3332. #endif
  3333. * |-------------------------------------------------------------------|
  3334. * | rx ring2 size |
  3335. * |-------------------------------------------------------------------|
  3336. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3337. #if HTT_PADDR64
  3338. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3339. #endif
  3340. * |-------------------------------------------------------------------|
  3341. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3342. #if HTT_PADDR64
  3343. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3344. #endif
  3345. * |-------------------------------------------------------------------|
  3346. *
  3347. * Header fields:
  3348. * Header fields:
  3349. * - MSG_TYPE
  3350. * Bits 7:0
  3351. * Purpose: Identifies this as WDI_IPA config message
  3352. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3353. * - TX_PKT_POOL_SIZE
  3354. * Bits 15:0
  3355. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3356. * WDI_IPA TX path
  3357. * For systems using 32-bit format for bus addresses:
  3358. * - TX_COMP_RING_BASE_ADDR
  3359. * Bits 31:0
  3360. * Purpose: TX Completion Ring base address in DDR
  3361. * - TX_COMP_RING_SIZE
  3362. * Bits 31:0
  3363. * Purpose: TX Completion Ring size (must be power of 2)
  3364. * - TX_COMP_WR_IDX_ADDR
  3365. * Bits 31:0
  3366. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3367. * updates the Write Index for WDI_IPA TX completion ring
  3368. * - TX_CE_WR_IDX_ADDR
  3369. * Bits 31:0
  3370. * Purpose: DDR address where IPA uC
  3371. * updates the WR Index for TX CE ring
  3372. * (needed for fusion platforms)
  3373. * - RX_IND_RING_BASE_ADDR
  3374. * Bits 31:0
  3375. * Purpose: RX Indication Ring base address in DDR
  3376. * - RX_IND_RING_SIZE
  3377. * Bits 31:0
  3378. * Purpose: RX Indication Ring size
  3379. * - RX_IND_RD_IDX_ADDR
  3380. * Bits 31:0
  3381. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3382. * RX indication ring
  3383. * - RX_IND_WR_IDX_ADDR
  3384. * Bits 31:0
  3385. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3386. * updates the Write Index for WDI_IPA RX indication ring
  3387. * - RX_RING2_BASE_ADDR
  3388. * Bits 31:0
  3389. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3390. * - RX_RING2_SIZE
  3391. * Bits 31:0
  3392. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3393. * - RX_RING2_RD_IDX_ADDR
  3394. * Bits 31:0
  3395. * Purpose: If Second RX ring is Indication ring, DDR address where
  3396. * IPA uC updates the Read Index for Ring2.
  3397. * If Second RX ring is completion ring, this is NOT used
  3398. * - RX_RING2_WR_IDX_ADDR
  3399. * Bits 31:0
  3400. * Purpose: If Second RX ring is Indication ring, DDR address where
  3401. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3402. * If second RX ring is completion ring, DDR address where
  3403. * IPA uC updates the Write Index for Ring 2.
  3404. * For systems using 64-bit format for bus addresses:
  3405. * - TX_COMP_RING_BASE_ADDR_LO
  3406. * Bits 31:0
  3407. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3408. * - TX_COMP_RING_BASE_ADDR_HI
  3409. * Bits 31:0
  3410. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3411. * - TX_COMP_RING_SIZE
  3412. * Bits 31:0
  3413. * Purpose: TX Completion Ring size (must be power of 2)
  3414. * - TX_COMP_WR_IDX_ADDR_LO
  3415. * Bits 31:0
  3416. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3417. * Lower 4 bytes of DDR address where WIFI FW
  3418. * updates the Write Index for WDI_IPA TX completion ring
  3419. * - TX_COMP_WR_IDX_ADDR_HI
  3420. * Bits 31:0
  3421. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3422. * Higher 4 bytes of DDR address where WIFI FW
  3423. * updates the Write Index for WDI_IPA TX completion ring
  3424. * - TX_CE_WR_IDX_ADDR_LO
  3425. * Bits 31:0
  3426. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3427. * updates the WR Index for TX CE ring
  3428. * (needed for fusion platforms)
  3429. * - TX_CE_WR_IDX_ADDR_HI
  3430. * Bits 31:0
  3431. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3432. * updates the WR Index for TX CE ring
  3433. * (needed for fusion platforms)
  3434. * - RX_IND_RING_BASE_ADDR_LO
  3435. * Bits 31:0
  3436. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3437. * - RX_IND_RING_BASE_ADDR_HI
  3438. * Bits 31:0
  3439. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3440. * - RX_IND_RING_SIZE
  3441. * Bits 31:0
  3442. * Purpose: RX Indication Ring size
  3443. * - RX_IND_RD_IDX_ADDR_LO
  3444. * Bits 31:0
  3445. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3446. * for WDI_IPA RX indication ring
  3447. * - RX_IND_RD_IDX_ADDR_HI
  3448. * Bits 31:0
  3449. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3450. * for WDI_IPA RX indication ring
  3451. * - RX_IND_WR_IDX_ADDR_LO
  3452. * Bits 31:0
  3453. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3454. * Lower 4 bytes of DDR address where WIFI FW
  3455. * updates the Write Index for WDI_IPA RX indication ring
  3456. * - RX_IND_WR_IDX_ADDR_HI
  3457. * Bits 31:0
  3458. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3459. * Higher 4 bytes of DDR address where WIFI FW
  3460. * updates the Write Index for WDI_IPA RX indication ring
  3461. * - RX_RING2_BASE_ADDR_LO
  3462. * Bits 31:0
  3463. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3464. * - RX_RING2_BASE_ADDR_HI
  3465. * Bits 31:0
  3466. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3467. * - RX_RING2_SIZE
  3468. * Bits 31:0
  3469. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3470. * - RX_RING2_RD_IDX_ADDR_LO
  3471. * Bits 31:0
  3472. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3473. * DDR address where IPA uC updates the Read Index for Ring2.
  3474. * If Second RX ring is completion ring, this is NOT used
  3475. * - RX_RING2_RD_IDX_ADDR_HI
  3476. * Bits 31:0
  3477. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3478. * DDR address where IPA uC updates the Read Index for Ring2.
  3479. * If Second RX ring is completion ring, this is NOT used
  3480. * - RX_RING2_WR_IDX_ADDR_LO
  3481. * Bits 31:0
  3482. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3483. * DDR address where WIFI FW updates the Write Index
  3484. * for WDI_IPA RX ring2
  3485. * If second RX ring is completion ring, lower 4 bytes of
  3486. * DDR address where IPA uC updates the Write Index for Ring 2.
  3487. * - RX_RING2_WR_IDX_ADDR_HI
  3488. * Bits 31:0
  3489. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3490. * DDR address where WIFI FW updates the Write Index
  3491. * for WDI_IPA RX ring2
  3492. * If second RX ring is completion ring, higher 4 bytes of
  3493. * DDR address where IPA uC updates the Write Index for Ring 2.
  3494. */
  3495. #if HTT_PADDR64
  3496. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3497. #else
  3498. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3499. #endif
  3500. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3501. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3502. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3503. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3504. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3505. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3506. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3507. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3508. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3509. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3510. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3511. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3512. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3513. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3514. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3515. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3516. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3517. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3518. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3519. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3520. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3521. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3522. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3523. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3524. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3525. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3526. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3527. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3528. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3529. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3530. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3531. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3532. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3533. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3534. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3535. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3536. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3537. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3538. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3539. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3540. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3541. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3542. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3543. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3544. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3545. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3546. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3547. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3548. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3549. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3550. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3551. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3552. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3553. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3554. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3555. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3556. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3557. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3558. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3559. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3560. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3561. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3562. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3563. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3564. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3565. do { \
  3566. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3567. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3568. } while (0)
  3569. /* for systems using 32-bit format for bus addr */
  3570. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3571. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3572. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3573. do { \
  3574. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3575. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3576. } while (0)
  3577. /* for systems using 64-bit format for bus addr */
  3578. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3579. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3580. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3581. do { \
  3582. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3583. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3584. } while (0)
  3585. /* for systems using 64-bit format for bus addr */
  3586. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3587. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3588. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3589. do { \
  3590. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3591. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3592. } while (0)
  3593. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3594. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3595. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3596. do { \
  3597. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3598. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3599. } while (0)
  3600. /* for systems using 32-bit format for bus addr */
  3601. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3602. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3603. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3604. do { \
  3605. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3606. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3607. } while (0)
  3608. /* for systems using 64-bit format for bus addr */
  3609. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3610. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3611. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3612. do { \
  3613. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3614. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3615. } while (0)
  3616. /* for systems using 64-bit format for bus addr */
  3617. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3618. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3619. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3620. do { \
  3621. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3622. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3623. } while (0)
  3624. /* for systems using 32-bit format for bus addr */
  3625. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3626. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3627. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3628. do { \
  3629. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3630. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3631. } while (0)
  3632. /* for systems using 64-bit format for bus addr */
  3633. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3634. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3635. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3636. do { \
  3637. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3638. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3639. } while (0)
  3640. /* for systems using 64-bit format for bus addr */
  3641. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3642. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3643. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3644. do { \
  3645. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3646. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3647. } while (0)
  3648. /* for systems using 32-bit format for bus addr */
  3649. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3650. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3651. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3652. do { \
  3653. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3654. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3655. } while (0)
  3656. /* for systems using 64-bit format for bus addr */
  3657. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3658. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3659. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3660. do { \
  3661. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3662. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3663. } while (0)
  3664. /* for systems using 64-bit format for bus addr */
  3665. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3666. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3667. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3668. do { \
  3669. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3670. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3671. } while (0)
  3672. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3673. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3674. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3675. do { \
  3676. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3677. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3678. } while (0)
  3679. /* for systems using 32-bit format for bus addr */
  3680. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3681. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3682. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3683. do { \
  3684. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3685. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3686. } while (0)
  3687. /* for systems using 64-bit format for bus addr */
  3688. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3689. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3690. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3691. do { \
  3692. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3693. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3694. } while (0)
  3695. /* for systems using 64-bit format for bus addr */
  3696. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3697. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3698. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3699. do { \
  3700. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3701. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3702. } while (0)
  3703. /* for systems using 32-bit format for bus addr */
  3704. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3705. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3706. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3707. do { \
  3708. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3709. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3710. } while (0)
  3711. /* for systems using 64-bit format for bus addr */
  3712. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3713. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3714. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3715. do { \
  3716. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3717. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3718. } while (0)
  3719. /* for systems using 64-bit format for bus addr */
  3720. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3721. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3722. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3723. do { \
  3724. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3725. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3726. } while (0)
  3727. /* for systems using 32-bit format for bus addr */
  3728. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3729. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3730. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3731. do { \
  3732. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3733. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3734. } while (0)
  3735. /* for systems using 64-bit format for bus addr */
  3736. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3737. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3738. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3739. do { \
  3740. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3741. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3742. } while (0)
  3743. /* for systems using 64-bit format for bus addr */
  3744. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3745. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3746. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3747. do { \
  3748. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3749. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3750. } while (0)
  3751. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3752. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3753. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3754. do { \
  3755. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3756. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3757. } while (0)
  3758. /* for systems using 32-bit format for bus addr */
  3759. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3760. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3761. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3762. do { \
  3763. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3764. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3765. } while (0)
  3766. /* for systems using 64-bit format for bus addr */
  3767. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3768. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3769. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3770. do { \
  3771. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3772. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3773. } while (0)
  3774. /* for systems using 64-bit format for bus addr */
  3775. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3776. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3777. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3778. do { \
  3779. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3780. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3781. } while (0)
  3782. /* for systems using 32-bit format for bus addr */
  3783. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3784. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3785. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3786. do { \
  3787. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3788. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3789. } while (0)
  3790. /* for systems using 64-bit format for bus addr */
  3791. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3792. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3793. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3794. do { \
  3795. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3796. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3797. } while (0)
  3798. /* for systems using 64-bit format for bus addr */
  3799. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3800. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3801. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3802. do { \
  3803. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3804. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3805. } while (0)
  3806. /*
  3807. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3808. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3809. * addresses are stored in a XXX-bit field.
  3810. * This macro is used to define both htt_wdi_ipa_config32_t and
  3811. * htt_wdi_ipa_config64_t structs.
  3812. */
  3813. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3814. _paddr__tx_comp_ring_base_addr_, \
  3815. _paddr__tx_comp_wr_idx_addr_, \
  3816. _paddr__tx_ce_wr_idx_addr_, \
  3817. _paddr__rx_ind_ring_base_addr_, \
  3818. _paddr__rx_ind_rd_idx_addr_, \
  3819. _paddr__rx_ind_wr_idx_addr_, \
  3820. _paddr__rx_ring2_base_addr_,\
  3821. _paddr__rx_ring2_rd_idx_addr_,\
  3822. _paddr__rx_ring2_wr_idx_addr_) \
  3823. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3824. { \
  3825. /* DWORD 0: flags and meta-data */ \
  3826. A_UINT32 \
  3827. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3828. reserved: 8, \
  3829. tx_pkt_pool_size: 16;\
  3830. /* DWORD 1 */\
  3831. _paddr__tx_comp_ring_base_addr_;\
  3832. /* DWORD 2 (or 3)*/\
  3833. A_UINT32 tx_comp_ring_size;\
  3834. /* DWORD 3 (or 4)*/\
  3835. _paddr__tx_comp_wr_idx_addr_;\
  3836. /* DWORD 4 (or 6)*/\
  3837. _paddr__tx_ce_wr_idx_addr_;\
  3838. /* DWORD 5 (or 8)*/\
  3839. _paddr__rx_ind_ring_base_addr_;\
  3840. /* DWORD 6 (or 10)*/\
  3841. A_UINT32 rx_ind_ring_size;\
  3842. /* DWORD 7 (or 11)*/\
  3843. _paddr__rx_ind_rd_idx_addr_;\
  3844. /* DWORD 8 (or 13)*/\
  3845. _paddr__rx_ind_wr_idx_addr_;\
  3846. /* DWORD 9 (or 15)*/\
  3847. _paddr__rx_ring2_base_addr_;\
  3848. /* DWORD 10 (or 17) */\
  3849. A_UINT32 rx_ring2_size;\
  3850. /* DWORD 11 (or 18) */\
  3851. _paddr__rx_ring2_rd_idx_addr_;\
  3852. /* DWORD 12 (or 20) */\
  3853. _paddr__rx_ring2_wr_idx_addr_;\
  3854. } POSTPACK
  3855. /* define a htt_wdi_ipa_config32_t type */
  3856. TEMPLATE_HTT_WDI_IPA_CONFIG_T(32, HTT_VAR_PADDR32(tx_comp_ring_base_addr), HTT_VAR_PADDR32(tx_comp_wr_idx_addr), HTT_VAR_PADDR32(tx_ce_wr_idx_addr), HTT_VAR_PADDR32(rx_ind_ring_base_addr), HTT_VAR_PADDR32(rx_ind_rd_idx_addr),HTT_VAR_PADDR32(rx_ind_wr_idx_addr), HTT_VAR_PADDR32(rx_ring2_base_addr), HTT_VAR_PADDR32(rx_ring2_rd_idx_addr), HTT_VAR_PADDR32(rx_ring2_wr_idx_addr));
  3857. /* define a htt_wdi_ipa_config64_t type */
  3858. TEMPLATE_HTT_WDI_IPA_CONFIG_T(64, HTT_VAR_PADDR64_LE(tx_comp_ring_base_addr), HTT_VAR_PADDR64_LE(tx_comp_wr_idx_addr), HTT_VAR_PADDR64_LE(tx_ce_wr_idx_addr), HTT_VAR_PADDR64_LE(rx_ind_ring_base_addr), HTT_VAR_PADDR64_LE(rx_ind_rd_idx_addr), HTT_VAR_PADDR64_LE(rx_ind_wr_idx_addr), HTT_VAR_PADDR64_LE(rx_ring2_base_addr), HTT_VAR_PADDR64_LE(rx_ring2_rd_idx_addr), HTT_VAR_PADDR64_LE(rx_ring2_wr_idx_addr));
  3859. #if HTT_PADDR64
  3860. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3861. #else
  3862. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3863. #endif
  3864. enum htt_wdi_ipa_op_code {
  3865. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3866. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3867. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3868. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3869. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3870. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3871. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3872. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3873. /* keep this last */
  3874. HTT_WDI_IPA_OPCODE_MAX
  3875. };
  3876. /**
  3877. * @brief HTT WDI_IPA Operation Request Message
  3878. *
  3879. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  3880. *
  3881. * @details
  3882. * HTT WDI_IPA Operation Request message is sent by host
  3883. * to either suspend or resume WDI_IPA TX or RX path.
  3884. * |31 24|23 16|15 8|7 0|
  3885. * |----------------+----------------+----------------+----------------|
  3886. * | op_code | Rsvd | msg_type |
  3887. * |-------------------------------------------------------------------|
  3888. *
  3889. * Header fields:
  3890. * - MSG_TYPE
  3891. * Bits 7:0
  3892. * Purpose: Identifies this as WDI_IPA Operation Request message
  3893. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  3894. * - OP_CODE
  3895. * Bits 31:16
  3896. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3897. * value: = enum htt_wdi_ipa_op_code
  3898. */
  3899. PREPACK struct htt_wdi_ipa_op_request_t
  3900. {
  3901. /* DWORD 0: flags and meta-data */
  3902. A_UINT32
  3903. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3904. reserved: 8,
  3905. op_code: 16;
  3906. } POSTPACK;
  3907. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3908. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3909. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3910. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3911. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3912. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3913. do { \
  3914. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3915. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3916. } while (0)
  3917. /*
  3918. * @brief host -> target HTT_SRING_SETUP message
  3919. *
  3920. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  3921. *
  3922. * @details
  3923. * After target is booted up, Host can send SRING setup message for
  3924. * each host facing LMAC SRING. Target setups up HW registers based
  3925. * on setup message and confirms back to Host if response_required is set.
  3926. * Host should wait for confirmation message before sending new SRING
  3927. * setup message
  3928. *
  3929. * The message would appear as follows:
  3930. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  3931. * |--------------- +-----------------+-----------------+-----------------|
  3932. * | ring_type | ring_id | pdev_id | msg_type |
  3933. * |----------------------------------------------------------------------|
  3934. * | ring_base_addr_lo |
  3935. * |----------------------------------------------------------------------|
  3936. * | ring_base_addr_hi |
  3937. * |----------------------------------------------------------------------|
  3938. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3939. * |----------------------------------------------------------------------|
  3940. * | ring_head_offset32_remote_addr_lo |
  3941. * |----------------------------------------------------------------------|
  3942. * | ring_head_offset32_remote_addr_hi |
  3943. * |----------------------------------------------------------------------|
  3944. * | ring_tail_offset32_remote_addr_lo |
  3945. * |----------------------------------------------------------------------|
  3946. * | ring_tail_offset32_remote_addr_hi |
  3947. * |----------------------------------------------------------------------|
  3948. * | ring_msi_addr_lo |
  3949. * |----------------------------------------------------------------------|
  3950. * | ring_msi_addr_hi |
  3951. * |----------------------------------------------------------------------|
  3952. * | ring_msi_data |
  3953. * |----------------------------------------------------------------------|
  3954. * | intr_timer_th |IM| intr_batch_counter_th |
  3955. * |----------------------------------------------------------------------|
  3956. * | reserved |ID|RR| PTCF| intr_low_threshold |
  3957. * |----------------------------------------------------------------------|
  3958. * | reserved |IPA drop thres hi|IPA drop thres lo|
  3959. * |----------------------------------------------------------------------|
  3960. * Where
  3961. * IM = sw_intr_mode
  3962. * RR = response_required
  3963. * PTCF = prefetch_timer_cfg
  3964. * IP = IPA drop flag
  3965. *
  3966. * The message is interpreted as follows:
  3967. * dword0 - b'0:7 - msg_type: This will be set to
  3968. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  3969. * b'8:15 - pdev_id:
  3970. * 0 (for rings at SOC/UMAC level),
  3971. * 1/2/3 mac id (for rings at LMAC level)
  3972. * b'16:23 - ring_id: identify which ring is to setup,
  3973. * more details can be got from enum htt_srng_ring_id
  3974. * b'24:31 - ring_type: identify type of host rings,
  3975. * more details can be got from enum htt_srng_ring_type
  3976. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3977. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3978. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3979. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3980. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3981. * SW_TO_HW_RING.
  3982. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3983. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3984. * Lower 32 bits of memory address of the remote variable
  3985. * storing the 4-byte word offset that identifies the head
  3986. * element within the ring.
  3987. * (The head offset variable has type A_UINT32.)
  3988. * Valid for HW_TO_SW and SW_TO_SW rings.
  3989. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3990. * Upper 32 bits of memory address of the remote variable
  3991. * storing the 4-byte word offset that identifies the head
  3992. * element within the ring.
  3993. * (The head offset variable has type A_UINT32.)
  3994. * Valid for HW_TO_SW and SW_TO_SW rings.
  3995. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3996. * Lower 32 bits of memory address of the remote variable
  3997. * storing the 4-byte word offset that identifies the tail
  3998. * element within the ring.
  3999. * (The tail offset variable has type A_UINT32.)
  4000. * Valid for HW_TO_SW and SW_TO_SW rings.
  4001. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4002. * Upper 32 bits of memory address of the remote variable
  4003. * storing the 4-byte word offset that identifies the tail
  4004. * element within the ring.
  4005. * (The tail offset variable has type A_UINT32.)
  4006. * Valid for HW_TO_SW and SW_TO_SW rings.
  4007. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4008. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4009. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4010. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4011. * dword10 - b'0:31 - ring_msi_data: MSI data
  4012. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4013. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4014. * dword11 - b'0:14 - intr_batch_counter_th:
  4015. * batch counter threshold is in units of 4-byte words.
  4016. * HW internally maintains and increments batch count.
  4017. * (see SRING spec for detail description).
  4018. * When batch count reaches threshold value, an interrupt
  4019. * is generated by HW.
  4020. * b'15 - sw_intr_mode:
  4021. * This configuration shall be static.
  4022. * Only programmed at power up.
  4023. * 0: generate pulse style sw interrupts
  4024. * 1: generate level style sw interrupts
  4025. * b'16:31 - intr_timer_th:
  4026. * The timer init value when timer is idle or is
  4027. * initialized to start downcounting.
  4028. * In 8us units (to cover a range of 0 to 524 ms)
  4029. * dword12 - b'0:15 - intr_low_threshold:
  4030. * Used only by Consumer ring to generate ring_sw_int_p.
  4031. * Ring entries low threshold water mark, that is used
  4032. * in combination with the interrupt timer as well as
  4033. * the the clearing of the level interrupt.
  4034. * b'16:18 - prefetch_timer_cfg:
  4035. * Used only by Consumer ring to set timer mode to
  4036. * support Application prefetch handling.
  4037. * The external tail offset/pointer will be updated
  4038. * at following intervals:
  4039. * 3'b000: (Prefetch feature disabled; used only for debug)
  4040. * 3'b001: 1 usec
  4041. * 3'b010: 4 usec
  4042. * 3'b011: 8 usec (default)
  4043. * 3'b100: 16 usec
  4044. * Others: Reserverd
  4045. * b'19 - response_required:
  4046. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4047. * b'20 - ipa_drop_flag:
  4048. Indicates that host will config ipa drop threshold percentage
  4049. * b'21:31 - reserved: reserved for future use
  4050. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4051. * b'8:15 - ipa drop high threshold percentage:
  4052. * b'16:31 - Reserved
  4053. */
  4054. PREPACK struct htt_sring_setup_t {
  4055. A_UINT32 msg_type: 8,
  4056. pdev_id: 8,
  4057. ring_id: 8,
  4058. ring_type: 8;
  4059. A_UINT32 ring_base_addr_lo;
  4060. A_UINT32 ring_base_addr_hi;
  4061. A_UINT32 ring_size: 16,
  4062. ring_entry_size: 8,
  4063. ring_misc_cfg_flag: 8;
  4064. A_UINT32 ring_head_offset32_remote_addr_lo;
  4065. A_UINT32 ring_head_offset32_remote_addr_hi;
  4066. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4067. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4068. A_UINT32 ring_msi_addr_lo;
  4069. A_UINT32 ring_msi_addr_hi;
  4070. A_UINT32 ring_msi_data;
  4071. A_UINT32 intr_batch_counter_th: 15,
  4072. sw_intr_mode: 1,
  4073. intr_timer_th: 16;
  4074. A_UINT32 intr_low_threshold: 16,
  4075. prefetch_timer_cfg: 3,
  4076. response_required: 1,
  4077. ipa_drop_flag: 1,
  4078. reserved1: 11;
  4079. A_UINT32 ipa_drop_low_threshold: 8,
  4080. ipa_drop_high_threshold: 8,
  4081. reserved: 16;
  4082. } POSTPACK;
  4083. enum htt_srng_ring_type {
  4084. HTT_HW_TO_SW_RING = 0,
  4085. HTT_SW_TO_HW_RING,
  4086. HTT_SW_TO_SW_RING,
  4087. /* Insert new ring types above this line */
  4088. };
  4089. enum htt_srng_ring_id {
  4090. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4091. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4092. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4093. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4094. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4095. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4096. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4097. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4098. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4099. /* Add Other SRING which can't be directly configured by host software above this line */
  4100. };
  4101. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4102. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4103. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4104. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4105. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4106. HTT_SRING_SETUP_PDEV_ID_S)
  4107. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4108. do { \
  4109. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4110. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4111. } while (0)
  4112. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4113. #define HTT_SRING_SETUP_RING_ID_S 16
  4114. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4115. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4116. HTT_SRING_SETUP_RING_ID_S)
  4117. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4118. do { \
  4119. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4120. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4121. } while (0)
  4122. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4123. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4124. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4125. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4126. HTT_SRING_SETUP_RING_TYPE_S)
  4127. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4128. do { \
  4129. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4130. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4131. } while (0)
  4132. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4133. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4134. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4135. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4136. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4137. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4138. do { \
  4139. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4140. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4141. } while (0)
  4142. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4143. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4144. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4145. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4146. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4147. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4148. do { \
  4149. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4150. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4151. } while (0)
  4152. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4153. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4154. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4155. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4156. HTT_SRING_SETUP_RING_SIZE_S)
  4157. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4158. do { \
  4159. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4160. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4161. } while (0)
  4162. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4163. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4164. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4165. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4166. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4167. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4168. do { \
  4169. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4170. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4171. } while (0)
  4172. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4173. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4174. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4175. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4176. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4177. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4178. do { \
  4179. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4180. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4181. } while (0)
  4182. /* This control bit is applicable to only Producer, which updates Ring ID field
  4183. * of each descriptor before pushing into the ring.
  4184. * 0: updates ring_id(default)
  4185. * 1: ring_id updating disabled */
  4186. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4187. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4188. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4189. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4190. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4191. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4192. do { \
  4193. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4194. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4195. } while (0)
  4196. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4197. * of each descriptor before pushing into the ring.
  4198. * 0: updates Loopcnt(default)
  4199. * 1: Loopcnt updating disabled */
  4200. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4201. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4202. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4203. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4204. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4205. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4206. do { \
  4207. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4208. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4209. } while (0)
  4210. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4211. * into security_id port of GXI/AXI. */
  4212. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4213. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4214. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4215. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4216. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4217. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4218. do { \
  4219. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4220. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4221. } while (0)
  4222. /* During MSI write operation, SRNG drives value of this register bit into
  4223. * swap bit of GXI/AXI. */
  4224. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4225. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4226. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4227. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4228. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4229. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4230. do { \
  4231. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4232. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4233. } while (0)
  4234. /* During Pointer write operation, SRNG drives value of this register bit into
  4235. * swap bit of GXI/AXI. */
  4236. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4237. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4238. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4239. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4240. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4241. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4242. do { \
  4243. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4244. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4245. } while (0)
  4246. /* During any data or TLV write operation, SRNG drives value of this register
  4247. * bit into swap bit of GXI/AXI. */
  4248. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4249. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4250. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4251. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4252. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4253. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4254. do { \
  4255. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4256. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4257. } while (0)
  4258. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4259. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4260. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4261. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4262. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4263. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4264. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4265. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4266. do { \
  4267. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4268. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4269. } while (0)
  4270. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4271. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4272. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4273. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4274. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4275. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4276. do { \
  4277. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4278. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4279. } while (0)
  4280. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4281. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4282. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4283. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4284. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4285. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4286. do { \
  4287. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4288. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4289. } while (0)
  4290. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4291. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4292. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4293. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4294. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4295. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4296. do { \
  4297. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4298. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4299. } while (0)
  4300. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4301. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4302. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4303. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4304. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4305. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4306. do { \
  4307. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4308. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4309. } while (0)
  4310. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4311. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4312. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4313. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4314. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4315. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4316. do { \
  4317. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4318. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4319. } while (0)
  4320. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4321. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4322. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4323. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4324. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4325. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4326. do { \
  4327. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4328. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4329. } while (0)
  4330. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4331. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4332. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4333. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4334. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4335. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4336. do { \
  4337. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4338. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4339. } while (0)
  4340. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4341. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4342. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4343. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4344. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4345. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4346. do { \
  4347. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4348. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4349. } while (0)
  4350. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4351. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4352. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4353. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4354. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4355. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4356. do { \
  4357. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4358. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4359. } while (0)
  4360. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4361. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4362. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4363. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4364. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4365. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4366. do { \
  4367. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4368. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4369. } while (0)
  4370. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4371. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4372. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4373. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4374. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4375. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4376. do { \
  4377. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4378. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4379. } while (0)
  4380. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4381. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4382. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4383. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4384. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4385. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4386. do { \
  4387. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4388. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4389. } while (0)
  4390. /**
  4391. * @brief host -> target RX ring selection config message
  4392. *
  4393. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4394. *
  4395. * @details
  4396. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4397. * configure RXDMA rings.
  4398. * The configuration is per ring based and includes both packet subtypes
  4399. * and PPDU/MPDU TLVs.
  4400. *
  4401. * The message would appear as follows:
  4402. *
  4403. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  4404. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  4405. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  4406. * |-------------------------------------------------------------------|
  4407. * | rsvd2 | ring_buffer_size |
  4408. * |-------------------------------------------------------------------|
  4409. * | packet_type_enable_flags_0 |
  4410. * |-------------------------------------------------------------------|
  4411. * | packet_type_enable_flags_1 |
  4412. * |-------------------------------------------------------------------|
  4413. * | packet_type_enable_flags_2 |
  4414. * |-------------------------------------------------------------------|
  4415. * | packet_type_enable_flags_3 |
  4416. * |-------------------------------------------------------------------|
  4417. * | tlv_filter_in_flags |
  4418. * |-------------------------------------------------------------------|
  4419. * | rx_header_offset | rx_packet_offset |
  4420. * |-------------------------------------------------------------------|
  4421. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4422. * |-------------------------------------------------------------------|
  4423. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4424. * |-------------------------------------------------------------------|
  4425. * | rsvd3 | rx_attention_offset |
  4426. * |-------------------------------------------------------------------|
  4427. * | rsvd4 | mo| fp| rx_drop_threshold |
  4428. * | |ndp|ndp| |
  4429. * |-------------------------------------------------------------------|
  4430. * Where:
  4431. * PS = pkt_swap
  4432. * SS = status_swap
  4433. * OV = rx_offsets_valid
  4434. * DT = drop_thresh_valid
  4435. * The message is interpreted as follows:
  4436. * dword0 - b'0:7 - msg_type: This will be set to
  4437. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  4438. * b'8:15 - pdev_id:
  4439. * 0 (for rings at SOC/UMAC level),
  4440. * 1/2/3 mac id (for rings at LMAC level)
  4441. * b'16:23 - ring_id : Identify the ring to configure.
  4442. * More details can be got from enum htt_srng_ring_id
  4443. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4444. * BUF_RING_CFG_0 defs within HW .h files,
  4445. * e.g. wmac_top_reg_seq_hwioreg.h
  4446. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4447. * BUF_RING_CFG_0 defs within HW .h files,
  4448. * e.g. wmac_top_reg_seq_hwioreg.h
  4449. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4450. * configuration fields are valid
  4451. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  4452. * rx_drop_threshold field is valid
  4453. * b'28:31 - rsvd1: reserved for future use
  4454. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4455. * in byte units.
  4456. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4457. * - b'16:31 - rsvd2: Reserved for future use
  4458. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4459. * Enable MGMT packet from 0b0000 to 0b1001
  4460. * bits from low to high: FP, MD, MO - 3 bits
  4461. * FP: Filter_Pass
  4462. * MD: Monitor_Direct
  4463. * MO: Monitor_Other
  4464. * 10 mgmt subtypes * 3 bits -> 30 bits
  4465. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4466. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4467. * Enable MGMT packet from 0b1010 to 0b1111
  4468. * bits from low to high: FP, MD, MO - 3 bits
  4469. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4470. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4471. * Enable CTRL packet from 0b0000 to 0b1001
  4472. * bits from low to high: FP, MD, MO - 3 bits
  4473. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4474. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4475. * Enable CTRL packet from 0b1010 to 0b1111,
  4476. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4477. * bits from low to high: FP, MD, MO - 3 bits
  4478. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4479. * dword6 - b'0:31 - tlv_filter_in_flags:
  4480. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4481. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4482. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  4483. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4484. * A value of 0 will be considered as ignore this config.
  4485. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4486. * e.g. wmac_top_reg_seq_hwioreg.h
  4487. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  4488. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4489. * A value of 0 will be considered as ignore this config.
  4490. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4491. * e.g. wmac_top_reg_seq_hwioreg.h
  4492. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  4493. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4494. * A value of 0 will be considered as ignore this config.
  4495. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4496. * e.g. wmac_top_reg_seq_hwioreg.h
  4497. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  4498. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4499. * A value of 0 will be considered as ignore this config.
  4500. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4501. * e.g. wmac_top_reg_seq_hwioreg.h
  4502. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  4503. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4504. * A value of 0 will be considered as ignore this config.
  4505. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4506. * e.g. wmac_top_reg_seq_hwioreg.h
  4507. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  4508. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4509. * A value of 0 will be considered as ignore this config.
  4510. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4511. * e.g. wmac_top_reg_seq_hwioreg.h
  4512. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4513. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4514. * A value of 0 will be considered as ignore this config.
  4515. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4516. * e.g. wmac_top_reg_seq_hwioreg.h
  4517. * - b'16:31 - rsvd3 for future use
  4518. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  4519. * to source rings. Consumer drops packets if the available
  4520. * words in the ring falls below the configured threshold
  4521. * value.
  4522. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  4523. * by host. 1 -> subscribed
  4524. * - b`11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  4525. * by host. 1 -> subscribed
  4526. */
  4527. PREPACK struct htt_rx_ring_selection_cfg_t {
  4528. A_UINT32 msg_type: 8,
  4529. pdev_id: 8,
  4530. ring_id: 8,
  4531. status_swap: 1,
  4532. pkt_swap: 1,
  4533. rx_offsets_valid: 1,
  4534. drop_thresh_valid: 1,
  4535. rsvd1: 4;
  4536. A_UINT32 ring_buffer_size: 16,
  4537. rsvd2: 16;
  4538. A_UINT32 packet_type_enable_flags_0;
  4539. A_UINT32 packet_type_enable_flags_1;
  4540. A_UINT32 packet_type_enable_flags_2;
  4541. A_UINT32 packet_type_enable_flags_3;
  4542. A_UINT32 tlv_filter_in_flags;
  4543. A_UINT32 rx_packet_offset: 16,
  4544. rx_header_offset: 16;
  4545. A_UINT32 rx_mpdu_end_offset: 16,
  4546. rx_mpdu_start_offset: 16;
  4547. A_UINT32 rx_msdu_end_offset: 16,
  4548. rx_msdu_start_offset: 16;
  4549. A_UINT32 rx_attn_offset: 16,
  4550. rsvd3: 16;
  4551. A_UINT32 rx_drop_threshold: 10,
  4552. fp_ndp: 1,
  4553. mo_ndp: 1,
  4554. rsvd4: 20;
  4555. } POSTPACK;
  4556. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4557. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4558. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4559. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4560. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4561. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4562. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4563. do { \
  4564. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4565. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4566. } while (0)
  4567. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4568. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4569. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4570. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4571. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4572. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4573. do { \
  4574. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4575. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4576. } while (0)
  4577. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4578. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4579. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4580. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4581. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4582. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4583. do { \
  4584. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4585. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4586. } while (0)
  4587. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4588. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4589. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4590. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4591. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4592. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4593. do { \
  4594. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4595. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4596. } while (0)
  4597. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  4598. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  4599. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  4600. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  4601. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  4602. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  4603. do { \
  4604. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  4605. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  4606. } while (0)
  4607. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  4608. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  4609. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  4610. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  4611. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  4612. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  4613. do { \
  4614. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  4615. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  4616. } while (0)
  4617. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4618. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4619. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4620. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4621. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4622. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4623. do { \
  4624. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4625. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4626. } while (0)
  4627. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4628. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4629. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4630. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4631. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4632. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4633. do { \
  4634. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4635. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4636. } while (0)
  4637. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4638. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4639. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4640. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4641. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4642. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4643. do { \
  4644. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4645. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4646. } while (0)
  4647. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4648. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4649. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4650. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4651. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4652. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4653. do { \
  4654. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4655. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4656. } while (0)
  4657. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4658. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4659. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4660. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4661. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4662. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4663. do { \
  4664. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4665. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4666. } while (0)
  4667. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4668. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4669. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4670. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4671. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4672. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4673. do { \
  4674. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4675. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4676. } while (0)
  4677. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  4678. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  4679. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  4680. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  4681. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  4682. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  4683. do { \
  4684. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  4685. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  4686. } while (0)
  4687. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  4688. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  4689. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  4690. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  4691. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  4692. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  4693. do { \
  4694. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  4695. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  4696. } while (0)
  4697. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  4698. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  4699. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  4700. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  4701. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  4702. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  4703. do { \
  4704. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  4705. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  4706. } while (0)
  4707. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  4708. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  4709. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  4710. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  4711. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  4712. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  4713. do { \
  4714. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  4715. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  4716. } while (0)
  4717. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  4718. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  4719. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  4720. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  4721. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  4722. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  4723. do { \
  4724. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  4725. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  4726. } while (0)
  4727. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  4728. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  4729. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  4730. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  4731. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  4732. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  4733. do { \
  4734. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  4735. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  4736. } while (0)
  4737. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  4738. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  4739. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  4740. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  4741. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  4742. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  4743. do { \
  4744. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  4745. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  4746. } while (0)
  4747. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  4748. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  4749. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  4750. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  4751. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  4752. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  4753. do { \
  4754. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  4755. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  4756. } while (0)
  4757. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  4758. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  4759. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  4760. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  4761. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  4762. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  4763. do { \
  4764. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  4765. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  4766. } while (0)
  4767. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  4768. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  4769. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  4770. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  4771. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  4772. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  4773. do { \
  4774. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  4775. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  4776. } while (0)
  4777. /*
  4778. * Subtype based MGMT frames enable bits.
  4779. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4780. */
  4781. /* association request */
  4782. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4784. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4785. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4787. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4788. /* association response */
  4789. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4791. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4792. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4795. /* Reassociation request */
  4796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4798. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4802. /* Reassociation response */
  4803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4805. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4809. /* Probe request */
  4810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4812. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4813. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4816. /* Probe response */
  4817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4819. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4823. /* Timing Advertisement */
  4824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4826. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4830. /* Reserved */
  4831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4837. /* Beacon */
  4838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  4839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4840. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  4841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  4843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4844. /* ATIM */
  4845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  4846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  4848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  4850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4851. /* Disassociation */
  4852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4858. /* Authentication */
  4859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4865. /* Deauthentication */
  4866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4872. /* Action */
  4873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4879. /* Action No Ack */
  4880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4886. /* Reserved */
  4887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4893. /*
  4894. * Subtype based CTRL frames enable bits.
  4895. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4896. */
  4897. /* Reserved */
  4898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4904. /* Reserved */
  4905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4911. /* Reserved */
  4912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4918. /* Reserved */
  4919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4925. /* Reserved */
  4926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4928. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4932. /* Reserved */
  4933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4935. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4939. /* Reserved */
  4940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4942. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4943. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4946. /* Control Wrapper */
  4947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4949. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4953. /* Block Ack Request */
  4954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  4955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4956. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  4957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  4959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4960. /* Block Ack*/
  4961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  4962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4963. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  4964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  4966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4967. /* PS-POLL */
  4968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4970. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4974. /* RTS */
  4975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4977. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4981. /* CTS */
  4982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4985. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4988. /* ACK */
  4989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4991. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4992. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4995. /* CF-END */
  4996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4998. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4999. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5000. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5001. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5002. /* CF-END + CF-ACK */
  5003. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5004. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5005. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5006. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5007. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5008. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5009. /* Multicast data */
  5010. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5011. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5012. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5013. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5014. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5015. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5016. /* Unicast data */
  5017. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5018. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5019. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5020. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5021. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5022. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5023. /* NULL data */
  5024. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5025. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5026. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5027. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5028. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5029. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5030. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5031. do { \
  5032. HTT_CHECK_SET_VAL(httsym, value); \
  5033. (word) |= (value) << httsym##_S; \
  5034. } while (0)
  5035. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5036. (((word) & httsym##_M) >> httsym##_S)
  5037. #define htt_rx_ring_pkt_enable_subtype_set( \
  5038. word, flag, mode, type, subtype, val) \
  5039. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5040. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5041. #define htt_rx_ring_pkt_enable_subtype_get( \
  5042. word, flag, mode, type, subtype) \
  5043. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5044. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5045. /* Definition to filter in TLVs */
  5046. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5047. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5048. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5049. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5050. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5051. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5052. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5053. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5054. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5055. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5056. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5057. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5058. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5059. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5060. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5061. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5062. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5063. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5064. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5065. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5066. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5067. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5068. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5069. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5070. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5071. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5072. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5073. do { \
  5074. HTT_CHECK_SET_VAL(httsym, enable); \
  5075. (word) |= (enable) << httsym##_S; \
  5076. } while (0)
  5077. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5078. (((word) & httsym##_M) >> httsym##_S)
  5079. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5080. HTT_RX_RING_TLV_ENABLE_SET( \
  5081. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5082. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5083. HTT_RX_RING_TLV_ENABLE_GET( \
  5084. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5085. /**
  5086. * @brief host --> target Receive Flow Steering configuration message definition
  5087. *
  5088. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  5089. *
  5090. * host --> target Receive Flow Steering configuration message definition.
  5091. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5092. * The reason for this is we want RFS to be configured and ready before MAC
  5093. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5094. *
  5095. * |31 24|23 16|15 9|8|7 0|
  5096. * |----------------+----------------+----------------+----------------|
  5097. * | reserved |E| msg type |
  5098. * |-------------------------------------------------------------------|
  5099. * Where E = RFS enable flag
  5100. *
  5101. * The RFS_CONFIG message consists of a single 4-byte word.
  5102. *
  5103. * Header fields:
  5104. * - MSG_TYPE
  5105. * Bits 7:0
  5106. * Purpose: identifies this as a RFS config msg
  5107. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  5108. * - RFS_CONFIG
  5109. * Bit 8
  5110. * Purpose: Tells target whether to enable (1) or disable (0)
  5111. * flow steering feature when sending rx indication messages to host
  5112. */
  5113. #define HTT_H2T_RFS_CONFIG_M 0x100
  5114. #define HTT_H2T_RFS_CONFIG_S 8
  5115. #define HTT_RX_RFS_CONFIG_GET(_var) \
  5116. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  5117. HTT_H2T_RFS_CONFIG_S)
  5118. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  5119. do { \
  5120. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  5121. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  5122. } while (0)
  5123. #define HTT_RFS_CFG_REQ_BYTES 4
  5124. /**
  5125. * @brief host -> target FW extended statistics retrieve
  5126. *
  5127. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  5128. *
  5129. * @details
  5130. * The following field definitions describe the format of the HTT host
  5131. * to target FW extended stats retrieve message.
  5132. * The message specifies the type of stats the host wants to retrieve.
  5133. *
  5134. * |31 24|23 16|15 8|7 0|
  5135. * |-----------------------------------------------------------|
  5136. * | reserved | stats type | pdev_mask | msg type |
  5137. * |-----------------------------------------------------------|
  5138. * | config param [0] |
  5139. * |-----------------------------------------------------------|
  5140. * | config param [1] |
  5141. * |-----------------------------------------------------------|
  5142. * | config param [2] |
  5143. * |-----------------------------------------------------------|
  5144. * | config param [3] |
  5145. * |-----------------------------------------------------------|
  5146. * | reserved |
  5147. * |-----------------------------------------------------------|
  5148. * | cookie LSBs |
  5149. * |-----------------------------------------------------------|
  5150. * | cookie MSBs |
  5151. * |-----------------------------------------------------------|
  5152. * Header fields:
  5153. * - MSG_TYPE
  5154. * Bits 7:0
  5155. * Purpose: identifies this is a extended stats upload request message
  5156. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  5157. * - PDEV_MASK
  5158. * Bits 8:15
  5159. * Purpose: identifies the mask of PDEVs to retrieve stats from
  5160. * Value: This is a overloaded field, refer to usage and interpretation of
  5161. * PDEV in interface document.
  5162. * Bit 8 : Reserved for SOC stats
  5163. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5164. * Indicates MACID_MASK in DBS
  5165. * - STATS_TYPE
  5166. * Bits 23:16
  5167. * Purpose: identifies which FW statistics to upload
  5168. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  5169. * - Reserved
  5170. * Bits 31:24
  5171. * - CONFIG_PARAM [0]
  5172. * Bits 31:0
  5173. * Purpose: give an opaque configuration value to the specified stats type
  5174. * Value: stats-type specific configuration value
  5175. * Refer to htt_stats.h for interpretation for each stats sub_type
  5176. * - CONFIG_PARAM [1]
  5177. * Bits 31:0
  5178. * Purpose: give an opaque configuration value to the specified stats type
  5179. * Value: stats-type specific configuration value
  5180. * Refer to htt_stats.h for interpretation for each stats sub_type
  5181. * - CONFIG_PARAM [2]
  5182. * Bits 31:0
  5183. * Purpose: give an opaque configuration value to the specified stats type
  5184. * Value: stats-type specific configuration value
  5185. * Refer to htt_stats.h for interpretation for each stats sub_type
  5186. * - CONFIG_PARAM [3]
  5187. * Bits 31:0
  5188. * Purpose: give an opaque configuration value to the specified stats type
  5189. * Value: stats-type specific configuration value
  5190. * Refer to htt_stats.h for interpretation for each stats sub_type
  5191. * - Reserved [31:0] for future use.
  5192. * - COOKIE_LSBS
  5193. * Bits 31:0
  5194. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5195. * message with its preceding host->target stats request message.
  5196. * Value: LSBs of the opaque cookie specified by the host-side requestor
  5197. * - COOKIE_MSBS
  5198. * Bits 31:0
  5199. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5200. * message with its preceding host->target stats request message.
  5201. * Value: MSBs of the opaque cookie specified by the host-side requestor
  5202. */
  5203. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  5204. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  5205. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  5206. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  5207. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  5208. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  5209. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  5210. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  5211. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  5212. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  5213. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  5214. do { \
  5215. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  5216. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  5217. } while (0)
  5218. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  5219. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  5220. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  5221. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  5222. do { \
  5223. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  5224. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  5225. } while (0)
  5226. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  5227. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  5228. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  5229. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  5230. do { \
  5231. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  5232. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  5233. } while (0)
  5234. /**
  5235. * @brief host -> target FW PPDU_STATS request message
  5236. *
  5237. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  5238. *
  5239. * @details
  5240. * The following field definitions describe the format of the HTT host
  5241. * to target FW for PPDU_STATS_CFG msg.
  5242. * The message allows the host to configure the PPDU_STATS_IND messages
  5243. * produced by the target.
  5244. *
  5245. * |31 24|23 16|15 8|7 0|
  5246. * |-----------------------------------------------------------|
  5247. * | REQ bit mask | pdev_mask | msg type |
  5248. * |-----------------------------------------------------------|
  5249. * Header fields:
  5250. * - MSG_TYPE
  5251. * Bits 7:0
  5252. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  5253. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  5254. * - PDEV_MASK
  5255. * Bits 8:15
  5256. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  5257. * Value: This is a overloaded field, refer to usage and interpretation of
  5258. * PDEV in interface document.
  5259. * Bit 8 : Reserved for SOC stats
  5260. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5261. * Indicates MACID_MASK in DBS
  5262. * - REQ_TLV_BIT_MASK
  5263. * Bits 16:31
  5264. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  5265. * needs to be included in the target's PPDU_STATS_IND messages.
  5266. * Value: refer htt_ppdu_stats_tlv_tag_t
  5267. *
  5268. */
  5269. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  5270. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  5271. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  5272. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  5273. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  5274. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  5275. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  5276. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  5277. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  5278. do { \
  5279. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  5280. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  5281. } while (0)
  5282. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  5283. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  5284. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  5285. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  5286. do { \
  5287. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  5288. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  5289. } while (0)
  5290. /**
  5291. * @brief Host-->target HTT RX FSE setup message
  5292. *
  5293. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  5294. *
  5295. * @details
  5296. * Through this message, the host will provide details of the flow tables
  5297. * in host DDR along with hash keys.
  5298. * This message can be sent per SOC or per PDEV, which is differentiated
  5299. * by pdev id values.
  5300. * The host will allocate flow search table and sends table size,
  5301. * physical DMA address of flow table, and hash keys to firmware to
  5302. * program into the RXOLE FSE HW block.
  5303. *
  5304. * The following field definitions describe the format of the RX FSE setup
  5305. * message sent from the host to target
  5306. *
  5307. * Header fields:
  5308. * dword0 - b'7:0 - msg_type: This will be set to
  5309. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  5310. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5311. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  5312. * pdev's LMAC ring.
  5313. * b'31:16 - reserved : Reserved for future use
  5314. * dword1 - b'19:0 - number of records: This field indicates the number of
  5315. * entries in the flow table. For example: 8k number of
  5316. * records is equivalent to
  5317. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  5318. * b'27:20 - max search: This field specifies the skid length to FSE
  5319. * parser HW module whenever match is not found at the
  5320. * exact index pointed by hash.
  5321. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  5322. * Refer htt_ip_da_sa_prefix below for more details.
  5323. * b'31:30 - reserved: Reserved for future use
  5324. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  5325. * table allocated by host in DDR
  5326. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  5327. * table allocated by host in DDR
  5328. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  5329. * entry hashing
  5330. *
  5331. *
  5332. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  5333. * |---------------------------------------------------------------|
  5334. * | reserved | pdev_id | MSG_TYPE |
  5335. * |---------------------------------------------------------------|
  5336. * |resvd|IPDSA| max_search | Number of records |
  5337. * |---------------------------------------------------------------|
  5338. * | base address lo |
  5339. * |---------------------------------------------------------------|
  5340. * | base address high |
  5341. * |---------------------------------------------------------------|
  5342. * | toeplitz key 31_0 |
  5343. * |---------------------------------------------------------------|
  5344. * | toeplitz key 63_32 |
  5345. * |---------------------------------------------------------------|
  5346. * | toeplitz key 95_64 |
  5347. * |---------------------------------------------------------------|
  5348. * | toeplitz key 127_96 |
  5349. * |---------------------------------------------------------------|
  5350. * | toeplitz key 159_128 |
  5351. * |---------------------------------------------------------------|
  5352. * | toeplitz key 191_160 |
  5353. * |---------------------------------------------------------------|
  5354. * | toeplitz key 223_192 |
  5355. * |---------------------------------------------------------------|
  5356. * | toeplitz key 255_224 |
  5357. * |---------------------------------------------------------------|
  5358. * | toeplitz key 287_256 |
  5359. * |---------------------------------------------------------------|
  5360. * | reserved | toeplitz key 314_288(26:0 bits) |
  5361. * |---------------------------------------------------------------|
  5362. * where:
  5363. * IPDSA = ip_da_sa
  5364. */
  5365. /**
  5366. * @brief: htt_ip_da_sa_prefix
  5367. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  5368. * IPv6 addresses beginning with 0x20010db8 are reserved for
  5369. * documentation per RFC3849
  5370. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  5371. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  5372. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  5373. */
  5374. enum htt_ip_da_sa_prefix {
  5375. HTT_RX_IPV6_20010db8,
  5376. HTT_RX_IPV4_MAPPED_IPV6,
  5377. HTT_RX_IPV4_COMPATIBLE_IPV6,
  5378. HTT_RX_IPV6_64FF9B,
  5379. };
  5380. /**
  5381. * @brief Host-->target HTT RX FISA configure and enable
  5382. *
  5383. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  5384. *
  5385. * @details
  5386. * The host will send this command down to configure and enable the FISA
  5387. * operational params.
  5388. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  5389. * register.
  5390. * Should configure both the MACs.
  5391. *
  5392. * dword0 - b'7:0 - msg_type:
  5393. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  5394. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5395. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  5396. * pdev's LMAC ring.
  5397. * b'31:16 - reserved : Reserved for future use
  5398. *
  5399. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  5400. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  5401. * packets. 1 flow search will be skipped
  5402. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  5403. * tcp,udp packets
  5404. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  5405. * calculation
  5406. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  5407. * calculation
  5408. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  5409. * calculation
  5410. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  5411. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  5412. * length
  5413. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  5414. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  5415. * length
  5416. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  5417. * num jump
  5418. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  5419. * num jump
  5420. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  5421. * data type switch has happend for MPDU Sequence num jump
  5422. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  5423. * for MPDU Sequence num jump
  5424. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  5425. * for decrypt errors
  5426. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  5427. * while aggregating a msdu
  5428. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  5429. * The aggregation is done until (number of MSDUs aggregated
  5430. * < LIMIT + 1)
  5431. * b'31:18 - Reserved
  5432. *
  5433. * fisa_control_value - 32bit value FW can write to register
  5434. *
  5435. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  5436. * Threshold value for FISA timeout (units are microseconds).
  5437. * When the global timestamp exceeds this threshold, FISA
  5438. * aggregation will be restarted.
  5439. * A value of 0 means timeout is disabled.
  5440. * Compare the threshold register with timestamp field in
  5441. * flow entry to generate timeout for the flow.
  5442. *
  5443. * |31 18 |17 16|15 8|7 0|
  5444. * |-------------------------------------------------------------|
  5445. * | reserved | pdev_mask | msg type |
  5446. * |-------------------------------------------------------------|
  5447. * | reserved | FISA_CTRL |
  5448. * |-------------------------------------------------------------|
  5449. * | FISA_TIMEOUT_THRESH |
  5450. * |-------------------------------------------------------------|
  5451. */
  5452. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  5453. A_UINT32 msg_type:8,
  5454. pdev_id:8,
  5455. reserved0:16;
  5456. /**
  5457. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  5458. * [17:0]
  5459. */
  5460. union {
  5461. /*
  5462. * fisa_control_bits structure is deprecated.
  5463. * Please use fisa_control_bits_v2 going forward.
  5464. */
  5465. struct {
  5466. A_UINT32 fisa_enable: 1,
  5467. ipsec_skip_search: 1,
  5468. nontcp_skip_search: 1,
  5469. add_ipv4_fixed_hdr_len: 1,
  5470. add_ipv6_fixed_hdr_len: 1,
  5471. add_tcp_fixed_hdr_len: 1,
  5472. add_udp_hdr_len: 1,
  5473. chksum_cum_ip_len_en: 1,
  5474. disable_tid_check: 1,
  5475. disable_ta_check: 1,
  5476. disable_qos_check: 1,
  5477. disable_raw_check: 1,
  5478. disable_decrypt_err_check: 1,
  5479. disable_msdu_drop_check: 1,
  5480. fisa_aggr_limit: 4,
  5481. reserved: 14;
  5482. } fisa_control_bits;
  5483. struct {
  5484. A_UINT32 fisa_enable: 1,
  5485. fisa_aggr_limit: 4,
  5486. reserved: 27;
  5487. } fisa_control_bits_v2;
  5488. A_UINT32 fisa_control_value;
  5489. } u_fisa_control;
  5490. /**
  5491. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  5492. * timeout threshold for aggregation. Unit in usec.
  5493. * [31:0]
  5494. */
  5495. A_UINT32 fisa_timeout_threshold;
  5496. } POSTPACK;
  5497. /* DWord 0: pdev-ID */
  5498. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  5499. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  5500. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  5501. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  5502. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  5503. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  5504. do { \
  5505. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  5506. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  5507. } while (0)
  5508. /* Dword 1: fisa_control_value fisa config */
  5509. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  5510. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  5511. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  5512. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  5513. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  5514. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  5515. do { \
  5516. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  5517. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  5518. } while (0)
  5519. /* Dword 1: fisa_control_value ipsec_skip_search */
  5520. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  5521. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  5522. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  5523. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  5524. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  5525. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  5526. do { \
  5527. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  5528. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  5529. } while (0)
  5530. /* Dword 1: fisa_control_value non_tcp_skip_search */
  5531. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  5532. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  5533. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  5534. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  5535. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  5536. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  5537. do { \
  5538. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  5539. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  5540. } while (0)
  5541. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  5542. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  5543. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  5544. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  5545. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  5546. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  5547. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  5548. do { \
  5549. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  5550. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  5551. } while (0)
  5552. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  5553. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  5554. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  5555. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  5556. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  5557. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  5558. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  5559. do { \
  5560. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  5561. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  5562. } while (0)
  5563. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  5564. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  5565. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  5566. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  5567. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  5568. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  5569. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  5570. do { \
  5571. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  5572. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  5573. } while (0)
  5574. /* Dword 1: fisa_control_value add_udp_hdr_len */
  5575. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  5576. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  5577. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  5578. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  5579. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  5580. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  5581. do { \
  5582. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  5583. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  5584. } while (0)
  5585. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  5586. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  5587. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  5588. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  5589. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  5590. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  5591. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  5592. do { \
  5593. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  5594. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  5595. } while (0)
  5596. /* Dword 1: fisa_control_value disable_tid_check */
  5597. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  5598. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  5599. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  5600. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  5601. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  5602. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  5603. do { \
  5604. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  5605. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  5606. } while (0)
  5607. /* Dword 1: fisa_control_value disable_ta_check */
  5608. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  5609. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  5610. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  5611. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  5612. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  5613. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  5614. do { \
  5615. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  5616. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  5617. } while (0)
  5618. /* Dword 1: fisa_control_value disable_qos_check */
  5619. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  5620. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  5621. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  5622. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  5623. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  5624. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  5625. do { \
  5626. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  5627. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  5628. } while (0)
  5629. /* Dword 1: fisa_control_value disable_raw_check */
  5630. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  5631. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  5632. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  5633. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  5634. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  5635. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  5636. do { \
  5637. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  5638. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  5639. } while (0)
  5640. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  5641. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  5642. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  5643. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  5644. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  5645. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  5646. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  5647. do { \
  5648. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  5649. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  5650. } while (0)
  5651. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  5652. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  5653. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  5654. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  5655. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  5656. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  5657. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  5658. do { \
  5659. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  5660. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  5661. } while (0)
  5662. /* Dword 1: fisa_control_value fisa_aggr_limit */
  5663. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  5664. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  5665. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  5666. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  5667. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  5668. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  5669. do { \
  5670. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  5671. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  5672. } while (0)
  5673. /* Dword 1: fisa_control_value fisa config */
  5674. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  5675. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  5676. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  5677. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  5678. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  5679. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  5680. do { \
  5681. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  5682. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  5683. } while (0)
  5684. /* Dword 1: fisa_control_value fisa_aggr_limit */
  5685. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  5686. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  5687. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  5688. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  5689. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  5690. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  5691. do { \
  5692. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  5693. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  5694. } while (0)
  5695. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  5696. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  5697. pdev_id:8,
  5698. reserved0:16;
  5699. A_UINT32 num_records:20,
  5700. max_search:8,
  5701. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  5702. reserved1:2;
  5703. A_UINT32 base_addr_lo;
  5704. A_UINT32 base_addr_hi;
  5705. A_UINT32 toeplitz31_0;
  5706. A_UINT32 toeplitz63_32;
  5707. A_UINT32 toeplitz95_64;
  5708. A_UINT32 toeplitz127_96;
  5709. A_UINT32 toeplitz159_128;
  5710. A_UINT32 toeplitz191_160;
  5711. A_UINT32 toeplitz223_192;
  5712. A_UINT32 toeplitz255_224;
  5713. A_UINT32 toeplitz287_256;
  5714. A_UINT32 toeplitz314_288:27,
  5715. reserved2:5;
  5716. } POSTPACK;
  5717. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  5718. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  5719. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  5720. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  5721. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  5722. /* DWORD 0: Pdev ID */
  5723. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  5724. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  5725. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  5726. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  5727. HTT_RX_FSE_SETUP_PDEV_ID_S)
  5728. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  5729. do { \
  5730. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  5731. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  5732. } while (0)
  5733. /* DWORD 1:num of records */
  5734. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  5735. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  5736. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  5737. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  5738. HTT_RX_FSE_SETUP_NUM_REC_S)
  5739. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  5740. do { \
  5741. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  5742. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  5743. } while (0)
  5744. /* DWORD 1:max_search */
  5745. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  5746. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  5747. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  5748. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  5749. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  5750. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  5751. do { \
  5752. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  5753. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  5754. } while (0)
  5755. /* DWORD 1:ip_da_sa prefix */
  5756. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  5757. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  5758. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  5759. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  5760. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  5761. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  5762. do { \
  5763. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  5764. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  5765. } while (0)
  5766. /* DWORD 2: Base Address LO */
  5767. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  5768. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  5769. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  5770. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  5771. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  5772. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  5773. do { \
  5774. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  5775. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  5776. } while (0)
  5777. /* DWORD 3: Base Address High */
  5778. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  5779. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  5780. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  5781. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  5782. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  5783. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  5784. do { \
  5785. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  5786. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  5787. } while (0)
  5788. /* DWORD 4-12: Hash Value */
  5789. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  5790. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  5791. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  5792. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  5793. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  5794. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  5795. do { \
  5796. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  5797. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  5798. } while (0)
  5799. /* DWORD 13: Hash Value 314:288 bits */
  5800. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  5801. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  5802. HTT_RX_FSE_SETUP_HASH_314_288_S)
  5803. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  5804. do { \
  5805. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  5806. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  5807. } while (0)
  5808. /**
  5809. * @brief Host-->target HTT RX FSE operation message
  5810. *
  5811. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  5812. *
  5813. * @details
  5814. * The host will send this Flow Search Engine (FSE) operation message for
  5815. * every flow add/delete operation.
  5816. * The FSE operation includes FSE full cache invalidation or individual entry
  5817. * invalidation.
  5818. * This message can be sent per SOC or per PDEV which is differentiated
  5819. * by pdev id values.
  5820. *
  5821. * |31 16|15 8|7 1|0|
  5822. * |-------------------------------------------------------------|
  5823. * | reserved | pdev_id | MSG_TYPE |
  5824. * |-------------------------------------------------------------|
  5825. * | reserved | operation |I|
  5826. * |-------------------------------------------------------------|
  5827. * | ip_src_addr_31_0 |
  5828. * |-------------------------------------------------------------|
  5829. * | ip_src_addr_63_32 |
  5830. * |-------------------------------------------------------------|
  5831. * | ip_src_addr_95_64 |
  5832. * |-------------------------------------------------------------|
  5833. * | ip_src_addr_127_96 |
  5834. * |-------------------------------------------------------------|
  5835. * | ip_dst_addr_31_0 |
  5836. * |-------------------------------------------------------------|
  5837. * | ip_dst_addr_63_32 |
  5838. * |-------------------------------------------------------------|
  5839. * | ip_dst_addr_95_64 |
  5840. * |-------------------------------------------------------------|
  5841. * | ip_dst_addr_127_96 |
  5842. * |-------------------------------------------------------------|
  5843. * | l4_dst_port | l4_src_port |
  5844. * | (32-bit SPI incase of IPsec) |
  5845. * |-------------------------------------------------------------|
  5846. * | reserved | l4_proto |
  5847. * |-------------------------------------------------------------|
  5848. *
  5849. * where I is 1-bit ipsec_valid.
  5850. *
  5851. * The following field definitions describe the format of the RX FSE operation
  5852. * message sent from the host to target for every add/delete flow entry to flow
  5853. * table.
  5854. *
  5855. * Header fields:
  5856. * dword0 - b'7:0 - msg_type: This will be set to
  5857. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  5858. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5859. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  5860. * specified pdev's LMAC ring.
  5861. * b'31:16 - reserved : Reserved for future use
  5862. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  5863. * (Internet Protocol Security).
  5864. * IPsec describes the framework for providing security at
  5865. * IP layer. IPsec is defined for both versions of IP:
  5866. * IPV4 and IPV6.
  5867. * Please refer to htt_rx_flow_proto enumeration below for
  5868. * more info.
  5869. * ipsec_valid = 1 for IPSEC packets
  5870. * ipsec_valid = 0 for IP Packets
  5871. * b'7:1 - operation: This indicates types of FSE operation.
  5872. * Refer to htt_rx_fse_operation enumeration:
  5873. * 0 - No Cache Invalidation required
  5874. * 1 - Cache invalidate only one entry given by IP
  5875. * src/dest address at DWORD[2:9]
  5876. * 2 - Complete FSE Cache Invalidation
  5877. * 3 - FSE Disable
  5878. * 4 - FSE Enable
  5879. * b'31:8 - reserved: Reserved for future use
  5880. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  5881. * for per flow addition/deletion
  5882. * For IPV4 src/dest addresses, the first A_UINT32 is used
  5883. * and the subsequent 3 A_UINT32 will be padding bytes.
  5884. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  5885. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  5886. * from 0 to 65535 but only 0 to 1023 are designated as
  5887. * well-known ports. Refer to [RFC1700] for more details.
  5888. * This field is valid only if
  5889. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  5890. * - L4 dest port (31:16): 16-bit Destination Port numbers
  5891. * range from 0 to 65535 but only 0 to 1023 are designated
  5892. * as well-known ports. Refer to [RFC1700] for more details.
  5893. * This field is valid only if
  5894. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  5895. * - SPI (31:0): Security Parameters Index is an
  5896. * identification tag added to the header while using IPsec
  5897. * for tunneling the IP traffici.
  5898. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  5899. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  5900. * Assigned Internet Protocol Numbers.
  5901. * l4_proto numbers for standard protocol like UDP/TCP
  5902. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  5903. * l4_proto = 17 for UDP etc.
  5904. * b'31:8 - reserved: Reserved for future use.
  5905. *
  5906. */
  5907. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  5908. A_UINT32 msg_type:8,
  5909. pdev_id:8,
  5910. reserved0:16;
  5911. A_UINT32 ipsec_valid:1,
  5912. operation:7,
  5913. reserved1:24;
  5914. A_UINT32 ip_src_addr_31_0;
  5915. A_UINT32 ip_src_addr_63_32;
  5916. A_UINT32 ip_src_addr_95_64;
  5917. A_UINT32 ip_src_addr_127_96;
  5918. A_UINT32 ip_dest_addr_31_0;
  5919. A_UINT32 ip_dest_addr_63_32;
  5920. A_UINT32 ip_dest_addr_95_64;
  5921. A_UINT32 ip_dest_addr_127_96;
  5922. union {
  5923. A_UINT32 spi;
  5924. struct {
  5925. A_UINT32 l4_src_port:16,
  5926. l4_dest_port:16;
  5927. } ip;
  5928. } u;
  5929. A_UINT32 l4_proto:8,
  5930. reserved:24;
  5931. } POSTPACK;
  5932. /**
  5933. * @brief Host-->target HTT RX Full monitor mode register configuration message
  5934. *
  5935. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  5936. *
  5937. * @details
  5938. * The host will send this Full monitor mode register configuration message.
  5939. * This message can be sent per SOC or per PDEV which is differentiated
  5940. * by pdev id values.
  5941. *
  5942. * |31 16|15 11|10 8|7 3|2|1|0|
  5943. * |-------------------------------------------------------------|
  5944. * | reserved | pdev_id | MSG_TYPE |
  5945. * |-------------------------------------------------------------|
  5946. * | reserved |Release Ring |N|Z|E|
  5947. * |-------------------------------------------------------------|
  5948. *
  5949. * where E is 1-bit full monitor mode enable/disable.
  5950. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  5951. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  5952. *
  5953. * The following field definitions describe the format of the full monitor
  5954. * mode configuration message sent from the host to target for each pdev.
  5955. *
  5956. * Header fields:
  5957. * dword0 - b'7:0 - msg_type: This will be set to
  5958. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  5959. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5960. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  5961. * specified pdev's LMAC ring.
  5962. * b'31:16 - reserved : Reserved for future use.
  5963. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  5964. * monitor mode rxdma register is to be enabled or disabled.
  5965. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  5966. * additional descriptors at ppdu end for zero mpdus
  5967. * enabled or disabled.
  5968. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  5969. * additional descriptors at ppdu end for non zero mpdus
  5970. * enabled or disabled.
  5971. * b'10:3 - release_ring: This indicates the destination ring
  5972. * selection for the descriptor at the end of PPDU
  5973. * 0 - REO ring select
  5974. * 1 - FW ring select
  5975. * 2 - SW ring select
  5976. * 3 - Release ring select
  5977. * Refer to htt_rx_full_mon_release_ring.
  5978. * b'31:11 - reserved for future use
  5979. */
  5980. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  5981. A_UINT32 msg_type:8,
  5982. pdev_id:8,
  5983. reserved0:16;
  5984. A_UINT32 full_monitor_mode_enable:1,
  5985. addnl_descs_zero_mpdus_end:1,
  5986. addnl_descs_non_zero_mpdus_end:1,
  5987. release_ring:8,
  5988. reserved1:21;
  5989. } POSTPACK;
  5990. /**
  5991. * Enumeration for full monitor mode destination ring select
  5992. * 0 - REO destination ring select
  5993. * 1 - FW destination ring select
  5994. * 2 - SW destination ring select
  5995. * 3 - Release destination ring select
  5996. */
  5997. enum htt_rx_full_mon_release_ring {
  5998. HTT_RX_MON_RING_REO,
  5999. HTT_RX_MON_RING_FW,
  6000. HTT_RX_MON_RING_SW,
  6001. HTT_RX_MON_RING_RELEASE,
  6002. };
  6003. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  6004. /* DWORD 0: Pdev ID */
  6005. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  6006. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  6007. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  6008. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  6009. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  6010. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  6011. do { \
  6012. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  6013. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  6014. } while (0)
  6015. /* DWORD 1:ENABLE */
  6016. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  6017. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  6018. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  6019. do { \
  6020. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  6021. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  6022. } while (0)
  6023. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  6024. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  6025. /* DWORD 1:ZERO_MPDU */
  6026. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  6027. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  6028. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  6029. do { \
  6030. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  6031. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  6032. } while (0)
  6033. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  6034. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  6035. /* DWORD 1:NON_ZERO_MPDU */
  6036. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  6037. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  6038. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  6039. do { \
  6040. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  6041. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  6042. } while (0)
  6043. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  6044. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  6045. /* DWORD 1:RELEASE_RINGS */
  6046. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  6047. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  6048. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  6049. do { \
  6050. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  6051. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  6052. } while (0)
  6053. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  6054. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  6055. /**
  6056. * Enumeration for IP Protocol or IPSEC Protocol
  6057. * IPsec describes the framework for providing security at IP layer.
  6058. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  6059. */
  6060. enum htt_rx_flow_proto {
  6061. HTT_RX_FLOW_IP_PROTO,
  6062. HTT_RX_FLOW_IPSEC_PROTO,
  6063. };
  6064. /**
  6065. * Enumeration for FSE Cache Invalidation
  6066. * 0 - No Cache Invalidation required
  6067. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  6068. * 2 - Complete FSE Cache Invalidation
  6069. * 3 - FSE Disable
  6070. * 4 - FSE Enable
  6071. */
  6072. enum htt_rx_fse_operation {
  6073. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  6074. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  6075. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  6076. HTT_RX_FSE_DISABLE,
  6077. HTT_RX_FSE_ENABLE,
  6078. };
  6079. /* DWORD 0: Pdev ID */
  6080. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  6081. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  6082. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  6083. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  6084. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  6085. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  6086. do { \
  6087. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  6088. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  6089. } while (0)
  6090. /* DWORD 1:IP PROTO or IPSEC */
  6091. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  6092. #define HTT_RX_FSE_IPSEC_VALID_S 0
  6093. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  6094. do { \
  6095. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  6096. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  6097. } while (0)
  6098. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  6099. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  6100. /* DWORD 1:FSE Operation */
  6101. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  6102. #define HTT_RX_FSE_OPERATION_S 1
  6103. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  6104. do { \
  6105. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  6106. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  6107. } while (0)
  6108. #define HTT_RX_FSE_OPERATION_GET(word) \
  6109. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  6110. /* DWORD 2-9:IP Address */
  6111. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  6112. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  6113. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  6114. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  6115. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  6116. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  6117. do { \
  6118. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  6119. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  6120. } while (0)
  6121. /* DWORD 10:Source Port Number */
  6122. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  6123. #define HTT_RX_FSE_SOURCEPORT_S 0
  6124. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  6125. do { \
  6126. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  6127. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  6128. } while (0)
  6129. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  6130. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  6131. /* DWORD 11:Destination Port Number */
  6132. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  6133. #define HTT_RX_FSE_DESTPORT_S 16
  6134. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  6135. do { \
  6136. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  6137. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  6138. } while (0)
  6139. #define HTT_RX_FSE_DESTPORT_GET(word) \
  6140. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  6141. /* DWORD 10-11:SPI (In case of IPSEC) */
  6142. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  6143. #define HTT_RX_FSE_OPERATION_SPI_S 0
  6144. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  6145. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  6146. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  6147. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  6148. do { \
  6149. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  6150. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  6151. } while (0)
  6152. /* DWORD 12:L4 PROTO */
  6153. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  6154. #define HTT_RX_FSE_L4_PROTO_S 0
  6155. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  6156. do { \
  6157. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  6158. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  6159. } while (0)
  6160. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  6161. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  6162. /**
  6163. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  6164. *
  6165. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  6166. *
  6167. * |31 24|23 |15 8|7 2|1|0|
  6168. * |----------------+----------------+----------------+----------------|
  6169. * | reserved | pdev_id | msg_type |
  6170. * |---------------------------------+----------------+----------------|
  6171. * | reserved |E|F|
  6172. * |---------------------------------+----------------+----------------|
  6173. * Where E = Configure the target to provide the 3-tuple hash value in
  6174. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  6175. * F = Configure the target to provide the 3-tuple hash value in
  6176. * flow_id_toeplitz field of rx_msdu_start tlv
  6177. *
  6178. * The following field definitions describe the format of the 3 tuple hash value
  6179. * message sent from the host to target as part of initialization sequence.
  6180. *
  6181. * Header fields:
  6182. * dword0 - b'7:0 - msg_type: This will be set to
  6183. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  6184. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6185. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6186. * specified pdev's LMAC ring.
  6187. * b'31:16 - reserved : Reserved for future use
  6188. * dword1 - b'0 - flow_id_toeplitz_field_enable
  6189. * b'1 - toeplitz_hash_2_or_4_field_enable
  6190. * b'31:2 - reserved : Reserved for future use
  6191. * ---------+------+----------------------------------------------------------
  6192. * bit1 | bit0 | Functionality
  6193. * ---------+------+----------------------------------------------------------
  6194. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  6195. * | | in flow_id_toeplitz field
  6196. * ---------+------+----------------------------------------------------------
  6197. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  6198. * | | in toeplitz_hash_2_or_4 field
  6199. * ---------+------+----------------------------------------------------------
  6200. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  6201. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  6202. * ---------+------+----------------------------------------------------------
  6203. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  6204. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  6205. * | | toeplitz_hash_2_or_4 field
  6206. *----------------------------------------------------------------------------
  6207. */
  6208. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  6209. A_UINT32 msg_type :8,
  6210. pdev_id :8,
  6211. reserved0 :16;
  6212. A_UINT32 flow_id_toeplitz_field_enable :1,
  6213. toeplitz_hash_2_or_4_field_enable :1,
  6214. reserved1 :30;
  6215. } POSTPACK;
  6216. /* DWORD0 : pdev_id configuration Macros */
  6217. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  6218. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  6219. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  6220. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  6221. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  6222. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  6223. do { \
  6224. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  6225. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  6226. } while (0)
  6227. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  6228. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  6229. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  6230. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  6231. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  6232. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  6233. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  6234. do { \
  6235. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  6236. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  6237. } while (0)
  6238. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  6239. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  6240. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  6241. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  6242. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  6243. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  6244. do { \
  6245. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  6246. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  6247. } while (0)
  6248. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  6249. /**
  6250. * @brief host --> target Host PA Address Size
  6251. *
  6252. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  6253. *
  6254. * @details
  6255. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  6256. * provide the physical start address and size of each of the memory
  6257. * areas within host DDR that the target FW may need to access.
  6258. *
  6259. * For example, the host can use this message to allow the target FW
  6260. * to set up access to the host's pools of TQM link descriptors.
  6261. * The message would appear as follows:
  6262. *
  6263. * |31 24|23 16|15 8|7 0|
  6264. * |----------------+----------------+----------------+----------------|
  6265. * | reserved | num_entries | msg_type |
  6266. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  6267. * | mem area 0 size |
  6268. * |----------------+----------------+----------------+----------------|
  6269. * | mem area 0 physical_address_lo |
  6270. * |----------------+----------------+----------------+----------------|
  6271. * | mem area 0 physical_address_hi |
  6272. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  6273. * | mem area 1 size |
  6274. * |----------------+----------------+----------------+----------------|
  6275. * | mem area 1 physical_address_lo |
  6276. * |----------------+----------------+----------------+----------------|
  6277. * | mem area 1 physical_address_hi |
  6278. * |----------------+----------------+----------------+----------------|
  6279. * ...
  6280. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  6281. * | mem area N size |
  6282. * |----------------+----------------+----------------+----------------|
  6283. * | mem area N physical_address_lo |
  6284. * |----------------+----------------+----------------+----------------|
  6285. * | mem area N physical_address_hi |
  6286. * |----------------+----------------+----------------+----------------|
  6287. *
  6288. * The message is interpreted as follows:
  6289. * dword0 - b'0:7 - msg_type: This will be set to
  6290. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  6291. * b'8:15 - number_entries: Indicated the number of host memory
  6292. * areas specified within the remainder of the message
  6293. * b'16:31 - reserved.
  6294. * dword1 - b'0:31 - memory area 0 size in bytes
  6295. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  6296. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  6297. * and similar for memory area 1 through memory area N.
  6298. */
  6299. PREPACK struct htt_h2t_host_paddr_size {
  6300. A_UINT32 msg_type: 8,
  6301. num_entries: 8,
  6302. reserved: 16;
  6303. } POSTPACK;
  6304. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  6305. A_UINT32 size;
  6306. A_UINT32 physical_address_lo;
  6307. A_UINT32 physical_address_hi;
  6308. } POSTPACK;
  6309. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  6310. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  6311. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  6312. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  6313. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  6314. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  6315. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  6316. do { \
  6317. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  6318. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  6319. } while (0)
  6320. /*=== target -> host messages ===============================================*/
  6321. enum htt_t2h_msg_type {
  6322. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  6323. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  6324. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  6325. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  6326. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  6327. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  6328. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  6329. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  6330. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  6331. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  6332. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  6333. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  6334. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  6335. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  6336. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  6337. /* only used for HL, add HTT MSG for HTT CREDIT update */
  6338. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  6339. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  6340. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  6341. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  6342. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  6343. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  6344. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  6345. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  6346. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  6347. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  6348. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  6349. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  6350. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  6351. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  6352. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  6353. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  6354. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  6355. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  6356. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  6357. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  6358. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  6359. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  6360. /* TX_OFFLOAD_DELIVER_IND:
  6361. * Forward the target's locally-generated packets to the host,
  6362. * to provide to the monitor mode interface.
  6363. */
  6364. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  6365. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  6366. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  6367. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  6368. HTT_T2H_MSG_TYPE_TEST,
  6369. /* keep this last */
  6370. HTT_T2H_NUM_MSGS
  6371. };
  6372. /*
  6373. * HTT target to host message type -
  6374. * stored in bits 7:0 of the first word of the message
  6375. */
  6376. #define HTT_T2H_MSG_TYPE_M 0xff
  6377. #define HTT_T2H_MSG_TYPE_S 0
  6378. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  6379. do { \
  6380. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  6381. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  6382. } while (0)
  6383. #define HTT_T2H_MSG_TYPE_GET(word) \
  6384. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  6385. /**
  6386. * @brief target -> host version number confirmation message definition
  6387. *
  6388. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  6389. *
  6390. * |31 24|23 16|15 8|7 0|
  6391. * |----------------+----------------+----------------+----------------|
  6392. * | reserved | major number | minor number | msg type |
  6393. * |-------------------------------------------------------------------|
  6394. * : option request TLV (optional) |
  6395. * :...................................................................:
  6396. *
  6397. * The VER_CONF message may consist of a single 4-byte word, or may be
  6398. * extended with TLVs that specify HTT options selected by the target.
  6399. * The following option TLVs may be appended to the VER_CONF message:
  6400. * - LL_BUS_ADDR_SIZE
  6401. * - HL_SUPPRESS_TX_COMPL_IND
  6402. * - MAX_TX_QUEUE_GROUPS
  6403. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  6404. * may be appended to the VER_CONF message (but only one TLV of each type).
  6405. *
  6406. * Header fields:
  6407. * - MSG_TYPE
  6408. * Bits 7:0
  6409. * Purpose: identifies this as a version number confirmation message
  6410. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  6411. * - VER_MINOR
  6412. * Bits 15:8
  6413. * Purpose: Specify the minor number of the HTT message library version
  6414. * in use by the target firmware.
  6415. * The minor number specifies the specific revision within a range
  6416. * of fundamentally compatible HTT message definition revisions.
  6417. * Compatible revisions involve adding new messages or perhaps
  6418. * adding new fields to existing messages, in a backwards-compatible
  6419. * manner.
  6420. * Incompatible revisions involve changing the message type values,
  6421. * or redefining existing messages.
  6422. * Value: minor number
  6423. * - VER_MAJOR
  6424. * Bits 15:8
  6425. * Purpose: Specify the major number of the HTT message library version
  6426. * in use by the target firmware.
  6427. * The major number specifies the family of minor revisions that are
  6428. * fundamentally compatible with each other, but not with prior or
  6429. * later families.
  6430. * Value: major number
  6431. */
  6432. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  6433. #define HTT_VER_CONF_MINOR_S 8
  6434. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  6435. #define HTT_VER_CONF_MAJOR_S 16
  6436. #define HTT_VER_CONF_MINOR_SET(word, value) \
  6437. do { \
  6438. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  6439. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  6440. } while (0)
  6441. #define HTT_VER_CONF_MINOR_GET(word) \
  6442. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  6443. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  6444. do { \
  6445. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  6446. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  6447. } while (0)
  6448. #define HTT_VER_CONF_MAJOR_GET(word) \
  6449. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  6450. #define HTT_VER_CONF_BYTES 4
  6451. /**
  6452. * @brief - target -> host HTT Rx In order indication message
  6453. *
  6454. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  6455. *
  6456. * @details
  6457. *
  6458. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  6459. * |----------------+-------------------+---------------------+---------------|
  6460. * | peer ID | P| F| O| ext TID | msg type |
  6461. * |--------------------------------------------------------------------------|
  6462. * | MSDU count | Reserved | vdev id |
  6463. * |--------------------------------------------------------------------------|
  6464. * | MSDU 0 bus address (bits 31:0) |
  6465. #if HTT_PADDR64
  6466. * | MSDU 0 bus address (bits 63:32) |
  6467. #endif
  6468. * |--------------------------------------------------------------------------|
  6469. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  6470. * |--------------------------------------------------------------------------|
  6471. * | MSDU 1 bus address (bits 31:0) |
  6472. #if HTT_PADDR64
  6473. * | MSDU 1 bus address (bits 63:32) |
  6474. #endif
  6475. * |--------------------------------------------------------------------------|
  6476. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  6477. * |--------------------------------------------------------------------------|
  6478. */
  6479. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  6480. *
  6481. * @details
  6482. * bits
  6483. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  6484. * |-----+----+-------+--------+--------+---------+---------+-----------|
  6485. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  6486. * | | frag | | | | fail |chksum fail|
  6487. * |-----+----+-------+--------+--------+---------+---------+-----------|
  6488. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  6489. */
  6490. struct htt_rx_in_ord_paddr_ind_hdr_t
  6491. {
  6492. A_UINT32 /* word 0 */
  6493. msg_type: 8,
  6494. ext_tid: 5,
  6495. offload: 1,
  6496. frag: 1,
  6497. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  6498. peer_id: 16;
  6499. A_UINT32 /* word 1 */
  6500. vap_id: 8,
  6501. /* NOTE:
  6502. * This reserved_1 field is not truly reserved - certain targets use
  6503. * this field internally to store debug information, and do not zero
  6504. * out the contents of the field before uploading the message to the
  6505. * host. Thus, any host-target communication supported by this field
  6506. * is limited to using values that are never used by the debug
  6507. * information stored by certain targets in the reserved_1 field.
  6508. * In particular, the targets in question don't use the value 0x3
  6509. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  6510. * so this previously-unused value within these bits is available to
  6511. * use as the host / target PKT_CAPTURE_MODE flag.
  6512. */
  6513. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  6514. /* if pkt_capture_mode == 0x3, host should
  6515. * send rx frames to monitor mode interface
  6516. */
  6517. msdu_cnt: 16;
  6518. };
  6519. struct htt_rx_in_ord_paddr_ind_msdu32_t
  6520. {
  6521. A_UINT32 dma_addr;
  6522. A_UINT32
  6523. length: 16,
  6524. fw_desc: 8,
  6525. msdu_info:8;
  6526. };
  6527. struct htt_rx_in_ord_paddr_ind_msdu64_t
  6528. {
  6529. A_UINT32 dma_addr_lo;
  6530. A_UINT32 dma_addr_hi;
  6531. A_UINT32
  6532. length: 16,
  6533. fw_desc: 8,
  6534. msdu_info:8;
  6535. };
  6536. #if HTT_PADDR64
  6537. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  6538. #else
  6539. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  6540. #endif
  6541. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  6542. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  6543. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  6544. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  6545. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  6546. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  6547. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  6548. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  6549. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  6550. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  6551. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  6552. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  6553. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  6554. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  6555. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  6556. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  6557. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  6558. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  6559. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  6560. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  6561. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  6562. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  6563. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  6564. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  6565. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  6566. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  6567. /* for systems using 64-bit format for bus addresses */
  6568. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  6569. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  6570. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  6571. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  6572. /* for systems using 32-bit format for bus addresses */
  6573. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  6574. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  6575. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  6576. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  6577. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  6578. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  6579. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  6580. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  6581. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  6582. do { \
  6583. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  6584. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  6585. } while (0)
  6586. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  6587. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  6588. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  6589. do { \
  6590. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  6591. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  6592. } while (0)
  6593. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  6594. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  6595. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  6596. do { \
  6597. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  6598. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  6599. } while (0)
  6600. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  6601. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  6602. /*
  6603. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  6604. * deliver the rx frames to the monitor mode interface.
  6605. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  6606. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  6607. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  6608. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  6609. */
  6610. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  6611. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  6612. do { \
  6613. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  6614. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  6615. } while (0)
  6616. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  6617. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  6618. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  6619. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  6620. do { \
  6621. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  6622. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  6623. } while (0)
  6624. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  6625. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  6626. /* for systems using 64-bit format for bus addresses */
  6627. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  6628. do { \
  6629. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  6630. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  6631. } while (0)
  6632. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  6633. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  6634. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  6635. do { \
  6636. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  6637. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  6638. } while (0)
  6639. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  6640. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  6641. /* for systems using 32-bit format for bus addresses */
  6642. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  6643. do { \
  6644. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  6645. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  6646. } while (0)
  6647. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  6648. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  6649. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  6650. do { \
  6651. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  6652. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  6653. } while (0)
  6654. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  6655. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  6656. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  6657. do { \
  6658. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  6659. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  6660. } while (0)
  6661. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  6662. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  6663. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  6664. do { \
  6665. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  6666. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  6667. } while (0)
  6668. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  6669. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  6670. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  6671. do { \
  6672. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  6673. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  6674. } while (0)
  6675. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  6676. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  6677. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  6678. do { \
  6679. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  6680. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  6681. } while (0)
  6682. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  6683. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  6684. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  6685. do { \
  6686. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  6687. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  6688. } while (0)
  6689. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  6690. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  6691. /* definitions used within target -> host rx indication message */
  6692. PREPACK struct htt_rx_ind_hdr_prefix_t
  6693. {
  6694. A_UINT32 /* word 0 */
  6695. msg_type: 8,
  6696. ext_tid: 5,
  6697. release_valid: 1,
  6698. flush_valid: 1,
  6699. reserved0: 1,
  6700. peer_id: 16;
  6701. A_UINT32 /* word 1 */
  6702. flush_start_seq_num: 6,
  6703. flush_end_seq_num: 6,
  6704. release_start_seq_num: 6,
  6705. release_end_seq_num: 6,
  6706. num_mpdu_ranges: 8;
  6707. } POSTPACK;
  6708. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  6709. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  6710. #define HTT_TGT_RSSI_INVALID 0x80
  6711. PREPACK struct htt_rx_ppdu_desc_t
  6712. {
  6713. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  6714. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  6715. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  6716. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  6717. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  6718. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  6719. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  6720. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  6721. A_UINT32 /* word 0 */
  6722. rssi_cmb: 8,
  6723. timestamp_submicrosec: 8,
  6724. phy_err_code: 8,
  6725. phy_err: 1,
  6726. legacy_rate: 4,
  6727. legacy_rate_sel: 1,
  6728. end_valid: 1,
  6729. start_valid: 1;
  6730. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  6731. union {
  6732. A_UINT32 /* word 1 */
  6733. rssi0_pri20: 8,
  6734. rssi0_ext20: 8,
  6735. rssi0_ext40: 8,
  6736. rssi0_ext80: 8;
  6737. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  6738. } u0;
  6739. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  6740. union {
  6741. A_UINT32 /* word 2 */
  6742. rssi1_pri20: 8,
  6743. rssi1_ext20: 8,
  6744. rssi1_ext40: 8,
  6745. rssi1_ext80: 8;
  6746. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  6747. } u1;
  6748. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  6749. union {
  6750. A_UINT32 /* word 3 */
  6751. rssi2_pri20: 8,
  6752. rssi2_ext20: 8,
  6753. rssi2_ext40: 8,
  6754. rssi2_ext80: 8;
  6755. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  6756. } u2;
  6757. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  6758. union {
  6759. A_UINT32 /* word 4 */
  6760. rssi3_pri20: 8,
  6761. rssi3_ext20: 8,
  6762. rssi3_ext40: 8,
  6763. rssi3_ext80: 8;
  6764. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  6765. } u3;
  6766. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  6767. A_UINT32 tsf32; /* word 5 */
  6768. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  6769. A_UINT32 timestamp_microsec; /* word 6 */
  6770. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  6771. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  6772. A_UINT32 /* word 7 */
  6773. vht_sig_a1: 24,
  6774. preamble_type: 8;
  6775. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  6776. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  6777. A_UINT32 /* word 8 */
  6778. vht_sig_a2: 24,
  6779. /* sa_ant_matrix
  6780. * For cases where a single rx chain has options to be connected to
  6781. * different rx antennas, show which rx antennas were in use during
  6782. * receipt of a given PPDU.
  6783. * This sa_ant_matrix provides a bitmask of the antennas used while
  6784. * receiving this frame.
  6785. */
  6786. sa_ant_matrix: 8;
  6787. } POSTPACK;
  6788. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  6789. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  6790. PREPACK struct htt_rx_ind_hdr_suffix_t
  6791. {
  6792. A_UINT32 /* word 0 */
  6793. fw_rx_desc_bytes: 16,
  6794. reserved0: 16;
  6795. } POSTPACK;
  6796. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  6797. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  6798. PREPACK struct htt_rx_ind_hdr_t
  6799. {
  6800. struct htt_rx_ind_hdr_prefix_t prefix;
  6801. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  6802. struct htt_rx_ind_hdr_suffix_t suffix;
  6803. } POSTPACK;
  6804. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  6805. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  6806. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  6807. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  6808. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  6809. /*
  6810. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  6811. * the offset into the HTT rx indication message at which the
  6812. * FW rx PPDU descriptor resides
  6813. */
  6814. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  6815. /*
  6816. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  6817. * the offset into the HTT rx indication message at which the
  6818. * header suffix (FW rx MSDU byte count) resides
  6819. */
  6820. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  6821. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  6822. /*
  6823. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  6824. * the offset into the HTT rx indication message at which the per-MSDU
  6825. * information starts
  6826. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  6827. * per-MSDU information portion of the message. The per-MSDU info itself
  6828. * starts at byte 12.
  6829. */
  6830. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  6831. /**
  6832. * @brief target -> host rx indication message definition
  6833. *
  6834. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  6835. *
  6836. * @details
  6837. * The following field definitions describe the format of the rx indication
  6838. * message sent from the target to the host.
  6839. * The message consists of three major sections:
  6840. * 1. a fixed-length header
  6841. * 2. a variable-length list of firmware rx MSDU descriptors
  6842. * 3. one or more 4-octet MPDU range information elements
  6843. * The fixed length header itself has two sub-sections
  6844. * 1. the message meta-information, including identification of the
  6845. * sender and type of the received data, and a 4-octet flush/release IE
  6846. * 2. the firmware rx PPDU descriptor
  6847. *
  6848. * The format of the message is depicted below.
  6849. * in this depiction, the following abbreviations are used for information
  6850. * elements within the message:
  6851. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  6852. * elements associated with the PPDU start are valid.
  6853. * Specifically, the following fields are valid only if SV is set:
  6854. * RSSI (all variants), L, legacy rate, preamble type, service,
  6855. * VHT-SIG-A
  6856. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  6857. * elements associated with the PPDU end are valid.
  6858. * Specifically, the following fields are valid only if EV is set:
  6859. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  6860. * - L - Legacy rate selector - if legacy rates are used, this flag
  6861. * indicates whether the rate is from a CCK (L == 1) or OFDM
  6862. * (L == 0) PHY.
  6863. * - P - PHY error flag - boolean indication of whether the rx frame had
  6864. * a PHY error
  6865. *
  6866. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  6867. * |----------------+-------------------+---------------------+---------------|
  6868. * | peer ID | |RV|FV| ext TID | msg type |
  6869. * |--------------------------------------------------------------------------|
  6870. * | num | release | release | flush | flush |
  6871. * | MPDU | end | start | end | start |
  6872. * | ranges | seq num | seq num | seq num | seq num |
  6873. * |==========================================================================|
  6874. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  6875. * |V|V| | rate | | | timestamp | RSSI |
  6876. * |--------------------------------------------------------------------------|
  6877. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  6878. * |--------------------------------------------------------------------------|
  6879. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  6880. * |--------------------------------------------------------------------------|
  6881. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  6882. * |--------------------------------------------------------------------------|
  6883. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  6884. * |--------------------------------------------------------------------------|
  6885. * | TSF LSBs |
  6886. * |--------------------------------------------------------------------------|
  6887. * | microsec timestamp |
  6888. * |--------------------------------------------------------------------------|
  6889. * | preamble type | HT-SIG / VHT-SIG-A1 |
  6890. * |--------------------------------------------------------------------------|
  6891. * | service | HT-SIG / VHT-SIG-A2 |
  6892. * |==========================================================================|
  6893. * | reserved | FW rx desc bytes |
  6894. * |--------------------------------------------------------------------------|
  6895. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  6896. * | desc B3 | desc B2 | desc B1 | desc B0 |
  6897. * |--------------------------------------------------------------------------|
  6898. * : : :
  6899. * |--------------------------------------------------------------------------|
  6900. * | alignment | MSDU Rx |
  6901. * | padding | desc Bn |
  6902. * |--------------------------------------------------------------------------|
  6903. * | reserved | MPDU range status | MPDU count |
  6904. * |--------------------------------------------------------------------------|
  6905. * : reserved : MPDU range status : MPDU count :
  6906. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  6907. *
  6908. * Header fields:
  6909. * - MSG_TYPE
  6910. * Bits 7:0
  6911. * Purpose: identifies this as an rx indication message
  6912. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  6913. * - EXT_TID
  6914. * Bits 12:8
  6915. * Purpose: identify the traffic ID of the rx data, including
  6916. * special "extended" TID values for multicast, broadcast, and
  6917. * non-QoS data frames
  6918. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  6919. * - FLUSH_VALID (FV)
  6920. * Bit 13
  6921. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  6922. * is valid
  6923. * Value:
  6924. * 1 -> flush IE is valid and needs to be processed
  6925. * 0 -> flush IE is not valid and should be ignored
  6926. * - REL_VALID (RV)
  6927. * Bit 13
  6928. * Purpose: indicate whether the release IE (start/end sequence numbers)
  6929. * is valid
  6930. * Value:
  6931. * 1 -> release IE is valid and needs to be processed
  6932. * 0 -> release IE is not valid and should be ignored
  6933. * - PEER_ID
  6934. * Bits 31:16
  6935. * Purpose: Identify, by ID, which peer sent the rx data
  6936. * Value: ID of the peer who sent the rx data
  6937. * - FLUSH_SEQ_NUM_START
  6938. * Bits 5:0
  6939. * Purpose: Indicate the start of a series of MPDUs to flush
  6940. * Not all MPDUs within this series are necessarily valid - the host
  6941. * must check each sequence number within this range to see if the
  6942. * corresponding MPDU is actually present.
  6943. * This field is only valid if the FV bit is set.
  6944. * Value:
  6945. * The sequence number for the first MPDUs to check to flush.
  6946. * The sequence number is masked by 0x3f.
  6947. * - FLUSH_SEQ_NUM_END
  6948. * Bits 11:6
  6949. * Purpose: Indicate the end of a series of MPDUs to flush
  6950. * Value:
  6951. * The sequence number one larger than the sequence number of the
  6952. * last MPDU to check to flush.
  6953. * The sequence number is masked by 0x3f.
  6954. * Not all MPDUs within this series are necessarily valid - the host
  6955. * must check each sequence number within this range to see if the
  6956. * corresponding MPDU is actually present.
  6957. * This field is only valid if the FV bit is set.
  6958. * - REL_SEQ_NUM_START
  6959. * Bits 17:12
  6960. * Purpose: Indicate the start of a series of MPDUs to release.
  6961. * All MPDUs within this series are present and valid - the host
  6962. * need not check each sequence number within this range to see if
  6963. * the corresponding MPDU is actually present.
  6964. * This field is only valid if the RV bit is set.
  6965. * Value:
  6966. * The sequence number for the first MPDUs to check to release.
  6967. * The sequence number is masked by 0x3f.
  6968. * - REL_SEQ_NUM_END
  6969. * Bits 23:18
  6970. * Purpose: Indicate the end of a series of MPDUs to release.
  6971. * Value:
  6972. * The sequence number one larger than the sequence number of the
  6973. * last MPDU to check to release.
  6974. * The sequence number is masked by 0x3f.
  6975. * All MPDUs within this series are present and valid - the host
  6976. * need not check each sequence number within this range to see if
  6977. * the corresponding MPDU is actually present.
  6978. * This field is only valid if the RV bit is set.
  6979. * - NUM_MPDU_RANGES
  6980. * Bits 31:24
  6981. * Purpose: Indicate how many ranges of MPDUs are present.
  6982. * Each MPDU range consists of a series of contiguous MPDUs within the
  6983. * rx frame sequence which all have the same MPDU status.
  6984. * Value: 1-63 (typically a small number, like 1-3)
  6985. *
  6986. * Rx PPDU descriptor fields:
  6987. * - RSSI_CMB
  6988. * Bits 7:0
  6989. * Purpose: Combined RSSI from all active rx chains, across the active
  6990. * bandwidth.
  6991. * Value: RSSI dB units w.r.t. noise floor
  6992. * - TIMESTAMP_SUBMICROSEC
  6993. * Bits 15:8
  6994. * Purpose: high-resolution timestamp
  6995. * Value:
  6996. * Sub-microsecond time of PPDU reception.
  6997. * This timestamp ranges from [0,MAC clock MHz).
  6998. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  6999. * to form a high-resolution, large range rx timestamp.
  7000. * - PHY_ERR_CODE
  7001. * Bits 23:16
  7002. * Purpose:
  7003. * If the rx frame processing resulted in a PHY error, indicate what
  7004. * type of rx PHY error occurred.
  7005. * Value:
  7006. * This field is valid if the "P" (PHY_ERR) flag is set.
  7007. * TBD: document/specify the values for this field
  7008. * - PHY_ERR
  7009. * Bit 24
  7010. * Purpose: indicate whether the rx PPDU had a PHY error
  7011. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  7012. * - LEGACY_RATE
  7013. * Bits 28:25
  7014. * Purpose:
  7015. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  7016. * specify which rate was used.
  7017. * Value:
  7018. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  7019. * flag.
  7020. * If LEGACY_RATE_SEL is 0:
  7021. * 0x8: OFDM 48 Mbps
  7022. * 0x9: OFDM 24 Mbps
  7023. * 0xA: OFDM 12 Mbps
  7024. * 0xB: OFDM 6 Mbps
  7025. * 0xC: OFDM 54 Mbps
  7026. * 0xD: OFDM 36 Mbps
  7027. * 0xE: OFDM 18 Mbps
  7028. * 0xF: OFDM 9 Mbps
  7029. * If LEGACY_RATE_SEL is 1:
  7030. * 0x8: CCK 11 Mbps long preamble
  7031. * 0x9: CCK 5.5 Mbps long preamble
  7032. * 0xA: CCK 2 Mbps long preamble
  7033. * 0xB: CCK 1 Mbps long preamble
  7034. * 0xC: CCK 11 Mbps short preamble
  7035. * 0xD: CCK 5.5 Mbps short preamble
  7036. * 0xE: CCK 2 Mbps short preamble
  7037. * - LEGACY_RATE_SEL
  7038. * Bit 29
  7039. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  7040. * Value:
  7041. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  7042. * used a legacy rate.
  7043. * 0 -> OFDM, 1 -> CCK
  7044. * - END_VALID
  7045. * Bit 30
  7046. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  7047. * the start of the PPDU are valid. Specifically, the following
  7048. * fields are only valid if END_VALID is set:
  7049. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  7050. * TIMESTAMP_SUBMICROSEC
  7051. * Value:
  7052. * 0 -> rx PPDU desc end fields are not valid
  7053. * 1 -> rx PPDU desc end fields are valid
  7054. * - START_VALID
  7055. * Bit 31
  7056. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  7057. * the end of the PPDU are valid. Specifically, the following
  7058. * fields are only valid if START_VALID is set:
  7059. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  7060. * VHT-SIG-A
  7061. * Value:
  7062. * 0 -> rx PPDU desc start fields are not valid
  7063. * 1 -> rx PPDU desc start fields are valid
  7064. * - RSSI0_PRI20
  7065. * Bits 7:0
  7066. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  7067. * Value: RSSI dB units w.r.t. noise floor
  7068. *
  7069. * - RSSI0_EXT20
  7070. * Bits 7:0
  7071. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  7072. * (if the rx bandwidth was >= 40 MHz)
  7073. * Value: RSSI dB units w.r.t. noise floor
  7074. * - RSSI0_EXT40
  7075. * Bits 7:0
  7076. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  7077. * (if the rx bandwidth was >= 80 MHz)
  7078. * Value: RSSI dB units w.r.t. noise floor
  7079. * - RSSI0_EXT80
  7080. * Bits 7:0
  7081. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  7082. * (if the rx bandwidth was >= 160 MHz)
  7083. * Value: RSSI dB units w.r.t. noise floor
  7084. *
  7085. * - RSSI1_PRI20
  7086. * Bits 7:0
  7087. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  7088. * Value: RSSI dB units w.r.t. noise floor
  7089. * - RSSI1_EXT20
  7090. * Bits 7:0
  7091. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  7092. * (if the rx bandwidth was >= 40 MHz)
  7093. * Value: RSSI dB units w.r.t. noise floor
  7094. * - RSSI1_EXT40
  7095. * Bits 7:0
  7096. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  7097. * (if the rx bandwidth was >= 80 MHz)
  7098. * Value: RSSI dB units w.r.t. noise floor
  7099. * - RSSI1_EXT80
  7100. * Bits 7:0
  7101. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  7102. * (if the rx bandwidth was >= 160 MHz)
  7103. * Value: RSSI dB units w.r.t. noise floor
  7104. *
  7105. * - RSSI2_PRI20
  7106. * Bits 7:0
  7107. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  7108. * Value: RSSI dB units w.r.t. noise floor
  7109. * - RSSI2_EXT20
  7110. * Bits 7:0
  7111. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  7112. * (if the rx bandwidth was >= 40 MHz)
  7113. * Value: RSSI dB units w.r.t. noise floor
  7114. * - RSSI2_EXT40
  7115. * Bits 7:0
  7116. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  7117. * (if the rx bandwidth was >= 80 MHz)
  7118. * Value: RSSI dB units w.r.t. noise floor
  7119. * - RSSI2_EXT80
  7120. * Bits 7:0
  7121. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  7122. * (if the rx bandwidth was >= 160 MHz)
  7123. * Value: RSSI dB units w.r.t. noise floor
  7124. *
  7125. * - RSSI3_PRI20
  7126. * Bits 7:0
  7127. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  7128. * Value: RSSI dB units w.r.t. noise floor
  7129. * - RSSI3_EXT20
  7130. * Bits 7:0
  7131. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  7132. * (if the rx bandwidth was >= 40 MHz)
  7133. * Value: RSSI dB units w.r.t. noise floor
  7134. * - RSSI3_EXT40
  7135. * Bits 7:0
  7136. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  7137. * (if the rx bandwidth was >= 80 MHz)
  7138. * Value: RSSI dB units w.r.t. noise floor
  7139. * - RSSI3_EXT80
  7140. * Bits 7:0
  7141. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  7142. * (if the rx bandwidth was >= 160 MHz)
  7143. * Value: RSSI dB units w.r.t. noise floor
  7144. *
  7145. * - TSF32
  7146. * Bits 31:0
  7147. * Purpose: specify the time the rx PPDU was received, in TSF units
  7148. * Value: 32 LSBs of the TSF
  7149. * - TIMESTAMP_MICROSEC
  7150. * Bits 31:0
  7151. * Purpose: specify the time the rx PPDU was received, in microsecond units
  7152. * Value: PPDU rx time, in microseconds
  7153. * - VHT_SIG_A1
  7154. * Bits 23:0
  7155. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  7156. * from the rx PPDU
  7157. * Value:
  7158. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  7159. * VHT-SIG-A1 data.
  7160. * If PREAMBLE_TYPE specifies HT, then this field contains the
  7161. * first 24 bits of the HT-SIG data.
  7162. * Otherwise, this field is invalid.
  7163. * Refer to the the 802.11 protocol for the definition of the
  7164. * HT-SIG and VHT-SIG-A1 fields
  7165. * - VHT_SIG_A2
  7166. * Bits 23:0
  7167. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  7168. * from the rx PPDU
  7169. * Value:
  7170. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  7171. * VHT-SIG-A2 data.
  7172. * If PREAMBLE_TYPE specifies HT, then this field contains the
  7173. * last 24 bits of the HT-SIG data.
  7174. * Otherwise, this field is invalid.
  7175. * Refer to the the 802.11 protocol for the definition of the
  7176. * HT-SIG and VHT-SIG-A2 fields
  7177. * - PREAMBLE_TYPE
  7178. * Bits 31:24
  7179. * Purpose: indicate the PHY format of the received burst
  7180. * Value:
  7181. * 0x4: Legacy (OFDM/CCK)
  7182. * 0x8: HT
  7183. * 0x9: HT with TxBF
  7184. * 0xC: VHT
  7185. * 0xD: VHT with TxBF
  7186. * - SERVICE
  7187. * Bits 31:24
  7188. * Purpose: TBD
  7189. * Value: TBD
  7190. *
  7191. * Rx MSDU descriptor fields:
  7192. * - FW_RX_DESC_BYTES
  7193. * Bits 15:0
  7194. * Purpose: Indicate how many bytes in the Rx indication are used for
  7195. * FW Rx descriptors
  7196. *
  7197. * Payload fields:
  7198. * - MPDU_COUNT
  7199. * Bits 7:0
  7200. * Purpose: Indicate how many sequential MPDUs share the same status.
  7201. * All MPDUs within the indicated list are from the same RA-TA-TID.
  7202. * - MPDU_STATUS
  7203. * Bits 15:8
  7204. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  7205. * received successfully.
  7206. * Value:
  7207. * 0x1: success
  7208. * 0x2: FCS error
  7209. * 0x3: duplicate error
  7210. * 0x4: replay error
  7211. * 0x5: invalid peer
  7212. */
  7213. /* header fields */
  7214. #define HTT_RX_IND_EXT_TID_M 0x1f00
  7215. #define HTT_RX_IND_EXT_TID_S 8
  7216. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  7217. #define HTT_RX_IND_FLUSH_VALID_S 13
  7218. #define HTT_RX_IND_REL_VALID_M 0x4000
  7219. #define HTT_RX_IND_REL_VALID_S 14
  7220. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  7221. #define HTT_RX_IND_PEER_ID_S 16
  7222. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  7223. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  7224. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  7225. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  7226. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  7227. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  7228. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  7229. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  7230. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  7231. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  7232. /* rx PPDU descriptor fields */
  7233. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  7234. #define HTT_RX_IND_RSSI_CMB_S 0
  7235. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  7236. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  7237. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  7238. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  7239. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  7240. #define HTT_RX_IND_PHY_ERR_S 24
  7241. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  7242. #define HTT_RX_IND_LEGACY_RATE_S 25
  7243. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  7244. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  7245. #define HTT_RX_IND_END_VALID_M 0x40000000
  7246. #define HTT_RX_IND_END_VALID_S 30
  7247. #define HTT_RX_IND_START_VALID_M 0x80000000
  7248. #define HTT_RX_IND_START_VALID_S 31
  7249. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  7250. #define HTT_RX_IND_RSSI_PRI20_S 0
  7251. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  7252. #define HTT_RX_IND_RSSI_EXT20_S 8
  7253. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  7254. #define HTT_RX_IND_RSSI_EXT40_S 16
  7255. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  7256. #define HTT_RX_IND_RSSI_EXT80_S 24
  7257. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  7258. #define HTT_RX_IND_VHT_SIG_A1_S 0
  7259. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  7260. #define HTT_RX_IND_VHT_SIG_A2_S 0
  7261. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  7262. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  7263. #define HTT_RX_IND_SERVICE_M 0xff000000
  7264. #define HTT_RX_IND_SERVICE_S 24
  7265. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  7266. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  7267. /* rx MSDU descriptor fields */
  7268. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  7269. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  7270. /* payload fields */
  7271. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  7272. #define HTT_RX_IND_MPDU_COUNT_S 0
  7273. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  7274. #define HTT_RX_IND_MPDU_STATUS_S 8
  7275. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  7276. do { \
  7277. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  7278. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  7279. } while (0)
  7280. #define HTT_RX_IND_EXT_TID_GET(word) \
  7281. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  7282. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  7283. do { \
  7284. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  7285. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  7286. } while (0)
  7287. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  7288. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  7289. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  7290. do { \
  7291. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  7292. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  7293. } while (0)
  7294. #define HTT_RX_IND_REL_VALID_GET(word) \
  7295. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  7296. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  7297. do { \
  7298. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  7299. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  7300. } while (0)
  7301. #define HTT_RX_IND_PEER_ID_GET(word) \
  7302. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  7303. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  7304. do { \
  7305. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  7306. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  7307. } while (0)
  7308. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  7309. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  7310. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  7311. do { \
  7312. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  7313. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  7314. } while (0)
  7315. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  7316. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  7317. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  7318. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  7319. do { \
  7320. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  7321. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  7322. } while (0)
  7323. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  7324. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  7325. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  7326. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  7327. do { \
  7328. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  7329. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  7330. } while (0)
  7331. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  7332. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  7333. HTT_RX_IND_REL_SEQ_NUM_START_S)
  7334. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  7335. do { \
  7336. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  7337. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  7338. } while (0)
  7339. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  7340. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  7341. HTT_RX_IND_REL_SEQ_NUM_END_S)
  7342. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  7343. do { \
  7344. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  7345. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  7346. } while (0)
  7347. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  7348. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  7349. HTT_RX_IND_NUM_MPDU_RANGES_S)
  7350. /* FW rx PPDU descriptor fields */
  7351. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  7352. do { \
  7353. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  7354. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  7355. } while (0)
  7356. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  7357. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  7358. HTT_RX_IND_RSSI_CMB_S)
  7359. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  7360. do { \
  7361. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  7362. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  7363. } while (0)
  7364. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  7365. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  7366. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  7367. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  7368. do { \
  7369. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  7370. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  7371. } while (0)
  7372. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  7373. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  7374. HTT_RX_IND_PHY_ERR_CODE_S)
  7375. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  7376. do { \
  7377. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  7378. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  7379. } while (0)
  7380. #define HTT_RX_IND_PHY_ERR_GET(word) \
  7381. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  7382. HTT_RX_IND_PHY_ERR_S)
  7383. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  7384. do { \
  7385. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  7386. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  7387. } while (0)
  7388. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  7389. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  7390. HTT_RX_IND_LEGACY_RATE_S)
  7391. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  7392. do { \
  7393. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  7394. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  7395. } while (0)
  7396. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  7397. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  7398. HTT_RX_IND_LEGACY_RATE_SEL_S)
  7399. #define HTT_RX_IND_END_VALID_SET(word, value) \
  7400. do { \
  7401. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  7402. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  7403. } while (0)
  7404. #define HTT_RX_IND_END_VALID_GET(word) \
  7405. (((word) & HTT_RX_IND_END_VALID_M) >> \
  7406. HTT_RX_IND_END_VALID_S)
  7407. #define HTT_RX_IND_START_VALID_SET(word, value) \
  7408. do { \
  7409. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  7410. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  7411. } while (0)
  7412. #define HTT_RX_IND_START_VALID_GET(word) \
  7413. (((word) & HTT_RX_IND_START_VALID_M) >> \
  7414. HTT_RX_IND_START_VALID_S)
  7415. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  7416. do { \
  7417. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  7418. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  7419. } while (0)
  7420. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  7421. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  7422. HTT_RX_IND_RSSI_PRI20_S)
  7423. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  7424. do { \
  7425. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  7426. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  7427. } while (0)
  7428. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  7429. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  7430. HTT_RX_IND_RSSI_EXT20_S)
  7431. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  7432. do { \
  7433. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  7434. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  7435. } while (0)
  7436. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  7437. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  7438. HTT_RX_IND_RSSI_EXT40_S)
  7439. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  7440. do { \
  7441. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  7442. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  7443. } while (0)
  7444. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  7445. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  7446. HTT_RX_IND_RSSI_EXT80_S)
  7447. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  7448. do { \
  7449. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  7450. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  7451. } while (0)
  7452. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  7453. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  7454. HTT_RX_IND_VHT_SIG_A1_S)
  7455. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  7456. do { \
  7457. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  7458. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  7459. } while (0)
  7460. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  7461. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  7462. HTT_RX_IND_VHT_SIG_A2_S)
  7463. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  7464. do { \
  7465. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  7466. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  7467. } while (0)
  7468. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  7469. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  7470. HTT_RX_IND_PREAMBLE_TYPE_S)
  7471. #define HTT_RX_IND_SERVICE_SET(word, value) \
  7472. do { \
  7473. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  7474. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  7475. } while (0)
  7476. #define HTT_RX_IND_SERVICE_GET(word) \
  7477. (((word) & HTT_RX_IND_SERVICE_M) >> \
  7478. HTT_RX_IND_SERVICE_S)
  7479. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  7480. do { \
  7481. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  7482. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  7483. } while (0)
  7484. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  7485. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  7486. HTT_RX_IND_SA_ANT_MATRIX_S)
  7487. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  7488. do { \
  7489. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  7490. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  7491. } while (0)
  7492. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  7493. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  7494. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  7495. do { \
  7496. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  7497. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  7498. } while (0)
  7499. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  7500. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  7501. #define HTT_RX_IND_HL_BYTES \
  7502. (HTT_RX_IND_HDR_BYTES + \
  7503. 4 /* single FW rx MSDU descriptor */ + \
  7504. 4 /* single MPDU range information element */)
  7505. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  7506. /* Could we use one macro entry? */
  7507. #define HTT_WORD_SET(word, field, value) \
  7508. do { \
  7509. HTT_CHECK_SET_VAL(field, value); \
  7510. (word) |= ((value) << field ## _S); \
  7511. } while (0)
  7512. #define HTT_WORD_GET(word, field) \
  7513. (((word) & field ## _M) >> field ## _S)
  7514. PREPACK struct hl_htt_rx_ind_base {
  7515. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  7516. } POSTPACK;
  7517. /*
  7518. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  7519. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  7520. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  7521. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  7522. * htt_rx_ind_hl_rx_desc_t.
  7523. */
  7524. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  7525. struct htt_rx_ind_hl_rx_desc_t {
  7526. A_UINT8 ver;
  7527. A_UINT8 len;
  7528. struct {
  7529. A_UINT8
  7530. first_msdu: 1,
  7531. last_msdu: 1,
  7532. c3_failed: 1,
  7533. c4_failed: 1,
  7534. ipv6: 1,
  7535. tcp: 1,
  7536. udp: 1,
  7537. reserved: 1;
  7538. } flags;
  7539. /* NOTE: no reserved space - don't append any new fields here */
  7540. };
  7541. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  7542. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7543. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  7544. #define HTT_RX_IND_HL_RX_DESC_VER 0
  7545. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  7546. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7547. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  7548. #define HTT_RX_IND_HL_FLAG_OFFSET \
  7549. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7550. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  7551. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  7552. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  7553. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  7554. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  7555. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  7556. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  7557. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  7558. /* This structure is used in HL, the basic descriptor information
  7559. * used by host. the structure is translated by FW from HW desc
  7560. * or generated by FW. But in HL monitor mode, the host would use
  7561. * the same structure with LL.
  7562. */
  7563. PREPACK struct hl_htt_rx_desc_base {
  7564. A_UINT32
  7565. seq_num:12,
  7566. encrypted:1,
  7567. chan_info_present:1,
  7568. resv0:2,
  7569. mcast_bcast:1,
  7570. fragment:1,
  7571. key_id_oct:8,
  7572. resv1:6;
  7573. A_UINT32
  7574. pn_31_0;
  7575. union {
  7576. struct {
  7577. A_UINT16 pn_47_32;
  7578. A_UINT16 pn_63_48;
  7579. } pn16;
  7580. A_UINT32 pn_63_32;
  7581. } u0;
  7582. A_UINT32
  7583. pn_95_64;
  7584. A_UINT32
  7585. pn_127_96;
  7586. } POSTPACK;
  7587. /*
  7588. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  7589. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  7590. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  7591. * Please see htt_chan_change_t for description of the fields.
  7592. */
  7593. PREPACK struct htt_chan_info_t
  7594. {
  7595. A_UINT32 primary_chan_center_freq_mhz: 16,
  7596. contig_chan1_center_freq_mhz: 16;
  7597. A_UINT32 contig_chan2_center_freq_mhz: 16,
  7598. phy_mode: 8,
  7599. reserved: 8;
  7600. } POSTPACK;
  7601. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  7602. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  7603. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  7604. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  7605. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  7606. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  7607. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  7608. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  7609. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  7610. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  7611. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  7612. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  7613. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  7614. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  7615. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  7616. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  7617. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  7618. /* Channel information */
  7619. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  7620. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  7621. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  7622. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  7623. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  7624. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  7625. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  7626. #define HTT_CHAN_INFO_PHY_MODE_S 16
  7627. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  7628. do { \
  7629. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  7630. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  7631. } while (0)
  7632. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  7633. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  7634. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  7635. do { \
  7636. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  7637. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  7638. } while (0)
  7639. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  7640. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  7641. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  7642. do { \
  7643. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  7644. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  7645. } while (0)
  7646. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  7647. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  7648. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  7649. do { \
  7650. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  7651. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  7652. } while (0)
  7653. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  7654. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  7655. /*
  7656. * @brief target -> host message definition for FW offloaded pkts
  7657. *
  7658. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  7659. *
  7660. * @details
  7661. * The following field definitions describe the format of the firmware
  7662. * offload deliver message sent from the target to the host.
  7663. *
  7664. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  7665. *
  7666. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  7667. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  7668. * | reserved_1 | msg type |
  7669. * |--------------------------------------------------------------------------|
  7670. * | phy_timestamp_l32 |
  7671. * |--------------------------------------------------------------------------|
  7672. * | WORD2 (see below) |
  7673. * |--------------------------------------------------------------------------|
  7674. * | seqno | framectrl |
  7675. * |--------------------------------------------------------------------------|
  7676. * | reserved_3 | vdev_id | tid_num|
  7677. * |--------------------------------------------------------------------------|
  7678. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  7679. * |--------------------------------------------------------------------------|
  7680. *
  7681. * where:
  7682. * STAT = status
  7683. * F = format (802.3 vs. 802.11)
  7684. *
  7685. * definition for word 2
  7686. *
  7687. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  7688. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  7689. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  7690. * |--------------------------------------------------------------------------|
  7691. *
  7692. * where:
  7693. * PR = preamble
  7694. * BF = beamformed
  7695. */
  7696. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  7697. {
  7698. A_UINT32 /* word 0 */
  7699. msg_type:8, /* [ 7: 0] */
  7700. reserved_1:24; /* [31: 8] */
  7701. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  7702. A_UINT32 /* word 2 */
  7703. /* preamble:
  7704. * 0-OFDM,
  7705. * 1-CCk,
  7706. * 2-HT,
  7707. * 3-VHT
  7708. */
  7709. preamble: 2, /* [1:0] */
  7710. /* mcs:
  7711. * In case of HT preamble interpret
  7712. * MCS along with NSS.
  7713. * Valid values for HT are 0 to 7.
  7714. * HT mcs 0 with NSS 2 is mcs 8.
  7715. * Valid values for VHT are 0 to 9.
  7716. */
  7717. mcs: 4, /* [5:2] */
  7718. /* rate:
  7719. * This is applicable only for
  7720. * CCK and OFDM preamble type
  7721. * rate 0: OFDM 48 Mbps,
  7722. * 1: OFDM 24 Mbps,
  7723. * 2: OFDM 12 Mbps
  7724. * 3: OFDM 6 Mbps
  7725. * 4: OFDM 54 Mbps
  7726. * 5: OFDM 36 Mbps
  7727. * 6: OFDM 18 Mbps
  7728. * 7: OFDM 9 Mbps
  7729. * rate 0: CCK 11 Mbps Long
  7730. * 1: CCK 5.5 Mbps Long
  7731. * 2: CCK 2 Mbps Long
  7732. * 3: CCK 1 Mbps Long
  7733. * 4: CCK 11 Mbps Short
  7734. * 5: CCK 5.5 Mbps Short
  7735. * 6: CCK 2 Mbps Short
  7736. */
  7737. rate : 3, /* [ 8: 6] */
  7738. rssi : 8, /* [16: 9] units=dBm */
  7739. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  7740. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  7741. stbc : 1, /* [22] */
  7742. sgi : 1, /* [23] */
  7743. ldpc : 1, /* [24] */
  7744. beamformed: 1, /* [25] */
  7745. reserved_2: 6; /* [31:26] */
  7746. A_UINT32 /* word 3 */
  7747. framectrl:16, /* [15: 0] */
  7748. seqno:16; /* [31:16] */
  7749. A_UINT32 /* word 4 */
  7750. tid_num:5, /* [ 4: 0] actual TID number */
  7751. vdev_id:8, /* [12: 5] */
  7752. reserved_3:19; /* [31:13] */
  7753. A_UINT32 /* word 5 */
  7754. /* status:
  7755. * 0: tx_ok
  7756. * 1: retry
  7757. * 2: drop
  7758. * 3: filtered
  7759. * 4: abort
  7760. * 5: tid delete
  7761. * 6: sw abort
  7762. * 7: dropped by peer migration
  7763. */
  7764. status:3, /* [2:0] */
  7765. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  7766. tx_mpdu_bytes:16, /* [19:4] */
  7767. /* Indicates retry count of offloaded/local generated Data tx frames */
  7768. tx_retry_cnt:6, /* [25:20] */
  7769. reserved_4:6; /* [31:26] */
  7770. } POSTPACK;
  7771. /* FW offload deliver ind message header fields */
  7772. /* DWORD one */
  7773. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  7774. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  7775. /* DWORD two */
  7776. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  7777. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  7778. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  7779. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  7780. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  7781. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  7782. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  7783. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  7784. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  7785. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  7786. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  7787. #define HTT_FW_OFFLOAD_IND_BW_S 19
  7788. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  7789. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  7790. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  7791. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  7792. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  7793. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  7794. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  7795. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  7796. /* DWORD three*/
  7797. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  7798. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  7799. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  7800. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  7801. /* DWORD four */
  7802. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  7803. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  7804. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  7805. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  7806. /* DWORD five */
  7807. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  7808. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  7809. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  7810. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  7811. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  7812. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  7813. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  7814. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  7815. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  7816. do { \
  7817. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  7818. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  7819. } while (0)
  7820. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  7821. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  7822. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  7823. do { \
  7824. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  7825. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  7826. } while (0)
  7827. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  7828. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  7829. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  7830. do { \
  7831. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  7832. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  7833. } while (0)
  7834. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  7835. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  7836. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  7837. do { \
  7838. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  7839. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  7840. } while (0)
  7841. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  7842. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  7843. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  7844. do { \
  7845. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  7846. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  7847. } while (0)
  7848. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  7849. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  7850. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  7851. do { \
  7852. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  7853. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  7854. } while (0)
  7855. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  7856. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  7857. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  7858. do { \
  7859. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  7860. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  7861. } while (0)
  7862. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  7863. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  7864. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  7865. do { \
  7866. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  7867. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  7868. } while (0)
  7869. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  7870. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  7871. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  7872. do { \
  7873. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  7874. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  7875. } while (0)
  7876. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  7877. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  7878. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  7879. do { \
  7880. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  7881. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  7882. } while (0)
  7883. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  7884. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  7885. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  7886. do { \
  7887. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  7888. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  7889. } while (0)
  7890. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  7891. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  7892. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  7893. do { \
  7894. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  7895. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  7896. } while (0)
  7897. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  7898. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  7899. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  7900. do { \
  7901. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  7902. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  7903. } while (0)
  7904. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  7905. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  7906. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  7907. do { \
  7908. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  7909. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  7910. } while (0)
  7911. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  7912. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  7913. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  7914. do { \
  7915. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  7916. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  7917. } while (0)
  7918. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  7919. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  7920. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  7921. do { \
  7922. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  7923. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  7924. } while (0)
  7925. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  7926. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  7927. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  7928. do { \
  7929. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  7930. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  7931. } while (0)
  7932. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  7933. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  7934. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  7935. do { \
  7936. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  7937. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  7938. } while (0)
  7939. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  7940. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  7941. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  7942. do { \
  7943. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  7944. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  7945. } while (0)
  7946. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  7947. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  7948. /*
  7949. * @brief target -> host rx reorder flush message definition
  7950. *
  7951. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  7952. *
  7953. * @details
  7954. * The following field definitions describe the format of the rx flush
  7955. * message sent from the target to the host.
  7956. * The message consists of a 4-octet header, followed by one or more
  7957. * 4-octet payload information elements.
  7958. *
  7959. * |31 24|23 8|7 0|
  7960. * |--------------------------------------------------------------|
  7961. * | TID | peer ID | msg type |
  7962. * |--------------------------------------------------------------|
  7963. * | seq num end | seq num start | MPDU status | reserved |
  7964. * |--------------------------------------------------------------|
  7965. * First DWORD:
  7966. * - MSG_TYPE
  7967. * Bits 7:0
  7968. * Purpose: identifies this as an rx flush message
  7969. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  7970. * - PEER_ID
  7971. * Bits 23:8 (only bits 18:8 actually used)
  7972. * Purpose: identify which peer's rx data is being flushed
  7973. * Value: (rx) peer ID
  7974. * - TID
  7975. * Bits 31:24 (only bits 27:24 actually used)
  7976. * Purpose: Specifies which traffic identifier's rx data is being flushed
  7977. * Value: traffic identifier
  7978. * Second DWORD:
  7979. * - MPDU_STATUS
  7980. * Bits 15:8
  7981. * Purpose:
  7982. * Indicate whether the flushed MPDUs should be discarded or processed.
  7983. * Value:
  7984. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  7985. * stages of rx processing
  7986. * other: discard the MPDUs
  7987. * It is anticipated that flush messages will always have
  7988. * MPDU status == 1, but the status flag is included for
  7989. * flexibility.
  7990. * - SEQ_NUM_START
  7991. * Bits 23:16
  7992. * Purpose:
  7993. * Indicate the start of a series of consecutive MPDUs being flushed.
  7994. * Not all MPDUs within this range are necessarily valid - the host
  7995. * must check each sequence number within this range to see if the
  7996. * corresponding MPDU is actually present.
  7997. * Value:
  7998. * The sequence number for the first MPDU in the sequence.
  7999. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  8000. * - SEQ_NUM_END
  8001. * Bits 30:24
  8002. * Purpose:
  8003. * Indicate the end of a series of consecutive MPDUs being flushed.
  8004. * Value:
  8005. * The sequence number one larger than the sequence number of the
  8006. * last MPDU being flushed.
  8007. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  8008. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  8009. * are to be released for further rx processing.
  8010. * Not all MPDUs within this range are necessarily valid - the host
  8011. * must check each sequence number within this range to see if the
  8012. * corresponding MPDU is actually present.
  8013. */
  8014. /* first DWORD */
  8015. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  8016. #define HTT_RX_FLUSH_PEER_ID_S 8
  8017. #define HTT_RX_FLUSH_TID_M 0xff000000
  8018. #define HTT_RX_FLUSH_TID_S 24
  8019. /* second DWORD */
  8020. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  8021. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  8022. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  8023. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  8024. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  8025. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  8026. #define HTT_RX_FLUSH_BYTES 8
  8027. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  8028. do { \
  8029. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  8030. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  8031. } while (0)
  8032. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  8033. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  8034. #define HTT_RX_FLUSH_TID_SET(word, value) \
  8035. do { \
  8036. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  8037. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  8038. } while (0)
  8039. #define HTT_RX_FLUSH_TID_GET(word) \
  8040. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  8041. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  8042. do { \
  8043. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  8044. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  8045. } while (0)
  8046. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  8047. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  8048. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  8049. do { \
  8050. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  8051. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  8052. } while (0)
  8053. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  8054. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  8055. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  8056. do { \
  8057. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  8058. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  8059. } while (0)
  8060. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  8061. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  8062. /*
  8063. * @brief target -> host rx pn check indication message
  8064. *
  8065. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  8066. *
  8067. * @details
  8068. * The following field definitions describe the format of the Rx PN check
  8069. * indication message sent from the target to the host.
  8070. * The message consists of a 4-octet header, followed by the start and
  8071. * end sequence numbers to be released, followed by the PN IEs. Each PN
  8072. * IE is one octet containing the sequence number that failed the PN
  8073. * check.
  8074. *
  8075. * |31 24|23 8|7 0|
  8076. * |--------------------------------------------------------------|
  8077. * | TID | peer ID | msg type |
  8078. * |--------------------------------------------------------------|
  8079. * | Reserved | PN IE count | seq num end | seq num start|
  8080. * |--------------------------------------------------------------|
  8081. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  8082. * |--------------------------------------------------------------|
  8083. * First DWORD:
  8084. * - MSG_TYPE
  8085. * Bits 7:0
  8086. * Purpose: Identifies this as an rx pn check indication message
  8087. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  8088. * - PEER_ID
  8089. * Bits 23:8 (only bits 18:8 actually used)
  8090. * Purpose: identify which peer
  8091. * Value: (rx) peer ID
  8092. * - TID
  8093. * Bits 31:24 (only bits 27:24 actually used)
  8094. * Purpose: identify traffic identifier
  8095. * Value: traffic identifier
  8096. * Second DWORD:
  8097. * - SEQ_NUM_START
  8098. * Bits 7:0
  8099. * Purpose:
  8100. * Indicates the starting sequence number of the MPDU in this
  8101. * series of MPDUs that went though PN check.
  8102. * Value:
  8103. * The sequence number for the first MPDU in the sequence.
  8104. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  8105. * - SEQ_NUM_END
  8106. * Bits 15:8
  8107. * Purpose:
  8108. * Indicates the ending sequence number of the MPDU in this
  8109. * series of MPDUs that went though PN check.
  8110. * Value:
  8111. * The sequence number one larger then the sequence number of the last
  8112. * MPDU being flushed.
  8113. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  8114. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  8115. * for invalid PN numbers and are ready to be released for further processing.
  8116. * Not all MPDUs within this range are necessarily valid - the host
  8117. * must check each sequence number within this range to see if the
  8118. * corresponding MPDU is actually present.
  8119. * - PN_IE_COUNT
  8120. * Bits 23:16
  8121. * Purpose:
  8122. * Used to determine the variable number of PN information elements in this
  8123. * message
  8124. *
  8125. * PN information elements:
  8126. * - PN_IE_x-
  8127. * Purpose:
  8128. * Each PN information element contains the sequence number of the MPDU that
  8129. * has failed the target PN check.
  8130. * Value:
  8131. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  8132. * that failed the PN check.
  8133. */
  8134. /* first DWORD */
  8135. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  8136. #define HTT_RX_PN_IND_PEER_ID_S 8
  8137. #define HTT_RX_PN_IND_TID_M 0xff000000
  8138. #define HTT_RX_PN_IND_TID_S 24
  8139. /* second DWORD */
  8140. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  8141. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  8142. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  8143. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  8144. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  8145. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  8146. #define HTT_RX_PN_IND_BYTES 8
  8147. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  8148. do { \
  8149. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  8150. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  8151. } while (0)
  8152. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  8153. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  8154. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  8155. do { \
  8156. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  8157. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  8158. } while (0)
  8159. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  8160. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  8161. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  8162. do { \
  8163. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  8164. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  8165. } while (0)
  8166. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  8167. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  8168. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  8169. do { \
  8170. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  8171. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  8172. } while (0)
  8173. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  8174. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  8175. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  8176. do { \
  8177. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  8178. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  8179. } while (0)
  8180. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  8181. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  8182. /*
  8183. * @brief target -> host rx offload deliver message for LL system
  8184. *
  8185. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  8186. *
  8187. * @details
  8188. * In a low latency system this message is sent whenever the offload
  8189. * manager flushes out the packets it has coalesced in its coalescing buffer.
  8190. * The DMA of the actual packets into host memory is done before sending out
  8191. * this message. This message indicates only how many MSDUs to reap. The
  8192. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  8193. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  8194. * DMA'd by the MAC directly into host memory these packets do not contain
  8195. * the MAC descriptors in the header portion of the packet. Instead they contain
  8196. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  8197. * message, the packets are delivered directly to the NW stack without going
  8198. * through the regular reorder buffering and PN checking path since it has
  8199. * already been done in target.
  8200. *
  8201. * |31 24|23 16|15 8|7 0|
  8202. * |-----------------------------------------------------------------------|
  8203. * | Total MSDU count | reserved | msg type |
  8204. * |-----------------------------------------------------------------------|
  8205. *
  8206. * @brief target -> host rx offload deliver message for HL system
  8207. *
  8208. * @details
  8209. * In a high latency system this message is sent whenever the offload manager
  8210. * flushes out the packets it has coalesced in its coalescing buffer. The
  8211. * actual packets are also carried along with this message. When the host
  8212. * receives this message, it is expected to deliver these packets to the NW
  8213. * stack directly instead of routing them through the reorder buffering and
  8214. * PN checking path since it has already been done in target.
  8215. *
  8216. * |31 24|23 16|15 8|7 0|
  8217. * |-----------------------------------------------------------------------|
  8218. * | Total MSDU count | reserved | msg type |
  8219. * |-----------------------------------------------------------------------|
  8220. * | peer ID | MSDU length |
  8221. * |-----------------------------------------------------------------------|
  8222. * | MSDU payload | FW Desc | tid | vdev ID |
  8223. * |-----------------------------------------------------------------------|
  8224. * | MSDU payload contd. |
  8225. * |-----------------------------------------------------------------------|
  8226. * | peer ID | MSDU length |
  8227. * |-----------------------------------------------------------------------|
  8228. * | MSDU payload | FW Desc | tid | vdev ID |
  8229. * |-----------------------------------------------------------------------|
  8230. * | MSDU payload contd. |
  8231. * |-----------------------------------------------------------------------|
  8232. *
  8233. */
  8234. /* first DWORD */
  8235. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  8236. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  8237. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  8238. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  8239. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  8240. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  8241. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  8242. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  8243. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  8244. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  8245. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  8246. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  8247. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  8248. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  8249. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  8250. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  8251. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  8252. do { \
  8253. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  8254. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  8255. } while (0)
  8256. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  8257. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  8258. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  8259. do { \
  8260. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  8261. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  8262. } while (0)
  8263. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  8264. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  8265. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  8266. do { \
  8267. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  8268. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  8269. } while (0)
  8270. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  8271. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  8272. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  8273. do { \
  8274. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  8275. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  8276. } while (0)
  8277. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  8278. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  8279. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  8280. do { \
  8281. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  8282. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  8283. } while (0)
  8284. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  8285. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  8286. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  8287. do { \
  8288. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  8289. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  8290. } while (0)
  8291. /**
  8292. * @brief target -> host rx peer map/unmap message definition
  8293. *
  8294. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  8295. *
  8296. * @details
  8297. * The following diagram shows the format of the rx peer map message sent
  8298. * from the target to the host. This layout assumes the target operates
  8299. * as little-endian.
  8300. *
  8301. * This message always contains a SW peer ID. The main purpose of the
  8302. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  8303. * with, so that the host can use that peer ID to determine which peer
  8304. * transmitted the rx frame. This SW peer ID is sometimes also used for
  8305. * other purposes, such as identifying during tx completions which peer
  8306. * the tx frames in question were transmitted to.
  8307. *
  8308. * In certain generations of chips, the peer map message also contains
  8309. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  8310. * to identify which peer the frame needs to be forwarded to (i.e. the
  8311. * peer assocated with the Destination MAC Address within the packet),
  8312. * and particularly which vdev needs to transmit the frame (for cases
  8313. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  8314. * meaning as AST_INDEX_0.
  8315. * This DA-based peer ID that is provided for certain rx frames
  8316. * (the rx frames that need to be re-transmitted as tx frames)
  8317. * is the ID that the HW uses for referring to the peer in question,
  8318. * rather than the peer ID that the SW+FW use to refer to the peer.
  8319. *
  8320. *
  8321. * |31 24|23 16|15 8|7 0|
  8322. * |-----------------------------------------------------------------------|
  8323. * | SW peer ID | VDEV ID | msg type |
  8324. * |-----------------------------------------------------------------------|
  8325. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8326. * |-----------------------------------------------------------------------|
  8327. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  8328. * |-----------------------------------------------------------------------|
  8329. *
  8330. *
  8331. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  8332. *
  8333. * The following diagram shows the format of the rx peer unmap message sent
  8334. * from the target to the host.
  8335. *
  8336. * |31 24|23 16|15 8|7 0|
  8337. * |-----------------------------------------------------------------------|
  8338. * | SW peer ID | VDEV ID | msg type |
  8339. * |-----------------------------------------------------------------------|
  8340. *
  8341. * The following field definitions describe the format of the rx peer map
  8342. * and peer unmap messages sent from the target to the host.
  8343. * - MSG_TYPE
  8344. * Bits 7:0
  8345. * Purpose: identifies this as an rx peer map or peer unmap message
  8346. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  8347. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  8348. * - VDEV_ID
  8349. * Bits 15:8
  8350. * Purpose: Indicates which virtual device the peer is associated
  8351. * with.
  8352. * Value: vdev ID (used in the host to look up the vdev object)
  8353. * - PEER_ID (a.k.a. SW_PEER_ID)
  8354. * Bits 31:16
  8355. * Purpose: The peer ID (index) that WAL is allocating (map) or
  8356. * freeing (unmap)
  8357. * Value: (rx) peer ID
  8358. * - MAC_ADDR_L32 (peer map only)
  8359. * Bits 31:0
  8360. * Purpose: Identifies which peer node the peer ID is for.
  8361. * Value: lower 4 bytes of peer node's MAC address
  8362. * - MAC_ADDR_U16 (peer map only)
  8363. * Bits 15:0
  8364. * Purpose: Identifies which peer node the peer ID is for.
  8365. * Value: upper 2 bytes of peer node's MAC address
  8366. * - HW_PEER_ID
  8367. * Bits 31:16
  8368. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  8369. * address, so for rx frames marked for rx --> tx forwarding, the
  8370. * host can determine from the HW peer ID provided as meta-data with
  8371. * the rx frame which peer the frame is supposed to be forwarded to.
  8372. * Value: ID used by the MAC HW to identify the peer
  8373. */
  8374. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  8375. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  8376. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  8377. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  8378. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  8379. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  8380. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  8381. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  8382. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  8383. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  8384. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  8385. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  8386. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  8387. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  8388. do { \
  8389. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  8390. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  8391. } while (0)
  8392. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  8393. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  8394. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  8395. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  8396. do { \
  8397. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  8398. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  8399. } while (0)
  8400. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  8401. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  8402. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  8403. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  8404. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  8405. do { \
  8406. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  8407. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  8408. } while (0)
  8409. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  8410. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  8411. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  8412. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  8413. #define HTT_RX_PEER_MAP_BYTES 12
  8414. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  8415. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  8416. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  8417. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  8418. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  8419. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  8420. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  8421. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  8422. #define HTT_RX_PEER_UNMAP_BYTES 4
  8423. /**
  8424. * @brief target -> host rx peer map V2 message definition
  8425. *
  8426. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  8427. *
  8428. * @details
  8429. * The following diagram shows the format of the rx peer map v2 message sent
  8430. * from the target to the host. This layout assumes the target operates
  8431. * as little-endian.
  8432. *
  8433. * This message always contains a SW peer ID. The main purpose of the
  8434. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  8435. * with, so that the host can use that peer ID to determine which peer
  8436. * transmitted the rx frame. This SW peer ID is sometimes also used for
  8437. * other purposes, such as identifying during tx completions which peer
  8438. * the tx frames in question were transmitted to.
  8439. *
  8440. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  8441. * is used during rx --> tx frame forwarding to identify which peer the
  8442. * frame needs to be forwarded to (i.e. the peer assocated with the
  8443. * Destination MAC Address within the packet), and particularly which vdev
  8444. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  8445. * This DA-based peer ID that is provided for certain rx frames
  8446. * (the rx frames that need to be re-transmitted as tx frames)
  8447. * is the ID that the HW uses for referring to the peer in question,
  8448. * rather than the peer ID that the SW+FW use to refer to the peer.
  8449. *
  8450. * The HW peer id here is the same meaning as AST_INDEX_0.
  8451. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  8452. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  8453. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  8454. * AST is valid.
  8455. *
  8456. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  8457. * |-------------------------------------------------------------------------|
  8458. * | SW peer ID | VDEV ID | msg type |
  8459. * |-------------------------------------------------------------------------|
  8460. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8461. * |-------------------------------------------------------------------------|
  8462. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  8463. * |-------------------------------------------------------------------------|
  8464. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  8465. * |-------------------------------------------------------------------------|
  8466. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  8467. * |-------------------------------------------------------------------------|
  8468. * |TID valid low pri| TID valid hi pri | AST index 2 |
  8469. * |-------------------------------------------------------------------------|
  8470. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  8471. * |-------------------------------------------------------------------------|
  8472. * | Reserved_2 |
  8473. * |-------------------------------------------------------------------------|
  8474. * Where:
  8475. * NH = Next Hop
  8476. * ASTVM = AST valid mask
  8477. * OA = on-chip AST valid bit
  8478. * ASTFM = AST flow mask
  8479. *
  8480. * The following field definitions describe the format of the rx peer map v2
  8481. * messages sent from the target to the host.
  8482. * - MSG_TYPE
  8483. * Bits 7:0
  8484. * Purpose: identifies this as an rx peer map v2 message
  8485. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  8486. * - VDEV_ID
  8487. * Bits 15:8
  8488. * Purpose: Indicates which virtual device the peer is associated with.
  8489. * Value: vdev ID (used in the host to look up the vdev object)
  8490. * - SW_PEER_ID
  8491. * Bits 31:16
  8492. * Purpose: The peer ID (index) that WAL is allocating
  8493. * Value: (rx) peer ID
  8494. * - MAC_ADDR_L32
  8495. * Bits 31:0
  8496. * Purpose: Identifies which peer node the peer ID is for.
  8497. * Value: lower 4 bytes of peer node's MAC address
  8498. * - MAC_ADDR_U16
  8499. * Bits 15:0
  8500. * Purpose: Identifies which peer node the peer ID is for.
  8501. * Value: upper 2 bytes of peer node's MAC address
  8502. * - HW_PEER_ID / AST_INDEX_0
  8503. * Bits 31:16
  8504. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  8505. * address, so for rx frames marked for rx --> tx forwarding, the
  8506. * host can determine from the HW peer ID provided as meta-data with
  8507. * the rx frame which peer the frame is supposed to be forwarded to.
  8508. * Value: ID used by the MAC HW to identify the peer
  8509. * - AST_HASH_VALUE
  8510. * Bits 15:0
  8511. * Purpose: Indicates AST Hash value is required for the TCL AST index
  8512. * override feature.
  8513. * - NEXT_HOP
  8514. * Bit 16
  8515. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  8516. * (Wireless Distribution System).
  8517. * - AST_VALID_MASK
  8518. * Bits 19:17
  8519. * Purpose: Indicate if the AST 1 through AST 3 are valid
  8520. * - ONCHIP_AST_VALID_FLAG
  8521. * Bit 20
  8522. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  8523. * is valid.
  8524. * - AST_INDEX_1
  8525. * Bits 15:0
  8526. * Purpose: indicate the second AST index for this peer
  8527. * - AST_0_FLOW_MASK
  8528. * Bits 19:16
  8529. * Purpose: identify the which flow the AST 0 entry corresponds to.
  8530. * - AST_1_FLOW_MASK
  8531. * Bits 23:20
  8532. * Purpose: identify the which flow the AST 1 entry corresponds to.
  8533. * - AST_2_FLOW_MASK
  8534. * Bits 27:24
  8535. * Purpose: identify the which flow the AST 2 entry corresponds to.
  8536. * - AST_3_FLOW_MASK
  8537. * Bits 31:28
  8538. * Purpose: identify the which flow the AST 3 entry corresponds to.
  8539. * - AST_INDEX_2
  8540. * Bits 15:0
  8541. * Purpose: indicate the third AST index for this peer
  8542. * - TID_VALID_HI_PRI
  8543. * Bits 23:16
  8544. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  8545. * - TID_VALID_LOW_PRI
  8546. * Bits 31:24
  8547. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  8548. * - AST_INDEX_3
  8549. * Bits 15:0
  8550. * Purpose: indicate the fourth AST index for this peer
  8551. * - ONCHIP_AST_IDX / RESERVED
  8552. * Bits 31:16
  8553. * Purpose: This field is valid only when split AST feature is enabled.
  8554. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  8555. * If valid, identifies the HW peer ID corresponding to the peer MAC
  8556. * address, this ast_idx is used for LMAC modules for RXPCU.
  8557. * Value: ID used by the LMAC HW to identify the peer
  8558. */
  8559. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  8560. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  8561. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  8562. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  8563. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  8564. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  8565. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  8566. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  8567. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  8568. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  8569. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  8570. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  8571. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  8572. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  8573. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  8574. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  8575. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  8576. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  8577. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  8578. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  8579. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  8580. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  8581. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  8582. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  8583. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  8584. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  8585. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  8586. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  8587. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  8588. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  8589. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  8590. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  8591. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  8592. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  8593. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  8594. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  8595. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  8596. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  8597. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  8598. do { \
  8599. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  8600. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  8601. } while (0)
  8602. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  8603. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  8604. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  8605. do { \
  8606. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  8607. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  8608. } while (0)
  8609. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  8610. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  8611. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  8612. do { \
  8613. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  8614. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  8615. } while (0)
  8616. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  8617. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  8618. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  8619. do { \
  8620. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  8621. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  8622. } while (0)
  8623. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  8624. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  8625. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  8626. do { \
  8627. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  8628. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  8629. } while (0)
  8630. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  8631. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  8632. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  8633. do { \
  8634. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  8635. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  8636. } while (0)
  8637. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  8638. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  8639. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  8640. do { \
  8641. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  8642. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  8643. } while (0)
  8644. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  8645. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  8646. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  8647. do { \
  8648. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  8649. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  8650. } while (0)
  8651. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  8652. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  8653. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  8654. do { \
  8655. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  8656. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  8657. } while (0)
  8658. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  8659. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  8660. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  8661. do { \
  8662. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  8663. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  8664. } while (0)
  8665. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  8666. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  8667. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  8668. do { \
  8669. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  8670. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  8671. } while (0)
  8672. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  8673. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  8674. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  8675. do { \
  8676. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  8677. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  8678. } while (0)
  8679. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  8680. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  8681. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  8682. do { \
  8683. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  8684. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  8685. } while (0)
  8686. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  8687. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  8688. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  8689. do { \
  8690. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  8691. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  8692. } while (0)
  8693. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  8694. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  8695. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  8696. do { \
  8697. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  8698. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  8699. } while (0)
  8700. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  8701. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  8702. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  8703. do { \
  8704. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  8705. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  8706. } while (0)
  8707. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  8708. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  8709. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  8710. do { \
  8711. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  8712. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  8713. } while (0)
  8714. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  8715. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  8716. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  8717. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  8718. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  8719. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  8720. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  8721. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  8722. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  8723. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  8724. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  8725. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  8726. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  8727. #define HTT_RX_PEER_MAP_V2_BYTES 32
  8728. /**
  8729. * @brief target -> host rx peer unmap V2 message definition
  8730. *
  8731. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  8732. *
  8733. * The following diagram shows the format of the rx peer unmap message sent
  8734. * from the target to the host.
  8735. *
  8736. * |31 24|23 16|15 8|7 0|
  8737. * |-----------------------------------------------------------------------|
  8738. * | SW peer ID | VDEV ID | msg type |
  8739. * |-----------------------------------------------------------------------|
  8740. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8741. * |-----------------------------------------------------------------------|
  8742. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  8743. * |-----------------------------------------------------------------------|
  8744. * | Peer Delete Duration |
  8745. * |-----------------------------------------------------------------------|
  8746. * | Reserved_0 | WDS Free Count |
  8747. * |-----------------------------------------------------------------------|
  8748. * | Reserved_1 |
  8749. * |-----------------------------------------------------------------------|
  8750. * | Reserved_2 |
  8751. * |-----------------------------------------------------------------------|
  8752. *
  8753. *
  8754. * The following field definitions describe the format of the rx peer unmap
  8755. * messages sent from the target to the host.
  8756. * - MSG_TYPE
  8757. * Bits 7:0
  8758. * Purpose: identifies this as an rx peer unmap v2 message
  8759. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  8760. * - VDEV_ID
  8761. * Bits 15:8
  8762. * Purpose: Indicates which virtual device the peer is associated
  8763. * with.
  8764. * Value: vdev ID (used in the host to look up the vdev object)
  8765. * - SW_PEER_ID
  8766. * Bits 31:16
  8767. * Purpose: The peer ID (index) that WAL is freeing
  8768. * Value: (rx) peer ID
  8769. * - MAC_ADDR_L32
  8770. * Bits 31:0
  8771. * Purpose: Identifies which peer node the peer ID is for.
  8772. * Value: lower 4 bytes of peer node's MAC address
  8773. * - MAC_ADDR_U16
  8774. * Bits 15:0
  8775. * Purpose: Identifies which peer node the peer ID is for.
  8776. * Value: upper 2 bytes of peer node's MAC address
  8777. * - NEXT_HOP
  8778. * Bits 16
  8779. * Purpose: Bit indicates next_hop AST entry used for WDS
  8780. * (Wireless Distribution System).
  8781. * - PEER_DELETE_DURATION
  8782. * Bits 31:0
  8783. * Purpose: Time taken to delete peer, in msec,
  8784. * Used for monitoring / debugging PEER delete response delay
  8785. * - PEER_WDS_FREE_COUNT
  8786. * Bits 15:0
  8787. * Purpose: Count of WDS entries deleted associated to peer deleted
  8788. */
  8789. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  8790. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  8791. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  8792. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  8793. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  8794. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  8795. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  8796. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  8797. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  8798. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  8799. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  8800. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  8801. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  8802. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  8803. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  8804. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  8805. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  8806. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  8807. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  8808. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  8809. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  8810. do { \
  8811. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  8812. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  8813. } while (0)
  8814. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  8815. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  8816. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  8817. do { \
  8818. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  8819. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  8820. } while (0)
  8821. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  8822. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  8823. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  8824. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  8825. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  8826. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  8827. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  8828. /**
  8829. * @brief target -> host message specifying security parameters
  8830. *
  8831. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  8832. *
  8833. * @details
  8834. * The following diagram shows the format of the security specification
  8835. * message sent from the target to the host.
  8836. * This security specification message tells the host whether a PN check is
  8837. * necessary on rx data frames, and if so, how large the PN counter is.
  8838. * This message also tells the host about the security processing to apply
  8839. * to defragmented rx frames - specifically, whether a Message Integrity
  8840. * Check is required, and the Michael key to use.
  8841. *
  8842. * |31 24|23 16|15|14 8|7 0|
  8843. * |-----------------------------------------------------------------------|
  8844. * | peer ID | U| security type | msg type |
  8845. * |-----------------------------------------------------------------------|
  8846. * | Michael Key K0 |
  8847. * |-----------------------------------------------------------------------|
  8848. * | Michael Key K1 |
  8849. * |-----------------------------------------------------------------------|
  8850. * | WAPI RSC Low0 |
  8851. * |-----------------------------------------------------------------------|
  8852. * | WAPI RSC Low1 |
  8853. * |-----------------------------------------------------------------------|
  8854. * | WAPI RSC Hi0 |
  8855. * |-----------------------------------------------------------------------|
  8856. * | WAPI RSC Hi1 |
  8857. * |-----------------------------------------------------------------------|
  8858. *
  8859. * The following field definitions describe the format of the security
  8860. * indication message sent from the target to the host.
  8861. * - MSG_TYPE
  8862. * Bits 7:0
  8863. * Purpose: identifies this as a security specification message
  8864. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  8865. * - SEC_TYPE
  8866. * Bits 14:8
  8867. * Purpose: specifies which type of security applies to the peer
  8868. * Value: htt_sec_type enum value
  8869. * - UNICAST
  8870. * Bit 15
  8871. * Purpose: whether this security is applied to unicast or multicast data
  8872. * Value: 1 -> unicast, 0 -> multicast
  8873. * - PEER_ID
  8874. * Bits 31:16
  8875. * Purpose: The ID number for the peer the security specification is for
  8876. * Value: peer ID
  8877. * - MICHAEL_KEY_K0
  8878. * Bits 31:0
  8879. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  8880. * Value: Michael Key K0 (if security type is TKIP)
  8881. * - MICHAEL_KEY_K1
  8882. * Bits 31:0
  8883. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  8884. * Value: Michael Key K1 (if security type is TKIP)
  8885. * - WAPI_RSC_LOW0
  8886. * Bits 31:0
  8887. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  8888. * Value: WAPI RSC Low0 (if security type is WAPI)
  8889. * - WAPI_RSC_LOW1
  8890. * Bits 31:0
  8891. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  8892. * Value: WAPI RSC Low1 (if security type is WAPI)
  8893. * - WAPI_RSC_HI0
  8894. * Bits 31:0
  8895. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  8896. * Value: WAPI RSC Hi0 (if security type is WAPI)
  8897. * - WAPI_RSC_HI1
  8898. * Bits 31:0
  8899. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  8900. * Value: WAPI RSC Hi1 (if security type is WAPI)
  8901. */
  8902. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  8903. #define HTT_SEC_IND_SEC_TYPE_S 8
  8904. #define HTT_SEC_IND_UNICAST_M 0x00008000
  8905. #define HTT_SEC_IND_UNICAST_S 15
  8906. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  8907. #define HTT_SEC_IND_PEER_ID_S 16
  8908. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  8909. do { \
  8910. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  8911. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  8912. } while (0)
  8913. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  8914. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  8915. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  8916. do { \
  8917. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  8918. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  8919. } while (0)
  8920. #define HTT_SEC_IND_UNICAST_GET(word) \
  8921. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  8922. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  8923. do { \
  8924. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  8925. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  8926. } while (0)
  8927. #define HTT_SEC_IND_PEER_ID_GET(word) \
  8928. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  8929. #define HTT_SEC_IND_BYTES 28
  8930. /**
  8931. * @brief target -> host rx ADDBA / DELBA message definitions
  8932. *
  8933. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  8934. *
  8935. * @details
  8936. * The following diagram shows the format of the rx ADDBA message sent
  8937. * from the target to the host:
  8938. *
  8939. * |31 20|19 16|15 8|7 0|
  8940. * |---------------------------------------------------------------------|
  8941. * | peer ID | TID | window size | msg type |
  8942. * |---------------------------------------------------------------------|
  8943. *
  8944. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  8945. *
  8946. * The following diagram shows the format of the rx DELBA message sent
  8947. * from the target to the host:
  8948. *
  8949. * |31 20|19 16|15 10|9 8|7 0|
  8950. * |---------------------------------------------------------------------|
  8951. * | peer ID | TID | window size | IR| msg type |
  8952. * |---------------------------------------------------------------------|
  8953. *
  8954. * The following field definitions describe the format of the rx ADDBA
  8955. * and DELBA messages sent from the target to the host.
  8956. * - MSG_TYPE
  8957. * Bits 7:0
  8958. * Purpose: identifies this as an rx ADDBA or DELBA message
  8959. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  8960. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  8961. * - IR (initiator / recipient)
  8962. * Bits 9:8 (DELBA only)
  8963. * Purpose: specify whether the DELBA handshake was initiated by the
  8964. * local STA/AP, or by the peer STA/AP
  8965. * Value:
  8966. * 0 - unspecified
  8967. * 1 - initiator (a.k.a. originator)
  8968. * 2 - recipient (a.k.a. responder)
  8969. * 3 - unused / reserved
  8970. * - WIN_SIZE
  8971. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  8972. * Purpose: Specifies the length of the block ack window (max = 64).
  8973. * Value:
  8974. * block ack window length specified by the received ADDBA/DELBA
  8975. * management message.
  8976. * - TID
  8977. * Bits 19:16
  8978. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  8979. * Value:
  8980. * TID specified by the received ADDBA or DELBA management message.
  8981. * - PEER_ID
  8982. * Bits 31:20
  8983. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  8984. * Value:
  8985. * ID (hash value) used by the host for fast, direct lookup of
  8986. * host SW peer info, including rx reorder states.
  8987. */
  8988. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  8989. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  8990. #define HTT_RX_ADDBA_TID_M 0xf0000
  8991. #define HTT_RX_ADDBA_TID_S 16
  8992. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  8993. #define HTT_RX_ADDBA_PEER_ID_S 20
  8994. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  8995. do { \
  8996. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  8997. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  8998. } while (0)
  8999. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  9000. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  9001. #define HTT_RX_ADDBA_TID_SET(word, value) \
  9002. do { \
  9003. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  9004. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  9005. } while (0)
  9006. #define HTT_RX_ADDBA_TID_GET(word) \
  9007. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  9008. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  9009. do { \
  9010. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  9011. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  9012. } while (0)
  9013. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  9014. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  9015. #define HTT_RX_ADDBA_BYTES 4
  9016. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  9017. #define HTT_RX_DELBA_INITIATOR_S 8
  9018. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  9019. #define HTT_RX_DELBA_WIN_SIZE_S 10
  9020. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  9021. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  9022. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  9023. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  9024. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  9025. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  9026. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  9027. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  9028. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  9029. do { \
  9030. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  9031. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  9032. } while (0)
  9033. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  9034. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  9035. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  9036. do { \
  9037. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  9038. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  9039. } while (0)
  9040. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  9041. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  9042. #define HTT_RX_DELBA_BYTES 4
  9043. /**
  9044. * @brief tx queue group information element definition
  9045. *
  9046. * @details
  9047. * The following diagram shows the format of the tx queue group
  9048. * information element, which can be included in target --> host
  9049. * messages to specify the number of tx "credits" (tx descriptors
  9050. * for LL, or tx buffers for HL) available to a particular group
  9051. * of host-side tx queues, and which host-side tx queues belong to
  9052. * the group.
  9053. *
  9054. * |31|30 24|23 16|15|14|13 0|
  9055. * |------------------------------------------------------------------------|
  9056. * | X| reserved | tx queue grp ID | A| S| credit count |
  9057. * |------------------------------------------------------------------------|
  9058. * | vdev ID mask | AC mask |
  9059. * |------------------------------------------------------------------------|
  9060. *
  9061. * The following definitions describe the fields within the tx queue group
  9062. * information element:
  9063. * - credit_count
  9064. * Bits 13:1
  9065. * Purpose: specify how many tx credits are available to the tx queue group
  9066. * Value: An absolute or relative, positive or negative credit value
  9067. * The 'A' bit specifies whether the value is absolute or relative.
  9068. * The 'S' bit specifies whether the value is positive or negative.
  9069. * A negative value can only be relative, not absolute.
  9070. * An absolute value replaces any prior credit value the host has for
  9071. * the tx queue group in question.
  9072. * A relative value is added to the prior credit value the host has for
  9073. * the tx queue group in question.
  9074. * - sign
  9075. * Bit 14
  9076. * Purpose: specify whether the credit count is positive or negative
  9077. * Value: 0 -> positive, 1 -> negative
  9078. * - absolute
  9079. * Bit 15
  9080. * Purpose: specify whether the credit count is absolute or relative
  9081. * Value: 0 -> relative, 1 -> absolute
  9082. * - txq_group_id
  9083. * Bits 23:16
  9084. * Purpose: indicate which tx queue group's credit and/or membership are
  9085. * being specified
  9086. * Value: 0 to max_tx_queue_groups-1
  9087. * - reserved
  9088. * Bits 30:16
  9089. * Value: 0x0
  9090. * - eXtension
  9091. * Bit 31
  9092. * Purpose: specify whether another tx queue group info element follows
  9093. * Value: 0 -> no more tx queue group information elements
  9094. * 1 -> another tx queue group information element immediately follows
  9095. * - ac_mask
  9096. * Bits 15:0
  9097. * Purpose: specify which Access Categories belong to the tx queue group
  9098. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  9099. * the tx queue group.
  9100. * The AC bit-mask values are obtained by left-shifting by the
  9101. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  9102. * - vdev_id_mask
  9103. * Bits 31:16
  9104. * Purpose: specify which vdev's tx queues belong to the tx queue group
  9105. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  9106. * belong to the tx queue group.
  9107. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  9108. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  9109. */
  9110. PREPACK struct htt_txq_group {
  9111. A_UINT32
  9112. credit_count: 14,
  9113. sign: 1,
  9114. absolute: 1,
  9115. tx_queue_group_id: 8,
  9116. reserved0: 7,
  9117. extension: 1;
  9118. A_UINT32
  9119. ac_mask: 16,
  9120. vdev_id_mask: 16;
  9121. } POSTPACK;
  9122. /* first word */
  9123. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  9124. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  9125. #define HTT_TXQ_GROUP_SIGN_S 14
  9126. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  9127. #define HTT_TXQ_GROUP_ABS_S 15
  9128. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  9129. #define HTT_TXQ_GROUP_ID_S 16
  9130. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  9131. #define HTT_TXQ_GROUP_EXT_S 31
  9132. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  9133. /* second word */
  9134. #define HTT_TXQ_GROUP_AC_MASK_S 0
  9135. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  9136. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  9137. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  9138. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  9139. do { \
  9140. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  9141. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  9142. } while (0)
  9143. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  9144. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  9145. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  9146. do { \
  9147. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  9148. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  9149. } while (0)
  9150. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  9151. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  9152. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  9153. do { \
  9154. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  9155. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  9156. } while (0)
  9157. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  9158. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  9159. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  9160. do { \
  9161. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  9162. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  9163. } while (0)
  9164. #define HTT_TXQ_GROUP_ID_GET(_info) \
  9165. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  9166. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  9167. do { \
  9168. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  9169. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  9170. } while (0)
  9171. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  9172. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  9173. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  9174. do { \
  9175. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  9176. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  9177. } while (0)
  9178. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  9179. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  9180. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  9181. do { \
  9182. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  9183. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  9184. } while (0)
  9185. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  9186. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  9187. /**
  9188. * @brief target -> host TX completion indication message definition
  9189. *
  9190. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  9191. *
  9192. * @details
  9193. * The following diagram shows the format of the TX completion indication sent
  9194. * from the target to the host
  9195. *
  9196. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  9197. * |-------------------------------------------------------------------|
  9198. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  9199. * |-------------------------------------------------------------------|
  9200. * payload:| MSDU1 ID | MSDU0 ID |
  9201. * |-------------------------------------------------------------------|
  9202. * : MSDU3 ID | MSDU2 ID :
  9203. * |-------------------------------------------------------------------|
  9204. * | struct htt_tx_compl_ind_append_retries |
  9205. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9206. * | struct htt_tx_compl_ind_append_tx_tstamp |
  9207. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9208. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  9209. * |-------------------------------------------------------------------|
  9210. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  9211. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9212. * | MSDU0 tx_tsf64_low |
  9213. * |-------------------------------------------------------------------|
  9214. * | MSDU0 tx_tsf64_high |
  9215. * |-------------------------------------------------------------------|
  9216. * | MSDU1 tx_tsf64_low |
  9217. * |-------------------------------------------------------------------|
  9218. * | MSDU1 tx_tsf64_high |
  9219. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9220. * | phy_timestamp |
  9221. * |-------------------------------------------------------------------|
  9222. * | rate specs (see below) |
  9223. * |-------------------------------------------------------------------|
  9224. * | seqctrl | framectrl |
  9225. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9226. * Where:
  9227. * A0 = append (a.k.a. append0)
  9228. * A1 = append1
  9229. * TP = MSDU tx power presence
  9230. * A2 = append2
  9231. * A3 = append3
  9232. * A4 = append4
  9233. *
  9234. * The following field definitions describe the format of the TX completion
  9235. * indication sent from the target to the host
  9236. * Header fields:
  9237. * - msg_type
  9238. * Bits 7:0
  9239. * Purpose: identifies this as HTT TX completion indication
  9240. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  9241. * - status
  9242. * Bits 10:8
  9243. * Purpose: the TX completion status of payload fragmentations descriptors
  9244. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  9245. * - tid
  9246. * Bits 14:11
  9247. * Purpose: the tid associated with those fragmentation descriptors. It is
  9248. * valid or not, depending on the tid_invalid bit.
  9249. * Value: 0 to 15
  9250. * - tid_invalid
  9251. * Bits 15:15
  9252. * Purpose: this bit indicates whether the tid field is valid or not
  9253. * Value: 0 indicates valid; 1 indicates invalid
  9254. * - num
  9255. * Bits 23:16
  9256. * Purpose: the number of payload in this indication
  9257. * Value: 1 to 255
  9258. * - append (a.k.a. append0)
  9259. * Bits 24:24
  9260. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  9261. * the number of tx retries for one MSDU at the end of this message
  9262. * Value: 0 indicates no appending; 1 indicates appending
  9263. * - append1
  9264. * Bits 25:25
  9265. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  9266. * contains the timestamp info for each TX msdu id in payload.
  9267. * The order of the timestamps matches the order of the MSDU IDs.
  9268. * Note that a big-endian host needs to account for the reordering
  9269. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  9270. * conversion) when determining which tx timestamp corresponds to
  9271. * which MSDU ID.
  9272. * Value: 0 indicates no appending; 1 indicates appending
  9273. * - msdu_tx_power_presence
  9274. * Bits 26:26
  9275. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  9276. * for each MSDU referenced by the TX_COMPL_IND message.
  9277. * The tx power is reported in 0.5 dBm units.
  9278. * The order of the per-MSDU tx power reports matches the order
  9279. * of the MSDU IDs.
  9280. * Note that a big-endian host needs to account for the reordering
  9281. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  9282. * conversion) when determining which Tx Power corresponds to
  9283. * which MSDU ID.
  9284. * Value: 0 indicates MSDU tx power reports are not appended,
  9285. * 1 indicates MSDU tx power reports are appended
  9286. * - append2
  9287. * Bits 27:27
  9288. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  9289. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  9290. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  9291. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  9292. * for each MSDU, for convenience.
  9293. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  9294. * this append2 bit is set).
  9295. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  9296. * dB above the noise floor.
  9297. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  9298. * 1 indicates MSDU ACK RSSI values are appended.
  9299. * - append3
  9300. * Bits 28:28
  9301. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  9302. * contains the tx tsf info based on wlan global TSF for
  9303. * each TX msdu id in payload.
  9304. * The order of the tx tsf matches the order of the MSDU IDs.
  9305. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  9306. * values to indicate the the lower 32 bits and higher 32 bits of
  9307. * the tx tsf.
  9308. * The tx_tsf64 here represents the time MSDU was acked and the
  9309. * tx_tsf64 has microseconds units.
  9310. * Value: 0 indicates no appending; 1 indicates appending
  9311. * - append4
  9312. * Bits 29:29
  9313. * Purpose: Indicate whether data frame control fields and fields required
  9314. * for radio tap header are appended for each MSDU in TX_COMP_IND
  9315. * message. The order of the this message matches the order of
  9316. * the MSDU IDs.
  9317. * Value: 0 indicates frame control fields and fields required for
  9318. * radio tap header values are not appended,
  9319. * 1 indicates frame control fields and fields required for
  9320. * radio tap header values are appended.
  9321. * Payload fields:
  9322. * - hmsdu_id
  9323. * Bits 15:0
  9324. * Purpose: this ID is used to track the Tx buffer in host
  9325. * Value: 0 to "size of host MSDU descriptor pool - 1"
  9326. */
  9327. PREPACK struct htt_tx_data_hdr_information {
  9328. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  9329. A_UINT32 /* word 1 */
  9330. /* preamble:
  9331. * 0-OFDM,
  9332. * 1-CCk,
  9333. * 2-HT,
  9334. * 3-VHT
  9335. */
  9336. preamble: 2, /* [1:0] */
  9337. /* mcs:
  9338. * In case of HT preamble interpret
  9339. * MCS along with NSS.
  9340. * Valid values for HT are 0 to 7.
  9341. * HT mcs 0 with NSS 2 is mcs 8.
  9342. * Valid values for VHT are 0 to 9.
  9343. */
  9344. mcs: 4, /* [5:2] */
  9345. /* rate:
  9346. * This is applicable only for
  9347. * CCK and OFDM preamble type
  9348. * rate 0: OFDM 48 Mbps,
  9349. * 1: OFDM 24 Mbps,
  9350. * 2: OFDM 12 Mbps
  9351. * 3: OFDM 6 Mbps
  9352. * 4: OFDM 54 Mbps
  9353. * 5: OFDM 36 Mbps
  9354. * 6: OFDM 18 Mbps
  9355. * 7: OFDM 9 Mbps
  9356. * rate 0: CCK 11 Mbps Long
  9357. * 1: CCK 5.5 Mbps Long
  9358. * 2: CCK 2 Mbps Long
  9359. * 3: CCK 1 Mbps Long
  9360. * 4: CCK 11 Mbps Short
  9361. * 5: CCK 5.5 Mbps Short
  9362. * 6: CCK 2 Mbps Short
  9363. */
  9364. rate : 3, /* [ 8: 6] */
  9365. rssi : 8, /* [16: 9] units=dBm */
  9366. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  9367. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  9368. stbc : 1, /* [22] */
  9369. sgi : 1, /* [23] */
  9370. ldpc : 1, /* [24] */
  9371. beamformed: 1, /* [25] */
  9372. /* tx_retry_cnt:
  9373. * Indicates retry count of data tx frames provided by the host.
  9374. */
  9375. tx_retry_cnt: 6; /* [31:26] */
  9376. A_UINT32 /* word 2 */
  9377. framectrl:16, /* [15: 0] */
  9378. seqno:16; /* [31:16] */
  9379. } POSTPACK;
  9380. #define HTT_TX_COMPL_IND_STATUS_S 8
  9381. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  9382. #define HTT_TX_COMPL_IND_TID_S 11
  9383. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  9384. #define HTT_TX_COMPL_IND_TID_INV_S 15
  9385. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  9386. #define HTT_TX_COMPL_IND_NUM_S 16
  9387. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  9388. #define HTT_TX_COMPL_IND_APPEND_S 24
  9389. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  9390. #define HTT_TX_COMPL_IND_APPEND1_S 25
  9391. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  9392. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  9393. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  9394. #define HTT_TX_COMPL_IND_APPEND2_S 27
  9395. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  9396. #define HTT_TX_COMPL_IND_APPEND3_S 28
  9397. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  9398. #define HTT_TX_COMPL_IND_APPEND4_S 29
  9399. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  9400. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  9401. do { \
  9402. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  9403. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  9404. } while (0)
  9405. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  9406. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  9407. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  9408. do { \
  9409. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  9410. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  9411. } while (0)
  9412. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  9413. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  9414. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  9415. do { \
  9416. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  9417. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  9418. } while (0)
  9419. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  9420. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  9421. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  9422. do { \
  9423. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  9424. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  9425. } while (0)
  9426. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  9427. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  9428. HTT_TX_COMPL_IND_TID_INV_S)
  9429. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  9430. do { \
  9431. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  9432. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  9433. } while (0)
  9434. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  9435. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  9436. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  9437. do { \
  9438. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  9439. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  9440. } while (0)
  9441. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  9442. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  9443. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  9444. do { \
  9445. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  9446. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  9447. } while (0)
  9448. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  9449. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  9450. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  9451. do { \
  9452. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  9453. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  9454. } while (0)
  9455. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  9456. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  9457. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  9458. do { \
  9459. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  9460. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  9461. } while (0)
  9462. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  9463. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  9464. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  9465. do { \
  9466. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  9467. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  9468. } while (0)
  9469. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  9470. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  9471. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  9472. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  9473. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  9474. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  9475. #define HTT_TX_COMPL_IND_STAT_OK 0
  9476. /* DISCARD:
  9477. * current meaning:
  9478. * MSDUs were queued for transmission but filtered by HW or SW
  9479. * without any over the air attempts
  9480. * legacy meaning (HL Rome):
  9481. * MSDUs were discarded by the target FW without any over the air
  9482. * attempts due to lack of space
  9483. */
  9484. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  9485. /* NO_ACK:
  9486. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  9487. */
  9488. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  9489. /* POSTPONE:
  9490. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  9491. * be downloaded again later (in the appropriate order), when they are
  9492. * deliverable.
  9493. */
  9494. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  9495. /*
  9496. * The PEER_DEL tx completion status is used for HL cases
  9497. * where the peer the frame is for has been deleted.
  9498. * The host has already discarded its copy of the frame, but
  9499. * it still needs the tx completion to restore its credit.
  9500. */
  9501. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  9502. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  9503. #define HTT_TX_COMPL_IND_STAT_DROP 5
  9504. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  9505. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  9506. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  9507. PREPACK struct htt_tx_compl_ind_base {
  9508. A_UINT32 hdr;
  9509. A_UINT16 payload[1/*or more*/];
  9510. } POSTPACK;
  9511. PREPACK struct htt_tx_compl_ind_append_retries {
  9512. A_UINT16 msdu_id;
  9513. A_UINT8 tx_retries;
  9514. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  9515. 0: this is the last append_retries struct */
  9516. } POSTPACK;
  9517. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  9518. A_UINT32 timestamp[1/*or more*/];
  9519. } POSTPACK;
  9520. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  9521. A_UINT32 tx_tsf64_low;
  9522. A_UINT32 tx_tsf64_high;
  9523. } POSTPACK;
  9524. /* htt_tx_data_hdr_information payload extension fields: */
  9525. /* DWORD zero */
  9526. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  9527. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  9528. /* DWORD one */
  9529. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  9530. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  9531. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  9532. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  9533. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  9534. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  9535. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  9536. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  9537. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  9538. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  9539. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  9540. #define HTT_FW_TX_DATA_HDR_BW_S 19
  9541. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  9542. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  9543. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  9544. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  9545. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  9546. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  9547. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  9548. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  9549. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  9550. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  9551. /* DWORD two */
  9552. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  9553. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  9554. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  9555. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  9556. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  9557. do { \
  9558. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  9559. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  9560. } while (0)
  9561. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  9562. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  9563. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  9564. do { \
  9565. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  9566. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  9567. } while (0)
  9568. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  9569. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  9570. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  9571. do { \
  9572. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  9573. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  9574. } while (0)
  9575. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  9576. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  9577. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  9578. do { \
  9579. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  9580. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  9581. } while (0)
  9582. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  9583. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  9584. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  9585. do { \
  9586. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  9587. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  9588. } while (0)
  9589. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  9590. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  9591. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  9592. do { \
  9593. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  9594. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  9595. } while (0)
  9596. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  9597. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  9598. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  9599. do { \
  9600. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  9601. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  9602. } while (0)
  9603. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  9604. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  9605. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  9606. do { \
  9607. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  9608. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  9609. } while (0)
  9610. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  9611. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  9612. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  9613. do { \
  9614. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  9615. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  9616. } while (0)
  9617. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  9618. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  9619. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  9620. do { \
  9621. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  9622. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  9623. } while (0)
  9624. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  9625. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  9626. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  9627. do { \
  9628. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  9629. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  9630. } while (0)
  9631. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  9632. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  9633. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  9634. do { \
  9635. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  9636. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  9637. } while (0)
  9638. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  9639. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  9640. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  9641. do { \
  9642. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  9643. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  9644. } while (0)
  9645. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  9646. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  9647. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  9648. do { \
  9649. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  9650. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  9651. } while (0)
  9652. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  9653. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  9654. /**
  9655. * @brief target -> host rate-control update indication message
  9656. *
  9657. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  9658. *
  9659. * @details
  9660. * The following diagram shows the format of the RC Update message
  9661. * sent from the target to the host, while processing the tx-completion
  9662. * of a transmitted PPDU.
  9663. *
  9664. * |31 24|23 16|15 8|7 0|
  9665. * |-------------------------------------------------------------|
  9666. * | peer ID | vdev ID | msg_type |
  9667. * |-------------------------------------------------------------|
  9668. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9669. * |-------------------------------------------------------------|
  9670. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  9671. * |-------------------------------------------------------------|
  9672. * | : |
  9673. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  9674. * | : |
  9675. * |-------------------------------------------------------------|
  9676. * | : |
  9677. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  9678. * | : |
  9679. * |-------------------------------------------------------------|
  9680. * : :
  9681. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  9682. *
  9683. */
  9684. typedef struct {
  9685. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  9686. A_UINT32 rate_code_flags;
  9687. A_UINT32 flags; /* Encodes information such as excessive
  9688. retransmission, aggregate, some info
  9689. from .11 frame control,
  9690. STBC, LDPC, (SGI and Tx Chain Mask
  9691. are encoded in ptx_rc->flags field),
  9692. AMPDU truncation (BT/time based etc.),
  9693. RTS/CTS attempt */
  9694. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  9695. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  9696. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  9697. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  9698. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  9699. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  9700. } HTT_RC_TX_DONE_PARAMS;
  9701. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  9702. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  9703. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  9704. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  9705. #define HTT_RC_UPDATE_VDEVID_S 8
  9706. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  9707. #define HTT_RC_UPDATE_PEERID_S 16
  9708. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  9709. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  9710. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  9711. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  9712. do { \
  9713. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  9714. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  9715. } while (0)
  9716. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  9717. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  9718. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  9719. do { \
  9720. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  9721. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  9722. } while (0)
  9723. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  9724. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  9725. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  9726. do { \
  9727. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  9728. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  9729. } while (0)
  9730. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  9731. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  9732. /**
  9733. * @brief target -> host rx fragment indication message definition
  9734. *
  9735. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  9736. *
  9737. * @details
  9738. * The following field definitions describe the format of the rx fragment
  9739. * indication message sent from the target to the host.
  9740. * The rx fragment indication message shares the format of the
  9741. * rx indication message, but not all fields from the rx indication message
  9742. * are relevant to the rx fragment indication message.
  9743. *
  9744. *
  9745. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  9746. * |-----------+-------------------+---------------------+-------------|
  9747. * | peer ID | |FV| ext TID | msg type |
  9748. * |-------------------------------------------------------------------|
  9749. * | | flush | flush |
  9750. * | | end | start |
  9751. * | | seq num | seq num |
  9752. * |-------------------------------------------------------------------|
  9753. * | reserved | FW rx desc bytes |
  9754. * |-------------------------------------------------------------------|
  9755. * | | FW MSDU Rx |
  9756. * | | desc B0 |
  9757. * |-------------------------------------------------------------------|
  9758. * Header fields:
  9759. * - MSG_TYPE
  9760. * Bits 7:0
  9761. * Purpose: identifies this as an rx fragment indication message
  9762. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  9763. * - EXT_TID
  9764. * Bits 12:8
  9765. * Purpose: identify the traffic ID of the rx data, including
  9766. * special "extended" TID values for multicast, broadcast, and
  9767. * non-QoS data frames
  9768. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  9769. * - FLUSH_VALID (FV)
  9770. * Bit 13
  9771. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  9772. * is valid
  9773. * Value:
  9774. * 1 -> flush IE is valid and needs to be processed
  9775. * 0 -> flush IE is not valid and should be ignored
  9776. * - PEER_ID
  9777. * Bits 31:16
  9778. * Purpose: Identify, by ID, which peer sent the rx data
  9779. * Value: ID of the peer who sent the rx data
  9780. * - FLUSH_SEQ_NUM_START
  9781. * Bits 5:0
  9782. * Purpose: Indicate the start of a series of MPDUs to flush
  9783. * Not all MPDUs within this series are necessarily valid - the host
  9784. * must check each sequence number within this range to see if the
  9785. * corresponding MPDU is actually present.
  9786. * This field is only valid if the FV bit is set.
  9787. * Value:
  9788. * The sequence number for the first MPDUs to check to flush.
  9789. * The sequence number is masked by 0x3f.
  9790. * - FLUSH_SEQ_NUM_END
  9791. * Bits 11:6
  9792. * Purpose: Indicate the end of a series of MPDUs to flush
  9793. * Value:
  9794. * The sequence number one larger than the sequence number of the
  9795. * last MPDU to check to flush.
  9796. * The sequence number is masked by 0x3f.
  9797. * Not all MPDUs within this series are necessarily valid - the host
  9798. * must check each sequence number within this range to see if the
  9799. * corresponding MPDU is actually present.
  9800. * This field is only valid if the FV bit is set.
  9801. * Rx descriptor fields:
  9802. * - FW_RX_DESC_BYTES
  9803. * Bits 15:0
  9804. * Purpose: Indicate how many bytes in the Rx indication are used for
  9805. * FW Rx descriptors
  9806. * Value: 1
  9807. */
  9808. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  9809. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  9810. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  9811. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  9812. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  9813. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  9814. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  9815. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  9816. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  9817. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  9818. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  9819. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  9820. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  9821. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  9822. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  9823. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  9824. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  9825. #define HTT_RX_FRAG_IND_BYTES \
  9826. (4 /* msg hdr */ + \
  9827. 4 /* flush spec */ + \
  9828. 4 /* (unused) FW rx desc bytes spec */ + \
  9829. 4 /* FW rx desc */)
  9830. /**
  9831. * @brief target -> host test message definition
  9832. *
  9833. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  9834. *
  9835. * @details
  9836. * The following field definitions describe the format of the test
  9837. * message sent from the target to the host.
  9838. * The message consists of a 4-octet header, followed by a variable
  9839. * number of 32-bit integer values, followed by a variable number
  9840. * of 8-bit character values.
  9841. *
  9842. * |31 16|15 8|7 0|
  9843. * |-----------------------------------------------------------|
  9844. * | num chars | num ints | msg type |
  9845. * |-----------------------------------------------------------|
  9846. * | int 0 |
  9847. * |-----------------------------------------------------------|
  9848. * | int 1 |
  9849. * |-----------------------------------------------------------|
  9850. * | ... |
  9851. * |-----------------------------------------------------------|
  9852. * | char 3 | char 2 | char 1 | char 0 |
  9853. * |-----------------------------------------------------------|
  9854. * | | | ... | char 4 |
  9855. * |-----------------------------------------------------------|
  9856. * - MSG_TYPE
  9857. * Bits 7:0
  9858. * Purpose: identifies this as a test message
  9859. * Value: HTT_MSG_TYPE_TEST
  9860. * - NUM_INTS
  9861. * Bits 15:8
  9862. * Purpose: indicate how many 32-bit integers follow the message header
  9863. * - NUM_CHARS
  9864. * Bits 31:16
  9865. * Purpose: indicate how many 8-bit charaters follow the series of integers
  9866. */
  9867. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  9868. #define HTT_RX_TEST_NUM_INTS_S 8
  9869. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  9870. #define HTT_RX_TEST_NUM_CHARS_S 16
  9871. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  9872. do { \
  9873. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  9874. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  9875. } while (0)
  9876. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  9877. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  9878. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  9879. do { \
  9880. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  9881. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  9882. } while (0)
  9883. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  9884. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  9885. /**
  9886. * @brief target -> host packet log message
  9887. *
  9888. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  9889. *
  9890. * @details
  9891. * The following field definitions describe the format of the packet log
  9892. * message sent from the target to the host.
  9893. * The message consists of a 4-octet header,followed by a variable number
  9894. * of 32-bit character values.
  9895. *
  9896. * |31 16|15 12|11 10|9 8|7 0|
  9897. * |------------------------------------------------------------------|
  9898. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  9899. * |------------------------------------------------------------------|
  9900. * | payload |
  9901. * |------------------------------------------------------------------|
  9902. * - MSG_TYPE
  9903. * Bits 7:0
  9904. * Purpose: identifies this as a pktlog message
  9905. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  9906. * - mac_id
  9907. * Bits 9:8
  9908. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  9909. * Value: 0-3
  9910. * - pdev_id
  9911. * Bits 11:10
  9912. * Purpose: pdev_id
  9913. * Value: 0-3
  9914. * 0 (for rings at SOC level),
  9915. * 1/2/3 PDEV -> 0/1/2
  9916. * - payload_size
  9917. * Bits 31:16
  9918. * Purpose: explicitly specify the payload size
  9919. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  9920. */
  9921. PREPACK struct htt_pktlog_msg {
  9922. A_UINT32 header;
  9923. A_UINT32 payload[1/* or more */];
  9924. } POSTPACK;
  9925. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  9926. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  9927. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  9928. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  9929. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  9930. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  9931. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  9932. do { \
  9933. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  9934. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  9935. } while (0)
  9936. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  9937. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  9938. HTT_T2H_PKTLOG_MAC_ID_S)
  9939. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  9940. do { \
  9941. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  9942. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  9943. } while (0)
  9944. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  9945. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  9946. HTT_T2H_PKTLOG_PDEV_ID_S)
  9947. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  9948. do { \
  9949. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  9950. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  9951. } while (0)
  9952. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  9953. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  9954. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  9955. /*
  9956. * Rx reorder statistics
  9957. * NB: all the fields must be defined in 4 octets size.
  9958. */
  9959. struct rx_reorder_stats {
  9960. /* Non QoS MPDUs received */
  9961. A_UINT32 deliver_non_qos;
  9962. /* MPDUs received in-order */
  9963. A_UINT32 deliver_in_order;
  9964. /* Flush due to reorder timer expired */
  9965. A_UINT32 deliver_flush_timeout;
  9966. /* Flush due to move out of window */
  9967. A_UINT32 deliver_flush_oow;
  9968. /* Flush due to DELBA */
  9969. A_UINT32 deliver_flush_delba;
  9970. /* MPDUs dropped due to FCS error */
  9971. A_UINT32 fcs_error;
  9972. /* MPDUs dropped due to monitor mode non-data packet */
  9973. A_UINT32 mgmt_ctrl;
  9974. /* Unicast-data MPDUs dropped due to invalid peer */
  9975. A_UINT32 invalid_peer;
  9976. /* MPDUs dropped due to duplication (non aggregation) */
  9977. A_UINT32 dup_non_aggr;
  9978. /* MPDUs dropped due to processed before */
  9979. A_UINT32 dup_past;
  9980. /* MPDUs dropped due to duplicate in reorder queue */
  9981. A_UINT32 dup_in_reorder;
  9982. /* Reorder timeout happened */
  9983. A_UINT32 reorder_timeout;
  9984. /* invalid bar ssn */
  9985. A_UINT32 invalid_bar_ssn;
  9986. /* reorder reset due to bar ssn */
  9987. A_UINT32 ssn_reset;
  9988. /* Flush due to delete peer */
  9989. A_UINT32 deliver_flush_delpeer;
  9990. /* Flush due to offload*/
  9991. A_UINT32 deliver_flush_offload;
  9992. /* Flush due to out of buffer*/
  9993. A_UINT32 deliver_flush_oob;
  9994. /* MPDUs dropped due to PN check fail */
  9995. A_UINT32 pn_fail;
  9996. /* MPDUs dropped due to unable to allocate memory */
  9997. A_UINT32 store_fail;
  9998. /* Number of times the tid pool alloc succeeded */
  9999. A_UINT32 tid_pool_alloc_succ;
  10000. /* Number of times the MPDU pool alloc succeeded */
  10001. A_UINT32 mpdu_pool_alloc_succ;
  10002. /* Number of times the MSDU pool alloc succeeded */
  10003. A_UINT32 msdu_pool_alloc_succ;
  10004. /* Number of times the tid pool alloc failed */
  10005. A_UINT32 tid_pool_alloc_fail;
  10006. /* Number of times the MPDU pool alloc failed */
  10007. A_UINT32 mpdu_pool_alloc_fail;
  10008. /* Number of times the MSDU pool alloc failed */
  10009. A_UINT32 msdu_pool_alloc_fail;
  10010. /* Number of times the tid pool freed */
  10011. A_UINT32 tid_pool_free;
  10012. /* Number of times the MPDU pool freed */
  10013. A_UINT32 mpdu_pool_free;
  10014. /* Number of times the MSDU pool freed */
  10015. A_UINT32 msdu_pool_free;
  10016. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  10017. A_UINT32 msdu_queued;
  10018. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  10019. A_UINT32 msdu_recycled;
  10020. /* Number of MPDUs with invalid peer but A2 found in AST */
  10021. A_UINT32 invalid_peer_a2_in_ast;
  10022. /* Number of MPDUs with invalid peer but A3 found in AST */
  10023. A_UINT32 invalid_peer_a3_in_ast;
  10024. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  10025. A_UINT32 invalid_peer_bmc_mpdus;
  10026. /* Number of MSDUs with err attention word */
  10027. A_UINT32 rxdesc_err_att;
  10028. /* Number of MSDUs with flag of peer_idx_invalid */
  10029. A_UINT32 rxdesc_err_peer_idx_inv;
  10030. /* Number of MSDUs with flag of peer_idx_timeout */
  10031. A_UINT32 rxdesc_err_peer_idx_to;
  10032. /* Number of MSDUs with flag of overflow */
  10033. A_UINT32 rxdesc_err_ov;
  10034. /* Number of MSDUs with flag of msdu_length_err */
  10035. A_UINT32 rxdesc_err_msdu_len;
  10036. /* Number of MSDUs with flag of mpdu_length_err */
  10037. A_UINT32 rxdesc_err_mpdu_len;
  10038. /* Number of MSDUs with flag of tkip_mic_err */
  10039. A_UINT32 rxdesc_err_tkip_mic;
  10040. /* Number of MSDUs with flag of decrypt_err */
  10041. A_UINT32 rxdesc_err_decrypt;
  10042. /* Number of MSDUs with flag of fcs_err */
  10043. A_UINT32 rxdesc_err_fcs;
  10044. /* Number of Unicast (bc_mc bit is not set in attention word)
  10045. * frames with invalid peer handler
  10046. */
  10047. A_UINT32 rxdesc_uc_msdus_inv_peer;
  10048. /* Number of unicast frame directly (direct bit is set in attention word)
  10049. * to DUT with invalid peer handler
  10050. */
  10051. A_UINT32 rxdesc_direct_msdus_inv_peer;
  10052. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  10053. * frames with invalid peer handler
  10054. */
  10055. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  10056. /* Number of MSDUs dropped due to no first MSDU flag */
  10057. A_UINT32 rxdesc_no_1st_msdu;
  10058. /* Number of MSDUs droped due to ring overflow */
  10059. A_UINT32 msdu_drop_ring_ov;
  10060. /* Number of MSDUs dropped due to FC mismatch */
  10061. A_UINT32 msdu_drop_fc_mismatch;
  10062. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  10063. A_UINT32 msdu_drop_mgmt_remote_ring;
  10064. /* Number of MSDUs dropped due to errors not reported in attention word */
  10065. A_UINT32 msdu_drop_misc;
  10066. /* Number of MSDUs go to offload before reorder */
  10067. A_UINT32 offload_msdu_wal;
  10068. /* Number of data frame dropped by offload after reorder */
  10069. A_UINT32 offload_msdu_reorder;
  10070. /* Number of MPDUs with sequence number in the past and within the BA window */
  10071. A_UINT32 dup_past_within_window;
  10072. /* Number of MPDUs with sequence number in the past and outside the BA window */
  10073. A_UINT32 dup_past_outside_window;
  10074. /* Number of MSDUs with decrypt/MIC error */
  10075. A_UINT32 rxdesc_err_decrypt_mic;
  10076. /* Number of data MSDUs received on both local and remote rings */
  10077. A_UINT32 data_msdus_on_both_rings;
  10078. /* MPDUs never filled */
  10079. A_UINT32 holes_not_filled;
  10080. };
  10081. /*
  10082. * Rx Remote buffer statistics
  10083. * NB: all the fields must be defined in 4 octets size.
  10084. */
  10085. struct rx_remote_buffer_mgmt_stats {
  10086. /* Total number of MSDUs reaped for Rx processing */
  10087. A_UINT32 remote_reaped;
  10088. /* MSDUs recycled within firmware */
  10089. A_UINT32 remote_recycled;
  10090. /* MSDUs stored by Data Rx */
  10091. A_UINT32 data_rx_msdus_stored;
  10092. /* Number of HTT indications from WAL Rx MSDU */
  10093. A_UINT32 wal_rx_ind;
  10094. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  10095. A_UINT32 wal_rx_ind_unconsumed;
  10096. /* Number of HTT indications from Data Rx MSDU */
  10097. A_UINT32 data_rx_ind;
  10098. /* Number of unconsumed HTT indications from Data Rx MSDU */
  10099. A_UINT32 data_rx_ind_unconsumed;
  10100. /* Number of HTT indications from ATHBUF */
  10101. A_UINT32 athbuf_rx_ind;
  10102. /* Number of remote buffers requested for refill */
  10103. A_UINT32 refill_buf_req;
  10104. /* Number of remote buffers filled by the host */
  10105. A_UINT32 refill_buf_rsp;
  10106. /* Number of times MAC hw_index = f/w write_index */
  10107. A_INT32 mac_no_bufs;
  10108. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  10109. A_INT32 fw_indices_equal;
  10110. /* Number of times f/w finds no buffers to post */
  10111. A_INT32 host_no_bufs;
  10112. };
  10113. /*
  10114. * TXBF MU/SU packets and NDPA statistics
  10115. * NB: all the fields must be defined in 4 octets size.
  10116. */
  10117. struct rx_txbf_musu_ndpa_pkts_stats {
  10118. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  10119. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  10120. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  10121. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  10122. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  10123. A_UINT32 reserved[3]; /* must be set to 0x0 */
  10124. };
  10125. /*
  10126. * htt_dbg_stats_status -
  10127. * present - The requested stats have been delivered in full.
  10128. * This indicates that either the stats information was contained
  10129. * in its entirety within this message, or else this message
  10130. * completes the delivery of the requested stats info that was
  10131. * partially delivered through earlier STATS_CONF messages.
  10132. * partial - The requested stats have been delivered in part.
  10133. * One or more subsequent STATS_CONF messages with the same
  10134. * cookie value will be sent to deliver the remainder of the
  10135. * information.
  10136. * error - The requested stats could not be delivered, for example due
  10137. * to a shortage of memory to construct a message holding the
  10138. * requested stats.
  10139. * invalid - The requested stat type is either not recognized, or the
  10140. * target is configured to not gather the stats type in question.
  10141. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  10142. * series_done - This special value indicates that no further stats info
  10143. * elements are present within a series of stats info elems
  10144. * (within a stats upload confirmation message).
  10145. */
  10146. enum htt_dbg_stats_status {
  10147. HTT_DBG_STATS_STATUS_PRESENT = 0,
  10148. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  10149. HTT_DBG_STATS_STATUS_ERROR = 2,
  10150. HTT_DBG_STATS_STATUS_INVALID = 3,
  10151. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  10152. };
  10153. /**
  10154. * @brief target -> host statistics upload
  10155. *
  10156. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  10157. *
  10158. * @details
  10159. * The following field definitions describe the format of the HTT target
  10160. * to host stats upload confirmation message.
  10161. * The message contains a cookie echoed from the HTT host->target stats
  10162. * upload request, which identifies which request the confirmation is
  10163. * for, and a series of tag-length-value stats information elements.
  10164. * The tag-length header for each stats info element also includes a
  10165. * status field, to indicate whether the request for the stat type in
  10166. * question was fully met, partially met, unable to be met, or invalid
  10167. * (if the stat type in question is disabled in the target).
  10168. * A special value of all 1's in this status field is used to indicate
  10169. * the end of the series of stats info elements.
  10170. *
  10171. *
  10172. * |31 16|15 8|7 5|4 0|
  10173. * |------------------------------------------------------------|
  10174. * | reserved | msg type |
  10175. * |------------------------------------------------------------|
  10176. * | cookie LSBs |
  10177. * |------------------------------------------------------------|
  10178. * | cookie MSBs |
  10179. * |------------------------------------------------------------|
  10180. * | stats entry length | reserved | S |stat type|
  10181. * |------------------------------------------------------------|
  10182. * | |
  10183. * | type-specific stats info |
  10184. * | |
  10185. * |------------------------------------------------------------|
  10186. * | stats entry length | reserved | S |stat type|
  10187. * |------------------------------------------------------------|
  10188. * | |
  10189. * | type-specific stats info |
  10190. * | |
  10191. * |------------------------------------------------------------|
  10192. * | n/a | reserved | 111 | n/a |
  10193. * |------------------------------------------------------------|
  10194. * Header fields:
  10195. * - MSG_TYPE
  10196. * Bits 7:0
  10197. * Purpose: identifies this is a statistics upload confirmation message
  10198. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  10199. * - COOKIE_LSBS
  10200. * Bits 31:0
  10201. * Purpose: Provide a mechanism to match a target->host stats confirmation
  10202. * message with its preceding host->target stats request message.
  10203. * Value: LSBs of the opaque cookie specified by the host-side requestor
  10204. * - COOKIE_MSBS
  10205. * Bits 31:0
  10206. * Purpose: Provide a mechanism to match a target->host stats confirmation
  10207. * message with its preceding host->target stats request message.
  10208. * Value: MSBs of the opaque cookie specified by the host-side requestor
  10209. *
  10210. * Stats Information Element tag-length header fields:
  10211. * - STAT_TYPE
  10212. * Bits 4:0
  10213. * Purpose: identifies the type of statistics info held in the
  10214. * following information element
  10215. * Value: htt_dbg_stats_type
  10216. * - STATUS
  10217. * Bits 7:5
  10218. * Purpose: indicate whether the requested stats are present
  10219. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  10220. * the completion of the stats entry series
  10221. * - LENGTH
  10222. * Bits 31:16
  10223. * Purpose: indicate the stats information size
  10224. * Value: This field specifies the number of bytes of stats information
  10225. * that follows the element tag-length header.
  10226. * It is expected but not required that this length is a multiple of
  10227. * 4 bytes. Even if the length is not an integer multiple of 4, the
  10228. * subsequent stats entry header will begin on a 4-byte aligned
  10229. * boundary.
  10230. */
  10231. #define HTT_T2H_STATS_COOKIE_SIZE 8
  10232. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  10233. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  10234. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  10235. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  10236. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  10237. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  10238. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  10239. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  10240. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  10241. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  10242. do { \
  10243. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  10244. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  10245. } while (0)
  10246. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  10247. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  10248. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  10249. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  10250. do { \
  10251. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  10252. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  10253. } while (0)
  10254. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  10255. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  10256. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  10257. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  10258. do { \
  10259. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  10260. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  10261. } while (0)
  10262. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  10263. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  10264. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  10265. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  10266. #define HTT_MAX_AGGR 64
  10267. #define HTT_HL_MAX_AGGR 18
  10268. /**
  10269. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  10270. *
  10271. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  10272. *
  10273. * @details
  10274. * The following field definitions describe the format of the HTT host
  10275. * to target frag_desc/msdu_ext bank configuration message.
  10276. * The message contains the based address and the min and max id of the
  10277. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  10278. * MSDU_EXT/FRAG_DESC.
  10279. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  10280. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  10281. * the hardware does the mapping/translation.
  10282. *
  10283. * Total banks that can be configured is configured to 16.
  10284. *
  10285. * This should be called before any TX has be initiated by the HTT
  10286. *
  10287. * |31 16|15 8|7 5|4 0|
  10288. * |------------------------------------------------------------|
  10289. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  10290. * |------------------------------------------------------------|
  10291. * | BANK0_BASE_ADDRESS (bits 31:0) |
  10292. #if HTT_PADDR64
  10293. * | BANK0_BASE_ADDRESS (bits 63:32) |
  10294. #endif
  10295. * |------------------------------------------------------------|
  10296. * | ... |
  10297. * |------------------------------------------------------------|
  10298. * | BANK15_BASE_ADDRESS (bits 31:0) |
  10299. #if HTT_PADDR64
  10300. * | BANK15_BASE_ADDRESS (bits 63:32) |
  10301. #endif
  10302. * |------------------------------------------------------------|
  10303. * | BANK0_MAX_ID | BANK0_MIN_ID |
  10304. * |------------------------------------------------------------|
  10305. * | ... |
  10306. * |------------------------------------------------------------|
  10307. * | BANK15_MAX_ID | BANK15_MIN_ID |
  10308. * |------------------------------------------------------------|
  10309. * Header fields:
  10310. * - MSG_TYPE
  10311. * Bits 7:0
  10312. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  10313. * for systems with 64-bit format for bus addresses:
  10314. * - BANKx_BASE_ADDRESS_LO
  10315. * Bits 31:0
  10316. * Purpose: Provide a mechanism to specify the base address of the
  10317. * MSDU_EXT bank physical/bus address.
  10318. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  10319. * - BANKx_BASE_ADDRESS_HI
  10320. * Bits 31:0
  10321. * Purpose: Provide a mechanism to specify the base address of the
  10322. * MSDU_EXT bank physical/bus address.
  10323. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  10324. * for systems with 32-bit format for bus addresses:
  10325. * - BANKx_BASE_ADDRESS
  10326. * Bits 31:0
  10327. * Purpose: Provide a mechanism to specify the base address of the
  10328. * MSDU_EXT bank physical/bus address.
  10329. * Value: MSDU_EXT bank physical / bus address
  10330. * - BANKx_MIN_ID
  10331. * Bits 15:0
  10332. * Purpose: Provide a mechanism to specify the min index that needs to
  10333. * mapped.
  10334. * - BANKx_MAX_ID
  10335. * Bits 31:16
  10336. * Purpose: Provide a mechanism to specify the max index that needs to
  10337. * mapped.
  10338. *
  10339. */
  10340. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  10341. * safe value.
  10342. * @note MAX supported banks is 16.
  10343. */
  10344. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  10345. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  10346. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  10347. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  10348. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  10349. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  10350. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  10351. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  10352. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  10353. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  10354. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  10355. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  10356. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  10357. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  10358. do { \
  10359. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  10360. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  10361. } while (0)
  10362. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  10363. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  10364. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  10365. do { \
  10366. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  10367. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  10368. } while (0)
  10369. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  10370. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  10371. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  10372. do { \
  10373. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  10374. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  10375. } while (0)
  10376. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  10377. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  10378. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  10379. do { \
  10380. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  10381. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  10382. } while (0)
  10383. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  10384. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  10385. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  10386. do { \
  10387. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  10388. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  10389. } while (0)
  10390. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  10391. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  10392. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  10393. do { \
  10394. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  10395. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  10396. } while (0)
  10397. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  10398. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  10399. /*
  10400. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  10401. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  10402. * addresses are stored in a XXX-bit field.
  10403. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  10404. * htt_tx_frag_desc64_bank_cfg_t structs.
  10405. */
  10406. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  10407. _paddr_bits_, \
  10408. _paddr__bank_base_address_) \
  10409. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  10410. /** word 0 \
  10411. * msg_type: 8, \
  10412. * pdev_id: 2, \
  10413. * swap: 1, \
  10414. * reserved0: 5, \
  10415. * num_banks: 8, \
  10416. * desc_size: 8; \
  10417. */ \
  10418. A_UINT32 word0; \
  10419. /* \
  10420. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  10421. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  10422. * the second A_UINT32). \
  10423. */ \
  10424. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  10425. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  10426. } POSTPACK
  10427. /* define htt_tx_frag_desc32_bank_cfg_t */
  10428. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  10429. /* define htt_tx_frag_desc64_bank_cfg_t */
  10430. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  10431. /*
  10432. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  10433. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  10434. */
  10435. #if HTT_PADDR64
  10436. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  10437. #else
  10438. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  10439. #endif
  10440. /**
  10441. * @brief target -> host HTT TX Credit total count update message definition
  10442. *
  10443. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  10444. *
  10445. *|31 16|15|14 9| 8 |7 0 |
  10446. *|---------------------+--+----------+-------+----------|
  10447. *|cur htt credit delta | Q| reserved | sign | msg type |
  10448. *|------------------------------------------------------|
  10449. *
  10450. * Header fields:
  10451. * - MSG_TYPE
  10452. * Bits 7:0
  10453. * Purpose: identifies this as a htt tx credit delta update message
  10454. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  10455. * - SIGN
  10456. * Bits 8
  10457. * identifies whether credit delta is positive or negative
  10458. * Value:
  10459. * - 0x0: credit delta is positive, rebalance in some buffers
  10460. * - 0x1: credit delta is negative, rebalance out some buffers
  10461. * - reserved
  10462. * Bits 14:9
  10463. * Value: 0x0
  10464. * - TXQ_GRP
  10465. * Bit 15
  10466. * Purpose: indicates whether any tx queue group information elements
  10467. * are appended to the tx credit update message
  10468. * Value: 0 -> no tx queue group information element is present
  10469. * 1 -> a tx queue group information element immediately follows
  10470. * - DELTA_COUNT
  10471. * Bits 31:16
  10472. * Purpose: Specify current htt credit delta absolute count
  10473. */
  10474. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  10475. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  10476. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  10477. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  10478. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  10479. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  10480. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  10481. do { \
  10482. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  10483. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  10484. } while (0)
  10485. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  10486. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  10487. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  10488. do { \
  10489. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  10490. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  10491. } while (0)
  10492. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  10493. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  10494. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  10495. do { \
  10496. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  10497. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  10498. } while (0)
  10499. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  10500. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  10501. #define HTT_TX_CREDIT_MSG_BYTES 4
  10502. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  10503. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  10504. /**
  10505. * @brief HTT WDI_IPA Operation Response Message
  10506. *
  10507. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  10508. *
  10509. * @details
  10510. * HTT WDI_IPA Operation Response message is sent by target
  10511. * to host confirming suspend or resume operation.
  10512. * |31 24|23 16|15 8|7 0|
  10513. * |----------------+----------------+----------------+----------------|
  10514. * | op_code | Rsvd | msg_type |
  10515. * |-------------------------------------------------------------------|
  10516. * | Rsvd | Response len |
  10517. * |-------------------------------------------------------------------|
  10518. * | |
  10519. * | Response-type specific info |
  10520. * | |
  10521. * | |
  10522. * |-------------------------------------------------------------------|
  10523. * Header fields:
  10524. * - MSG_TYPE
  10525. * Bits 7:0
  10526. * Purpose: Identifies this as WDI_IPA Operation Response message
  10527. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  10528. * - OP_CODE
  10529. * Bits 31:16
  10530. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  10531. * value: = enum htt_wdi_ipa_op_code
  10532. * - RSP_LEN
  10533. * Bits 16:0
  10534. * Purpose: length for the response-type specific info
  10535. * value: = length in bytes for response-type specific info
  10536. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  10537. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  10538. */
  10539. PREPACK struct htt_wdi_ipa_op_response_t
  10540. {
  10541. /* DWORD 0: flags and meta-data */
  10542. A_UINT32
  10543. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  10544. reserved1: 8,
  10545. op_code: 16;
  10546. A_UINT32
  10547. rsp_len: 16,
  10548. reserved2: 16;
  10549. } POSTPACK;
  10550. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  10551. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  10552. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  10553. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  10554. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  10555. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  10556. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  10557. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  10558. do { \
  10559. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  10560. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  10561. } while (0)
  10562. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  10563. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  10564. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  10565. do { \
  10566. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  10567. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  10568. } while (0)
  10569. enum htt_phy_mode {
  10570. htt_phy_mode_11a = 0,
  10571. htt_phy_mode_11g = 1,
  10572. htt_phy_mode_11b = 2,
  10573. htt_phy_mode_11g_only = 3,
  10574. htt_phy_mode_11na_ht20 = 4,
  10575. htt_phy_mode_11ng_ht20 = 5,
  10576. htt_phy_mode_11na_ht40 = 6,
  10577. htt_phy_mode_11ng_ht40 = 7,
  10578. htt_phy_mode_11ac_vht20 = 8,
  10579. htt_phy_mode_11ac_vht40 = 9,
  10580. htt_phy_mode_11ac_vht80 = 10,
  10581. htt_phy_mode_11ac_vht20_2g = 11,
  10582. htt_phy_mode_11ac_vht40_2g = 12,
  10583. htt_phy_mode_11ac_vht80_2g = 13,
  10584. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  10585. htt_phy_mode_11ac_vht160 = 15,
  10586. htt_phy_mode_max,
  10587. };
  10588. /**
  10589. * @brief target -> host HTT channel change indication
  10590. *
  10591. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  10592. *
  10593. * @details
  10594. * Specify when a channel change occurs.
  10595. * This allows the host to precisely determine which rx frames arrived
  10596. * on the old channel and which rx frames arrived on the new channel.
  10597. *
  10598. *|31 |7 0 |
  10599. *|-------------------------------------------+----------|
  10600. *| reserved | msg type |
  10601. *|------------------------------------------------------|
  10602. *| primary_chan_center_freq_mhz |
  10603. *|------------------------------------------------------|
  10604. *| contiguous_chan1_center_freq_mhz |
  10605. *|------------------------------------------------------|
  10606. *| contiguous_chan2_center_freq_mhz |
  10607. *|------------------------------------------------------|
  10608. *| phy_mode |
  10609. *|------------------------------------------------------|
  10610. *
  10611. * Header fields:
  10612. * - MSG_TYPE
  10613. * Bits 7:0
  10614. * Purpose: identifies this as a htt channel change indication message
  10615. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  10616. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  10617. * Bits 31:0
  10618. * Purpose: identify the (center of the) new 20 MHz primary channel
  10619. * Value: center frequency of the 20 MHz primary channel, in MHz units
  10620. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  10621. * Bits 31:0
  10622. * Purpose: identify the (center of the) contiguous frequency range
  10623. * comprising the new channel.
  10624. * For example, if the new channel is a 80 MHz channel extending
  10625. * 60 MHz beyond the primary channel, this field would be 30 larger
  10626. * than the primary channel center frequency field.
  10627. * Value: center frequency of the contiguous frequency range comprising
  10628. * the full channel in MHz units
  10629. * (80+80 channels also use the CONTIG_CHAN2 field)
  10630. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  10631. * Bits 31:0
  10632. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  10633. * within a VHT 80+80 channel.
  10634. * This field is only relevant for VHT 80+80 channels.
  10635. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  10636. * channel (arbitrary value for cases besides VHT 80+80)
  10637. * - PHY_MODE
  10638. * Bits 31:0
  10639. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  10640. * and band
  10641. * Value: htt_phy_mode enum value
  10642. */
  10643. PREPACK struct htt_chan_change_t
  10644. {
  10645. /* DWORD 0: flags and meta-data */
  10646. A_UINT32
  10647. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  10648. reserved1: 24;
  10649. A_UINT32 primary_chan_center_freq_mhz;
  10650. A_UINT32 contig_chan1_center_freq_mhz;
  10651. A_UINT32 contig_chan2_center_freq_mhz;
  10652. A_UINT32 phy_mode;
  10653. } POSTPACK;
  10654. /*
  10655. * Due to historical / backwards-compatibility reasons, maintain the
  10656. * below htt_chan_change_msg struct definition, which needs to be
  10657. * consistent with the above htt_chan_change_t struct definition
  10658. * (aside from the htt_chan_change_t definition including the msg_type
  10659. * dword within the message, and the htt_chan_change_msg only containing
  10660. * the payload of the message that follows the msg_type dword).
  10661. */
  10662. PREPACK struct htt_chan_change_msg {
  10663. A_UINT32 chan_mhz; /* frequency in mhz */
  10664. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  10665. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  10666. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  10667. } POSTPACK;
  10668. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  10669. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  10670. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  10671. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  10672. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  10673. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  10674. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  10675. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  10676. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  10677. do { \
  10678. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  10679. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  10680. } while (0)
  10681. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  10682. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  10683. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  10684. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  10685. do { \
  10686. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  10687. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  10688. } while (0)
  10689. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  10690. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  10691. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  10692. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  10693. do { \
  10694. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  10695. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  10696. } while (0)
  10697. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  10698. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  10699. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  10700. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  10701. do { \
  10702. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  10703. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  10704. } while (0)
  10705. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  10706. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  10707. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  10708. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  10709. /**
  10710. * @brief rx offload packet error message
  10711. *
  10712. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  10713. *
  10714. * @details
  10715. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  10716. * of target payload like mic err.
  10717. *
  10718. * |31 24|23 16|15 8|7 0|
  10719. * |----------------+----------------+----------------+----------------|
  10720. * | tid | vdev_id | msg_sub_type | msg_type |
  10721. * |-------------------------------------------------------------------|
  10722. * : (sub-type dependent content) :
  10723. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  10724. * Header fields:
  10725. * - msg_type
  10726. * Bits 7:0
  10727. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  10728. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  10729. * - msg_sub_type
  10730. * Bits 15:8
  10731. * Purpose: Identifies which type of rx error is reported by this message
  10732. * value: htt_rx_ofld_pkt_err_type
  10733. * - vdev_id
  10734. * Bits 23:16
  10735. * Purpose: Identifies which vdev received the erroneous rx frame
  10736. * value:
  10737. * - tid
  10738. * Bits 31:24
  10739. * Purpose: Identifies the traffic type of the rx frame
  10740. * value:
  10741. *
  10742. * - The payload fields used if the sub-type == MIC error are shown below.
  10743. * Note - MIC err is per MSDU, while PN is per MPDU.
  10744. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  10745. * with MIC err in A-MSDU case, so FW will send only one HTT message
  10746. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  10747. * instead of sending separate HTT messages for each wrong MSDU within
  10748. * the MPDU.
  10749. *
  10750. * |31 24|23 16|15 8|7 0|
  10751. * |----------------+----------------+----------------+----------------|
  10752. * | Rsvd | key_id | peer_id |
  10753. * |-------------------------------------------------------------------|
  10754. * | receiver MAC addr 31:0 |
  10755. * |-------------------------------------------------------------------|
  10756. * | Rsvd | receiver MAC addr 47:32 |
  10757. * |-------------------------------------------------------------------|
  10758. * | transmitter MAC addr 31:0 |
  10759. * |-------------------------------------------------------------------|
  10760. * | Rsvd | transmitter MAC addr 47:32 |
  10761. * |-------------------------------------------------------------------|
  10762. * | PN 31:0 |
  10763. * |-------------------------------------------------------------------|
  10764. * | Rsvd | PN 47:32 |
  10765. * |-------------------------------------------------------------------|
  10766. * - peer_id
  10767. * Bits 15:0
  10768. * Purpose: identifies which peer is frame is from
  10769. * value:
  10770. * - key_id
  10771. * Bits 23:16
  10772. * Purpose: identifies key_id of rx frame
  10773. * value:
  10774. * - RA_31_0 (receiver MAC addr 31:0)
  10775. * Bits 31:0
  10776. * Purpose: identifies by MAC address which vdev received the frame
  10777. * value: MAC address lower 4 bytes
  10778. * - RA_47_32 (receiver MAC addr 47:32)
  10779. * Bits 15:0
  10780. * Purpose: identifies by MAC address which vdev received the frame
  10781. * value: MAC address upper 2 bytes
  10782. * - TA_31_0 (transmitter MAC addr 31:0)
  10783. * Bits 31:0
  10784. * Purpose: identifies by MAC address which peer transmitted the frame
  10785. * value: MAC address lower 4 bytes
  10786. * - TA_47_32 (transmitter MAC addr 47:32)
  10787. * Bits 15:0
  10788. * Purpose: identifies by MAC address which peer transmitted the frame
  10789. * value: MAC address upper 2 bytes
  10790. * - PN_31_0
  10791. * Bits 31:0
  10792. * Purpose: Identifies pn of rx frame
  10793. * value: PN lower 4 bytes
  10794. * - PN_47_32
  10795. * Bits 15:0
  10796. * Purpose: Identifies pn of rx frame
  10797. * value:
  10798. * TKIP or CCMP: PN upper 2 bytes
  10799. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  10800. */
  10801. enum htt_rx_ofld_pkt_err_type {
  10802. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  10803. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  10804. };
  10805. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  10806. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  10807. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  10808. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  10809. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  10810. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  10811. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  10812. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  10813. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  10814. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  10815. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  10816. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  10817. do { \
  10818. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  10819. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  10820. } while (0)
  10821. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  10822. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  10823. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  10824. do { \
  10825. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  10826. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  10827. } while (0)
  10828. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  10829. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  10830. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  10831. do { \
  10832. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  10833. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  10834. } while (0)
  10835. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  10836. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  10837. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  10838. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  10839. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  10840. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  10841. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  10842. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  10843. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  10844. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  10845. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  10846. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  10847. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  10848. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  10849. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  10850. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  10851. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  10852. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  10853. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  10854. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  10855. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  10856. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  10857. do { \
  10858. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  10859. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  10860. } while (0)
  10861. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  10862. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  10863. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  10864. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  10865. do { \
  10866. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  10867. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  10868. } while (0)
  10869. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  10870. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  10871. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  10872. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  10873. do { \
  10874. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  10875. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  10876. } while (0)
  10877. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  10878. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  10879. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  10880. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  10881. do { \
  10882. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  10883. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  10884. } while (0)
  10885. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  10886. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  10887. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  10888. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  10889. do { \
  10890. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  10891. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  10892. } while (0)
  10893. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  10894. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  10895. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  10896. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  10897. do { \
  10898. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  10899. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  10900. } while (0)
  10901. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  10902. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  10903. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  10904. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  10905. do { \
  10906. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  10907. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  10908. } while (0)
  10909. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  10910. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  10911. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  10912. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  10913. do { \
  10914. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  10915. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  10916. } while (0)
  10917. /**
  10918. * @brief target -> host peer rate report message
  10919. *
  10920. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  10921. *
  10922. * @details
  10923. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  10924. * justified rate of all the peers.
  10925. *
  10926. * |31 24|23 16|15 8|7 0|
  10927. * |----------------+----------------+----------------+----------------|
  10928. * | peer_count | | msg_type |
  10929. * |-------------------------------------------------------------------|
  10930. * : Payload (variant number of peer rate report) :
  10931. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  10932. * Header fields:
  10933. * - msg_type
  10934. * Bits 7:0
  10935. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  10936. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  10937. * - reserved
  10938. * Bits 15:8
  10939. * Purpose:
  10940. * value:
  10941. * - peer_count
  10942. * Bits 31:16
  10943. * Purpose: Specify how many peer rate report elements are present in the payload.
  10944. * value:
  10945. *
  10946. * Payload:
  10947. * There are variant number of peer rate report follow the first 32 bits.
  10948. * The peer rate report is defined as follows.
  10949. *
  10950. * |31 20|19 16|15 0|
  10951. * |-----------------------+---------+---------------------------------|-
  10952. * | reserved | phy | peer_id | \
  10953. * |-------------------------------------------------------------------| -> report #0
  10954. * | rate | /
  10955. * |-----------------------+---------+---------------------------------|-
  10956. * | reserved | phy | peer_id | \
  10957. * |-------------------------------------------------------------------| -> report #1
  10958. * | rate | /
  10959. * |-----------------------+---------+---------------------------------|-
  10960. * | reserved | phy | peer_id | \
  10961. * |-------------------------------------------------------------------| -> report #2
  10962. * | rate | /
  10963. * |-------------------------------------------------------------------|-
  10964. * : :
  10965. * : :
  10966. * : :
  10967. * :-------------------------------------------------------------------:
  10968. *
  10969. * - peer_id
  10970. * Bits 15:0
  10971. * Purpose: identify the peer
  10972. * value:
  10973. * - phy
  10974. * Bits 19:16
  10975. * Purpose: identify which phy is in use
  10976. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  10977. * Please see enum htt_peer_report_phy_type for detail.
  10978. * - reserved
  10979. * Bits 31:20
  10980. * Purpose:
  10981. * value:
  10982. * - rate
  10983. * Bits 31:0
  10984. * Purpose: represent the justified rate of the peer specified by peer_id
  10985. * value:
  10986. */
  10987. enum htt_peer_rate_report_phy_type {
  10988. HTT_PEER_RATE_REPORT_11B = 0,
  10989. HTT_PEER_RATE_REPORT_11A_G,
  10990. HTT_PEER_RATE_REPORT_11N,
  10991. HTT_PEER_RATE_REPORT_11AC,
  10992. };
  10993. #define HTT_PEER_RATE_REPORT_SIZE 8
  10994. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  10995. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  10996. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  10997. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  10998. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  10999. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  11000. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  11001. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  11002. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  11003. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  11004. do { \
  11005. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  11006. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  11007. } while (0)
  11008. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  11009. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  11010. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  11011. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  11012. do { \
  11013. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  11014. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  11015. } while (0)
  11016. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  11017. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  11018. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  11019. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  11020. do { \
  11021. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  11022. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  11023. } while (0)
  11024. /**
  11025. * @brief target -> host flow pool map message
  11026. *
  11027. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  11028. *
  11029. * @details
  11030. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  11031. * a flow of descriptors.
  11032. *
  11033. * This message is in TLV format and indicates the parameters to be setup a
  11034. * flow in the host. Each entry indicates that a particular flow ID is ready to
  11035. * receive descriptors from a specified pool.
  11036. *
  11037. * The message would appear as follows:
  11038. *
  11039. * |31 24|23 16|15 8|7 0|
  11040. * |----------------+----------------+----------------+----------------|
  11041. * header | reserved | num_flows | msg_type |
  11042. * |-------------------------------------------------------------------|
  11043. * | |
  11044. * : payload :
  11045. * | |
  11046. * |-------------------------------------------------------------------|
  11047. *
  11048. * The header field is one DWORD long and is interpreted as follows:
  11049. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  11050. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  11051. * this message
  11052. * b'16-31 - reserved: These bits are reserved for future use
  11053. *
  11054. * Payload:
  11055. * The payload would contain multiple objects of the following structure. Each
  11056. * object represents a flow.
  11057. *
  11058. * |31 24|23 16|15 8|7 0|
  11059. * |----------------+----------------+----------------+----------------|
  11060. * header | reserved | num_flows | msg_type |
  11061. * |-------------------------------------------------------------------|
  11062. * payload0| flow_type |
  11063. * |-------------------------------------------------------------------|
  11064. * | flow_id |
  11065. * |-------------------------------------------------------------------|
  11066. * | reserved0 | flow_pool_id |
  11067. * |-------------------------------------------------------------------|
  11068. * | reserved1 | flow_pool_size |
  11069. * |-------------------------------------------------------------------|
  11070. * | reserved2 |
  11071. * |-------------------------------------------------------------------|
  11072. * payload1| flow_type |
  11073. * |-------------------------------------------------------------------|
  11074. * | flow_id |
  11075. * |-------------------------------------------------------------------|
  11076. * | reserved0 | flow_pool_id |
  11077. * |-------------------------------------------------------------------|
  11078. * | reserved1 | flow_pool_size |
  11079. * |-------------------------------------------------------------------|
  11080. * | reserved2 |
  11081. * |-------------------------------------------------------------------|
  11082. * | . |
  11083. * | . |
  11084. * | . |
  11085. * |-------------------------------------------------------------------|
  11086. *
  11087. * Each payload is 5 DWORDS long and is interpreted as follows:
  11088. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  11089. * this flow is associated. It can be VDEV, peer,
  11090. * or tid (AC). Based on enum htt_flow_type.
  11091. *
  11092. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  11093. * object. For flow_type vdev it is set to the
  11094. * vdevid, for peer it is peerid and for tid, it is
  11095. * tid_num.
  11096. *
  11097. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  11098. * in the host for this flow
  11099. * b'16:31 - reserved0: This field in reserved for the future. In case
  11100. * we have a hierarchical implementation (HCM) of
  11101. * pools, it can be used to indicate the ID of the
  11102. * parent-pool.
  11103. *
  11104. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  11105. * Descriptors for this flow will be
  11106. * allocated from this pool in the host.
  11107. * b'16:31 - reserved1: This field in reserved for the future. In case
  11108. * we have a hierarchical implementation of pools,
  11109. * it can be used to indicate the max number of
  11110. * descriptors in the pool. The b'0:15 can be used
  11111. * to indicate min number of descriptors in the
  11112. * HCM scheme.
  11113. *
  11114. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  11115. * we have a hierarchical implementation of pools,
  11116. * b'0:15 can be used to indicate the
  11117. * priority-based borrowing (PBB) threshold of
  11118. * the flow's pool. The b'16:31 are still left
  11119. * reserved.
  11120. */
  11121. enum htt_flow_type {
  11122. FLOW_TYPE_VDEV = 0,
  11123. /* Insert new flow types above this line */
  11124. };
  11125. PREPACK struct htt_flow_pool_map_payload_t {
  11126. A_UINT32 flow_type;
  11127. A_UINT32 flow_id;
  11128. A_UINT32 flow_pool_id:16,
  11129. reserved0:16;
  11130. A_UINT32 flow_pool_size:16,
  11131. reserved1:16;
  11132. A_UINT32 reserved2;
  11133. } POSTPACK;
  11134. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  11135. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  11136. (sizeof(struct htt_flow_pool_map_payload_t))
  11137. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  11138. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  11139. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  11140. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  11141. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  11142. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  11143. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  11144. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  11145. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  11146. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  11147. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  11148. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  11149. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  11150. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  11151. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  11152. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  11153. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  11154. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  11155. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  11156. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  11157. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  11158. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  11159. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  11160. do { \
  11161. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  11162. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  11163. } while (0)
  11164. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  11165. do { \
  11166. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  11167. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  11168. } while (0)
  11169. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  11170. do { \
  11171. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  11172. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  11173. } while (0)
  11174. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  11175. do { \
  11176. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  11177. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  11178. } while (0)
  11179. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  11180. do { \
  11181. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  11182. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  11183. } while (0)
  11184. /**
  11185. * @brief target -> host flow pool unmap message
  11186. *
  11187. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  11188. *
  11189. * @details
  11190. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  11191. * down a flow of descriptors.
  11192. * This message indicates that for the flow (whose ID is provided) is wanting
  11193. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  11194. * pool of descriptors from where descriptors are being allocated for this
  11195. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  11196. * be unmapped by the host.
  11197. *
  11198. * The message would appear as follows:
  11199. *
  11200. * |31 24|23 16|15 8|7 0|
  11201. * |----------------+----------------+----------------+----------------|
  11202. * | reserved0 | msg_type |
  11203. * |-------------------------------------------------------------------|
  11204. * | flow_type |
  11205. * |-------------------------------------------------------------------|
  11206. * | flow_id |
  11207. * |-------------------------------------------------------------------|
  11208. * | reserved1 | flow_pool_id |
  11209. * |-------------------------------------------------------------------|
  11210. *
  11211. * The message is interpreted as follows:
  11212. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  11213. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  11214. * b'8:31 - reserved0: Reserved for future use
  11215. *
  11216. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  11217. * this flow is associated. It can be VDEV, peer,
  11218. * or tid (AC). Based on enum htt_flow_type.
  11219. *
  11220. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  11221. * object. For flow_type vdev it is set to the
  11222. * vdevid, for peer it is peerid and for tid, it is
  11223. * tid_num.
  11224. *
  11225. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  11226. * used in the host for this flow
  11227. * b'16:31 - reserved0: This field in reserved for the future.
  11228. *
  11229. */
  11230. PREPACK struct htt_flow_pool_unmap_t {
  11231. A_UINT32 msg_type:8,
  11232. reserved0:24;
  11233. A_UINT32 flow_type;
  11234. A_UINT32 flow_id;
  11235. A_UINT32 flow_pool_id:16,
  11236. reserved1:16;
  11237. } POSTPACK;
  11238. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  11239. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  11240. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  11241. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  11242. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  11243. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  11244. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  11245. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  11246. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  11247. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  11248. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  11249. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  11250. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  11251. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  11252. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  11253. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  11254. do { \
  11255. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  11256. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  11257. } while (0)
  11258. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  11259. do { \
  11260. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  11261. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  11262. } while (0)
  11263. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  11264. do { \
  11265. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  11266. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  11267. } while (0)
  11268. /**
  11269. * @brief target -> host SRING setup done message
  11270. *
  11271. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  11272. *
  11273. * @details
  11274. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  11275. * SRNG ring setup is done
  11276. *
  11277. * This message indicates whether the last setup operation is successful.
  11278. * It will be sent to host when host set respose_required bit in
  11279. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  11280. * The message would appear as follows:
  11281. *
  11282. * |31 24|23 16|15 8|7 0|
  11283. * |--------------- +----------------+----------------+----------------|
  11284. * | setup_status | ring_id | pdev_id | msg_type |
  11285. * |-------------------------------------------------------------------|
  11286. *
  11287. * The message is interpreted as follows:
  11288. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  11289. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  11290. * b'8:15 - pdev_id:
  11291. * 0 (for rings at SOC/UMAC level),
  11292. * 1/2/3 mac id (for rings at LMAC level)
  11293. * b'16:23 - ring_id: Identify the ring which is set up
  11294. * More details can be got from enum htt_srng_ring_id
  11295. * b'24:31 - setup_status: Indicate status of setup operation
  11296. * Refer to htt_ring_setup_status
  11297. */
  11298. PREPACK struct htt_sring_setup_done_t {
  11299. A_UINT32 msg_type: 8,
  11300. pdev_id: 8,
  11301. ring_id: 8,
  11302. setup_status: 8;
  11303. } POSTPACK;
  11304. enum htt_ring_setup_status {
  11305. htt_ring_setup_status_ok = 0,
  11306. htt_ring_setup_status_error,
  11307. };
  11308. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  11309. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  11310. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  11311. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  11312. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  11313. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  11314. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  11315. do { \
  11316. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  11317. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  11318. } while (0)
  11319. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  11320. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  11321. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  11322. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  11323. HTT_SRING_SETUP_DONE_RING_ID_S)
  11324. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  11325. do { \
  11326. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  11327. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  11328. } while (0)
  11329. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  11330. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  11331. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  11332. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  11333. HTT_SRING_SETUP_DONE_STATUS_S)
  11334. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  11335. do { \
  11336. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  11337. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  11338. } while (0)
  11339. /**
  11340. * @brief target -> flow map flow info
  11341. *
  11342. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  11343. *
  11344. * @details
  11345. * HTT TX map flow entry with tqm flow pointer
  11346. * Sent from firmware to host to add tqm flow pointer in corresponding
  11347. * flow search entry. Flow metadata is replayed back to host as part of this
  11348. * struct to enable host to find the specific flow search entry
  11349. *
  11350. * The message would appear as follows:
  11351. *
  11352. * |31 28|27 18|17 14|13 8|7 0|
  11353. * |-------+------------------------------------------+----------------|
  11354. * | rsvd0 | fse_hsh_idx | msg_type |
  11355. * |-------------------------------------------------------------------|
  11356. * | rsvd1 | tid | peer_id |
  11357. * |-------------------------------------------------------------------|
  11358. * | tqm_flow_pntr_lo |
  11359. * |-------------------------------------------------------------------|
  11360. * | tqm_flow_pntr_hi |
  11361. * |-------------------------------------------------------------------|
  11362. * | fse_meta_data |
  11363. * |-------------------------------------------------------------------|
  11364. *
  11365. * The message is interpreted as follows:
  11366. *
  11367. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  11368. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  11369. *
  11370. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  11371. * for this flow entry
  11372. *
  11373. * dword0 - b'28:31 - rsvd0: Reserved for future use
  11374. *
  11375. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  11376. *
  11377. * dword1 - b'14:17 - tid
  11378. *
  11379. * dword1 - b'18:31 - rsvd1: Reserved for future use
  11380. *
  11381. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  11382. *
  11383. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  11384. *
  11385. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  11386. * given by host
  11387. */
  11388. PREPACK struct htt_tx_map_flow_info {
  11389. A_UINT32
  11390. msg_type: 8,
  11391. fse_hsh_idx: 20,
  11392. rsvd0: 4;
  11393. A_UINT32
  11394. peer_id: 14,
  11395. tid: 4,
  11396. rsvd1: 14;
  11397. A_UINT32 tqm_flow_pntr_lo;
  11398. A_UINT32 tqm_flow_pntr_hi;
  11399. struct htt_tx_flow_metadata fse_meta_data;
  11400. } POSTPACK;
  11401. /* DWORD 0 */
  11402. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  11403. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  11404. /* DWORD 1 */
  11405. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  11406. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  11407. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  11408. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  11409. /* DWORD 0 */
  11410. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  11411. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  11412. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  11413. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  11414. do { \
  11415. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  11416. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  11417. } while (0)
  11418. /* DWORD 1 */
  11419. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  11420. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  11421. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  11422. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  11423. do { \
  11424. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  11425. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  11426. } while (0)
  11427. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  11428. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  11429. HTT_TX_MAP_FLOW_INFO_TID_S)
  11430. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  11431. do { \
  11432. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  11433. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  11434. } while (0)
  11435. /*
  11436. * htt_dbg_ext_stats_status -
  11437. * present - The requested stats have been delivered in full.
  11438. * This indicates that either the stats information was contained
  11439. * in its entirety within this message, or else this message
  11440. * completes the delivery of the requested stats info that was
  11441. * partially delivered through earlier STATS_CONF messages.
  11442. * partial - The requested stats have been delivered in part.
  11443. * One or more subsequent STATS_CONF messages with the same
  11444. * cookie value will be sent to deliver the remainder of the
  11445. * information.
  11446. * error - The requested stats could not be delivered, for example due
  11447. * to a shortage of memory to construct a message holding the
  11448. * requested stats.
  11449. * invalid - The requested stat type is either not recognized, or the
  11450. * target is configured to not gather the stats type in question.
  11451. */
  11452. enum htt_dbg_ext_stats_status {
  11453. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  11454. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  11455. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  11456. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  11457. };
  11458. /**
  11459. * @brief target -> host ppdu stats upload
  11460. *
  11461. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  11462. *
  11463. * @details
  11464. * The following field definitions describe the format of the HTT target
  11465. * to host ppdu stats indication message.
  11466. *
  11467. *
  11468. * |31 16|15 12|11 10|9 8|7 0 |
  11469. * |----------------------------------------------------------------------|
  11470. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  11471. * |----------------------------------------------------------------------|
  11472. * | ppdu_id |
  11473. * |----------------------------------------------------------------------|
  11474. * | Timestamp in us |
  11475. * |----------------------------------------------------------------------|
  11476. * | reserved |
  11477. * |----------------------------------------------------------------------|
  11478. * | type-specific stats info |
  11479. * | (see htt_ppdu_stats.h) |
  11480. * |----------------------------------------------------------------------|
  11481. * Header fields:
  11482. * - MSG_TYPE
  11483. * Bits 7:0
  11484. * Purpose: Identifies this is a PPDU STATS indication
  11485. * message.
  11486. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  11487. * - mac_id
  11488. * Bits 9:8
  11489. * Purpose: mac_id of this ppdu_id
  11490. * Value: 0-3
  11491. * - pdev_id
  11492. * Bits 11:10
  11493. * Purpose: pdev_id of this ppdu_id
  11494. * Value: 0-3
  11495. * 0 (for rings at SOC level),
  11496. * 1/2/3 PDEV -> 0/1/2
  11497. * - payload_size
  11498. * Bits 31:16
  11499. * Purpose: total tlv size
  11500. * Value: payload_size in bytes
  11501. */
  11502. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  11503. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  11504. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  11505. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  11506. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  11507. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  11508. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  11509. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  11510. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  11511. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  11512. do { \
  11513. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  11514. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  11515. } while (0)
  11516. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  11517. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  11518. HTT_T2H_PPDU_STATS_MAC_ID_S)
  11519. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  11520. do { \
  11521. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  11522. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  11523. } while (0)
  11524. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  11525. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  11526. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  11527. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  11528. do { \
  11529. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  11530. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  11531. } while (0)
  11532. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  11533. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  11534. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  11535. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  11536. do { \
  11537. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  11538. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  11539. } while (0)
  11540. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  11541. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  11542. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  11543. /* htt_t2h_ppdu_stats_ind_hdr_t
  11544. * This struct contains the fields within the header of the
  11545. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  11546. * stats info.
  11547. * This struct assumes little-endian layout, and thus is only
  11548. * suitable for use within processors known to be little-endian
  11549. * (such as the target).
  11550. * In contrast, the above macros provide endian-portable methods
  11551. * to get and set the bitfields within this PPDU_STATS_IND header.
  11552. */
  11553. typedef struct {
  11554. A_UINT32 msg_type: 8, /* bits 7:0 */
  11555. mac_id: 2, /* bits 9:8 */
  11556. pdev_id: 2, /* bits 11:10 */
  11557. reserved1: 4, /* bits 15:12 */
  11558. payload_size: 16; /* bits 31:16 */
  11559. A_UINT32 ppdu_id;
  11560. A_UINT32 timestamp_us;
  11561. A_UINT32 reserved2;
  11562. } htt_t2h_ppdu_stats_ind_hdr_t;
  11563. /**
  11564. * @brief target -> host extended statistics upload
  11565. *
  11566. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  11567. *
  11568. * @details
  11569. * The following field definitions describe the format of the HTT target
  11570. * to host stats upload confirmation message.
  11571. * The message contains a cookie echoed from the HTT host->target stats
  11572. * upload request, which identifies which request the confirmation is
  11573. * for, and a single stats can span over multiple HTT stats indication
  11574. * due to the HTT message size limitation so every HTT ext stats indication
  11575. * will have tag-length-value stats information elements.
  11576. * The tag-length header for each HTT stats IND message also includes a
  11577. * status field, to indicate whether the request for the stat type in
  11578. * question was fully met, partially met, unable to be met, or invalid
  11579. * (if the stat type in question is disabled in the target).
  11580. * A Done bit 1's indicate the end of the of stats info elements.
  11581. *
  11582. *
  11583. * |31 16|15 12|11|10 8|7 5|4 0|
  11584. * |--------------------------------------------------------------|
  11585. * | reserved | msg type |
  11586. * |--------------------------------------------------------------|
  11587. * | cookie LSBs |
  11588. * |--------------------------------------------------------------|
  11589. * | cookie MSBs |
  11590. * |--------------------------------------------------------------|
  11591. * | stats entry length | rsvd | D| S | stat type |
  11592. * |--------------------------------------------------------------|
  11593. * | type-specific stats info |
  11594. * | (see htt_stats.h) |
  11595. * |--------------------------------------------------------------|
  11596. * Header fields:
  11597. * - MSG_TYPE
  11598. * Bits 7:0
  11599. * Purpose: Identifies this is a extended statistics upload confirmation
  11600. * message.
  11601. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  11602. * - COOKIE_LSBS
  11603. * Bits 31:0
  11604. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11605. * message with its preceding host->target stats request message.
  11606. * Value: LSBs of the opaque cookie specified by the host-side requestor
  11607. * - COOKIE_MSBS
  11608. * Bits 31:0
  11609. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11610. * message with its preceding host->target stats request message.
  11611. * Value: MSBs of the opaque cookie specified by the host-side requestor
  11612. *
  11613. * Stats Information Element tag-length header fields:
  11614. * - STAT_TYPE
  11615. * Bits 7:0
  11616. * Purpose: identifies the type of statistics info held in the
  11617. * following information element
  11618. * Value: htt_dbg_ext_stats_type
  11619. * - STATUS
  11620. * Bits 10:8
  11621. * Purpose: indicate whether the requested stats are present
  11622. * Value: htt_dbg_ext_stats_status
  11623. * - DONE
  11624. * Bits 11
  11625. * Purpose:
  11626. * Indicates the completion of the stats entry, this will be the last
  11627. * stats conf HTT segment for the requested stats type.
  11628. * Value:
  11629. * 0 -> the stats retrieval is ongoing
  11630. * 1 -> the stats retrieval is complete
  11631. * - LENGTH
  11632. * Bits 31:16
  11633. * Purpose: indicate the stats information size
  11634. * Value: This field specifies the number of bytes of stats information
  11635. * that follows the element tag-length header.
  11636. * It is expected but not required that this length is a multiple of
  11637. * 4 bytes.
  11638. */
  11639. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  11640. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  11641. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  11642. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  11643. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  11644. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  11645. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  11646. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  11647. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  11648. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  11649. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  11650. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  11651. do { \
  11652. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  11653. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  11654. } while (0)
  11655. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  11656. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  11657. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  11658. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  11659. do { \
  11660. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  11661. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  11662. } while (0)
  11663. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  11664. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  11665. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  11666. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  11667. do { \
  11668. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  11669. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  11670. } while (0)
  11671. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  11672. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  11673. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  11674. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  11675. do { \
  11676. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  11677. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  11678. } while (0)
  11679. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  11680. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  11681. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  11682. typedef enum {
  11683. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  11684. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  11685. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  11686. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  11687. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  11688. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  11689. /* Reserved from 128 - 255 for target internal use.*/
  11690. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  11691. } HTT_PEER_TYPE;
  11692. /** macro to convert MAC address from char array to HTT word format */
  11693. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  11694. (phtt_mac_addr)->mac_addr31to0 = \
  11695. (((c_macaddr)[0] << 0) | \
  11696. ((c_macaddr)[1] << 8) | \
  11697. ((c_macaddr)[2] << 16) | \
  11698. ((c_macaddr)[3] << 24)); \
  11699. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  11700. } while (0)
  11701. /**
  11702. * @brief target -> host monitor mac header indication message
  11703. *
  11704. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  11705. *
  11706. * @details
  11707. * The following diagram shows the format of the monitor mac header message
  11708. * sent from the target to the host.
  11709. * This message is primarily sent when promiscuous rx mode is enabled.
  11710. * One message is sent per rx PPDU.
  11711. *
  11712. * |31 24|23 16|15 8|7 0|
  11713. * |-------------------------------------------------------------|
  11714. * | peer_id | reserved0 | msg_type |
  11715. * |-------------------------------------------------------------|
  11716. * | reserved1 | num_mpdu |
  11717. * |-------------------------------------------------------------|
  11718. * | struct hw_rx_desc |
  11719. * | (see wal_rx_desc.h) |
  11720. * |-------------------------------------------------------------|
  11721. * | struct ieee80211_frame_addr4 |
  11722. * | (see ieee80211_defs.h) |
  11723. * |-------------------------------------------------------------|
  11724. * | struct ieee80211_frame_addr4 |
  11725. * | (see ieee80211_defs.h) |
  11726. * |-------------------------------------------------------------|
  11727. * | ...... |
  11728. * |-------------------------------------------------------------|
  11729. *
  11730. * Header fields:
  11731. * - msg_type
  11732. * Bits 7:0
  11733. * Purpose: Identifies this is a monitor mac header indication message.
  11734. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  11735. * - peer_id
  11736. * Bits 31:16
  11737. * Purpose: Software peer id given by host during association,
  11738. * During promiscuous mode, the peer ID will be invalid (0xFF)
  11739. * for rx PPDUs received from unassociated peers.
  11740. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  11741. * - num_mpdu
  11742. * Bits 15:0
  11743. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  11744. * delivered within the message.
  11745. * Value: 1 to 32
  11746. * num_mpdu is limited to a maximum value of 32, due to buffer
  11747. * size limits. For PPDUs with more than 32 MPDUs, only the
  11748. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  11749. * the PPDU will be provided.
  11750. */
  11751. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  11752. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  11753. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  11754. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  11755. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  11756. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  11757. do { \
  11758. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  11759. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  11760. } while (0)
  11761. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  11762. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  11763. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  11764. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  11765. do { \
  11766. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  11767. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  11768. } while (0)
  11769. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  11770. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  11771. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  11772. /**
  11773. * @brief target -> host flow pool resize Message
  11774. *
  11775. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  11776. *
  11777. * @details
  11778. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  11779. * the flow pool associated with the specified ID is resized
  11780. *
  11781. * The message would appear as follows:
  11782. *
  11783. * |31 16|15 8|7 0|
  11784. * |---------------------------------+----------------+----------------|
  11785. * | reserved0 | Msg type |
  11786. * |-------------------------------------------------------------------|
  11787. * | flow pool new size | flow pool ID |
  11788. * |-------------------------------------------------------------------|
  11789. *
  11790. * The message is interpreted as follows:
  11791. * b'0:7 - msg_type: This will be set to 0x21
  11792. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  11793. *
  11794. * b'0:15 - flow pool ID: Existing flow pool ID
  11795. *
  11796. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  11797. *
  11798. */
  11799. PREPACK struct htt_flow_pool_resize_t {
  11800. A_UINT32 msg_type:8,
  11801. reserved0:24;
  11802. A_UINT32 flow_pool_id:16,
  11803. flow_pool_new_size:16;
  11804. } POSTPACK;
  11805. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  11806. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  11807. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  11808. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  11809. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  11810. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  11811. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  11812. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  11813. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  11814. do { \
  11815. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  11816. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  11817. } while (0)
  11818. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  11819. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  11820. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  11821. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  11822. do { \
  11823. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  11824. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  11825. } while (0)
  11826. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  11827. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  11828. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  11829. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  11830. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  11831. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  11832. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  11833. /*
  11834. * The read and write indices point to the data within the host buffer.
  11835. * Because the first 4 bytes of the host buffer is used for the read index and
  11836. * the next 4 bytes for the write index, the data itself starts at offset 8.
  11837. * The read index and write index are the byte offsets from the base of the
  11838. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  11839. * Refer the ASCII text picture below.
  11840. */
  11841. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  11842. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  11843. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  11844. /*
  11845. ***************************************************************************
  11846. *
  11847. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  11848. *
  11849. ***************************************************************************
  11850. *
  11851. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  11852. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  11853. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  11854. * written into the Host memory region mentioned below.
  11855. *
  11856. * Read index is updated by the Host. At any point of time, the read index will
  11857. * indicate the index that will next be read by the Host. The read index is
  11858. * in units of bytes offset from the base of the meta-data buffer.
  11859. *
  11860. * Write index is updated by the FW. At any point of time, the write index will
  11861. * indicate from where the FW can start writing any new data. The write index is
  11862. * in units of bytes offset from the base of the meta-data buffer.
  11863. *
  11864. * If the Host is not fast enough in reading the CFR data, any new capture data
  11865. * would be dropped if there is no space left to write the new captures.
  11866. *
  11867. * The last 4 bytes of the memory region will have the magic pattern
  11868. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  11869. * not overrun the host buffer.
  11870. *
  11871. * ,--------------------. read and write indices store the
  11872. * | | byte offset from the base of the
  11873. * | ,--------+--------. meta-data buffer to the next
  11874. * | | | | location within the data buffer
  11875. * | | v v that will be read / written
  11876. * ************************************************************************
  11877. * * Read * Write * * Magic *
  11878. * * index * index * CFR data1 ...... CFR data N * pattern *
  11879. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  11880. * ************************************************************************
  11881. * |<---------- data buffer ---------->|
  11882. *
  11883. * |<----------------- meta-data buffer allocated in Host ----------------|
  11884. *
  11885. * Note:
  11886. * - Considering the 4 bytes needed to store the Read index (R) and the
  11887. * Write index (W), the initial value is as follows:
  11888. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  11889. * - Buffer empty condition:
  11890. * R = W
  11891. *
  11892. * Regarding CFR data format:
  11893. * --------------------------
  11894. *
  11895. * Each CFR tone is stored in HW as 16-bits with the following format:
  11896. * {bits[15:12], bits[11:6], bits[5:0]} =
  11897. * {unsigned exponent (4 bits),
  11898. * signed mantissa_real (6 bits),
  11899. * signed mantissa_imag (6 bits)}
  11900. *
  11901. * CFR_real = mantissa_real * 2^(exponent-5)
  11902. * CFR_imag = mantissa_imag * 2^(exponent-5)
  11903. *
  11904. *
  11905. * The CFR data is written to the 16-bit unsigned output array (buff) in
  11906. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  11907. *
  11908. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  11909. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  11910. * .
  11911. * .
  11912. * .
  11913. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  11914. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  11915. */
  11916. /* Bandwidth of peer CFR captures */
  11917. typedef enum {
  11918. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  11919. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  11920. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  11921. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  11922. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  11923. HTT_PEER_CFR_CAPTURE_BW_MAX,
  11924. } HTT_PEER_CFR_CAPTURE_BW;
  11925. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  11926. * was captured
  11927. */
  11928. typedef enum {
  11929. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  11930. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  11931. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  11932. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  11933. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  11934. } HTT_PEER_CFR_CAPTURE_MODE;
  11935. typedef enum {
  11936. /* This message type is currently used for the below purpose:
  11937. *
  11938. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  11939. * wmi_peer_cfr_capture_cmd.
  11940. * If payload_present bit is set to 0 then the associated memory region
  11941. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  11942. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  11943. * message; the CFR dump will be present at the end of the message,
  11944. * after the chan_phy_mode.
  11945. */
  11946. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  11947. /* Always keep this last */
  11948. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  11949. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  11950. /**
  11951. * @brief target -> host CFR dump completion indication message definition
  11952. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  11953. *
  11954. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  11955. *
  11956. * @details
  11957. * The following diagram shows the format of the Channel Frequency Response
  11958. * (CFR) dump completion indication. This inidcation is sent to the Host when
  11959. * the channel capture of a peer is copied by Firmware into the Host memory
  11960. *
  11961. * **************************************************************************
  11962. *
  11963. * Message format when the CFR capture message type is
  11964. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  11965. *
  11966. * **************************************************************************
  11967. *
  11968. * |31 16|15 |8|7 0|
  11969. * |----------------------------------------------------------------|
  11970. * header: | reserved |P| msg_type |
  11971. * word 0 | | | |
  11972. * |----------------------------------------------------------------|
  11973. * payload: | cfr_capture_msg_type |
  11974. * word 1 | |
  11975. * |----------------------------------------------------------------|
  11976. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  11977. * word 2 | | | | | | | | |
  11978. * |----------------------------------------------------------------|
  11979. * | mac_addr31to0 |
  11980. * word 3 | |
  11981. * |----------------------------------------------------------------|
  11982. * | unused / reserved | mac_addr47to32 |
  11983. * word 4 | | |
  11984. * |----------------------------------------------------------------|
  11985. * | index |
  11986. * word 5 | |
  11987. * |----------------------------------------------------------------|
  11988. * | length |
  11989. * word 6 | |
  11990. * |----------------------------------------------------------------|
  11991. * | timestamp |
  11992. * word 7 | |
  11993. * |----------------------------------------------------------------|
  11994. * | counter |
  11995. * word 8 | |
  11996. * |----------------------------------------------------------------|
  11997. * | chan_mhz |
  11998. * word 9 | |
  11999. * |----------------------------------------------------------------|
  12000. * | band_center_freq1 |
  12001. * word 10 | |
  12002. * |----------------------------------------------------------------|
  12003. * | band_center_freq2 |
  12004. * word 11 | |
  12005. * |----------------------------------------------------------------|
  12006. * | chan_phy_mode |
  12007. * word 12 | |
  12008. * |----------------------------------------------------------------|
  12009. * where,
  12010. * P - payload present bit (payload_present explained below)
  12011. * req_id - memory request id (mem_req_id explained below)
  12012. * S - status field (status explained below)
  12013. * capbw - capture bandwidth (capture_bw explained below)
  12014. * mode - mode of capture (mode explained below)
  12015. * sts - space time streams (sts_count explained below)
  12016. * chbw - channel bandwidth (channel_bw explained below)
  12017. * captype - capture type (cap_type explained below)
  12018. *
  12019. * The following field definitions describe the format of the CFR dump
  12020. * completion indication sent from the target to the host
  12021. *
  12022. * Header fields:
  12023. *
  12024. * Word 0
  12025. * - msg_type
  12026. * Bits 7:0
  12027. * Purpose: Identifies this as CFR TX completion indication
  12028. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  12029. * - payload_present
  12030. * Bit 8
  12031. * Purpose: Identifies how CFR data is sent to host
  12032. * Value: 0 - If CFR Payload is written to host memory
  12033. * 1 - If CFR Payload is sent as part of HTT message
  12034. * (This is the requirement for SDIO/USB where it is
  12035. * not possible to write CFR data to host memory)
  12036. * - reserved
  12037. * Bits 31:9
  12038. * Purpose: Reserved
  12039. * Value: 0
  12040. *
  12041. * Payload fields:
  12042. *
  12043. * Word 1
  12044. * - cfr_capture_msg_type
  12045. * Bits 31:0
  12046. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  12047. * to specify the format used for the remainder of the message
  12048. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  12049. * (currently only MSG_TYPE_1 is defined)
  12050. *
  12051. * Word 2
  12052. * - mem_req_id
  12053. * Bits 6:0
  12054. * Purpose: Contain the mem request id of the region where the CFR capture
  12055. * has been stored - of type WMI_HOST_MEM_REQ_ID
  12056. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  12057. this value is invalid)
  12058. * - status
  12059. * Bit 7
  12060. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  12061. * Value: 1 (True) - Successful; 0 (False) - Not successful
  12062. * - capture_bw
  12063. * Bits 10:8
  12064. * Purpose: Carry the bandwidth of the CFR capture
  12065. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  12066. * - mode
  12067. * Bits 13:11
  12068. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  12069. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  12070. * - sts_count
  12071. * Bits 16:14
  12072. * Purpose: Carry the number of space time streams
  12073. * Value: Number of space time streams
  12074. * - channel_bw
  12075. * Bits 19:17
  12076. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  12077. * measurement
  12078. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  12079. * - cap_type
  12080. * Bits 23:20
  12081. * Purpose: Carry the type of the capture
  12082. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  12083. * - vdev_id
  12084. * Bits 31:24
  12085. * Purpose: Carry the virtual device id
  12086. * Value: vdev ID
  12087. *
  12088. * Word 3
  12089. * - mac_addr31to0
  12090. * Bits 31:0
  12091. * Purpose: Contain the bits 31:0 of the peer MAC address
  12092. * Value: Bits 31:0 of the peer MAC address
  12093. *
  12094. * Word 4
  12095. * - mac_addr47to32
  12096. * Bits 15:0
  12097. * Purpose: Contain the bits 47:32 of the peer MAC address
  12098. * Value: Bits 47:32 of the peer MAC address
  12099. *
  12100. * Word 5
  12101. * - index
  12102. * Bits 31:0
  12103. * Purpose: Contain the index at which this CFR dump was written in the Host
  12104. * allocated memory. This index is the number of bytes from the base address.
  12105. * Value: Index position
  12106. *
  12107. * Word 6
  12108. * - length
  12109. * Bits 31:0
  12110. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  12111. * Value: Length of the CFR capture of the peer
  12112. *
  12113. * Word 7
  12114. * - timestamp
  12115. * Bits 31:0
  12116. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  12117. * clock used for this timestamp is private to the target and not visible to
  12118. * the host i.e., Host can interpret only the relative timestamp deltas from
  12119. * one message to the next, but can't interpret the absolute timestamp from a
  12120. * single message.
  12121. * Value: Timestamp in microseconds
  12122. *
  12123. * Word 8
  12124. * - counter
  12125. * Bits 31:0
  12126. * Purpose: Carry the count of the current CFR capture from FW. This is
  12127. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  12128. * in host memory)
  12129. * Value: Count of the current CFR capture
  12130. *
  12131. * Word 9
  12132. * - chan_mhz
  12133. * Bits 31:0
  12134. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  12135. * Value: Primary 20 channel frequency
  12136. *
  12137. * Word 10
  12138. * - band_center_freq1
  12139. * Bits 31:0
  12140. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  12141. * Value: Center frequency 1 in MHz
  12142. *
  12143. * Word 11
  12144. * - band_center_freq2
  12145. * Bits 31:0
  12146. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  12147. * the VDEV
  12148. * 80plus80 mode
  12149. * Value: Center frequency 2 in MHz
  12150. *
  12151. * Word 12
  12152. * - chan_phy_mode
  12153. * Bits 31:0
  12154. * Purpose: Carry the phy mode of the channel, of the VDEV
  12155. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  12156. */
  12157. PREPACK struct htt_cfr_dump_ind_type_1 {
  12158. A_UINT32 mem_req_id:7,
  12159. status:1,
  12160. capture_bw:3,
  12161. mode:3,
  12162. sts_count:3,
  12163. channel_bw:3,
  12164. cap_type:4,
  12165. vdev_id:8;
  12166. htt_mac_addr addr;
  12167. A_UINT32 index;
  12168. A_UINT32 length;
  12169. A_UINT32 timestamp;
  12170. A_UINT32 counter;
  12171. struct htt_chan_change_msg chan;
  12172. } POSTPACK;
  12173. PREPACK struct htt_cfr_dump_compl_ind {
  12174. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  12175. union {
  12176. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  12177. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  12178. /* If there is a need to change the memory layout and its associated
  12179. * HTT indication format, a new CFR capture message type can be
  12180. * introduced and added into this union.
  12181. */
  12182. };
  12183. } POSTPACK;
  12184. /*
  12185. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  12186. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  12187. */
  12188. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  12189. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  12190. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  12191. do { \
  12192. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  12193. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  12194. } while(0)
  12195. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  12196. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  12197. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  12198. /*
  12199. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  12200. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  12201. */
  12202. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  12203. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  12204. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  12205. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  12206. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  12207. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  12208. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  12209. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  12210. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  12211. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  12212. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  12213. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  12214. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  12215. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  12216. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  12217. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  12218. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  12219. do { \
  12220. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  12221. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  12222. } while (0)
  12223. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  12224. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  12225. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  12226. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  12227. do { \
  12228. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  12229. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  12230. } while (0)
  12231. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  12232. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  12233. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  12234. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  12235. do { \
  12236. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  12237. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  12238. } while (0)
  12239. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  12240. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  12241. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  12242. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  12243. do { \
  12244. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  12245. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  12246. } while (0)
  12247. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  12248. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  12249. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  12250. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  12251. do { \
  12252. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  12253. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  12254. } while (0)
  12255. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  12256. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  12257. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  12258. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  12259. do { \
  12260. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  12261. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  12262. } while (0)
  12263. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  12264. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  12265. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  12266. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  12267. do { \
  12268. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  12269. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  12270. } while (0)
  12271. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  12272. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  12273. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  12274. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  12275. do { \
  12276. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  12277. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  12278. } while (0)
  12279. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  12280. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  12281. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  12282. /**
  12283. * @brief target -> host peer (PPDU) stats message
  12284. *
  12285. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  12286. *
  12287. * @details
  12288. * This message is generated by FW when FW is sending stats to host
  12289. * about one or more PPDUs that the FW has transmitted to one or more peers.
  12290. * This message is sent autonomously by the target rather than upon request
  12291. * by the host.
  12292. * The following field definitions describe the format of the HTT target
  12293. * to host peer stats indication message.
  12294. *
  12295. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  12296. * or more PPDU stats records.
  12297. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  12298. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  12299. * then the message would start with the
  12300. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  12301. * below.
  12302. *
  12303. * |31 16|15|14|13 11|10 9|8|7 0|
  12304. * |-------------------------------------------------------------|
  12305. * | reserved |MSG_TYPE |
  12306. * |-------------------------------------------------------------|
  12307. * rec 0 | TLV header |
  12308. * rec 0 |-------------------------------------------------------------|
  12309. * rec 0 | ppdu successful bytes |
  12310. * rec 0 |-------------------------------------------------------------|
  12311. * rec 0 | ppdu retry bytes |
  12312. * rec 0 |-------------------------------------------------------------|
  12313. * rec 0 | ppdu failed bytes |
  12314. * rec 0 |-------------------------------------------------------------|
  12315. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  12316. * rec 0 |-------------------------------------------------------------|
  12317. * rec 0 | retried MSDUs | successful MSDUs |
  12318. * rec 0 |-------------------------------------------------------------|
  12319. * rec 0 | TX duration | failed MSDUs |
  12320. * rec 0 |-------------------------------------------------------------|
  12321. * ...
  12322. * |-------------------------------------------------------------|
  12323. * rec N | TLV header |
  12324. * rec N |-------------------------------------------------------------|
  12325. * rec N | ppdu successful bytes |
  12326. * rec N |-------------------------------------------------------------|
  12327. * rec N | ppdu retry bytes |
  12328. * rec N |-------------------------------------------------------------|
  12329. * rec N | ppdu failed bytes |
  12330. * rec N |-------------------------------------------------------------|
  12331. * rec N | peer id | S|SG| BW | BA |A|rate code|
  12332. * rec N |-------------------------------------------------------------|
  12333. * rec N | retried MSDUs | successful MSDUs |
  12334. * rec N |-------------------------------------------------------------|
  12335. * rec N | TX duration | failed MSDUs |
  12336. * rec N |-------------------------------------------------------------|
  12337. *
  12338. * where:
  12339. * A = is A-MPDU flag
  12340. * BA = block-ack failure flags
  12341. * BW = bandwidth spec
  12342. * SG = SGI enabled spec
  12343. * S = skipped rate ctrl
  12344. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  12345. *
  12346. * Header
  12347. * ------
  12348. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  12349. * dword0 - b'8:31 - reserved : Reserved for future use
  12350. *
  12351. * payload include below peer_stats information
  12352. * --------------------------------------------
  12353. * @TLV : HTT_PPDU_STATS_INFO_TLV
  12354. * @tx_success_bytes : total successful bytes in the PPDU.
  12355. * @tx_retry_bytes : total retried bytes in the PPDU.
  12356. * @tx_failed_bytes : total failed bytes in the PPDU.
  12357. * @tx_ratecode : rate code used for the PPDU.
  12358. * @is_ampdu : Indicates PPDU is AMPDU or not.
  12359. * @ba_ack_failed : BA/ACK failed for this PPDU
  12360. * b00 -> BA received
  12361. * b01 -> BA failed once
  12362. * b10 -> BA failed twice, when HW retry is enabled.
  12363. * @bw : BW
  12364. * b00 -> 20 MHz
  12365. * b01 -> 40 MHz
  12366. * b10 -> 80 MHz
  12367. * b11 -> 160 MHz (or 80+80)
  12368. * @sg : SGI enabled
  12369. * @s : skipped ratectrl
  12370. * @peer_id : peer id
  12371. * @tx_success_msdus : successful MSDUs
  12372. * @tx_retry_msdus : retried MSDUs
  12373. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  12374. * @tx_duration : Tx duration for the PPDU (microsecond units)
  12375. */
  12376. /**
  12377. * @brief target -> host backpressure event
  12378. *
  12379. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  12380. *
  12381. * @details
  12382. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  12383. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  12384. * This message will only be sent if the backpressure condition has existed
  12385. * continuously for an initial period (100 ms).
  12386. * Repeat messages with updated information will be sent after each
  12387. * subsequent period (100 ms) as long as the backpressure remains unabated.
  12388. * This message indicates the ring id along with current head and tail index
  12389. * locations (i.e. write and read indices).
  12390. * The backpressure time indicates the time in ms for which continous
  12391. * backpressure has been observed in the ring.
  12392. *
  12393. * The message format is as follows:
  12394. *
  12395. * |31 24|23 16|15 8|7 0|
  12396. * |----------------+----------------+----------------+----------------|
  12397. * | ring_id | ring_type | pdev_id | msg_type |
  12398. * |-------------------------------------------------------------------|
  12399. * | tail_idx | head_idx |
  12400. * |-------------------------------------------------------------------|
  12401. * | backpressure_time_ms |
  12402. * |-------------------------------------------------------------------|
  12403. *
  12404. * The message is interpreted as follows:
  12405. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  12406. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  12407. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  12408. * 1, 2, 3 indicates pdev_id 0,1,2 and
  12409. the msg is for LMAC ring.
  12410. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  12411. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  12412. * htt_backpressure_lmac_ring_id. This represents
  12413. * the ring id for which continous backpressure is seen
  12414. *
  12415. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  12416. * the ring indicated by the ring_id
  12417. *
  12418. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  12419. * the ring indicated by the ring id
  12420. *
  12421. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  12422. * backpressure has been seen in the ring
  12423. * indicated by the ring_id.
  12424. * Units = milliseconds
  12425. */
  12426. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  12427. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  12428. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  12429. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  12430. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  12431. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  12432. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  12433. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  12434. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  12435. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  12436. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  12437. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  12438. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  12439. do { \
  12440. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  12441. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  12442. } while (0)
  12443. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  12444. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  12445. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  12446. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  12447. do { \
  12448. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  12449. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  12450. } while (0)
  12451. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  12452. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  12453. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  12454. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  12455. do { \
  12456. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  12457. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  12458. } while (0)
  12459. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  12460. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  12461. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  12462. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  12463. do { \
  12464. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  12465. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  12466. } while (0)
  12467. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  12468. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  12469. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  12470. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  12471. do { \
  12472. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  12473. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  12474. } while (0)
  12475. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  12476. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  12477. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  12478. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  12479. do { \
  12480. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  12481. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  12482. } while (0)
  12483. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  12484. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  12485. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  12486. enum htt_backpressure_ring_type {
  12487. HTT_SW_RING_TYPE_UMAC,
  12488. HTT_SW_RING_TYPE_LMAC,
  12489. HTT_SW_RING_TYPE_MAX,
  12490. };
  12491. /* Ring id for which the message is sent to host */
  12492. enum htt_backpressure_umac_ringid {
  12493. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  12494. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  12495. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  12496. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  12497. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  12498. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  12499. HTT_SW_RING_IDX_REO_REO2FW_RING,
  12500. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  12501. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  12502. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  12503. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  12504. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  12505. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  12506. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  12507. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  12508. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  12509. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  12510. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  12511. HTT_SW_UMAC_RING_IDX_MAX,
  12512. };
  12513. enum htt_backpressure_lmac_ringid {
  12514. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  12515. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  12516. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  12517. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  12518. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  12519. HTT_SW_RING_IDX_RXDMA2FW_RING,
  12520. HTT_SW_RING_IDX_RXDMA2SW_RING,
  12521. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  12522. HTT_SW_RING_IDX_RXDMA2REO_RING,
  12523. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  12524. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  12525. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  12526. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  12527. HTT_SW_LMAC_RING_IDX_MAX,
  12528. };
  12529. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  12530. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  12531. pdev_id: 8,
  12532. ring_type: 8, /* htt_backpressure_ring_type */
  12533. /*
  12534. * ring_id holds an enum value from either
  12535. * htt_backpressure_umac_ringid or
  12536. * htt_backpressure_lmac_ringid, based on
  12537. * the ring_type setting.
  12538. */
  12539. ring_id: 8;
  12540. A_UINT16 head_idx;
  12541. A_UINT16 tail_idx;
  12542. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  12543. } POSTPACK;
  12544. /*
  12545. * Defines two 32 bit words that can be used by the target to indicate a per
  12546. * user RU allocation and rate information.
  12547. *
  12548. * This information is currently provided in the "sw_response_reference_ptr"
  12549. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  12550. * "rx_ppdu_end_user_stats" TLV.
  12551. *
  12552. * VALID:
  12553. * The consumer of these words must explicitly check the valid bit,
  12554. * and only attempt interpretation of any of the remaining fields if
  12555. * the valid bit is set to 1.
  12556. *
  12557. * VERSION:
  12558. * The consumer of these words must also explicitly check the version bit,
  12559. * and only use the V0 definition if the VERSION field is set to 0.
  12560. *
  12561. * Version 1 is currently undefined, with the exception of the VALID and
  12562. * VERSION fields.
  12563. *
  12564. * Version 0:
  12565. *
  12566. * The fields below are duplicated per BW.
  12567. *
  12568. * The consumer must determine which BW field to use, based on the UL OFDMA
  12569. * PPDU BW indicated by HW.
  12570. *
  12571. * RU_START: RU26 start index for the user.
  12572. * Note that this is always using the RU26 index, regardless
  12573. * of the actual RU assigned to the user
  12574. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  12575. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  12576. *
  12577. * For example, 20MHz (the value in the top row is RU_START)
  12578. *
  12579. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  12580. * RU Size 1 (52): | | | | | |
  12581. * RU Size 2 (106): | | | |
  12582. * RU Size 3 (242): | |
  12583. *
  12584. * RU_SIZE: Indicates the RU size, as defined by enum
  12585. * htt_ul_ofdma_user_info_ru_size.
  12586. *
  12587. * LDPC: LDPC enabled (if 0, BCC is used)
  12588. *
  12589. * DCM: DCM enabled
  12590. *
  12591. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  12592. * |---------------------------------+--------------------------------|
  12593. * |Ver|Valid| FW internal |
  12594. * |---------------------------------+--------------------------------|
  12595. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  12596. * |---------------------------------+--------------------------------|
  12597. */
  12598. enum htt_ul_ofdma_user_info_ru_size {
  12599. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  12600. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  12601. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  12602. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  12603. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  12604. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  12605. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  12606. };
  12607. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  12608. struct htt_ul_ofdma_user_info_v0 {
  12609. A_UINT32 word0;
  12610. A_UINT32 word1;
  12611. };
  12612. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  12613. A_UINT32 w0_fw_rsvd:30; \
  12614. A_UINT32 w0_valid:1; \
  12615. A_UINT32 w0_version:1;
  12616. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  12617. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  12618. };
  12619. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  12620. A_UINT32 w1_nss:3; \
  12621. A_UINT32 w1_mcs:4; \
  12622. A_UINT32 w1_ldpc:1; \
  12623. A_UINT32 w1_dcm:1; \
  12624. A_UINT32 w1_ru_start:7; \
  12625. A_UINT32 w1_ru_size:3; \
  12626. A_UINT32 w1_trig_type:4; \
  12627. A_UINT32 w1_unused:9;
  12628. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  12629. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  12630. };
  12631. /* htt_up_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  12632. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  12633. union {
  12634. A_UINT32 word0;
  12635. struct {
  12636. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  12637. };
  12638. };
  12639. union {
  12640. A_UINT32 word1;
  12641. struct {
  12642. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  12643. };
  12644. };
  12645. } POSTPACK;
  12646. enum HTT_UL_OFDMA_TRIG_TYPE {
  12647. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  12648. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  12649. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  12650. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  12651. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  12652. };
  12653. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  12654. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  12655. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  12656. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  12657. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  12658. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  12659. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  12660. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  12661. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  12662. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  12663. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  12664. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  12665. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  12666. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  12667. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  12668. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  12669. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  12670. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  12671. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  12672. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  12673. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  12674. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  12675. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  12676. /*--- word 0 ---*/
  12677. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  12678. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  12679. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  12680. do { \
  12681. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  12682. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  12683. } while (0)
  12684. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  12685. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  12686. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  12687. do { \
  12688. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  12689. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  12690. } while (0)
  12691. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  12692. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  12693. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  12694. do { \
  12695. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  12696. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  12697. } while (0)
  12698. /*--- word 1 ---*/
  12699. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  12700. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  12701. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  12702. do { \
  12703. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  12704. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  12705. } while (0)
  12706. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  12707. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  12708. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  12709. do { \
  12710. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  12711. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  12712. } while (0)
  12713. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  12714. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  12715. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  12716. do { \
  12717. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  12718. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  12719. } while (0)
  12720. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  12721. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  12722. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  12723. do { \
  12724. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  12725. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  12726. } while (0)
  12727. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  12728. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  12729. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  12730. do { \
  12731. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  12732. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  12733. } while (0)
  12734. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  12735. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  12736. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  12737. do { \
  12738. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  12739. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  12740. } while (0)
  12741. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  12742. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  12743. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  12744. do { \
  12745. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  12746. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  12747. } while (0)
  12748. /**
  12749. * @brief target -> host channel calibration data message
  12750. *
  12751. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  12752. *
  12753. * @brief host -> target channel calibration data message
  12754. *
  12755. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  12756. *
  12757. * @details
  12758. * The following field definitions describe the format of the channel
  12759. * calibration data message sent from the target to the host when
  12760. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  12761. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  12762. * The message is defined as htt_chan_caldata_msg followed by a variable
  12763. * number of 32-bit character values.
  12764. *
  12765. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  12766. * |------------------------------------------------------------------|
  12767. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  12768. * |------------------------------------------------------------------|
  12769. * | payload size | mhz |
  12770. * |------------------------------------------------------------------|
  12771. * | center frequency 2 | center frequency 1 |
  12772. * |------------------------------------------------------------------|
  12773. * | check sum |
  12774. * |------------------------------------------------------------------|
  12775. * | payload |
  12776. * |------------------------------------------------------------------|
  12777. * message info field:
  12778. * - MSG_TYPE
  12779. * Bits 7:0
  12780. * Purpose: identifies this as a channel calibration data message
  12781. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  12782. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  12783. * - SUB_TYPE
  12784. * Bits 11:8
  12785. * Purpose: T2H: indicates whether target is providing chan cal data
  12786. * to the host to store, or requesting that the host
  12787. * download previously-stored data.
  12788. * H2T: indicates whether the host is providing the requested
  12789. * channel cal data, or if it is rejecting the data
  12790. * request because it does not have the requested data.
  12791. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  12792. * - CHKSUM_VALID
  12793. * Bit 12
  12794. * Purpose: indicates if the checksum field is valid
  12795. * value:
  12796. * - FRAG
  12797. * Bit 19:16
  12798. * Purpose: indicates the fragment index for message
  12799. * value: 0 for first fragment, 1 for second fragment, ...
  12800. * - APPEND
  12801. * Bit 20
  12802. * Purpose: indicates if this is the last fragment
  12803. * value: 0 = final fragment, 1 = more fragments will be appended
  12804. *
  12805. * channel and payload size field
  12806. * - MHZ
  12807. * Bits 15:0
  12808. * Purpose: indicates the channel primary frequency
  12809. * Value:
  12810. * - PAYLOAD_SIZE
  12811. * Bits 31:16
  12812. * Purpose: indicates the bytes of calibration data in payload
  12813. * Value:
  12814. *
  12815. * center frequency field
  12816. * - CENTER FREQUENCY 1
  12817. * Bits 15:0
  12818. * Purpose: indicates the channel center frequency
  12819. * Value: channel center frequency, in MHz units
  12820. * - CENTER FREQUENCY 2
  12821. * Bits 31:16
  12822. * Purpose: indicates the secondary channel center frequency,
  12823. * only for 11acvht 80plus80 mode
  12824. * Value: secondary channel center frequeny, in MHz units, if applicable
  12825. *
  12826. * checksum field
  12827. * - CHECK_SUM
  12828. * Bits 31:0
  12829. * Purpose: check the payload data, it is just for this fragment.
  12830. * This is intended for the target to check that the channel
  12831. * calibration data returned by the host is the unmodified data
  12832. * that was previously provided to the host by the target.
  12833. * value: checksum of fragment payload
  12834. */
  12835. PREPACK struct htt_chan_caldata_msg {
  12836. /* DWORD 0: message info */
  12837. A_UINT32
  12838. msg_type: 8,
  12839. sub_type: 4 ,
  12840. chksum_valid: 1, /** 1:valid, 0:invalid */
  12841. reserved1: 3,
  12842. frag_idx: 4, /** fragment index for calibration data */
  12843. appending: 1, /** 0: no fragment appending,
  12844. * 1: extra fragment appending */
  12845. reserved2: 11;
  12846. /* DWORD 1: channel and payload size */
  12847. A_UINT32
  12848. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  12849. payload_size: 16; /** unit: bytes */
  12850. /* DWORD 2: center frequency */
  12851. A_UINT32
  12852. band_center_freq1: 16, /** Center frequency 1 in MHz */
  12853. band_center_freq2: 16; /** Center frequency 2 in MHz,
  12854. * valid only for 11acvht 80plus80 mode */
  12855. /* DWORD 3: check sum */
  12856. A_UINT32 chksum;
  12857. /* variable length for calibration data */
  12858. A_UINT32 payload[1/* or more */];
  12859. } POSTPACK;
  12860. /* T2H SUBTYPE */
  12861. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  12862. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  12863. /* H2T SUBTYPE */
  12864. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  12865. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  12866. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  12867. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  12868. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  12869. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  12870. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  12871. do { \
  12872. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  12873. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  12874. } while (0)
  12875. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  12876. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  12877. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  12878. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  12879. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  12880. do { \
  12881. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  12882. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  12883. } while (0)
  12884. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  12885. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  12886. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  12887. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  12888. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  12889. do { \
  12890. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  12891. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  12892. } while (0)
  12893. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  12894. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  12895. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  12896. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  12897. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  12898. do { \
  12899. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  12900. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  12901. } while (0)
  12902. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  12903. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  12904. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  12905. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  12906. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  12907. do { \
  12908. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  12909. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  12910. } while (0)
  12911. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  12912. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  12913. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  12914. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  12915. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  12916. do { \
  12917. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  12918. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  12919. } while (0)
  12920. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  12921. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  12922. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  12923. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  12924. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  12925. do { \
  12926. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  12927. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  12928. } while (0)
  12929. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  12930. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  12931. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  12932. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  12933. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  12934. do { \
  12935. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  12936. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  12937. } while (0)
  12938. /**
  12939. * @brief target -> host FSE CMEM based send
  12940. *
  12941. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  12942. *
  12943. * @details
  12944. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  12945. * FSE placement in CMEM is enabled.
  12946. *
  12947. * This message sends the non-secure CMEM base address.
  12948. * It will be sent to host in response to message
  12949. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  12950. * The message would appear as follows:
  12951. *
  12952. * |31 24|23 16|15 8|7 0|
  12953. * |----------------+----------------+----------------+----------------|
  12954. * | reserved | num_entries | msg_type |
  12955. * |----------------+----------------+----------------+----------------|
  12956. * | base_address_lo |
  12957. * |----------------+----------------+----------------+----------------|
  12958. * | base_address_hi |
  12959. * |-------------------------------------------------------------------|
  12960. *
  12961. * The message is interpreted as follows:
  12962. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  12963. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  12964. * b'8:15 - number_entries: Indicated the number of entries
  12965. * programmed.
  12966. * b'16:31 - reserved.
  12967. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  12968. * CMEM base address
  12969. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  12970. * CMEM base address
  12971. */
  12972. PREPACK struct htt_cmem_base_send_t {
  12973. A_UINT32 msg_type: 8,
  12974. num_entries: 8,
  12975. reserved: 16;
  12976. A_UINT32 base_address_lo;
  12977. A_UINT32 base_address_hi;
  12978. } POSTPACK;
  12979. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  12980. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  12981. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  12982. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  12983. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  12984. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  12985. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  12986. do { \
  12987. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  12988. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  12989. } while (0)
  12990. /**
  12991. * @brief - HTT PPDU ID format
  12992. *
  12993. * @details
  12994. * The following field definitions describe the format of the PPDU ID.
  12995. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  12996. *
  12997. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  12998. * +--------------------------------------------------------------------------
  12999. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  13000. * +--------------------------------------------------------------------------
  13001. *
  13002. * sch id :Schedule command id
  13003. * Bits [11 : 0] : monotonically increasing counter to track the
  13004. * PPDU posted to a specific transmit queue.
  13005. *
  13006. * hwq_id: Hardware Queue ID.
  13007. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  13008. *
  13009. * mac_id: MAC ID
  13010. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  13011. *
  13012. * seq_idx: Sequence index.
  13013. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  13014. * a particular TXOP.
  13015. *
  13016. * tqm_cmd: HWSCH/TQM flag.
  13017. * Bit [23] : Always set to 0.
  13018. *
  13019. * seq_cmd_type: Sequence command type.
  13020. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  13021. * Refer to enum HTT_STATS_FTYPE for values.
  13022. */
  13023. PREPACK struct htt_ppdu_id {
  13024. A_UINT32
  13025. sch_id: 12,
  13026. hwq_id: 5,
  13027. mac_id: 2,
  13028. seq_idx: 2,
  13029. reserved1: 2,
  13030. tqm_cmd: 1,
  13031. seq_cmd_type: 6,
  13032. reserved2: 2;
  13033. } POSTPACK;
  13034. #define HTT_PPDU_ID_SCH_ID_S 0
  13035. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  13036. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  13037. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  13038. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  13039. do { \
  13040. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  13041. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  13042. } while (0)
  13043. #define HTT_PPDU_ID_HWQ_ID_S 12
  13044. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  13045. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  13046. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  13047. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  13048. do { \
  13049. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  13050. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  13051. } while (0)
  13052. #define HTT_PPDU_ID_MAC_ID_S 17
  13053. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  13054. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  13055. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  13056. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  13057. do { \
  13058. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  13059. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  13060. } while (0)
  13061. #define HTT_PPDU_ID_SEQ_IDX_S 19
  13062. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  13063. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  13064. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  13065. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  13066. do { \
  13067. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  13068. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  13069. } while (0)
  13070. #define HTT_PPDU_ID_TQM_CMD_S 23
  13071. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  13072. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  13073. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  13074. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  13075. do { \
  13076. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  13077. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  13078. } while (0)
  13079. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  13080. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  13081. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  13082. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  13083. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  13084. do { \
  13085. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  13086. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  13087. } while (0)
  13088. /**
  13089. * @brief target -> RX PEER METADATA V0 format
  13090. * Host will know the peer metadata version from the wmi_service_ready_ext2
  13091. * message from target, and will confirm to the target which peer metadata
  13092. * version to use in the wmi_init message.
  13093. *
  13094. * The following diagram shows the format of the RX PEER METADATA.
  13095. *
  13096. * |31 24|23 16|15 8|7 0|
  13097. * |-----------------------------------------------------------------------|
  13098. * | Reserved | VDEV ID | PEER ID |
  13099. * |-----------------------------------------------------------------------|
  13100. */
  13101. PREPACK struct htt_rx_peer_metadata_v0 {
  13102. A_UINT32
  13103. peer_id: 16,
  13104. vdev_id: 8,
  13105. reserved1: 8;
  13106. } POSTPACK;
  13107. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  13108. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  13109. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  13110. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  13111. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  13112. do { \
  13113. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  13114. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  13115. } while (0)
  13116. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  13117. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  13118. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  13119. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  13120. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  13121. do { \
  13122. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  13123. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  13124. } while (0)
  13125. /**
  13126. * @brief target -> RX PEER METADATA V1 format
  13127. * Host will know the peer metadata version from the wmi_service_ready_ext2
  13128. * message from target, and will confirm to the target which peer metadata
  13129. * version to use in the wmi_init message.
  13130. *
  13131. * The following diagram shows the format of the RX PEER METADATA V1 format.
  13132. *
  13133. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  13134. * |-----------------------------------------------------------------------|
  13135. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  13136. * |-----------------------------------------------------------------------|
  13137. */
  13138. PREPACK struct htt_rx_peer_metadata_v1 {
  13139. A_UINT32
  13140. peer_id: 13,
  13141. ml_peer_valid: 1,
  13142. reserved1: 2,
  13143. vdev_id: 8,
  13144. lmac_id: 2,
  13145. chip_id: 3,
  13146. reserved2: 3;
  13147. } POSTPACK;
  13148. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  13149. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  13150. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  13151. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  13152. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  13153. do { \
  13154. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  13155. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  13156. } while (0)
  13157. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  13158. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  13159. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  13160. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  13161. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  13162. do { \
  13163. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  13164. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  13165. } while (0)
  13166. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  13167. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  13168. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  13169. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  13170. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  13171. do { \
  13172. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  13173. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  13174. } while (0)
  13175. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  13176. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  13177. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  13178. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  13179. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  13180. do { \
  13181. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  13182. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  13183. } while (0)
  13184. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  13185. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  13186. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  13187. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  13188. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  13189. do { \
  13190. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  13191. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  13192. } while (0)
  13193. /*
  13194. * In some systems, the host SW wants to specify priorities between
  13195. * different MSDU / flow queues within the same peer-TID.
  13196. * The below enums are used for the host to identify to the target
  13197. * which MSDU queue's priority it wants to adjust.
  13198. */
  13199. /*
  13200. * The MSDUQ index describe index of TCL HW, where each index is
  13201. * used for queuing particular types of MSDUs.
  13202. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  13203. */
  13204. enum HTT_MSDUQ_INDEX {
  13205. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  13206. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  13207. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  13208. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  13209. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  13210. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  13211. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  13212. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  13213. HTT_MSDUQ_MAX_INDEX,
  13214. };
  13215. /* MSDU qtype definition */
  13216. enum HTT_MSDU_QTYPE {
  13217. /*
  13218. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  13219. * relative priority. Instead, the relative priority of CRIT_0 versus
  13220. * CRIT_1 is controlled by the FW, through the configuration parameters
  13221. * it applies to the queues.
  13222. */
  13223. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  13224. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  13225. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  13226. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  13227. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  13228. /* New MSDU_QTYPE should be added above this line */
  13229. /*
  13230. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  13231. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  13232. * any host/target message definitions. The QTYPE_MAX value can
  13233. * only be used internally within the host or within the target.
  13234. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  13235. * it must regard the unexpected value as a default qtype value,
  13236. * or ignore it.
  13237. */
  13238. HTT_MSDU_QTYPE_MAX,
  13239. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  13240. };
  13241. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  13242. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  13243. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  13244. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  13245. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  13246. };
  13247. /**
  13248. * @brief target -> host mlo timestamp offset indication
  13249. *
  13250. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  13251. *
  13252. * @details
  13253. * The following field definitions describe the format of the HTT target
  13254. * to host mlo timestamp offset indication message.
  13255. *
  13256. *
  13257. * |31 16|15 12|11 10|9 8|7 0 |
  13258. * |----------------------------------------------------------------------|
  13259. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  13260. * |----------------------------------------------------------------------|
  13261. * | Sync time stamp lo in us |
  13262. * |----------------------------------------------------------------------|
  13263. * | Sync time stamp hi in us |
  13264. * |----------------------------------------------------------------------|
  13265. * | mlo time stamp offset lo in us |
  13266. * |----------------------------------------------------------------------|
  13267. * | mlo time stamp offset hi in us |
  13268. * |----------------------------------------------------------------------|
  13269. * | mlo time stamp offset clocks in clock ticks |
  13270. * |----------------------------------------------------------------------|
  13271. * |31 26|25 16|15 0 |
  13272. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  13273. * | | compensation in clks | |
  13274. * |----------------------------------------------------------------------|
  13275. * |31 22|21 0 |
  13276. * | rsvd 3 | mlo time stamp comp timer period |
  13277. * |----------------------------------------------------------------------|
  13278. * The message is interpreted as follows:
  13279. *
  13280. * dword0 - b'0:7 - msg_type: This will be set to
  13281. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  13282. * value: 0x28
  13283. *
  13284. * dword0 - b'9:8 - pdev_id
  13285. *
  13286. * dword0 - b'11:10 - chip_id
  13287. *
  13288. * dword0 - b'15:12 - rsvd1: Reserved for future use
  13289. *
  13290. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  13291. *
  13292. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  13293. * which last sync interrupt was received
  13294. *
  13295. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  13296. * which last sync interrupt was received
  13297. *
  13298. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  13299. *
  13300. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  13301. *
  13302. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  13303. *
  13304. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  13305. *
  13306. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  13307. * for sub us resolution
  13308. *
  13309. * dword6 - b'31:26 - rsvd2: Reserved for future use
  13310. *
  13311. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  13312. * is applied, in us
  13313. *
  13314. * dword7 - b'31:22 - rsvd3: Reserved for future use
  13315. */
  13316. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  13317. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  13318. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  13319. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  13320. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  13321. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  13322. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  13323. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  13324. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  13325. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  13326. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  13327. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  13328. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  13329. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  13330. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  13331. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  13332. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  13333. do { \
  13334. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  13335. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  13336. } while (0)
  13337. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  13338. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  13339. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  13340. do { \
  13341. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  13342. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  13343. } while (0)
  13344. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  13345. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  13346. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  13347. do { \
  13348. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  13349. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  13350. } while (0)
  13351. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  13352. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  13353. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  13354. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  13355. do { \
  13356. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  13357. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  13358. } while (0)
  13359. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  13360. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  13361. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  13362. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  13363. do { \
  13364. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  13365. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  13366. } while (0)
  13367. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  13368. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  13369. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  13370. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  13371. do { \
  13372. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  13373. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  13374. } while (0)
  13375. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  13376. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  13377. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  13378. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  13379. do { \
  13380. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  13381. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  13382. } while (0)
  13383. typedef struct {
  13384. A_UINT32 msg_type: 8, /* bits 7:0 */
  13385. pdev_id: 2, /* bits 9:8 */
  13386. chip_id: 2, /* bits 11:10 */
  13387. reserved1: 4, /* bits 15:12 */
  13388. mac_clk_freq_mhz: 16; /* bits 31:16 */
  13389. A_UINT32 sync_timestamp_lo_us;
  13390. A_UINT32 sync_timestamp_hi_us;
  13391. A_UINT32 mlo_timestamp_offset_lo_us;
  13392. A_UINT32 mlo_timestamp_offset_hi_us;
  13393. A_UINT32 mlo_timestamp_offset_clks;
  13394. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  13395. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  13396. reserved2: 6; /* bits 31:26 */
  13397. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  13398. reserved3: 10; /* bits 31:22 */
  13399. } htt_t2h_mlo_offset_ind_t;
  13400. #endif