htt.h 501 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116
  1. /*
  2. * Copyright (c) 2011-2018 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. */
  169. #define HTT_CURRENT_VERSION_MAJOR 3
  170. #define HTT_CURRENT_VERSION_MINOR 57
  171. #define HTT_NUM_TX_FRAG_DESC 1024
  172. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  173. #define HTT_CHECK_SET_VAL(field, val) \
  174. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  175. /* macros to assist in sign-extending fields from HTT messages */
  176. #define HTT_SIGN_BIT_MASK(field) \
  177. ((field ## _M + (1 << field ## _S)) >> 1)
  178. #define HTT_SIGN_BIT(_val, field) \
  179. (_val & HTT_SIGN_BIT_MASK(field))
  180. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  181. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  182. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  183. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  184. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  185. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  186. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  187. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  188. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  189. /*
  190. * TEMPORARY:
  191. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  192. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  193. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  194. * updated.
  195. */
  196. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  197. /*
  198. * TEMPORARY:
  199. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  200. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  201. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  202. * updated.
  203. */
  204. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  205. /* HTT Access Category values */
  206. enum HTT_AC_WMM {
  207. /* WMM Access Categories */
  208. HTT_AC_WMM_BE = 0x0,
  209. HTT_AC_WMM_BK = 0x1,
  210. HTT_AC_WMM_VI = 0x2,
  211. HTT_AC_WMM_VO = 0x3,
  212. /* extension Access Categories */
  213. HTT_AC_EXT_NON_QOS = 0x4,
  214. HTT_AC_EXT_UCAST_MGMT = 0x5,
  215. HTT_AC_EXT_MCAST_DATA = 0x6,
  216. HTT_AC_EXT_MCAST_MGMT = 0x7,
  217. };
  218. enum HTT_AC_WMM_MASK {
  219. /* WMM Access Categories */
  220. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  221. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  222. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  223. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  224. /* extension Access Categories */
  225. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  226. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  227. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  228. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  229. };
  230. #define HTT_AC_MASK_WMM \
  231. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  232. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  233. #define HTT_AC_MASK_EXT \
  234. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  235. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  236. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  237. /*
  238. * htt_dbg_stats_type -
  239. * bit positions for each stats type within a stats type bitmask
  240. * The bitmask contains 24 bits.
  241. */
  242. enum htt_dbg_stats_type {
  243. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  244. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  245. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  246. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  247. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  248. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  249. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  250. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  251. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  252. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  253. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  254. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  255. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  256. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  257. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  258. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  259. /* bits 16-23 currently reserved */
  260. /* keep this last */
  261. HTT_DBG_NUM_STATS
  262. };
  263. /*=== HTT option selection TLVs ===
  264. * Certain HTT messages have alternatives or options.
  265. * For such cases, the host and target need to agree on which option to use.
  266. * Option specification TLVs can be appended to the VERSION_REQ and
  267. * VERSION_CONF messages to select options other than the default.
  268. * These TLVs are entirely optional - if they are not provided, there is a
  269. * well-defined default for each option. If they are provided, they can be
  270. * provided in any order. Each TLV can be present or absent independent of
  271. * the presence / absence of other TLVs.
  272. *
  273. * The HTT option selection TLVs use the following format:
  274. * |31 16|15 8|7 0|
  275. * |---------------------------------+----------------+----------------|
  276. * | value (payload) | length | tag |
  277. * |-------------------------------------------------------------------|
  278. * The value portion need not be only 2 bytes; it can be extended by any
  279. * integer number of 4-byte units. The total length of the TLV, including
  280. * the tag and length fields, must be a multiple of 4 bytes. The length
  281. * field specifies the total TLV size in 4-byte units. Thus, the typical
  282. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  283. * field, would store 0x1 in its length field, to show that the TLV occupies
  284. * a single 4-byte unit.
  285. */
  286. /*--- TLV header format - applies to all HTT option TLVs ---*/
  287. enum HTT_OPTION_TLV_TAGS {
  288. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  289. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  290. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  291. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  292. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  293. };
  294. PREPACK struct htt_option_tlv_header_t {
  295. A_UINT8 tag;
  296. A_UINT8 length;
  297. } POSTPACK;
  298. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  299. #define HTT_OPTION_TLV_TAG_S 0
  300. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  301. #define HTT_OPTION_TLV_LENGTH_S 8
  302. /*
  303. * value0 - 16 bit value field stored in word0
  304. * The TLV's value field may be longer than 2 bytes, in which case
  305. * the remainder of the value is stored in word1, word2, etc.
  306. */
  307. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  308. #define HTT_OPTION_TLV_VALUE0_S 16
  309. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  310. do { \
  311. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  312. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  313. } while (0)
  314. #define HTT_OPTION_TLV_TAG_GET(word) \
  315. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  316. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  317. do { \
  318. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  319. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  320. } while (0)
  321. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  322. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  323. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  324. do { \
  325. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  326. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  327. } while (0)
  328. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  329. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  330. /*--- format of specific HTT option TLVs ---*/
  331. /*
  332. * HTT option TLV for specifying LL bus address size
  333. * Some chips require bus addresses used by the target to access buffers
  334. * within the host's memory to be 32 bits; others require bus addresses
  335. * used by the target to access buffers within the host's memory to be
  336. * 64 bits.
  337. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  338. * a suffix to the VERSION_CONF message to specify which bus address format
  339. * the target requires.
  340. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  341. * default to providing bus addresses to the target in 32-bit format.
  342. */
  343. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  344. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  345. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  346. };
  347. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  348. struct htt_option_tlv_header_t hdr;
  349. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  350. } POSTPACK;
  351. /*
  352. * HTT option TLV for specifying whether HL systems should indicate
  353. * over-the-air tx completion for individual frames, or should instead
  354. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  355. * requests an OTA tx completion for a particular tx frame.
  356. * This option does not apply to LL systems, where the TX_COMPL_IND
  357. * is mandatory.
  358. * This option is primarily intended for HL systems in which the tx frame
  359. * downloads over the host --> target bus are as slow as or slower than
  360. * the transmissions over the WLAN PHY. For cases where the bus is faster
  361. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  362. * and consquently will send one TX_COMPL_IND message that covers several
  363. * tx frames. For cases where the WLAN PHY is faster than the bus,
  364. * the target will end up transmitting very short A-MPDUs, and consequently
  365. * sending many TX_COMPL_IND messages, which each cover a very small number
  366. * of tx frames.
  367. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  368. * a suffix to the VERSION_REQ message to request whether the host desires to
  369. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  370. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  371. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  372. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  373. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  374. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  375. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  376. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  377. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  378. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  379. * TLV.
  380. */
  381. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  382. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  383. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  384. };
  385. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  386. struct htt_option_tlv_header_t hdr;
  387. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  388. } POSTPACK;
  389. /*
  390. * HTT option TLV for specifying how many tx queue groups the target
  391. * may establish.
  392. * This TLV specifies the maximum value the target may send in the
  393. * txq_group_id field of any TXQ_GROUP information elements sent by
  394. * the target to the host. This allows the host to pre-allocate an
  395. * appropriate number of tx queue group structs.
  396. *
  397. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  398. * a suffix to the VERSION_REQ message to specify whether the host supports
  399. * tx queue groups at all, and if so if there is any limit on the number of
  400. * tx queue groups that the host supports.
  401. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  402. * a suffix to the VERSION_CONF message. If the host has specified in the
  403. * VER_REQ message a limit on the number of tx queue groups the host can
  404. * supprt, the target shall limit its specification of the maximum tx groups
  405. * to be no larger than this host-specified limit.
  406. *
  407. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  408. * shall preallocate 4 tx queue group structs, and the target shall not
  409. * specify a txq_group_id larger than 3.
  410. */
  411. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  412. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  413. /*
  414. * values 1 through N specify the max number of tx queue groups
  415. * the sender supports
  416. */
  417. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  418. };
  419. /* TEMPORARY backwards-compatibility alias for a typo fix -
  420. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  421. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  422. * to support the old name (with the typo) until all references to the
  423. * old name are replaced with the new name.
  424. */
  425. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  426. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  427. struct htt_option_tlv_header_t hdr;
  428. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  429. } POSTPACK;
  430. /*
  431. * HTT option TLV for specifying whether the target supports an extended
  432. * version of the HTT tx descriptor. If the target provides this TLV
  433. * and specifies in the TLV that the target supports an extended version
  434. * of the HTT tx descriptor, the target must check the "extension" bit in
  435. * the HTT tx descriptor, and if the extension bit is set, to expect a
  436. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  437. * descriptor. Furthermore, the target must provide room for the HTT
  438. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  439. * This option is intended for systems where the host needs to explicitly
  440. * control the transmission parameters such as tx power for individual
  441. * tx frames.
  442. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  443. * as a suffix to the VERSION_CONF message to explicitly specify whether
  444. * the target supports the HTT tx MSDU extension descriptor.
  445. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  446. * by the host as lack of target support for the HTT tx MSDU extension
  447. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  448. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  449. * the HTT tx MSDU extension descriptor.
  450. * The host is not required to provide the HTT tx MSDU extension descriptor
  451. * just because the target supports it; the target must check the
  452. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  453. * extension descriptor is present.
  454. */
  455. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  456. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  457. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  458. };
  459. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  460. struct htt_option_tlv_header_t hdr;
  461. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  462. } POSTPACK;
  463. /*=== host -> target messages ===============================================*/
  464. enum htt_h2t_msg_type {
  465. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  466. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  467. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  468. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  469. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  470. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  471. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  472. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  473. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  474. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  475. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  476. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  477. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  478. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  479. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  480. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  481. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  482. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  483. /* keep this last */
  484. HTT_H2T_NUM_MSGS
  485. };
  486. /*
  487. * HTT host to target message type -
  488. * stored in bits 7:0 of the first word of the message
  489. */
  490. #define HTT_H2T_MSG_TYPE_M 0xff
  491. #define HTT_H2T_MSG_TYPE_S 0
  492. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  493. do { \
  494. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  495. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  496. } while (0)
  497. #define HTT_H2T_MSG_TYPE_GET(word) \
  498. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  499. /**
  500. * @brief host -> target version number request message definition
  501. *
  502. * |31 24|23 16|15 8|7 0|
  503. * |----------------+----------------+----------------+----------------|
  504. * | reserved | msg type |
  505. * |-------------------------------------------------------------------|
  506. * : option request TLV (optional) |
  507. * :...................................................................:
  508. *
  509. * The VER_REQ message may consist of a single 4-byte word, or may be
  510. * extended with TLVs that specify which HTT options the host is requesting
  511. * from the target.
  512. * The following option TLVs may be appended to the VER_REQ message:
  513. * - HL_SUPPRESS_TX_COMPL_IND
  514. * - HL_MAX_TX_QUEUE_GROUPS
  515. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  516. * may be appended to the VER_REQ message (but only one TLV of each type).
  517. *
  518. * Header fields:
  519. * - MSG_TYPE
  520. * Bits 7:0
  521. * Purpose: identifies this as a version number request message
  522. * Value: 0x0
  523. */
  524. #define HTT_VER_REQ_BYTES 4
  525. /* TBDXXX: figure out a reasonable number */
  526. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  527. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  528. /**
  529. * @brief HTT tx MSDU descriptor
  530. *
  531. * @details
  532. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  533. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  534. * the target firmware needs for the FW's tx processing, particularly
  535. * for creating the HW msdu descriptor.
  536. * The same HTT tx descriptor is used for HL and LL systems, though
  537. * a few fields within the tx descriptor are used only by LL or
  538. * only by HL.
  539. * The HTT tx descriptor is defined in two manners: by a struct with
  540. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  541. * definitions.
  542. * The target should use the struct def, for simplicitly and clarity,
  543. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  544. * neutral. Specifically, the host shall use the get/set macros built
  545. * around the mask + shift defs.
  546. */
  547. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  548. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  549. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  550. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  551. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  552. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  553. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  554. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  555. #define HTT_TX_VDEV_ID_WORD 0
  556. #define HTT_TX_VDEV_ID_MASK 0x3f
  557. #define HTT_TX_VDEV_ID_SHIFT 16
  558. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  559. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  560. #define HTT_TX_MSDU_LEN_DWORD 1
  561. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  562. /*
  563. * HTT_VAR_PADDR macros
  564. * Allow physical / bus addresses to be either a single 32-bit value,
  565. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  566. */
  567. #define HTT_VAR_PADDR32(var_name) \
  568. A_UINT32 var_name
  569. #define HTT_VAR_PADDR64_LE(var_name) \
  570. struct { \
  571. /* little-endian: lo precedes hi */ \
  572. A_UINT32 lo; \
  573. A_UINT32 hi; \
  574. } var_name
  575. /*
  576. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  577. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  578. * addresses are stored in a XXX-bit field.
  579. * This macro is used to define both htt_tx_msdu_desc32_t and
  580. * htt_tx_msdu_desc64_t structs.
  581. */
  582. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  583. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  584. { \
  585. /* DWORD 0: flags and meta-data */ \
  586. A_UINT32 \
  587. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  588. \
  589. /* pkt_subtype - \
  590. * Detailed specification of the tx frame contents, extending the \
  591. * general specification provided by pkt_type. \
  592. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  593. * pkt_type | pkt_subtype \
  594. * ============================================================== \
  595. * 802.3 | bit 0:3 - Reserved \
  596. * | bit 4: 0x0 - Copy-Engine Classification Results \
  597. * | not appended to the HTT message \
  598. * | 0x1 - Copy-Engine Classification Results \
  599. * | appended to the HTT message in the \
  600. * | format: \
  601. * | [HTT tx desc, frame header, \
  602. * | CE classification results] \
  603. * | The CE classification results begin \
  604. * | at the next 4-byte boundary after \
  605. * | the frame header. \
  606. * ------------+------------------------------------------------- \
  607. * Eth2 | bit 0:3 - Reserved \
  608. * | bit 4: 0x0 - Copy-Engine Classification Results \
  609. * | not appended to the HTT message \
  610. * | 0x1 - Copy-Engine Classification Results \
  611. * | appended to the HTT message. \
  612. * | See the above specification of the \
  613. * | CE classification results location. \
  614. * ------------+------------------------------------------------- \
  615. * native WiFi | 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. \
  620. * | See the above specification of the \
  621. * | CE classification results location. \
  622. * ------------+------------------------------------------------- \
  623. * mgmt | 0x0 - 802.11 MAC header absent \
  624. * | 0x1 - 802.11 MAC header present \
  625. * ------------+------------------------------------------------- \
  626. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  627. * | 0x1 - 802.11 MAC header present \
  628. * | bit 1: 0x0 - allow aggregation \
  629. * | 0x1 - don't allow aggregation \
  630. * | bit 2: 0x0 - perform encryption \
  631. * | 0x1 - don't perform encryption \
  632. * | bit 3: 0x0 - perform tx classification / queuing \
  633. * | 0x1 - don't perform tx classification; \
  634. * | insert the frame into the "misc" \
  635. * | tx queue \
  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. pkt_subtype: 5, \
  644. \
  645. /* pkt_type - \
  646. * General specification of the tx frame contents. \
  647. * The htt_pkt_type enum should be used to specify and check the \
  648. * value of this field. \
  649. */ \
  650. pkt_type: 3, \
  651. \
  652. /* vdev_id - \
  653. * ID for the vdev that is sending this tx frame. \
  654. * For certain non-standard packet types, e.g. pkt_type == raw \
  655. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  656. * This field is used primarily for determining where to queue \
  657. * broadcast and multicast frames. \
  658. */ \
  659. vdev_id: 6, \
  660. /* ext_tid - \
  661. * The extended traffic ID. \
  662. * If the TID is unknown, the extended TID is set to \
  663. * HTT_TX_EXT_TID_INVALID. \
  664. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  665. * value of the QoS TID. \
  666. * If the tx frame is non-QoS data, then the extended TID is set to \
  667. * HTT_TX_EXT_TID_NON_QOS. \
  668. * If the tx frame is multicast or broadcast, then the extended TID \
  669. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  670. */ \
  671. ext_tid: 5, \
  672. \
  673. /* postponed - \
  674. * This flag indicates whether the tx frame has been downloaded to \
  675. * the target before but discarded by the target, and now is being \
  676. * downloaded again; or if this is a new frame that is being \
  677. * downloaded for the first time. \
  678. * This flag allows the target to determine the correct order for \
  679. * transmitting new vs. old frames. \
  680. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  681. * This flag only applies to HL systems, since in LL systems, \
  682. * the tx flow control is handled entirely within the target. \
  683. */ \
  684. postponed: 1, \
  685. \
  686. /* extension - \
  687. * This flag indicates whether a HTT tx MSDU extension descriptor \
  688. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  689. * \
  690. * 0x0 - no extension MSDU descriptor is present \
  691. * 0x1 - an extension MSDU descriptor immediately follows the \
  692. * regular MSDU descriptor \
  693. */ \
  694. extension: 1, \
  695. \
  696. /* cksum_offload - \
  697. * This flag indicates whether checksum offload is enabled or not \
  698. * for this frame. Target FW use this flag to turn on HW checksumming \
  699. * 0x0 - No checksum offload \
  700. * 0x1 - L3 header checksum only \
  701. * 0x2 - L4 checksum only \
  702. * 0x3 - L3 header checksum + L4 checksum \
  703. */ \
  704. cksum_offload: 2, \
  705. \
  706. /* tx_comp_req - \
  707. * This flag indicates whether Tx Completion \
  708. * from fw is required or not. \
  709. * This flag is only relevant if tx completion is not \
  710. * universally enabled. \
  711. * For all LL systems, tx completion is mandatory, \
  712. * so this flag will be irrelevant. \
  713. * For HL systems tx completion is optional, but HL systems in which \
  714. * the bus throughput exceeds the WLAN throughput will \
  715. * probably want to always use tx completion, and thus \
  716. * would not check this flag. \
  717. * This flag is required when tx completions are not used universally, \
  718. * but are still required for certain tx frames for which \
  719. * an OTA delivery acknowledgment is needed by the host. \
  720. * In practice, this would be for HL systems in which the \
  721. * bus throughput is less than the WLAN throughput. \
  722. * \
  723. * 0x0 - Tx Completion Indication from Fw not required \
  724. * 0x1 - Tx Completion Indication from Fw is required \
  725. */ \
  726. tx_compl_req: 1; \
  727. \
  728. \
  729. /* DWORD 1: MSDU length and ID */ \
  730. A_UINT32 \
  731. len: 16, /* MSDU length, in bytes */ \
  732. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  733. * and this id is used to calculate fragmentation \
  734. * descriptor pointer inside the target based on \
  735. * the base address, configured inside the target. \
  736. */ \
  737. \
  738. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  739. /* frags_desc_ptr - \
  740. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  741. * where the tx frame's fragments reside in memory. \
  742. * This field only applies to LL systems, since in HL systems the \
  743. * (degenerate single-fragment) fragmentation descriptor is created \
  744. * within the target. \
  745. */ \
  746. _paddr__frags_desc_ptr_; \
  747. \
  748. /* DWORD 3 (or 4): peerid, chanfreq */ \
  749. /* \
  750. * Peer ID : Target can use this value to know which peer-id packet \
  751. * destined to. \
  752. * It's intended to be specified by host in case of NAWDS. \
  753. */ \
  754. A_UINT16 peerid; \
  755. \
  756. /* \
  757. * Channel frequency: This identifies the desired channel \
  758. * frequency (in mhz) for tx frames. This is used by FW to help \
  759. * determine when it is safe to transmit or drop frames for \
  760. * off-channel operation. \
  761. * The default value of zero indicates to FW that the corresponding \
  762. * VDEV's home channel (if there is one) is the desired channel \
  763. * frequency. \
  764. */ \
  765. A_UINT16 chanfreq; \
  766. \
  767. /* Reason reserved is commented is increasing the htt structure size \
  768. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  769. * A_UINT32 reserved_dword3_bits0_31; \
  770. */ \
  771. } POSTPACK
  772. /* define a htt_tx_msdu_desc32_t type */
  773. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  774. /* define a htt_tx_msdu_desc64_t type */
  775. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  776. /*
  777. * Make htt_tx_msdu_desc_t be an alias for either
  778. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  779. */
  780. #if HTT_PADDR64
  781. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  782. #else
  783. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  784. #endif
  785. /* decriptor information for Management frame*/
  786. /*
  787. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  788. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  789. */
  790. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  791. extern A_UINT32 mgmt_hdr_len;
  792. PREPACK struct htt_mgmt_tx_desc_t {
  793. A_UINT32 msg_type;
  794. #if HTT_PADDR64
  795. A_UINT64 frag_paddr; /* DMAble address of the data */
  796. #else
  797. A_UINT32 frag_paddr; /* DMAble address of the data */
  798. #endif
  799. A_UINT32 desc_id; /* returned to host during completion
  800. * to free the meory*/
  801. A_UINT32 len; /* Fragment length */
  802. A_UINT32 vdev_id; /* virtual device ID*/
  803. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  804. } POSTPACK;
  805. PREPACK struct htt_mgmt_tx_compl_ind {
  806. A_UINT32 desc_id;
  807. A_UINT32 status;
  808. } POSTPACK;
  809. /*
  810. * This SDU header size comes from the summation of the following:
  811. * 1. Max of:
  812. * a. Native WiFi header, for native WiFi frames: 24 bytes
  813. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  814. * b. 802.11 header, for raw frames: 36 bytes
  815. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  816. * QoS header, HT header)
  817. * c. 802.3 header, for ethernet frames: 14 bytes
  818. * (destination address, source address, ethertype / length)
  819. * 2. Max of:
  820. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  821. * b. IPv6 header, up through the Traffic Class: 2 bytes
  822. * 3. 802.1Q VLAN header: 4 bytes
  823. * 4. LLC/SNAP header: 8 bytes
  824. */
  825. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  826. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  827. #define HTT_TX_HDR_SIZE_ETHERNET 14
  828. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  829. A_COMPILE_TIME_ASSERT(
  830. htt_encap_hdr_size_max_check_nwifi,
  831. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  832. A_COMPILE_TIME_ASSERT(
  833. htt_encap_hdr_size_max_check_enet,
  834. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  835. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  836. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  837. #define HTT_TX_HDR_SIZE_802_1Q 4
  838. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  839. #define HTT_COMMON_TX_FRM_HDR_LEN \
  840. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  841. HTT_TX_HDR_SIZE_802_1Q + \
  842. HTT_TX_HDR_SIZE_LLC_SNAP)
  843. #define HTT_HL_TX_FRM_HDR_LEN \
  844. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  845. #define HTT_LL_TX_FRM_HDR_LEN \
  846. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  847. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  848. /* dword 0 */
  849. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  850. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  851. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  852. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  853. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  854. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  855. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  856. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  857. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  858. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  859. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  860. #define HTT_TX_DESC_PKT_TYPE_S 13
  861. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  862. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  863. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  864. #define HTT_TX_DESC_VDEV_ID_S 16
  865. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  866. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  867. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  868. #define HTT_TX_DESC_EXT_TID_S 22
  869. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  870. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  871. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  872. #define HTT_TX_DESC_POSTPONED_S 27
  873. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  874. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  875. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  876. #define HTT_TX_DESC_EXTENSION_S 28
  877. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  878. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  879. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  880. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  881. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  882. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  883. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  884. #define HTT_TX_DESC_TX_COMP_S 31
  885. /* dword 1 */
  886. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  887. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  888. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  889. #define HTT_TX_DESC_FRM_LEN_S 0
  890. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  891. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  892. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  893. #define HTT_TX_DESC_FRM_ID_S 16
  894. /* dword 2 */
  895. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  896. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  897. /* for systems using 64-bit format for bus addresses */
  898. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  899. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  900. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  901. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  902. /* for systems using 32-bit format for bus addresses */
  903. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  904. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  905. /* dword 3 */
  906. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  907. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  908. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  909. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  910. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  911. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  912. #if HTT_PADDR64
  913. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  914. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  915. #else
  916. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  917. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  918. #endif
  919. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  920. #define HTT_TX_DESC_PEER_ID_S 0
  921. /*
  922. * TEMPORARY:
  923. * The original definitions for the PEER_ID fields contained typos
  924. * (with _DESC_PADDR appended to this PEER_ID field name).
  925. * Retain deprecated original names for PEER_ID fields until all code that
  926. * refers to them has been updated.
  927. */
  928. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  929. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  930. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  931. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  932. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  933. HTT_TX_DESC_PEER_ID_M
  934. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  935. HTT_TX_DESC_PEER_ID_S
  936. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  937. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  938. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  939. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  940. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  941. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  942. #if HTT_PADDR64
  943. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  944. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  945. #else
  946. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  947. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  948. #endif
  949. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  950. #define HTT_TX_DESC_CHAN_FREQ_S 16
  951. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  952. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  953. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  954. do { \
  955. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  956. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  957. } while (0)
  958. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  959. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  960. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  961. do { \
  962. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  963. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  964. } while (0)
  965. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  966. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  967. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  968. do { \
  969. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  970. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  971. } while (0)
  972. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  973. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  974. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  975. do { \
  976. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  977. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  978. } while (0)
  979. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  980. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  981. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  982. do { \
  983. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  984. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  985. } while (0)
  986. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  987. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  988. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  989. do { \
  990. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  991. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  992. } while (0)
  993. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  994. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  995. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  996. do { \
  997. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  998. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  999. } while (0)
  1000. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1001. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1002. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1003. do { \
  1004. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1005. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1006. } while (0)
  1007. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1008. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1009. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1010. do { \
  1011. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1012. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1013. } while (0)
  1014. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1015. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1016. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1017. do { \
  1018. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1019. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1020. } while (0)
  1021. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1022. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1023. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1024. do { \
  1025. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1026. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1027. } while (0)
  1028. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1029. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1030. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1031. do { \
  1032. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1033. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1034. } while (0)
  1035. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1036. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1037. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1038. do { \
  1039. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1040. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1041. } while (0)
  1042. /* enums used in the HTT tx MSDU extension descriptor */
  1043. enum {
  1044. htt_tx_guard_interval_regular = 0,
  1045. htt_tx_guard_interval_short = 1,
  1046. };
  1047. enum {
  1048. htt_tx_preamble_type_ofdm = 0,
  1049. htt_tx_preamble_type_cck = 1,
  1050. htt_tx_preamble_type_ht = 2,
  1051. htt_tx_preamble_type_vht = 3,
  1052. };
  1053. enum {
  1054. htt_tx_bandwidth_5MHz = 0,
  1055. htt_tx_bandwidth_10MHz = 1,
  1056. htt_tx_bandwidth_20MHz = 2,
  1057. htt_tx_bandwidth_40MHz = 3,
  1058. htt_tx_bandwidth_80MHz = 4,
  1059. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1060. };
  1061. /**
  1062. * @brief HTT tx MSDU extension descriptor
  1063. * @details
  1064. * If the target supports HTT tx MSDU extension descriptors, the host has
  1065. * the option of appending the following struct following the regular
  1066. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1067. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1068. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1069. * tx specs for each frame.
  1070. */
  1071. PREPACK struct htt_tx_msdu_desc_ext_t {
  1072. /* DWORD 0: flags */
  1073. A_UINT32
  1074. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1075. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1076. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1077. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1078. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1079. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1080. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1081. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1082. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1083. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1084. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1085. /* DWORD 1: tx power, tx rate, tx BW */
  1086. A_UINT32
  1087. /* pwr -
  1088. * Specify what power the tx frame needs to be transmitted at.
  1089. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1090. * The value needs to be appropriately sign-extended when extracting
  1091. * the value from the message and storing it in a variable that is
  1092. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1093. * automatically handles this sign-extension.)
  1094. * If the transmission uses multiple tx chains, this power spec is
  1095. * the total transmit power, assuming incoherent combination of
  1096. * per-chain power to produce the total power.
  1097. */
  1098. pwr: 8,
  1099. /* mcs_mask -
  1100. * Specify the allowable values for MCS index (modulation and coding)
  1101. * to use for transmitting the frame.
  1102. *
  1103. * For HT / VHT preamble types, this mask directly corresponds to
  1104. * the HT or VHT MCS indices that are allowed. For each bit N set
  1105. * within the mask, MCS index N is allowed for transmitting the frame.
  1106. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1107. * rates versus OFDM rates, so the host has the option of specifying
  1108. * that the target must transmit the frame with CCK or OFDM rates
  1109. * (not HT or VHT), but leaving the decision to the target whether
  1110. * to use CCK or OFDM.
  1111. *
  1112. * For CCK and OFDM, the bits within this mask are interpreted as
  1113. * follows:
  1114. * bit 0 -> CCK 1 Mbps rate is allowed
  1115. * bit 1 -> CCK 2 Mbps rate is allowed
  1116. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1117. * bit 3 -> CCK 11 Mbps rate is allowed
  1118. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1119. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1120. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1121. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1122. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1123. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1124. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1125. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1126. *
  1127. * The MCS index specification needs to be compatible with the
  1128. * bandwidth mask specification. For example, a MCS index == 9
  1129. * specification is inconsistent with a preamble type == VHT,
  1130. * Nss == 1, and channel bandwidth == 20 MHz.
  1131. *
  1132. * Furthermore, the host has only a limited ability to specify to
  1133. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1134. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1135. */
  1136. mcs_mask: 12,
  1137. /* nss_mask -
  1138. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1139. * Each bit in this mask corresponds to a Nss value:
  1140. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1141. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1142. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1143. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1144. * The values in the Nss mask must be suitable for the recipient, e.g.
  1145. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1146. * recipient which only supports 2x2 MIMO.
  1147. */
  1148. nss_mask: 4,
  1149. /* guard_interval -
  1150. * Specify a htt_tx_guard_interval enum value to indicate whether
  1151. * the transmission should use a regular guard interval or a
  1152. * short guard interval.
  1153. */
  1154. guard_interval: 1,
  1155. /* preamble_type_mask -
  1156. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1157. * may choose from for transmitting this frame.
  1158. * The bits in this mask correspond to the values in the
  1159. * htt_tx_preamble_type enum. For example, to allow the target
  1160. * to transmit the frame as either CCK or OFDM, this field would
  1161. * be set to
  1162. * (1 << htt_tx_preamble_type_ofdm) |
  1163. * (1 << htt_tx_preamble_type_cck)
  1164. */
  1165. preamble_type_mask: 4,
  1166. reserved1_31_29: 3; /* unused, set to 0x0 */
  1167. /* DWORD 2: tx chain mask, tx retries */
  1168. A_UINT32
  1169. /* chain_mask - specify which chains to transmit from */
  1170. chain_mask: 4,
  1171. /* retry_limit -
  1172. * Specify the maximum number of transmissions, including the
  1173. * initial transmission, to attempt before giving up if no ack
  1174. * is received.
  1175. * If the tx rate is specified, then all retries shall use the
  1176. * same rate as the initial transmission.
  1177. * If no tx rate is specified, the target can choose whether to
  1178. * retain the original rate during the retransmissions, or to
  1179. * fall back to a more robust rate.
  1180. */
  1181. retry_limit: 4,
  1182. /* bandwidth_mask -
  1183. * Specify what channel widths may be used for the transmission.
  1184. * A value of zero indicates "don't care" - the target may choose
  1185. * the transmission bandwidth.
  1186. * The bits within this mask correspond to the htt_tx_bandwidth
  1187. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1188. * The bandwidth_mask must be consistent with the preamble_type_mask
  1189. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1190. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1191. */
  1192. bandwidth_mask: 6,
  1193. reserved2_31_14: 18; /* unused, set to 0x0 */
  1194. /* DWORD 3: tx expiry time (TSF) LSBs */
  1195. A_UINT32 expire_tsf_lo;
  1196. /* DWORD 4: tx expiry time (TSF) MSBs */
  1197. A_UINT32 expire_tsf_hi;
  1198. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1199. } POSTPACK;
  1200. /* DWORD 0 */
  1201. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1202. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1203. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1204. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1205. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1206. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1207. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1208. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1209. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1210. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1211. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1212. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1213. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1214. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1215. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1216. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1217. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1218. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1219. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1220. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1221. /* DWORD 1 */
  1222. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1223. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1224. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1225. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1226. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1227. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1228. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1229. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1230. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1231. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1232. /* DWORD 2 */
  1233. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1234. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1235. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1236. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1237. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1238. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1239. /* DWORD 0 */
  1240. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1241. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1242. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1243. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1244. do { \
  1245. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1246. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1247. } while (0)
  1248. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1249. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1250. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1251. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1252. do { \
  1253. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1254. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1255. } while (0)
  1256. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1257. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1258. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1259. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1260. do { \
  1261. HTT_CHECK_SET_VAL( \
  1262. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1263. ((_var) |= ((_val) \
  1264. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1265. } while (0)
  1266. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1267. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1268. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1269. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1270. do { \
  1271. HTT_CHECK_SET_VAL( \
  1272. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1273. ((_var) |= ((_val) \
  1274. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1275. } while (0)
  1276. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1277. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1278. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1279. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1280. do { \
  1281. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1282. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1283. } while (0)
  1284. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1285. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1286. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1287. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1288. do { \
  1289. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1290. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1291. } while (0)
  1292. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1293. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1294. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1295. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1296. do { \
  1297. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1298. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1299. } while (0)
  1300. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1301. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1302. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1303. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1304. do { \
  1305. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1306. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1307. } while (0)
  1308. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1309. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1310. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1311. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1312. do { \
  1313. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1314. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1315. } while (0)
  1316. /* DWORD 1 */
  1317. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1318. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1319. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1320. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1321. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1322. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1323. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1324. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1325. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1326. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1327. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1328. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1329. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1330. do { \
  1331. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1332. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1333. } while (0)
  1334. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1335. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1336. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1337. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1338. do { \
  1339. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1340. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1341. } while (0)
  1342. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1343. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1344. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1345. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1346. do { \
  1347. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1348. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1349. } while (0)
  1350. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1351. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1352. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1353. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1354. do { \
  1355. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1356. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1357. } while (0)
  1358. /* DWORD 2 */
  1359. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1360. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1361. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1362. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1363. do { \
  1364. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1365. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1366. } while (0)
  1367. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1368. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1369. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1370. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1371. do { \
  1372. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1373. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1374. } while (0)
  1375. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1376. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1377. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1378. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1379. do { \
  1380. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1381. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1382. } while (0)
  1383. typedef enum {
  1384. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1385. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1386. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1387. } htt_11ax_ltf_subtype_t;
  1388. typedef enum {
  1389. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1390. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1391. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1392. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1393. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1394. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1395. } htt_tx_ext2_preamble_type_t;
  1396. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1397. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1398. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1399. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1400. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1401. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1402. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1403. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1404. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1405. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1406. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1407. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1408. /**
  1409. * @brief HTT tx MSDU extension descriptor v2
  1410. * @details
  1411. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1412. * is received as tcl_exit_base->host_meta_info in firmware.
  1413. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1414. * are already part of tcl_exit_base.
  1415. */
  1416. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1417. /* DWORD 0: flags */
  1418. A_UINT32
  1419. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1420. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1421. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1422. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1423. valid_retries : 1, /* if set, tx retries spec is valid */
  1424. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1425. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1426. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1427. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1428. valid_key_flags : 1, /* if set, key flags is valid */
  1429. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1430. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1431. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1432. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1433. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1434. 1 = ENCRYPT,
  1435. 2 ~ 3 - Reserved */
  1436. /* retry_limit -
  1437. * Specify the maximum number of transmissions, including the
  1438. * initial transmission, to attempt before giving up if no ack
  1439. * is received.
  1440. * If the tx rate is specified, then all retries shall use the
  1441. * same rate as the initial transmission.
  1442. * If no tx rate is specified, the target can choose whether to
  1443. * retain the original rate during the retransmissions, or to
  1444. * fall back to a more robust rate.
  1445. */
  1446. retry_limit : 4,
  1447. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1448. * Valid only for 11ax preamble types HE_SU
  1449. * and HE_EXT_SU
  1450. */
  1451. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1452. * Valid only for 11ax preamble types HE_SU
  1453. * and HE_EXT_SU
  1454. */
  1455. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1456. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1457. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1458. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1459. */
  1460. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1461. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1462. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1463. * Use cases:
  1464. * Any time firmware uses TQM-BYPASS for Data
  1465. * TID, firmware expect host to set this bit.
  1466. */
  1467. /* DWORD 1: tx power, tx rate */
  1468. A_UINT32
  1469. power : 8, /* unit of the power field is 0.5 dbm
  1470. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1471. * signed value ranging from -64dbm to 63.5 dbm
  1472. */
  1473. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1474. * Setting more than one MCS isn't currently
  1475. * supported by the target (but is supported
  1476. * in the interface in case in the future
  1477. * the target supports specifications of
  1478. * a limited set of MCS values.
  1479. */
  1480. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1481. * Setting more than one Nss isn't currently
  1482. * supported by the target (but is supported
  1483. * in the interface in case in the future
  1484. * the target supports specifications of
  1485. * a limited set of Nss values.
  1486. */
  1487. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1488. update_peer_cache : 1; /* When set these custom values will be
  1489. * used for all packets, until the next
  1490. * update via this ext header.
  1491. * This is to make sure not all packets
  1492. * need to include this header.
  1493. */
  1494. /* DWORD 2: tx chain mask, tx retries */
  1495. A_UINT32
  1496. /* chain_mask - specify which chains to transmit from */
  1497. chain_mask : 8,
  1498. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1499. * TODO: Update Enum values for key_flags
  1500. */
  1501. /*
  1502. * Channel frequency: This identifies the desired channel
  1503. * frequency (in MHz) for tx frames. This is used by FW to help
  1504. * determine when it is safe to transmit or drop frames for
  1505. * off-channel operation.
  1506. * The default value of zero indicates to FW that the corresponding
  1507. * VDEV's home channel (if there is one) is the desired channel
  1508. * frequency.
  1509. */
  1510. chanfreq : 16;
  1511. /* DWORD 3: tx expiry time (TSF) LSBs */
  1512. A_UINT32 expire_tsf_lo;
  1513. /* DWORD 4: tx expiry time (TSF) MSBs */
  1514. A_UINT32 expire_tsf_hi;
  1515. /* DWORD 5: reserved
  1516. * This structure can be expanded further up to 60 bytes
  1517. * by adding further DWORDs as needed.
  1518. */
  1519. A_UINT32
  1520. /* learning_frame
  1521. * When this flag is set, this frame will be dropped by FW
  1522. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1523. */
  1524. learning_frame : 1,
  1525. rsvd0 : 31;
  1526. } POSTPACK;
  1527. /* DWORD 0 */
  1528. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1529. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1530. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1531. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1532. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1533. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1534. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1535. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1536. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1537. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1538. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1539. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1540. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1541. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1542. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1543. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1544. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1545. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1546. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1547. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1548. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1549. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1550. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1551. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1552. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1553. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1554. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1555. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1556. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1557. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1558. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1559. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1560. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1561. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1562. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1563. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1564. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1565. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1566. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1567. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1568. /* DWORD 1 */
  1569. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1570. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1571. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1572. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1573. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1574. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1575. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1576. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1577. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1578. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1579. /* DWORD 2 */
  1580. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1581. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1582. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1583. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1584. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1585. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1586. /* DWORD 5 */
  1587. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1588. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1589. /* DWORD 0 */
  1590. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1591. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1592. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1593. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1594. do { \
  1595. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1596. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1597. } while (0)
  1598. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1599. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1600. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1601. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1602. do { \
  1603. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1604. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1605. } while (0)
  1606. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1607. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1608. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1609. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1610. do { \
  1611. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1612. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1613. } while (0)
  1614. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1615. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1616. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1617. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1618. do { \
  1619. HTT_CHECK_SET_VAL( \
  1620. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1621. ((_var) |= ((_val) \
  1622. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1623. } while (0)
  1624. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1625. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1626. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1627. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1628. do { \
  1629. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1630. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1631. } while (0)
  1632. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1633. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1634. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1635. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1636. do { \
  1637. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1638. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1639. } while (0)
  1640. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1641. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1642. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1643. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1644. do { \
  1645. HTT_CHECK_SET_VAL( \
  1646. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1647. ((_var) |= ((_val) \
  1648. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1649. } while (0)
  1650. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1651. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1652. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1653. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1654. do { \
  1655. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1656. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1657. } while (0)
  1658. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1659. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1660. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1661. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1662. do { \
  1663. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1664. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1665. } while (0)
  1666. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1667. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1668. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1669. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1670. do { \
  1671. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1672. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1673. } while (0)
  1674. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1675. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1676. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1677. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1678. do { \
  1679. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1680. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1681. } while (0)
  1682. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1683. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1684. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1685. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1686. do { \
  1687. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1688. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1689. } while (0)
  1690. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1691. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1692. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1693. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1694. do { \
  1695. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1696. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1697. } while (0)
  1698. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1699. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1700. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1701. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1702. do { \
  1703. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1704. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1705. } while (0)
  1706. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1707. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1708. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1709. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1710. do { \
  1711. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1712. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1713. } while (0)
  1714. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1715. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1716. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1717. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1718. do { \
  1719. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1720. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1721. } while (0)
  1722. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1723. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1724. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1725. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1726. do { \
  1727. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1728. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1729. } while (0)
  1730. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1731. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1732. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1733. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1734. do { \
  1735. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1736. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1737. } while (0)
  1738. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1739. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1740. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1741. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1742. do { \
  1743. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1744. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1745. } while (0)
  1746. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1747. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1748. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1749. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1750. do { \
  1751. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1752. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1753. } while (0)
  1754. /* DWORD 1 */
  1755. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1756. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1757. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1758. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1759. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1760. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1761. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1762. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1763. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1764. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1765. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1766. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1767. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1768. do { \
  1769. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1770. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1771. } while (0)
  1772. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1773. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1774. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1775. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1776. do { \
  1777. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1778. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1779. } while (0)
  1780. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1781. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1782. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1783. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1784. do { \
  1785. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1786. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1787. } while (0)
  1788. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1789. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1790. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1791. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1792. do { \
  1793. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1794. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1795. } while (0)
  1796. /* DWORD 2 */
  1797. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1798. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1799. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1800. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1801. do { \
  1802. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1803. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1804. } while (0)
  1805. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1806. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1807. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1808. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1809. do { \
  1810. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1811. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1812. } while (0)
  1813. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1814. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1815. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1816. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1817. do { \
  1818. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1819. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1820. } while (0)
  1821. /* DWORD 5 */
  1822. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  1823. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  1824. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  1825. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  1826. do { \
  1827. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  1828. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  1829. } while (0)
  1830. typedef enum {
  1831. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1832. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1833. } htt_tcl_metadata_type;
  1834. /**
  1835. * @brief HTT TCL command number format
  1836. * @details
  1837. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1838. * available to firmware as tcl_exit_base->tcl_status_number.
  1839. * For regular / multicast packets host will send vdev and mac id and for
  1840. * NAWDS packets, host will send peer id.
  1841. * A_UINT32 is used to avoid endianness conversion problems.
  1842. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1843. */
  1844. typedef struct {
  1845. A_UINT32
  1846. type: 1, /* vdev_id based or peer_id based */
  1847. rsvd: 31;
  1848. } htt_tx_tcl_vdev_or_peer_t;
  1849. typedef struct {
  1850. A_UINT32
  1851. type: 1, /* vdev_id based or peer_id based */
  1852. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1853. vdev_id: 8,
  1854. pdev_id: 2,
  1855. host_inspected:1,
  1856. rsvd: 19;
  1857. } htt_tx_tcl_vdev_metadata;
  1858. typedef struct {
  1859. A_UINT32
  1860. type: 1, /* vdev_id based or peer_id based */
  1861. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1862. peer_id: 14,
  1863. rsvd: 16;
  1864. } htt_tx_tcl_peer_metadata;
  1865. PREPACK struct htt_tx_tcl_metadata {
  1866. union {
  1867. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1868. htt_tx_tcl_vdev_metadata vdev_meta;
  1869. htt_tx_tcl_peer_metadata peer_meta;
  1870. };
  1871. } POSTPACK;
  1872. /* DWORD 0 */
  1873. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1874. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1875. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1876. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1877. /* VDEV metadata */
  1878. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1879. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1880. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1881. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1882. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1883. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1884. /* PEER metadata */
  1885. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1886. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1887. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1888. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1889. HTT_TX_TCL_METADATA_TYPE_S)
  1890. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1891. do { \
  1892. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1893. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1894. } while (0)
  1895. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1896. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1897. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1898. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1899. do { \
  1900. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1901. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1902. } while (0)
  1903. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1904. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1905. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1906. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1907. do { \
  1908. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1909. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1910. } while (0)
  1911. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1912. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1913. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1914. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1915. do { \
  1916. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1917. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1918. } while (0)
  1919. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1920. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1921. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  1922. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  1923. do { \
  1924. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  1925. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  1926. } while (0)
  1927. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1928. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  1929. HTT_TX_TCL_METADATA_PEER_ID_S)
  1930. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  1931. do { \
  1932. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  1933. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  1934. } while (0)
  1935. typedef enum {
  1936. HTT_TX_FW2WBM_TX_STATUS_OK,
  1937. HTT_TX_FW2WBM_TX_STATUS_DROP,
  1938. HTT_TX_FW2WBM_TX_STATUS_TTL,
  1939. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  1940. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  1941. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  1942. HTT_TX_FW2WBM_TX_STATUS_MAX
  1943. } htt_tx_fw2wbm_tx_status_t;
  1944. typedef enum {
  1945. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  1946. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  1947. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  1948. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  1949. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  1950. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  1951. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  1952. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  1953. } htt_tx_fw2wbm_reinject_reason_t;
  1954. /**
  1955. * @brief HTT TX WBM Completion from firmware to host
  1956. * @details
  1957. * This structure is passed from firmware to host overlayed on wbm_release_ring
  1958. * DWORD 3 and 4 for software based completions (Exception frames and
  1959. * TQM bypass frames)
  1960. * For software based completions, wbm_release_ring->release_source_module will
  1961. * be set to release_source_fw
  1962. */
  1963. PREPACK struct htt_tx_wbm_completion {
  1964. A_UINT32
  1965. sch_cmd_id: 24,
  1966. exception_frame: 1, /* If set, this packet was queued via exception path */
  1967. rsvd0_31_25: 7;
  1968. A_UINT32
  1969. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  1970. * reception of an ACK or BA, this field indicates
  1971. * the RSSI of the received ACK or BA frame.
  1972. * When the frame is removed as result of a direct
  1973. * remove command from the SW, this field is set
  1974. * to 0x0 (which is never a valid value when real
  1975. * RSSI is available).
  1976. * Units: dB w.r.t noise floor
  1977. */
  1978. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  1979. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  1980. rsvd1_31_16: 16;
  1981. } POSTPACK;
  1982. /* DWORD 0 */
  1983. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  1984. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  1985. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  1986. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  1987. /* DWORD 1 */
  1988. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  1989. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  1990. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  1991. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  1992. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  1993. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  1994. /* DWORD 0 */
  1995. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  1996. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  1997. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  1998. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  1999. do { \
  2000. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2001. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2002. } while (0)
  2003. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2004. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2005. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2006. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2007. do { \
  2008. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2009. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2010. } while (0)
  2011. /* DWORD 1 */
  2012. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2013. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2014. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2015. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2016. do { \
  2017. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2018. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2019. } while (0)
  2020. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2021. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2022. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2023. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2024. do { \
  2025. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2026. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2027. } while (0)
  2028. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2029. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2030. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2031. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2032. do { \
  2033. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2034. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2035. } while (0)
  2036. /**
  2037. * @brief HTT TX WBM Completion from firmware to host
  2038. * @details
  2039. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2040. * (WBM) offload HW.
  2041. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2042. * For software based completions, release_source_module will
  2043. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2044. * struct wbm_release_ring and then switch to this after looking at
  2045. * release_source_module.
  2046. */
  2047. PREPACK struct htt_tx_wbm_completion_v2 {
  2048. A_UINT32
  2049. used_by_hw0; /* Refer to struct wbm_release_ring */
  2050. A_UINT32
  2051. used_by_hw1; /* Refer to struct wbm_release_ring */
  2052. A_UINT32
  2053. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2054. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2055. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2056. exception_frame: 1,
  2057. rsvd0: 12, /* For future use */
  2058. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2059. rsvd1: 1; /* For future use */
  2060. A_UINT32
  2061. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2062. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2063. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2064. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2065. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2066. */
  2067. A_UINT32
  2068. data1: 32;
  2069. A_UINT32
  2070. data2: 32;
  2071. A_UINT32
  2072. used_by_hw3; /* Refer to struct wbm_release_ring */
  2073. } POSTPACK;
  2074. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2075. /* DWORD 3 */
  2076. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2077. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2078. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2079. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2080. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2081. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2082. /* DWORD 3 */
  2083. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2084. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2085. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2086. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2087. do { \
  2088. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2089. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2090. } while (0)
  2091. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2092. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2093. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2094. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2095. do { \
  2096. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2097. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2098. } while (0)
  2099. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2100. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2101. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2102. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2103. do { \
  2104. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2105. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2106. } while (0)
  2107. /**
  2108. * @brief HTT TX WBM transmit status from firmware to host
  2109. * @details
  2110. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2111. * (WBM) offload HW.
  2112. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2113. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2114. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2115. */
  2116. PREPACK struct htt_tx_wbm_transmit_status {
  2117. A_UINT32
  2118. sch_cmd_id: 24,
  2119. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2120. * reception of an ACK or BA, this field indicates
  2121. * the RSSI of the received ACK or BA frame.
  2122. * When the frame is removed as result of a direct
  2123. * remove command from the SW, this field is set
  2124. * to 0x0 (which is never a valid value when real
  2125. * RSSI is available).
  2126. * Units: dB w.r.t noise floor
  2127. */
  2128. A_UINT32
  2129. sw_peer_id: 16,
  2130. tid_num: 5,
  2131. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2132. * and tid_num fields contain valid data.
  2133. * If this "valid" flag is not set, the
  2134. * sw_peer_id and tid_num fields must be ignored.
  2135. */
  2136. mcast: 1,
  2137. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2138. * contains valid data.
  2139. */
  2140. reserved0: 8;
  2141. A_UINT32
  2142. reserved1: 32;
  2143. } POSTPACK;
  2144. /* DWORD 4 */
  2145. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2146. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2147. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2148. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2149. /* DWORD 5 */
  2150. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2151. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2152. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2153. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2154. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2155. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2156. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2157. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2158. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2159. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2160. /* DWORD 4 */
  2161. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2162. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2163. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2164. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2165. do { \
  2166. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2167. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2168. } while (0)
  2169. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2170. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2171. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2172. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2173. do { \
  2174. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2175. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2176. } while (0)
  2177. /* DWORD 5 */
  2178. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2179. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2180. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2181. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2182. do { \
  2183. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2184. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2185. } while (0)
  2186. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2187. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2188. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2189. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2190. do { \
  2191. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2192. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2193. } while (0)
  2194. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2195. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2196. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2197. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2198. do { \
  2199. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2200. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2201. } while (0)
  2202. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2203. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2204. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2205. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2206. do { \
  2207. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2208. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2209. } while (0)
  2210. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2211. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2212. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2213. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2214. do { \
  2215. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2216. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2217. } while (0)
  2218. /**
  2219. * @brief HTT TX WBM reinject status from firmware to host
  2220. * @details
  2221. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2222. * (WBM) offload HW.
  2223. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2224. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2225. */
  2226. PREPACK struct htt_tx_wbm_reinject_status {
  2227. A_UINT32
  2228. reserved0: 32;
  2229. A_UINT32
  2230. reserved1: 32;
  2231. A_UINT32
  2232. reserved2: 32;
  2233. } POSTPACK;
  2234. /**
  2235. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2236. * @details
  2237. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2238. * (WBM) offload HW.
  2239. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2240. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2241. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2242. * STA side.
  2243. */
  2244. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2245. A_UINT32
  2246. mec_sa_addr_31_0;
  2247. A_UINT32
  2248. mec_sa_addr_47_32: 16,
  2249. sa_ast_index: 16;
  2250. A_UINT32
  2251. vdev_id: 8,
  2252. reserved0: 24;
  2253. } POSTPACK;
  2254. /* DWORD 4 - mec_sa_addr_31_0 */
  2255. /* DWORD 5 */
  2256. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2257. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2258. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2259. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2260. /* DWORD 6 */
  2261. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2262. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2263. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2264. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2265. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2266. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2267. do { \
  2268. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2269. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2270. } while (0)
  2271. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2272. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2273. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2274. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2275. do { \
  2276. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2277. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2278. } while (0)
  2279. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2280. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2281. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2282. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2283. do { \
  2284. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2285. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2286. } while (0)
  2287. typedef enum {
  2288. TX_FLOW_PRIORITY_BE,
  2289. TX_FLOW_PRIORITY_HIGH,
  2290. TX_FLOW_PRIORITY_LOW,
  2291. } htt_tx_flow_priority_t;
  2292. typedef enum {
  2293. TX_FLOW_LATENCY_SENSITIVE,
  2294. TX_FLOW_LATENCY_INSENSITIVE,
  2295. } htt_tx_flow_latency_t;
  2296. typedef enum {
  2297. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2298. TX_FLOW_INTERACTIVE_TRAFFIC,
  2299. TX_FLOW_PERIODIC_TRAFFIC,
  2300. TX_FLOW_BURSTY_TRAFFIC,
  2301. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2302. } htt_tx_flow_traffic_pattern_t;
  2303. /**
  2304. * @brief HTT TX Flow search metadata format
  2305. * @details
  2306. * Host will set this metadata in flow table's flow search entry along with
  2307. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2308. * firmware and TQM ring if the flow search entry wins.
  2309. * This metadata is available to firmware in that first MSDU's
  2310. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2311. * to one of the available flows for specific tid and returns the tqm flow
  2312. * pointer as part of htt_tx_map_flow_info message.
  2313. */
  2314. PREPACK struct htt_tx_flow_metadata {
  2315. A_UINT32
  2316. rsvd0_1_0: 2,
  2317. tid: 4,
  2318. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2319. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2320. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2321. * Else choose final tid based on latency, priority.
  2322. */
  2323. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2324. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2325. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2326. } POSTPACK;
  2327. /* DWORD 0 */
  2328. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2329. #define HTT_TX_FLOW_METADATA_TID_S 2
  2330. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2331. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2332. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2333. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2334. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2335. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2336. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2337. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2338. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2339. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2340. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2341. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2342. /* DWORD 0 */
  2343. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2344. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2345. HTT_TX_FLOW_METADATA_TID_S)
  2346. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2347. do { \
  2348. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2349. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2350. } while (0)
  2351. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2352. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2353. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2354. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2355. do { \
  2356. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2357. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2358. } while (0)
  2359. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2360. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2361. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2362. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2363. do { \
  2364. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2365. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2366. } while (0)
  2367. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2368. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2369. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2370. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2371. do { \
  2372. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2373. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2374. } while (0)
  2375. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2376. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2377. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2378. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2379. do { \
  2380. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2381. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2382. } while (0)
  2383. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2384. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2385. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2386. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2387. do { \
  2388. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2389. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2390. } while (0)
  2391. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2392. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2393. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2394. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2395. do { \
  2396. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2397. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2398. } while (0)
  2399. /**
  2400. * @brief Used in HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2401. *
  2402. * @details
  2403. * HTT wds entry from source port learning
  2404. * Host will learn wds entries from rx and send this message to firmware
  2405. * to enable firmware to configure/delete AST entries for wds clients.
  2406. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2407. * and when SA's entry is deleted, firmware removes this AST entry
  2408. *
  2409. * The message would appear as follows:
  2410. *
  2411. * |31 30|29 |17 16|15 8|7 0|
  2412. * |----------------+----------------+----------------+----------------|
  2413. * | rsvd0 |PDVID| vdev_id | msg_type |
  2414. * |-------------------------------------------------------------------|
  2415. * | sa_addr_31_0 |
  2416. * |-------------------------------------------------------------------|
  2417. * | | ta_peer_id | sa_addr_47_32 |
  2418. * |-------------------------------------------------------------------|
  2419. * Where PDVID = pdev_id
  2420. *
  2421. * The message is interpreted as follows:
  2422. *
  2423. * dword0 - b'0:7 - msg_type: This will be set to
  2424. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2425. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2426. *
  2427. * dword0 - b'8:15 - vdev_id
  2428. *
  2429. * dword0 - b'16:17 - pdev_id
  2430. *
  2431. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2432. *
  2433. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2434. *
  2435. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2436. *
  2437. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2438. */
  2439. PREPACK struct htt_wds_entry {
  2440. A_UINT32
  2441. msg_type: 8,
  2442. vdev_id: 8,
  2443. pdev_id: 2,
  2444. rsvd0: 14;
  2445. A_UINT32 sa_addr_31_0;
  2446. A_UINT32
  2447. sa_addr_47_32: 16,
  2448. ta_peer_id: 14,
  2449. rsvd2: 2;
  2450. } POSTPACK;
  2451. /* DWORD 0 */
  2452. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2453. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2454. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2455. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2456. /* DWORD 2 */
  2457. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2458. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2459. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2460. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2461. /* DWORD 0 */
  2462. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2463. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2464. HTT_WDS_ENTRY_VDEV_ID_S)
  2465. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2466. do { \
  2467. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2468. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2469. } while (0)
  2470. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2471. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2472. HTT_WDS_ENTRY_PDEV_ID_S)
  2473. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2474. do { \
  2475. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2476. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2477. } while (0)
  2478. /* DWORD 2 */
  2479. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2480. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2481. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2482. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2483. do { \
  2484. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2485. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2486. } while (0)
  2487. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2488. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2489. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2490. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2491. do { \
  2492. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2493. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2494. } while (0)
  2495. /**
  2496. * @brief MAC DMA rx ring setup specification
  2497. * @details
  2498. * To allow for dynamic rx ring reconfiguration and to avoid race
  2499. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2500. * it uses. Instead, it sends this message to the target, indicating how
  2501. * the rx ring used by the host should be set up and maintained.
  2502. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2503. * specifications.
  2504. *
  2505. * |31 16|15 8|7 0|
  2506. * |---------------------------------------------------------------|
  2507. * header: | reserved | num rings | msg type |
  2508. * |---------------------------------------------------------------|
  2509. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2510. #if HTT_PADDR64
  2511. * | FW_IDX shadow register physical address (bits 63:32) |
  2512. #endif
  2513. * |---------------------------------------------------------------|
  2514. * | rx ring base physical address (bits 31:0) |
  2515. #if HTT_PADDR64
  2516. * | rx ring base physical address (bits 63:32) |
  2517. #endif
  2518. * |---------------------------------------------------------------|
  2519. * | rx ring buffer size | rx ring length |
  2520. * |---------------------------------------------------------------|
  2521. * | FW_IDX initial value | enabled flags |
  2522. * |---------------------------------------------------------------|
  2523. * | MSDU payload offset | 802.11 header offset |
  2524. * |---------------------------------------------------------------|
  2525. * | PPDU end offset | PPDU start offset |
  2526. * |---------------------------------------------------------------|
  2527. * | MPDU end offset | MPDU start offset |
  2528. * |---------------------------------------------------------------|
  2529. * | MSDU end offset | MSDU start offset |
  2530. * |---------------------------------------------------------------|
  2531. * | frag info offset | rx attention offset |
  2532. * |---------------------------------------------------------------|
  2533. * payload 2, if present, has the same format as payload 1
  2534. * Header fields:
  2535. * - MSG_TYPE
  2536. * Bits 7:0
  2537. * Purpose: identifies this as an rx ring configuration message
  2538. * Value: 0x2
  2539. * - NUM_RINGS
  2540. * Bits 15:8
  2541. * Purpose: indicates whether the host is setting up one rx ring or two
  2542. * Value: 1 or 2
  2543. * Payload:
  2544. * for systems using 64-bit format for bus addresses:
  2545. * - IDX_SHADOW_REG_PADDR_LO
  2546. * Bits 31:0
  2547. * Value: lower 4 bytes of physical address of the host's
  2548. * FW_IDX shadow register
  2549. * - IDX_SHADOW_REG_PADDR_HI
  2550. * Bits 31:0
  2551. * Value: upper 4 bytes of physical address of the host's
  2552. * FW_IDX shadow register
  2553. * - RING_BASE_PADDR_LO
  2554. * Bits 31:0
  2555. * Value: lower 4 bytes of physical address of the host's rx ring
  2556. * - RING_BASE_PADDR_HI
  2557. * Bits 31:0
  2558. * Value: uppper 4 bytes of physical address of the host's rx ring
  2559. * for systems using 32-bit format for bus addresses:
  2560. * - IDX_SHADOW_REG_PADDR
  2561. * Bits 31:0
  2562. * Value: physical address of the host's FW_IDX shadow register
  2563. * - RING_BASE_PADDR
  2564. * Bits 31:0
  2565. * Value: physical address of the host's rx ring
  2566. * - RING_LEN
  2567. * Bits 15:0
  2568. * Value: number of elements in the rx ring
  2569. * - RING_BUF_SZ
  2570. * Bits 31:16
  2571. * Value: size of the buffers referenced by the rx ring, in byte units
  2572. * - ENABLED_FLAGS
  2573. * Bits 15:0
  2574. * Value: 1-bit flags to show whether different rx fields are enabled
  2575. * bit 0: 802.11 header enabled (1) or disabled (0)
  2576. * bit 1: MSDU payload enabled (1) or disabled (0)
  2577. * bit 2: PPDU start enabled (1) or disabled (0)
  2578. * bit 3: PPDU end enabled (1) or disabled (0)
  2579. * bit 4: MPDU start enabled (1) or disabled (0)
  2580. * bit 5: MPDU end enabled (1) or disabled (0)
  2581. * bit 6: MSDU start enabled (1) or disabled (0)
  2582. * bit 7: MSDU end enabled (1) or disabled (0)
  2583. * bit 8: rx attention enabled (1) or disabled (0)
  2584. * bit 9: frag info enabled (1) or disabled (0)
  2585. * bit 10: unicast rx enabled (1) or disabled (0)
  2586. * bit 11: multicast rx enabled (1) or disabled (0)
  2587. * bit 12: ctrl rx enabled (1) or disabled (0)
  2588. * bit 13: mgmt rx enabled (1) or disabled (0)
  2589. * bit 14: null rx enabled (1) or disabled (0)
  2590. * bit 15: phy data rx enabled (1) or disabled (0)
  2591. * - IDX_INIT_VAL
  2592. * Bits 31:16
  2593. * Purpose: Specify the initial value for the FW_IDX.
  2594. * Value: the number of buffers initially present in the host's rx ring
  2595. * - OFFSET_802_11_HDR
  2596. * Bits 15:0
  2597. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2598. * - OFFSET_MSDU_PAYLOAD
  2599. * Bits 31:16
  2600. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2601. * - OFFSET_PPDU_START
  2602. * Bits 15:0
  2603. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2604. * - OFFSET_PPDU_END
  2605. * Bits 31:16
  2606. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2607. * - OFFSET_MPDU_START
  2608. * Bits 15:0
  2609. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2610. * - OFFSET_MPDU_END
  2611. * Bits 31:16
  2612. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2613. * - OFFSET_MSDU_START
  2614. * Bits 15:0
  2615. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2616. * - OFFSET_MSDU_END
  2617. * Bits 31:16
  2618. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2619. * - OFFSET_RX_ATTN
  2620. * Bits 15:0
  2621. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2622. * - OFFSET_FRAG_INFO
  2623. * Bits 31:16
  2624. * Value: offset in QUAD-bytes of frag info table
  2625. */
  2626. /* header fields */
  2627. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2628. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2629. /* payload fields */
  2630. /* for systems using a 64-bit format for bus addresses */
  2631. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2632. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2633. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2634. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2635. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2636. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2637. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2638. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2639. /* for systems using a 32-bit format for bus addresses */
  2640. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2641. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2642. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2643. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2644. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2645. #define HTT_RX_RING_CFG_LEN_S 0
  2646. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2647. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2648. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2649. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2650. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2651. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2652. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2653. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2654. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2655. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2656. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2657. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2658. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2659. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2660. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2661. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2662. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2663. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2664. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2665. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2666. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2667. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2668. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2669. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2670. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2671. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2672. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2673. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2674. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2675. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2676. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2677. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2678. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2679. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2680. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2681. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2682. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2683. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2684. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2685. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2686. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2687. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2688. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2689. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2690. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2691. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2692. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2693. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2694. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2695. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2696. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2697. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2698. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2699. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2700. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2701. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2702. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2703. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2704. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2705. #if HTT_PADDR64
  2706. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2707. #else
  2708. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2709. #endif
  2710. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2711. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2712. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2713. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2714. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2715. do { \
  2716. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2717. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2718. } while (0)
  2719. /* degenerate case for 32-bit fields */
  2720. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2721. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2722. ((_var) = (_val))
  2723. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2724. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2725. ((_var) = (_val))
  2726. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2727. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2728. ((_var) = (_val))
  2729. /* degenerate case for 32-bit fields */
  2730. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2731. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2732. ((_var) = (_val))
  2733. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2734. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2735. ((_var) = (_val))
  2736. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2737. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2738. ((_var) = (_val))
  2739. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2740. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2741. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2742. do { \
  2743. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2744. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2745. } while (0)
  2746. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2747. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2748. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2749. do { \
  2750. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2751. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2752. } while (0)
  2753. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2754. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2755. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2756. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2757. do { \
  2758. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2759. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2760. } while (0)
  2761. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2762. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2763. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2764. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2765. do { \
  2766. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2767. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2768. } while (0)
  2769. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2770. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2771. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2772. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2773. do { \
  2774. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2775. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2776. } while (0)
  2777. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2778. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2779. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2780. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2781. do { \
  2782. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2783. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2784. } while (0)
  2785. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2786. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2787. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2788. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2789. do { \
  2790. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2791. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2792. } while (0)
  2793. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2794. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2795. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2796. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2797. do { \
  2798. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2799. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2800. } while (0)
  2801. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2802. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2803. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2804. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2805. do { \
  2806. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2807. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2808. } while (0)
  2809. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2810. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2811. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2812. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2813. do { \
  2814. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2815. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2816. } while (0)
  2817. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2818. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2819. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2820. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2821. do { \
  2822. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2823. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2824. } while (0)
  2825. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2826. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2827. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2828. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2829. do { \
  2830. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2831. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2832. } while (0)
  2833. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2834. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2835. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2836. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2837. do { \
  2838. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2839. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2840. } while (0)
  2841. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2842. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2843. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2844. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2845. do { \
  2846. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2847. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2848. } while (0)
  2849. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2850. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2851. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2852. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2853. do { \
  2854. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2855. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2856. } while (0)
  2857. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2858. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2859. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2860. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2861. do { \
  2862. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2863. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2864. } while (0)
  2865. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2866. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2867. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2868. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2869. do { \
  2870. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2871. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2872. } while (0)
  2873. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2874. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2875. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2876. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2877. do { \
  2878. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2879. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2880. } while (0)
  2881. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2882. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2883. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2884. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2885. do { \
  2886. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2887. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2888. } while (0)
  2889. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2890. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2891. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2892. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2893. do { \
  2894. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2895. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2896. } while (0)
  2897. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2898. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2899. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2900. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2901. do { \
  2902. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2903. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2904. } while (0)
  2905. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2906. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2907. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2908. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2909. do { \
  2910. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2911. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2912. } while (0)
  2913. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2914. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2915. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2916. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2917. do { \
  2918. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2919. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2920. } while (0)
  2921. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  2922. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  2923. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  2924. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  2925. do { \
  2926. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  2927. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  2928. } while (0)
  2929. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  2930. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  2931. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  2932. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  2933. do { \
  2934. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  2935. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  2936. } while (0)
  2937. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  2938. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  2939. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  2940. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  2941. do { \
  2942. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  2943. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  2944. } while (0)
  2945. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  2946. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  2947. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  2948. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  2949. do { \
  2950. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  2951. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  2952. } while (0)
  2953. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  2954. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  2955. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  2956. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  2957. do { \
  2958. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  2959. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  2960. } while (0)
  2961. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  2962. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  2963. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  2964. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  2965. do { \
  2966. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  2967. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  2968. } while (0)
  2969. /**
  2970. * @brief host -> target FW statistics retrieve
  2971. *
  2972. * @details
  2973. * The following field definitions describe the format of the HTT host
  2974. * to target FW stats retrieve message. The message specifies the type of
  2975. * stats host wants to retrieve.
  2976. *
  2977. * |31 24|23 16|15 8|7 0|
  2978. * |-----------------------------------------------------------|
  2979. * | stats types request bitmask | msg type |
  2980. * |-----------------------------------------------------------|
  2981. * | stats types reset bitmask | reserved |
  2982. * |-----------------------------------------------------------|
  2983. * | stats type | config value |
  2984. * |-----------------------------------------------------------|
  2985. * | cookie LSBs |
  2986. * |-----------------------------------------------------------|
  2987. * | cookie MSBs |
  2988. * |-----------------------------------------------------------|
  2989. * Header fields:
  2990. * - MSG_TYPE
  2991. * Bits 7:0
  2992. * Purpose: identifies this is a stats upload request message
  2993. * Value: 0x3
  2994. * - UPLOAD_TYPES
  2995. * Bits 31:8
  2996. * Purpose: identifies which types of FW statistics to upload
  2997. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  2998. * - RESET_TYPES
  2999. * Bits 31:8
  3000. * Purpose: identifies which types of FW statistics to reset
  3001. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3002. * - CFG_VAL
  3003. * Bits 23:0
  3004. * Purpose: give an opaque configuration value to the specified stats type
  3005. * Value: stats-type specific configuration value
  3006. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3007. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3008. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3009. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3010. * - CFG_STAT_TYPE
  3011. * Bits 31:24
  3012. * Purpose: specify which stats type (if any) the config value applies to
  3013. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3014. * a valid configuration specification
  3015. * - COOKIE_LSBS
  3016. * Bits 31:0
  3017. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3018. * message with its preceding host->target stats request message.
  3019. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3020. * - COOKIE_MSBS
  3021. * Bits 31:0
  3022. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3023. * message with its preceding host->target stats request message.
  3024. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3025. */
  3026. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3027. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3028. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3029. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3030. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3031. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3032. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3033. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3034. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3035. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3036. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3037. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3038. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3039. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3040. do { \
  3041. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3042. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3043. } while (0)
  3044. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3045. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3046. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3047. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3048. do { \
  3049. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3050. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3051. } while (0)
  3052. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3053. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3054. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3055. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3056. do { \
  3057. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3058. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3059. } while (0)
  3060. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3061. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3062. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3063. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3064. do { \
  3065. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3066. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3067. } while (0)
  3068. /**
  3069. * @brief host -> target HTT out-of-band sync request
  3070. *
  3071. * @details
  3072. * The HTT SYNC tells the target to suspend processing of subsequent
  3073. * HTT host-to-target messages until some other target agent locally
  3074. * informs the target HTT FW that the current sync counter is equal to
  3075. * or greater than (in a modulo sense) the sync counter specified in
  3076. * the SYNC message.
  3077. * This allows other host-target components to synchronize their operation
  3078. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3079. * security key has been downloaded to and activated by the target.
  3080. * In the absence of any explicit synchronization counter value
  3081. * specification, the target HTT FW will use zero as the default current
  3082. * sync value.
  3083. *
  3084. * |31 24|23 16|15 8|7 0|
  3085. * |-----------------------------------------------------------|
  3086. * | reserved | sync count | msg type |
  3087. * |-----------------------------------------------------------|
  3088. * Header fields:
  3089. * - MSG_TYPE
  3090. * Bits 7:0
  3091. * Purpose: identifies this as a sync message
  3092. * Value: 0x4
  3093. * - SYNC_COUNT
  3094. * Bits 15:8
  3095. * Purpose: specifies what sync value the HTT FW will wait for from
  3096. * an out-of-band specification to resume its operation
  3097. * Value: in-band sync counter value to compare against the out-of-band
  3098. * counter spec.
  3099. * The HTT target FW will suspend its host->target message processing
  3100. * as long as
  3101. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3102. */
  3103. #define HTT_H2T_SYNC_MSG_SZ 4
  3104. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3105. #define HTT_H2T_SYNC_COUNT_S 8
  3106. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3107. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3108. HTT_H2T_SYNC_COUNT_S)
  3109. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3110. do { \
  3111. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3112. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3113. } while (0)
  3114. /**
  3115. * @brief HTT aggregation configuration
  3116. */
  3117. #define HTT_AGGR_CFG_MSG_SZ 4
  3118. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3119. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3120. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3121. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3122. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3123. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3124. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3125. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3126. do { \
  3127. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3128. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3129. } while (0)
  3130. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3131. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3132. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3133. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3134. do { \
  3135. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3136. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3137. } while (0)
  3138. /**
  3139. * @brief host -> target HTT configure max amsdu info per vdev
  3140. *
  3141. * @details
  3142. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3143. *
  3144. * |31 21|20 16|15 8|7 0|
  3145. * |-----------------------------------------------------------|
  3146. * | reserved | vdev id | max amsdu | msg type |
  3147. * |-----------------------------------------------------------|
  3148. * Header fields:
  3149. * - MSG_TYPE
  3150. * Bits 7:0
  3151. * Purpose: identifies this as a aggr cfg ex message
  3152. * Value: 0xa
  3153. * - MAX_NUM_AMSDU_SUBFRM
  3154. * Bits 15:8
  3155. * Purpose: max MSDUs per A-MSDU
  3156. * - VDEV_ID
  3157. * Bits 20:16
  3158. * Purpose: ID of the vdev to which this limit is applied
  3159. */
  3160. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3161. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3162. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3163. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3164. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3165. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3166. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3167. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3168. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3169. do { \
  3170. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3171. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3172. } while (0)
  3173. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3174. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3175. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3176. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3177. do { \
  3178. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3179. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3180. } while (0)
  3181. /**
  3182. * @brief HTT WDI_IPA Config Message
  3183. *
  3184. * @details
  3185. * The HTT WDI_IPA config message is created/sent by host at driver
  3186. * init time. It contains information about data structures used on
  3187. * WDI_IPA TX and RX path.
  3188. * TX CE ring is used for pushing packet metadata from IPA uC
  3189. * to WLAN FW
  3190. * TX Completion ring is used for generating TX completions from
  3191. * WLAN FW to IPA uC
  3192. * RX Indication ring is used for indicating RX packets from FW
  3193. * to IPA uC
  3194. * RX Ring2 is used as either completion ring or as second
  3195. * indication ring. when Ring2 is used as completion ring, IPA uC
  3196. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3197. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3198. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3199. * indicated in RX Indication ring. Please see WDI_IPA specification
  3200. * for more details.
  3201. * |31 24|23 16|15 8|7 0|
  3202. * |----------------+----------------+----------------+----------------|
  3203. * | tx pkt pool size | Rsvd | msg_type |
  3204. * |-------------------------------------------------------------------|
  3205. * | tx comp ring base (bits 31:0) |
  3206. #if HTT_PADDR64
  3207. * | tx comp ring base (bits 63:32) |
  3208. #endif
  3209. * |-------------------------------------------------------------------|
  3210. * | tx comp ring size |
  3211. * |-------------------------------------------------------------------|
  3212. * | tx comp WR_IDX physical address (bits 31:0) |
  3213. #if HTT_PADDR64
  3214. * | tx comp WR_IDX physical address (bits 63:32) |
  3215. #endif
  3216. * |-------------------------------------------------------------------|
  3217. * | tx CE WR_IDX physical address (bits 31:0) |
  3218. #if HTT_PADDR64
  3219. * | tx CE WR_IDX physical address (bits 63:32) |
  3220. #endif
  3221. * |-------------------------------------------------------------------|
  3222. * | rx indication ring base (bits 31:0) |
  3223. #if HTT_PADDR64
  3224. * | rx indication ring base (bits 63:32) |
  3225. #endif
  3226. * |-------------------------------------------------------------------|
  3227. * | rx indication ring size |
  3228. * |-------------------------------------------------------------------|
  3229. * | rx ind RD_IDX physical address (bits 31:0) |
  3230. #if HTT_PADDR64
  3231. * | rx ind RD_IDX physical address (bits 63:32) |
  3232. #endif
  3233. * |-------------------------------------------------------------------|
  3234. * | rx ind WR_IDX physical address (bits 31:0) |
  3235. #if HTT_PADDR64
  3236. * | rx ind WR_IDX physical address (bits 63:32) |
  3237. #endif
  3238. * |-------------------------------------------------------------------|
  3239. * |-------------------------------------------------------------------|
  3240. * | rx ring2 base (bits 31:0) |
  3241. #if HTT_PADDR64
  3242. * | rx ring2 base (bits 63:32) |
  3243. #endif
  3244. * |-------------------------------------------------------------------|
  3245. * | rx ring2 size |
  3246. * |-------------------------------------------------------------------|
  3247. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3248. #if HTT_PADDR64
  3249. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3250. #endif
  3251. * |-------------------------------------------------------------------|
  3252. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3253. #if HTT_PADDR64
  3254. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3255. #endif
  3256. * |-------------------------------------------------------------------|
  3257. *
  3258. * Header fields:
  3259. * Header fields:
  3260. * - MSG_TYPE
  3261. * Bits 7:0
  3262. * Purpose: Identifies this as WDI_IPA config message
  3263. * value: = 0x8
  3264. * - TX_PKT_POOL_SIZE
  3265. * Bits 15:0
  3266. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3267. * WDI_IPA TX path
  3268. * For systems using 32-bit format for bus addresses:
  3269. * - TX_COMP_RING_BASE_ADDR
  3270. * Bits 31:0
  3271. * Purpose: TX Completion Ring base address in DDR
  3272. * - TX_COMP_RING_SIZE
  3273. * Bits 31:0
  3274. * Purpose: TX Completion Ring size (must be power of 2)
  3275. * - TX_COMP_WR_IDX_ADDR
  3276. * Bits 31:0
  3277. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3278. * updates the Write Index for WDI_IPA TX completion ring
  3279. * - TX_CE_WR_IDX_ADDR
  3280. * Bits 31:0
  3281. * Purpose: DDR address where IPA uC
  3282. * updates the WR Index for TX CE ring
  3283. * (needed for fusion platforms)
  3284. * - RX_IND_RING_BASE_ADDR
  3285. * Bits 31:0
  3286. * Purpose: RX Indication Ring base address in DDR
  3287. * - RX_IND_RING_SIZE
  3288. * Bits 31:0
  3289. * Purpose: RX Indication Ring size
  3290. * - RX_IND_RD_IDX_ADDR
  3291. * Bits 31:0
  3292. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3293. * RX indication ring
  3294. * - RX_IND_WR_IDX_ADDR
  3295. * Bits 31:0
  3296. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3297. * updates the Write Index for WDI_IPA RX indication ring
  3298. * - RX_RING2_BASE_ADDR
  3299. * Bits 31:0
  3300. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3301. * - RX_RING2_SIZE
  3302. * Bits 31:0
  3303. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3304. * - RX_RING2_RD_IDX_ADDR
  3305. * Bits 31:0
  3306. * Purpose: If Second RX ring is Indication ring, DDR address where
  3307. * IPA uC updates the Read Index for Ring2.
  3308. * If Second RX ring is completion ring, this is NOT used
  3309. * - RX_RING2_WR_IDX_ADDR
  3310. * Bits 31:0
  3311. * Purpose: If Second RX ring is Indication ring, DDR address where
  3312. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3313. * If second RX ring is completion ring, DDR address where
  3314. * IPA uC updates the Write Index for Ring 2.
  3315. * For systems using 64-bit format for bus addresses:
  3316. * - TX_COMP_RING_BASE_ADDR_LO
  3317. * Bits 31:0
  3318. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3319. * - TX_COMP_RING_BASE_ADDR_HI
  3320. * Bits 31:0
  3321. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3322. * - TX_COMP_RING_SIZE
  3323. * Bits 31:0
  3324. * Purpose: TX Completion Ring size (must be power of 2)
  3325. * - TX_COMP_WR_IDX_ADDR_LO
  3326. * Bits 31:0
  3327. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3328. * Lower 4 bytes of DDR address where WIFI FW
  3329. * updates the Write Index for WDI_IPA TX completion ring
  3330. * - TX_COMP_WR_IDX_ADDR_HI
  3331. * Bits 31:0
  3332. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3333. * Higher 4 bytes of DDR address where WIFI FW
  3334. * updates the Write Index for WDI_IPA TX completion ring
  3335. * - TX_CE_WR_IDX_ADDR_LO
  3336. * Bits 31:0
  3337. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3338. * updates the WR Index for TX CE ring
  3339. * (needed for fusion platforms)
  3340. * - TX_CE_WR_IDX_ADDR_HI
  3341. * Bits 31:0
  3342. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3343. * updates the WR Index for TX CE ring
  3344. * (needed for fusion platforms)
  3345. * - RX_IND_RING_BASE_ADDR_LO
  3346. * Bits 31:0
  3347. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3348. * - RX_IND_RING_BASE_ADDR_HI
  3349. * Bits 31:0
  3350. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3351. * - RX_IND_RING_SIZE
  3352. * Bits 31:0
  3353. * Purpose: RX Indication Ring size
  3354. * - RX_IND_RD_IDX_ADDR_LO
  3355. * Bits 31:0
  3356. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3357. * for WDI_IPA RX indication ring
  3358. * - RX_IND_RD_IDX_ADDR_HI
  3359. * Bits 31:0
  3360. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3361. * for WDI_IPA RX indication ring
  3362. * - RX_IND_WR_IDX_ADDR_LO
  3363. * Bits 31:0
  3364. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3365. * Lower 4 bytes of DDR address where WIFI FW
  3366. * updates the Write Index for WDI_IPA RX indication ring
  3367. * - RX_IND_WR_IDX_ADDR_HI
  3368. * Bits 31:0
  3369. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3370. * Higher 4 bytes of DDR address where WIFI FW
  3371. * updates the Write Index for WDI_IPA RX indication ring
  3372. * - RX_RING2_BASE_ADDR_LO
  3373. * Bits 31:0
  3374. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3375. * - RX_RING2_BASE_ADDR_HI
  3376. * Bits 31:0
  3377. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3378. * - RX_RING2_SIZE
  3379. * Bits 31:0
  3380. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3381. * - RX_RING2_RD_IDX_ADDR_LO
  3382. * Bits 31:0
  3383. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3384. * DDR address where IPA uC updates the Read Index for Ring2.
  3385. * If Second RX ring is completion ring, this is NOT used
  3386. * - RX_RING2_RD_IDX_ADDR_HI
  3387. * Bits 31:0
  3388. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3389. * DDR address where IPA uC updates the Read Index for Ring2.
  3390. * If Second RX ring is completion ring, this is NOT used
  3391. * - RX_RING2_WR_IDX_ADDR_LO
  3392. * Bits 31:0
  3393. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3394. * DDR address where WIFI FW updates the Write Index
  3395. * for WDI_IPA RX ring2
  3396. * If second RX ring is completion ring, lower 4 bytes of
  3397. * DDR address where IPA uC updates the Write Index for Ring 2.
  3398. * - RX_RING2_WR_IDX_ADDR_HI
  3399. * Bits 31:0
  3400. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3401. * DDR address where WIFI FW updates the Write Index
  3402. * for WDI_IPA RX ring2
  3403. * If second RX ring is completion ring, higher 4 bytes of
  3404. * DDR address where IPA uC updates the Write Index for Ring 2.
  3405. */
  3406. #if HTT_PADDR64
  3407. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3408. #else
  3409. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3410. #endif
  3411. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3412. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3413. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3414. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3415. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3416. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3417. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3418. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3419. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3420. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3421. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3422. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3423. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3424. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3425. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3426. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3427. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3428. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3429. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3430. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3431. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3432. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3433. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3434. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3435. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3436. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3437. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3438. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3439. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3440. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3441. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3442. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3443. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3444. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3445. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3446. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3447. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3448. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3449. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3450. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3451. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3452. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3453. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3454. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3455. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3456. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3457. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3458. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3459. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3460. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3461. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3462. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3463. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3464. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3465. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3466. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3467. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3468. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3469. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3470. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3471. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3472. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3473. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3474. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3475. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3476. do { \
  3477. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3478. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3479. } while (0)
  3480. /* for systems using 32-bit format for bus addr */
  3481. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3482. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3483. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3484. do { \
  3485. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3486. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3487. } while (0)
  3488. /* for systems using 64-bit format for bus addr */
  3489. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3490. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3491. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3492. do { \
  3493. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3494. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3495. } while (0)
  3496. /* for systems using 64-bit format for bus addr */
  3497. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3498. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3499. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3500. do { \
  3501. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3502. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3503. } while (0)
  3504. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3505. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3506. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3507. do { \
  3508. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3509. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3510. } while (0)
  3511. /* for systems using 32-bit format for bus addr */
  3512. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3513. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3514. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3515. do { \
  3516. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3517. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3518. } while (0)
  3519. /* for systems using 64-bit format for bus addr */
  3520. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3521. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3522. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3523. do { \
  3524. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3525. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3526. } while (0)
  3527. /* for systems using 64-bit format for bus addr */
  3528. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3529. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3530. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3531. do { \
  3532. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3533. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3534. } while (0)
  3535. /* for systems using 32-bit format for bus addr */
  3536. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3537. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3538. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3539. do { \
  3540. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3541. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3542. } while (0)
  3543. /* for systems using 64-bit format for bus addr */
  3544. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3545. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3546. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3547. do { \
  3548. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3549. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3550. } while (0)
  3551. /* for systems using 64-bit format for bus addr */
  3552. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3553. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3554. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3555. do { \
  3556. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3557. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3558. } while (0)
  3559. /* for systems using 32-bit format for bus addr */
  3560. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3561. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3562. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3563. do { \
  3564. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3565. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3566. } while (0)
  3567. /* for systems using 64-bit format for bus addr */
  3568. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3569. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3570. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3571. do { \
  3572. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3573. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3574. } while (0)
  3575. /* for systems using 64-bit format for bus addr */
  3576. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3577. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3578. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3579. do { \
  3580. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3581. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3582. } while (0)
  3583. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3584. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3585. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3586. do { \
  3587. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3588. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3589. } while (0)
  3590. /* for systems using 32-bit format for bus addr */
  3591. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3592. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3593. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3594. do { \
  3595. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3596. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3597. } while (0)
  3598. /* for systems using 64-bit format for bus addr */
  3599. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3600. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3601. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3602. do { \
  3603. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3604. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3605. } while (0)
  3606. /* for systems using 64-bit format for bus addr */
  3607. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3608. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3609. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3610. do { \
  3611. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3612. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3613. } while (0)
  3614. /* for systems using 32-bit format for bus addr */
  3615. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3616. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3617. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3618. do { \
  3619. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3620. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3621. } while (0)
  3622. /* for systems using 64-bit format for bus addr */
  3623. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3624. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3625. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3626. do { \
  3627. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3628. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3629. } while (0)
  3630. /* for systems using 64-bit format for bus addr */
  3631. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3632. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3633. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3634. do { \
  3635. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3636. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3637. } while (0)
  3638. /* for systems using 32-bit format for bus addr */
  3639. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3640. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3641. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3642. do { \
  3643. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3644. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3645. } while (0)
  3646. /* for systems using 64-bit format for bus addr */
  3647. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3648. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3649. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3650. do { \
  3651. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3652. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3653. } while (0)
  3654. /* for systems using 64-bit format for bus addr */
  3655. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3656. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3657. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3658. do { \
  3659. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3660. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3661. } while (0)
  3662. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3663. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3664. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3665. do { \
  3666. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3667. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3668. } while (0)
  3669. /* for systems using 32-bit format for bus addr */
  3670. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3671. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3672. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3673. do { \
  3674. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3675. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3676. } while (0)
  3677. /* for systems using 64-bit format for bus addr */
  3678. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3679. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3680. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3681. do { \
  3682. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3683. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3684. } while (0)
  3685. /* for systems using 64-bit format for bus addr */
  3686. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3687. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3688. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3689. do { \
  3690. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3691. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3692. } while (0)
  3693. /* for systems using 32-bit format for bus addr */
  3694. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3695. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3696. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3697. do { \
  3698. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3699. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3700. } while (0)
  3701. /* for systems using 64-bit format for bus addr */
  3702. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3703. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3704. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3705. do { \
  3706. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3707. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3708. } while (0)
  3709. /* for systems using 64-bit format for bus addr */
  3710. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3711. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3712. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3713. do { \
  3714. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3715. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3716. } while (0)
  3717. /*
  3718. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3719. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3720. * addresses are stored in a XXX-bit field.
  3721. * This macro is used to define both htt_wdi_ipa_config32_t and
  3722. * htt_wdi_ipa_config64_t structs.
  3723. */
  3724. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3725. _paddr__tx_comp_ring_base_addr_, \
  3726. _paddr__tx_comp_wr_idx_addr_, \
  3727. _paddr__tx_ce_wr_idx_addr_, \
  3728. _paddr__rx_ind_ring_base_addr_, \
  3729. _paddr__rx_ind_rd_idx_addr_, \
  3730. _paddr__rx_ind_wr_idx_addr_, \
  3731. _paddr__rx_ring2_base_addr_,\
  3732. _paddr__rx_ring2_rd_idx_addr_,\
  3733. _paddr__rx_ring2_wr_idx_addr_) \
  3734. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3735. { \
  3736. /* DWORD 0: flags and meta-data */ \
  3737. A_UINT32 \
  3738. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3739. reserved: 8, \
  3740. tx_pkt_pool_size: 16;\
  3741. /* DWORD 1 */\
  3742. _paddr__tx_comp_ring_base_addr_;\
  3743. /* DWORD 2 (or 3)*/\
  3744. A_UINT32 tx_comp_ring_size;\
  3745. /* DWORD 3 (or 4)*/\
  3746. _paddr__tx_comp_wr_idx_addr_;\
  3747. /* DWORD 4 (or 6)*/\
  3748. _paddr__tx_ce_wr_idx_addr_;\
  3749. /* DWORD 5 (or 8)*/\
  3750. _paddr__rx_ind_ring_base_addr_;\
  3751. /* DWORD 6 (or 10)*/\
  3752. A_UINT32 rx_ind_ring_size;\
  3753. /* DWORD 7 (or 11)*/\
  3754. _paddr__rx_ind_rd_idx_addr_;\
  3755. /* DWORD 8 (or 13)*/\
  3756. _paddr__rx_ind_wr_idx_addr_;\
  3757. /* DWORD 9 (or 15)*/\
  3758. _paddr__rx_ring2_base_addr_;\
  3759. /* DWORD 10 (or 17) */\
  3760. A_UINT32 rx_ring2_size;\
  3761. /* DWORD 11 (or 18) */\
  3762. _paddr__rx_ring2_rd_idx_addr_;\
  3763. /* DWORD 12 (or 20) */\
  3764. _paddr__rx_ring2_wr_idx_addr_;\
  3765. } POSTPACK
  3766. /* define a htt_wdi_ipa_config32_t type */
  3767. 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));
  3768. /* define a htt_wdi_ipa_config64_t type */
  3769. 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));
  3770. #if HTT_PADDR64
  3771. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3772. #else
  3773. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3774. #endif
  3775. enum htt_wdi_ipa_op_code {
  3776. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3777. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3778. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3779. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3780. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3781. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3782. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3783. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3784. /* keep this last */
  3785. HTT_WDI_IPA_OPCODE_MAX
  3786. };
  3787. /**
  3788. * @brief HTT WDI_IPA Operation Request Message
  3789. *
  3790. * @details
  3791. * HTT WDI_IPA Operation Request message is sent by host
  3792. * to either suspend or resume WDI_IPA TX or RX path.
  3793. * |31 24|23 16|15 8|7 0|
  3794. * |----------------+----------------+----------------+----------------|
  3795. * | op_code | Rsvd | msg_type |
  3796. * |-------------------------------------------------------------------|
  3797. *
  3798. * Header fields:
  3799. * - MSG_TYPE
  3800. * Bits 7:0
  3801. * Purpose: Identifies this as WDI_IPA Operation Request message
  3802. * value: = 0x9
  3803. * - OP_CODE
  3804. * Bits 31:16
  3805. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3806. * value: = enum htt_wdi_ipa_op_code
  3807. */
  3808. PREPACK struct htt_wdi_ipa_op_request_t
  3809. {
  3810. /* DWORD 0: flags and meta-data */
  3811. A_UINT32
  3812. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3813. reserved: 8,
  3814. op_code: 16;
  3815. } POSTPACK;
  3816. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3817. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3818. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3819. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3820. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3821. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3822. do { \
  3823. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3824. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3825. } while (0)
  3826. /*
  3827. * @brief host -> target HTT_SRING_SETUP message
  3828. *
  3829. * @details
  3830. * After target is booted up, Host can send SRING setup message for
  3831. * each host facing LMAC SRING. Target setups up HW registers based
  3832. * on setup message and confirms back to Host if response_required is set.
  3833. * Host should wait for confirmation message before sending new SRING
  3834. * setup message
  3835. *
  3836. * The message would appear as follows:
  3837. * |31 24|23 20|19|18 16|15|14 8|7 0|
  3838. * |--------------- +-----------------+----------------+------------------|
  3839. * | ring_type | ring_id | pdev_id | msg_type |
  3840. * |----------------------------------------------------------------------|
  3841. * | ring_base_addr_lo |
  3842. * |----------------------------------------------------------------------|
  3843. * | ring_base_addr_hi |
  3844. * |----------------------------------------------------------------------|
  3845. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3846. * |----------------------------------------------------------------------|
  3847. * | ring_head_offset32_remote_addr_lo |
  3848. * |----------------------------------------------------------------------|
  3849. * | ring_head_offset32_remote_addr_hi |
  3850. * |----------------------------------------------------------------------|
  3851. * | ring_tail_offset32_remote_addr_lo |
  3852. * |----------------------------------------------------------------------|
  3853. * | ring_tail_offset32_remote_addr_hi |
  3854. * |----------------------------------------------------------------------|
  3855. * | ring_msi_addr_lo |
  3856. * |----------------------------------------------------------------------|
  3857. * | ring_msi_addr_hi |
  3858. * |----------------------------------------------------------------------|
  3859. * | ring_msi_data |
  3860. * |----------------------------------------------------------------------|
  3861. * | intr_timer_th |IM| intr_batch_counter_th |
  3862. * |----------------------------------------------------------------------|
  3863. * | reserved |RR|PTCF| intr_low_threshold |
  3864. * |----------------------------------------------------------------------|
  3865. * Where
  3866. * IM = sw_intr_mode
  3867. * RR = response_required
  3868. * PTCF = prefetch_timer_cfg
  3869. *
  3870. * The message is interpreted as follows:
  3871. * dword0 - b'0:7 - msg_type: This will be set to
  3872. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3873. * b'8:15 - pdev_id:
  3874. * 0 (for rings at SOC/UMAC level),
  3875. * 1/2/3 mac id (for rings at LMAC level)
  3876. * b'16:23 - ring_id: identify which ring is to setup,
  3877. * more details can be got from enum htt_srng_ring_id
  3878. * b'24:31 - ring_type: identify type of host rings,
  3879. * more details can be got from enum htt_srng_ring_type
  3880. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3881. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3882. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3883. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3884. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3885. * SW_TO_HW_RING.
  3886. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3887. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3888. * Lower 32 bits of memory address of the remote variable
  3889. * storing the 4-byte word offset that identifies the head
  3890. * element within the ring.
  3891. * (The head offset variable has type A_UINT32.)
  3892. * Valid for HW_TO_SW and SW_TO_SW rings.
  3893. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3894. * Upper 32 bits of memory address of the remote variable
  3895. * storing the 4-byte word offset that identifies the head
  3896. * element within the ring.
  3897. * (The head offset variable has type A_UINT32.)
  3898. * Valid for HW_TO_SW and SW_TO_SW rings.
  3899. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3900. * Lower 32 bits of memory address of the remote variable
  3901. * storing the 4-byte word offset that identifies the tail
  3902. * element within the ring.
  3903. * (The tail offset variable has type A_UINT32.)
  3904. * Valid for HW_TO_SW and SW_TO_SW rings.
  3905. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3906. * Upper 32 bits of memory address of the remote variable
  3907. * storing the 4-byte word offset that identifies the tail
  3908. * element within the ring.
  3909. * (The tail offset variable has type A_UINT32.)
  3910. * Valid for HW_TO_SW and SW_TO_SW rings.
  3911. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  3912. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3913. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  3914. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3915. * dword10 - b'0:31 - ring_msi_data: MSI data
  3916. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  3917. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3918. * dword11 - b'0:14 - intr_batch_counter_th:
  3919. * batch counter threshold is in units of 4-byte words.
  3920. * HW internally maintains and increments batch count.
  3921. * (see SRING spec for detail description).
  3922. * When batch count reaches threshold value, an interrupt
  3923. * is generated by HW.
  3924. * b'15 - sw_intr_mode:
  3925. * This configuration shall be static.
  3926. * Only programmed at power up.
  3927. * 0: generate pulse style sw interrupts
  3928. * 1: generate level style sw interrupts
  3929. * b'16:31 - intr_timer_th:
  3930. * The timer init value when timer is idle or is
  3931. * initialized to start downcounting.
  3932. * In 8us units (to cover a range of 0 to 524 ms)
  3933. * dword12 - b'0:15 - intr_low_threshold:
  3934. * Used only by Consumer ring to generate ring_sw_int_p.
  3935. * Ring entries low threshold water mark, that is used
  3936. * in combination with the interrupt timer as well as
  3937. * the the clearing of the level interrupt.
  3938. * b'16:18 - prefetch_timer_cfg:
  3939. * Used only by Consumer ring to set timer mode to
  3940. * support Application prefetch handling.
  3941. * The external tail offset/pointer will be updated
  3942. * at following intervals:
  3943. * 3'b000: (Prefetch feature disabled; used only for debug)
  3944. * 3'b001: 1 usec
  3945. * 3'b010: 4 usec
  3946. * 3'b011: 8 usec (default)
  3947. * 3'b100: 16 usec
  3948. * Others: Reserverd
  3949. * b'19 - response_required:
  3950. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  3951. * b'20:31 - reserved: reserved for future use
  3952. */
  3953. PREPACK struct htt_sring_setup_t {
  3954. A_UINT32 msg_type: 8,
  3955. pdev_id: 8,
  3956. ring_id: 8,
  3957. ring_type: 8;
  3958. A_UINT32 ring_base_addr_lo;
  3959. A_UINT32 ring_base_addr_hi;
  3960. A_UINT32 ring_size: 16,
  3961. ring_entry_size: 8,
  3962. ring_misc_cfg_flag: 8;
  3963. A_UINT32 ring_head_offset32_remote_addr_lo;
  3964. A_UINT32 ring_head_offset32_remote_addr_hi;
  3965. A_UINT32 ring_tail_offset32_remote_addr_lo;
  3966. A_UINT32 ring_tail_offset32_remote_addr_hi;
  3967. A_UINT32 ring_msi_addr_lo;
  3968. A_UINT32 ring_msi_addr_hi;
  3969. A_UINT32 ring_msi_data;
  3970. A_UINT32 intr_batch_counter_th: 15,
  3971. sw_intr_mode: 1,
  3972. intr_timer_th: 16;
  3973. A_UINT32 intr_low_threshold: 16,
  3974. prefetch_timer_cfg: 3,
  3975. response_required: 1,
  3976. reserved1: 12;
  3977. } POSTPACK;
  3978. enum htt_srng_ring_type {
  3979. HTT_HW_TO_SW_RING = 0,
  3980. HTT_SW_TO_HW_RING,
  3981. HTT_SW_TO_SW_RING,
  3982. /* Insert new ring types above this line */
  3983. };
  3984. enum htt_srng_ring_id {
  3985. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  3986. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  3987. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  3988. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  3989. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  3990. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  3991. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  3992. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  3993. /* Add Other SRING which can't be directly configured by host software above this line */
  3994. };
  3995. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  3996. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  3997. #define HTT_SRING_SETUP_PDEV_ID_S 8
  3998. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  3999. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4000. HTT_SRING_SETUP_PDEV_ID_S)
  4001. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4002. do { \
  4003. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4004. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4005. } while (0)
  4006. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4007. #define HTT_SRING_SETUP_RING_ID_S 16
  4008. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4009. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4010. HTT_SRING_SETUP_RING_ID_S)
  4011. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4012. do { \
  4013. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4014. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4015. } while (0)
  4016. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4017. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4018. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4019. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4020. HTT_SRING_SETUP_RING_TYPE_S)
  4021. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4022. do { \
  4023. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4024. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4025. } while (0)
  4026. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4027. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4028. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4029. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4030. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4031. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4032. do { \
  4033. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4034. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4035. } while (0)
  4036. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4037. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4038. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4039. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4040. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4041. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4042. do { \
  4043. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4044. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4045. } while (0)
  4046. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4047. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4048. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4049. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4050. HTT_SRING_SETUP_RING_SIZE_S)
  4051. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4052. do { \
  4053. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4054. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4055. } while (0)
  4056. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4057. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4058. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4059. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4060. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4061. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4062. do { \
  4063. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4064. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4065. } while (0)
  4066. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4067. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4068. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4069. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4070. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4071. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4072. do { \
  4073. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4074. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4075. } while (0)
  4076. /* This control bit is applicable to only Producer, which updates Ring ID field
  4077. * of each descriptor before pushing into the ring.
  4078. * 0: updates ring_id(default)
  4079. * 1: ring_id updating disabled */
  4080. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4081. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4082. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4083. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4084. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4085. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4086. do { \
  4087. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4088. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4089. } while (0)
  4090. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4091. * of each descriptor before pushing into the ring.
  4092. * 0: updates Loopcnt(default)
  4093. * 1: Loopcnt updating disabled */
  4094. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4095. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4096. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4097. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4098. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4099. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4100. do { \
  4101. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4102. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4103. } while (0)
  4104. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4105. * into security_id port of GXI/AXI. */
  4106. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4107. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4108. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4109. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4110. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4111. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4112. do { \
  4113. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4114. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4115. } while (0)
  4116. /* During MSI write operation, SRNG drives value of this register bit into
  4117. * swap bit of GXI/AXI. */
  4118. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4119. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4120. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4121. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4122. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4123. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4124. do { \
  4125. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4126. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4127. } while (0)
  4128. /* During Pointer write operation, SRNG drives value of this register bit into
  4129. * swap bit of GXI/AXI. */
  4130. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4131. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4132. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4133. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4134. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4135. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4136. do { \
  4137. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4138. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4139. } while (0)
  4140. /* During any data or TLV write operation, SRNG drives value of this register
  4141. * bit into swap bit of GXI/AXI. */
  4142. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4143. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4144. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4145. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4146. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4147. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4148. do { \
  4149. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4150. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4151. } while (0)
  4152. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4153. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4154. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4155. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4156. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4157. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4158. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4159. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4160. do { \
  4161. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4162. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4163. } while (0)
  4164. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4165. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4166. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4167. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4168. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4169. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4170. do { \
  4171. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4172. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4173. } while (0)
  4174. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4175. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4176. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4177. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4178. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4179. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4180. do { \
  4181. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4182. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4183. } while (0)
  4184. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4185. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4186. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4187. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4188. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4189. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4190. do { \
  4191. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4192. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4193. } while (0)
  4194. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4195. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4196. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4197. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4198. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4199. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4200. do { \
  4201. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4202. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4203. } while (0)
  4204. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4205. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4206. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4207. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4208. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4209. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4210. do { \
  4211. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4212. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4213. } while (0)
  4214. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4215. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4216. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4217. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4218. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4219. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4220. do { \
  4221. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4222. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4223. } while (0)
  4224. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4225. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4226. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4227. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4228. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4229. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4230. do { \
  4231. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4232. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4233. } while (0)
  4234. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4235. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4236. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4237. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4238. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4239. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4240. do { \
  4241. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4242. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4243. } while (0)
  4244. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4245. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4246. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4247. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4248. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4249. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4250. do { \
  4251. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4252. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4253. } while (0)
  4254. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4255. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4256. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4257. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4258. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4259. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4260. do { \
  4261. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4262. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4263. } while (0)
  4264. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4265. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4266. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4267. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4268. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4269. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4270. do { \
  4271. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4272. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4273. } while (0)
  4274. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4275. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4276. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4277. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4278. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4279. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4280. do { \
  4281. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4282. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4283. } while (0)
  4284. /**
  4285. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4286. *
  4287. * @details
  4288. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4289. * configure RXDMA rings.
  4290. * The configuration is per ring based and includes both packet subtypes
  4291. * and PPDU/MPDU TLVs.
  4292. *
  4293. * The message would appear as follows:
  4294. *
  4295. * |31 26|25|24|23 16|15 8|7 0|
  4296. * |-----------------+----------------+----------------+---------------|
  4297. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  4298. * |-------------------------------------------------------------------|
  4299. * | rsvd2 | ring_buffer_size |
  4300. * |-------------------------------------------------------------------|
  4301. * | packet_type_enable_flags_0 |
  4302. * |-------------------------------------------------------------------|
  4303. * | packet_type_enable_flags_1 |
  4304. * |-------------------------------------------------------------------|
  4305. * | packet_type_enable_flags_2 |
  4306. * |-------------------------------------------------------------------|
  4307. * | packet_type_enable_flags_3 |
  4308. * |-------------------------------------------------------------------|
  4309. * | tlv_filter_in_flags |
  4310. * |-------------------------------------------------------------------|
  4311. * Where:
  4312. * PS = pkt_swap
  4313. * SS = status_swap
  4314. * The message is interpreted as follows:
  4315. * dword0 - b'0:7 - msg_type: This will be set to
  4316. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4317. * b'8:15 - pdev_id:
  4318. * 0 (for rings at SOC/UMAC level),
  4319. * 1/2/3 mac id (for rings at LMAC level)
  4320. * b'16:23 - ring_id : Identify the ring to configure.
  4321. * More details can be got from enum htt_srng_ring_id
  4322. * b'24 - status_swap: 1 is to swap status TLV
  4323. * b'25 - pkt_swap: 1 is to swap packet TLV
  4324. * b'26:31 - rsvd1: reserved for future use
  4325. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4326. * in byte units.
  4327. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4328. * - b'16:31 - rsvd2: Reserved for future use
  4329. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4330. * Enable MGMT packet from 0b0000 to 0b1001
  4331. * bits from low to high: FP, MD, MO - 3 bits
  4332. * FP: Filter_Pass
  4333. * MD: Monitor_Direct
  4334. * MO: Monitor_Other
  4335. * 10 mgmt subtypes * 3 bits -> 30 bits
  4336. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4337. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4338. * Enable MGMT packet from 0b1010 to 0b1111
  4339. * bits from low to high: FP, MD, MO - 3 bits
  4340. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4341. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4342. * Enable CTRL packet from 0b0000 to 0b1001
  4343. * bits from low to high: FP, MD, MO - 3 bits
  4344. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4345. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4346. * Enable CTRL packet from 0b1010 to 0b1111,
  4347. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4348. * bits from low to high: FP, MD, MO - 3 bits
  4349. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4350. * dword6 - b'0:31 - tlv_filter_in_flags:
  4351. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4352. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4353. */
  4354. PREPACK struct htt_rx_ring_selection_cfg_t {
  4355. A_UINT32 msg_type: 8,
  4356. pdev_id: 8,
  4357. ring_id: 8,
  4358. status_swap: 1,
  4359. pkt_swap: 1,
  4360. rsvd1: 6;
  4361. A_UINT32 ring_buffer_size: 16,
  4362. rsvd2: 16;
  4363. A_UINT32 packet_type_enable_flags_0;
  4364. A_UINT32 packet_type_enable_flags_1;
  4365. A_UINT32 packet_type_enable_flags_2;
  4366. A_UINT32 packet_type_enable_flags_3;
  4367. A_UINT32 tlv_filter_in_flags;
  4368. } POSTPACK;
  4369. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4370. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4371. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4372. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4373. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4374. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4375. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4376. do { \
  4377. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4378. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4379. } while (0)
  4380. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4381. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4382. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4383. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4384. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4385. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4386. do { \
  4387. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4388. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4389. } while (0)
  4390. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4391. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4392. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4393. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4394. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4395. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4396. do { \
  4397. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4398. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4399. } while (0)
  4400. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4401. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4402. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4403. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4404. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4405. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4406. do { \
  4407. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4408. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4409. } while (0)
  4410. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4411. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4412. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4413. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4414. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4415. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4416. do { \
  4417. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4418. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4419. } while (0)
  4420. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4421. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4422. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4423. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4424. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4425. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4426. do { \
  4427. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4428. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4429. } while (0)
  4430. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4431. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4432. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4433. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4434. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4435. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4436. do { \
  4437. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4438. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4439. } while (0)
  4440. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4441. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4442. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4443. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4444. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4445. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4446. do { \
  4447. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4448. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4449. } while (0)
  4450. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4451. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4452. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4453. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4454. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4455. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4456. do { \
  4457. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4458. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4459. } while (0)
  4460. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4461. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4462. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4463. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4464. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4465. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4466. do { \
  4467. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4468. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4469. } while (0)
  4470. /*
  4471. * Subtype based MGMT frames enable bits.
  4472. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4473. */
  4474. /* association request */
  4475. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4476. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4477. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4478. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4479. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4480. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4481. /* association response */
  4482. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4483. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4484. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4485. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4486. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4487. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4488. /* Reassociation request */
  4489. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4490. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4491. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4492. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4493. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4494. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4495. /* Reassociation response */
  4496. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4497. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4498. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4499. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4500. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4501. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4502. /* Probe request */
  4503. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4504. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4505. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4506. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4507. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4508. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4509. /* Probe response */
  4510. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4511. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4512. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4513. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4514. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4515. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4516. /* Timing Advertisement */
  4517. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4518. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4519. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4520. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4521. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4522. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4523. /* Reserved */
  4524. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4525. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4526. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4527. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4528. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4529. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4530. /* Beacon */
  4531. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  4532. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4533. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  4534. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4535. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  4536. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4537. /* ATIM */
  4538. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  4539. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4540. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  4541. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4542. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  4543. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4544. /* Disassociation */
  4545. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4546. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4547. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4548. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4549. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4550. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4551. /* Authentication */
  4552. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4553. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4554. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4555. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4556. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4557. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4558. /* Deauthentication */
  4559. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4560. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4561. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4562. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4563. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4564. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4565. /* Action */
  4566. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4567. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4568. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4569. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4570. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4571. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4572. /* Action No Ack */
  4573. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4574. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4575. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4576. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4577. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4578. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4579. /* Reserved */
  4580. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4581. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4582. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4583. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4584. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4585. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4586. /*
  4587. * Subtype based CTRL frames enable bits.
  4588. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4589. */
  4590. /* Reserved */
  4591. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4592. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4593. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4594. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4595. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4596. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4597. /* Reserved */
  4598. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4599. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4600. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4601. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4602. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4603. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4604. /* Reserved */
  4605. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4606. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4607. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4608. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4609. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4610. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4611. /* Reserved */
  4612. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4613. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4614. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4615. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4616. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4617. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4618. /* Reserved */
  4619. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4620. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4621. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4622. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4623. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4624. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4625. /* Reserved */
  4626. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4627. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4628. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4629. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4630. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4631. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4632. /* Reserved */
  4633. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4634. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4635. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4636. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4637. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4638. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4639. /* Control Wrapper */
  4640. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4641. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4642. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4643. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4644. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4645. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4646. /* Block Ack Request */
  4647. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  4648. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4649. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  4650. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4651. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  4652. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4653. /* Block Ack*/
  4654. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  4655. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4656. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  4657. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4658. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  4659. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4660. /* PS-POLL */
  4661. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4662. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4663. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4664. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4665. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4666. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4667. /* RTS */
  4668. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4669. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4670. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4671. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4672. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4673. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4674. /* CTS */
  4675. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4676. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4677. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4678. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4679. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4680. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4681. /* ACK */
  4682. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4683. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4684. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4685. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4686. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4687. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4688. /* CF-END */
  4689. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4690. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4691. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4692. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4693. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  4694. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4695. /* CF-END + CF-ACK */
  4696. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  4697. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4698. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  4699. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4700. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  4701. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4702. /* Multicast data */
  4703. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  4704. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4705. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  4706. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  4707. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  4708. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  4709. /* Unicast data */
  4710. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  4711. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  4712. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  4713. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  4714. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  4715. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  4716. /* NULL data */
  4717. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  4718. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  4719. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  4720. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  4721. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  4722. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  4723. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  4724. do { \
  4725. HTT_CHECK_SET_VAL(httsym, value); \
  4726. (word) |= (value) << httsym##_S; \
  4727. } while (0)
  4728. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  4729. (((word) & httsym##_M) >> httsym##_S)
  4730. #define htt_rx_ring_pkt_enable_subtype_set( \
  4731. word, flag, mode, type, subtype, val) \
  4732. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  4733. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  4734. #define htt_rx_ring_pkt_enable_subtype_get( \
  4735. word, flag, mode, type, subtype) \
  4736. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  4737. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  4738. /* Definition to filter in TLVs */
  4739. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  4740. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  4741. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  4742. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  4743. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  4744. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  4745. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  4746. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  4747. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  4748. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  4749. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  4750. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  4751. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  4752. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  4753. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  4754. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  4755. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  4756. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  4757. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  4758. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  4759. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  4760. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  4761. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  4762. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  4763. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  4764. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  4765. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  4766. do { \
  4767. HTT_CHECK_SET_VAL(httsym, enable); \
  4768. (word) |= (enable) << httsym##_S; \
  4769. } while (0)
  4770. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  4771. (((word) & httsym##_M) >> httsym##_S)
  4772. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  4773. HTT_RX_RING_TLV_ENABLE_SET( \
  4774. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  4775. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  4776. HTT_RX_RING_TLV_ENABLE_GET( \
  4777. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  4778. /**
  4779. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  4780. * host --> target Receive Flow Steering configuration message definition.
  4781. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4782. * The reason for this is we want RFS to be configured and ready before MAC
  4783. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4784. *
  4785. * |31 24|23 16|15 9|8|7 0|
  4786. * |----------------+----------------+----------------+----------------|
  4787. * | reserved |E| msg type |
  4788. * |-------------------------------------------------------------------|
  4789. * Where E = RFS enable flag
  4790. *
  4791. * The RFS_CONFIG message consists of a single 4-byte word.
  4792. *
  4793. * Header fields:
  4794. * - MSG_TYPE
  4795. * Bits 7:0
  4796. * Purpose: identifies this as a RFS config msg
  4797. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  4798. * - RFS_CONFIG
  4799. * Bit 8
  4800. * Purpose: Tells target whether to enable (1) or disable (0)
  4801. * flow steering feature when sending rx indication messages to host
  4802. */
  4803. #define HTT_H2T_RFS_CONFIG_M 0x100
  4804. #define HTT_H2T_RFS_CONFIG_S 8
  4805. #define HTT_RX_RFS_CONFIG_GET(_var) \
  4806. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  4807. HTT_H2T_RFS_CONFIG_S)
  4808. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  4809. do { \
  4810. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  4811. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  4812. } while (0)
  4813. #define HTT_RFS_CFG_REQ_BYTES 4
  4814. /**
  4815. * @brief host -> target FW extended statistics retrieve
  4816. *
  4817. * @details
  4818. * The following field definitions describe the format of the HTT host
  4819. * to target FW extended stats retrieve message.
  4820. * The message specifies the type of stats the host wants to retrieve.
  4821. *
  4822. * |31 24|23 16|15 8|7 0|
  4823. * |-----------------------------------------------------------|
  4824. * | reserved | stats type | pdev_mask | msg type |
  4825. * |-----------------------------------------------------------|
  4826. * | config param [0] |
  4827. * |-----------------------------------------------------------|
  4828. * | config param [1] |
  4829. * |-----------------------------------------------------------|
  4830. * | config param [2] |
  4831. * |-----------------------------------------------------------|
  4832. * | config param [3] |
  4833. * |-----------------------------------------------------------|
  4834. * | reserved |
  4835. * |-----------------------------------------------------------|
  4836. * | cookie LSBs |
  4837. * |-----------------------------------------------------------|
  4838. * | cookie MSBs |
  4839. * |-----------------------------------------------------------|
  4840. * Header fields:
  4841. * - MSG_TYPE
  4842. * Bits 7:0
  4843. * Purpose: identifies this is a extended stats upload request message
  4844. * Value: 0x10
  4845. * - PDEV_MASK
  4846. * Bits 8:15
  4847. * Purpose: identifies the mask of PDEVs to retrieve stats from
  4848. * Value: This is a overloaded field, refer to usage and interpretation of
  4849. * PDEV in interface document.
  4850. * Bit 8 : Reserved for SOC stats
  4851. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  4852. * Indicates MACID_MASK in DBS
  4853. * - STATS_TYPE
  4854. * Bits 23:16
  4855. * Purpose: identifies which FW statistics to upload
  4856. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  4857. * - Reserved
  4858. * Bits 31:24
  4859. * - CONFIG_PARAM [0]
  4860. * Bits 31:0
  4861. * Purpose: give an opaque configuration value to the specified stats type
  4862. * Value: stats-type specific configuration value
  4863. * Refer to htt_stats.h for interpretation for each stats sub_type
  4864. * - CONFIG_PARAM [1]
  4865. * Bits 31:0
  4866. * Purpose: give an opaque configuration value to the specified stats type
  4867. * Value: stats-type specific configuration value
  4868. * Refer to htt_stats.h for interpretation for each stats sub_type
  4869. * - CONFIG_PARAM [2]
  4870. * Bits 31:0
  4871. * Purpose: give an opaque configuration value to the specified stats type
  4872. * Value: stats-type specific configuration value
  4873. * Refer to htt_stats.h for interpretation for each stats sub_type
  4874. * - CONFIG_PARAM [3]
  4875. * Bits 31:0
  4876. * Purpose: give an opaque configuration value to the specified stats type
  4877. * Value: stats-type specific configuration value
  4878. * Refer to htt_stats.h for interpretation for each stats sub_type
  4879. * - Reserved [31:0] for future use.
  4880. * - COOKIE_LSBS
  4881. * Bits 31:0
  4882. * Purpose: Provide a mechanism to match a target->host stats confirmation
  4883. * message with its preceding host->target stats request message.
  4884. * Value: LSBs of the opaque cookie specified by the host-side requestor
  4885. * - COOKIE_MSBS
  4886. * Bits 31:0
  4887. * Purpose: Provide a mechanism to match a target->host stats confirmation
  4888. * message with its preceding host->target stats request message.
  4889. * Value: MSBs of the opaque cookie specified by the host-side requestor
  4890. */
  4891. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  4892. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  4893. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  4894. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  4895. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  4896. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  4897. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  4898. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  4899. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  4900. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  4901. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  4902. do { \
  4903. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  4904. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  4905. } while (0)
  4906. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  4907. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  4908. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  4909. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  4910. do { \
  4911. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  4912. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  4913. } while (0)
  4914. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  4915. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  4916. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  4917. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  4918. do { \
  4919. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  4920. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  4921. } while (0)
  4922. /**
  4923. * @brief host -> target FW PPDU_STATS request message
  4924. *
  4925. * @details
  4926. * The following field definitions describe the format of the HTT host
  4927. * to target FW for PPDU_STATS_CFG msg.
  4928. * The message allows the host to configure the PPDU_STATS_IND messages
  4929. * produced by the target.
  4930. *
  4931. * |31 24|23 16|15 8|7 0|
  4932. * |-----------------------------------------------------------|
  4933. * | REQ bit mask | pdev_mask | msg type |
  4934. * |-----------------------------------------------------------|
  4935. * Header fields:
  4936. * - MSG_TYPE
  4937. * Bits 7:0
  4938. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  4939. * Value: 0x11
  4940. * - PDEV_MASK
  4941. * Bits 8:15
  4942. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  4943. * Value: This is a overloaded field, refer to usage and interpretation of
  4944. * PDEV in interface document.
  4945. * Bit 8 : Reserved for SOC stats
  4946. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  4947. * Indicates MACID_MASK in DBS
  4948. * - REQ_TLV_BIT_MASK
  4949. * Bits 16:31
  4950. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  4951. * needs to be included in the target's PPDU_STATS_IND messages.
  4952. * Value: refer htt_ppdu_stats_tlv_tag_t
  4953. *
  4954. */
  4955. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  4956. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  4957. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  4958. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  4959. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  4960. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  4961. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  4962. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  4963. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  4964. do { \
  4965. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  4966. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  4967. } while (0)
  4968. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  4969. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  4970. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  4971. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  4972. do { \
  4973. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  4974. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  4975. } while (0)
  4976. /*=== target -> host messages ===============================================*/
  4977. enum htt_t2h_msg_type {
  4978. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  4979. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  4980. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  4981. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  4982. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  4983. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  4984. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  4985. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  4986. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  4987. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  4988. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  4989. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  4990. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  4991. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  4992. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  4993. /* only used for HL, add HTT MSG for HTT CREDIT update */
  4994. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  4995. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  4996. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  4997. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  4998. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  4999. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  5000. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  5001. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  5002. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  5003. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  5004. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  5005. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  5006. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  5007. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  5008. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  5009. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  5010. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  5011. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  5012. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  5013. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  5014. HTT_T2H_MSG_TYPE_TEST,
  5015. /* keep this last */
  5016. HTT_T2H_NUM_MSGS
  5017. };
  5018. /*
  5019. * HTT target to host message type -
  5020. * stored in bits 7:0 of the first word of the message
  5021. */
  5022. #define HTT_T2H_MSG_TYPE_M 0xff
  5023. #define HTT_T2H_MSG_TYPE_S 0
  5024. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  5025. do { \
  5026. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  5027. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  5028. } while (0)
  5029. #define HTT_T2H_MSG_TYPE_GET(word) \
  5030. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  5031. /**
  5032. * @brief target -> host version number confirmation message definition
  5033. *
  5034. * |31 24|23 16|15 8|7 0|
  5035. * |----------------+----------------+----------------+----------------|
  5036. * | reserved | major number | minor number | msg type |
  5037. * |-------------------------------------------------------------------|
  5038. * : option request TLV (optional) |
  5039. * :...................................................................:
  5040. *
  5041. * The VER_CONF message may consist of a single 4-byte word, or may be
  5042. * extended with TLVs that specify HTT options selected by the target.
  5043. * The following option TLVs may be appended to the VER_CONF message:
  5044. * - LL_BUS_ADDR_SIZE
  5045. * - HL_SUPPRESS_TX_COMPL_IND
  5046. * - MAX_TX_QUEUE_GROUPS
  5047. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  5048. * may be appended to the VER_CONF message (but only one TLV of each type).
  5049. *
  5050. * Header fields:
  5051. * - MSG_TYPE
  5052. * Bits 7:0
  5053. * Purpose: identifies this as a version number confirmation message
  5054. * Value: 0x0
  5055. * - VER_MINOR
  5056. * Bits 15:8
  5057. * Purpose: Specify the minor number of the HTT message library version
  5058. * in use by the target firmware.
  5059. * The minor number specifies the specific revision within a range
  5060. * of fundamentally compatible HTT message definition revisions.
  5061. * Compatible revisions involve adding new messages or perhaps
  5062. * adding new fields to existing messages, in a backwards-compatible
  5063. * manner.
  5064. * Incompatible revisions involve changing the message type values,
  5065. * or redefining existing messages.
  5066. * Value: minor number
  5067. * - VER_MAJOR
  5068. * Bits 15:8
  5069. * Purpose: Specify the major number of the HTT message library version
  5070. * in use by the target firmware.
  5071. * The major number specifies the family of minor revisions that are
  5072. * fundamentally compatible with each other, but not with prior or
  5073. * later families.
  5074. * Value: major number
  5075. */
  5076. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  5077. #define HTT_VER_CONF_MINOR_S 8
  5078. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  5079. #define HTT_VER_CONF_MAJOR_S 16
  5080. #define HTT_VER_CONF_MINOR_SET(word, value) \
  5081. do { \
  5082. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  5083. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  5084. } while (0)
  5085. #define HTT_VER_CONF_MINOR_GET(word) \
  5086. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  5087. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  5088. do { \
  5089. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  5090. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  5091. } while (0)
  5092. #define HTT_VER_CONF_MAJOR_GET(word) \
  5093. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  5094. #define HTT_VER_CONF_BYTES 4
  5095. /**
  5096. * @brief - target -> host HTT Rx In order indication message
  5097. *
  5098. * @details
  5099. *
  5100. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  5101. * |----------------+-------------------+---------------------+---------------|
  5102. * | peer ID | P| F| O| ext TID | msg type |
  5103. * |--------------------------------------------------------------------------|
  5104. * | MSDU count | Reserved | vdev id |
  5105. * |--------------------------------------------------------------------------|
  5106. * | MSDU 0 bus address (bits 31:0) |
  5107. #if HTT_PADDR64
  5108. * | MSDU 0 bus address (bits 63:32) |
  5109. #endif
  5110. * |--------------------------------------------------------------------------|
  5111. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  5112. * |--------------------------------------------------------------------------|
  5113. * | MSDU 1 bus address (bits 31:0) |
  5114. #if HTT_PADDR64
  5115. * | MSDU 1 bus address (bits 63:32) |
  5116. #endif
  5117. * |--------------------------------------------------------------------------|
  5118. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  5119. * |--------------------------------------------------------------------------|
  5120. */
  5121. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  5122. *
  5123. * @details
  5124. * bits
  5125. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  5126. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5127. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  5128. * | | frag | | | | fail |chksum fail|
  5129. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5130. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  5131. */
  5132. struct htt_rx_in_ord_paddr_ind_hdr_t
  5133. {
  5134. A_UINT32 /* word 0 */
  5135. msg_type: 8,
  5136. ext_tid: 5,
  5137. offload: 1,
  5138. frag: 1,
  5139. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  5140. peer_id: 16;
  5141. A_UINT32 /* word 1 */
  5142. vap_id: 8,
  5143. reserved_1: 8,
  5144. msdu_cnt: 16;
  5145. };
  5146. struct htt_rx_in_ord_paddr_ind_msdu32_t
  5147. {
  5148. A_UINT32 dma_addr;
  5149. A_UINT32
  5150. length: 16,
  5151. fw_desc: 8,
  5152. msdu_info:8;
  5153. };
  5154. struct htt_rx_in_ord_paddr_ind_msdu64_t
  5155. {
  5156. A_UINT32 dma_addr_lo;
  5157. A_UINT32 dma_addr_hi;
  5158. A_UINT32
  5159. length: 16,
  5160. fw_desc: 8,
  5161. msdu_info:8;
  5162. };
  5163. #if HTT_PADDR64
  5164. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  5165. #else
  5166. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  5167. #endif
  5168. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  5169. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  5170. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  5171. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  5172. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  5173. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  5174. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  5175. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  5176. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  5177. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  5178. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  5179. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  5180. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  5181. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  5182. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  5183. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  5184. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  5185. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  5186. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  5187. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  5188. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  5189. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  5190. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  5191. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  5192. /* for systems using 64-bit format for bus addresses */
  5193. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  5194. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  5195. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  5196. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  5197. /* for systems using 32-bit format for bus addresses */
  5198. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  5199. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  5200. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  5201. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  5202. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  5203. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  5204. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  5205. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  5206. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  5207. do { \
  5208. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  5209. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  5210. } while (0)
  5211. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  5212. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  5213. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  5214. do { \
  5215. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  5216. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  5217. } while (0)
  5218. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  5219. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  5220. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  5221. do { \
  5222. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  5223. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  5224. } while (0)
  5225. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  5226. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  5227. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  5228. do { \
  5229. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  5230. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  5231. } while (0)
  5232. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  5233. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  5234. /* for systems using 64-bit format for bus addresses */
  5235. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  5236. do { \
  5237. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  5238. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  5239. } while (0)
  5240. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  5241. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  5242. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  5243. do { \
  5244. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  5245. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  5246. } while (0)
  5247. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  5248. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  5249. /* for systems using 32-bit format for bus addresses */
  5250. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  5251. do { \
  5252. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  5253. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  5254. } while (0)
  5255. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  5256. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  5257. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  5258. do { \
  5259. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  5260. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  5261. } while (0)
  5262. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  5263. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  5264. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  5265. do { \
  5266. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  5267. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  5268. } while (0)
  5269. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  5270. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  5271. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  5272. do { \
  5273. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  5274. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  5275. } while (0)
  5276. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  5277. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  5278. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  5279. do { \
  5280. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  5281. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  5282. } while (0)
  5283. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  5284. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  5285. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  5286. do { \
  5287. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  5288. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  5289. } while (0)
  5290. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  5291. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  5292. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  5293. do { \
  5294. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  5295. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  5296. } while (0)
  5297. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  5298. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  5299. /* definitions used within target -> host rx indication message */
  5300. PREPACK struct htt_rx_ind_hdr_prefix_t
  5301. {
  5302. A_UINT32 /* word 0 */
  5303. msg_type: 8,
  5304. ext_tid: 5,
  5305. release_valid: 1,
  5306. flush_valid: 1,
  5307. reserved0: 1,
  5308. peer_id: 16;
  5309. A_UINT32 /* word 1 */
  5310. flush_start_seq_num: 6,
  5311. flush_end_seq_num: 6,
  5312. release_start_seq_num: 6,
  5313. release_end_seq_num: 6,
  5314. num_mpdu_ranges: 8;
  5315. } POSTPACK;
  5316. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  5317. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  5318. #define HTT_TGT_RSSI_INVALID 0x80
  5319. PREPACK struct htt_rx_ppdu_desc_t
  5320. {
  5321. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  5322. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  5323. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  5324. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  5325. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  5326. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  5327. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  5328. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  5329. A_UINT32 /* word 0 */
  5330. rssi_cmb: 8,
  5331. timestamp_submicrosec: 8,
  5332. phy_err_code: 8,
  5333. phy_err: 1,
  5334. legacy_rate: 4,
  5335. legacy_rate_sel: 1,
  5336. end_valid: 1,
  5337. start_valid: 1;
  5338. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  5339. union {
  5340. A_UINT32 /* word 1 */
  5341. rssi0_pri20: 8,
  5342. rssi0_ext20: 8,
  5343. rssi0_ext40: 8,
  5344. rssi0_ext80: 8;
  5345. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  5346. } u0;
  5347. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  5348. union {
  5349. A_UINT32 /* word 2 */
  5350. rssi1_pri20: 8,
  5351. rssi1_ext20: 8,
  5352. rssi1_ext40: 8,
  5353. rssi1_ext80: 8;
  5354. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  5355. } u1;
  5356. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  5357. union {
  5358. A_UINT32 /* word 3 */
  5359. rssi2_pri20: 8,
  5360. rssi2_ext20: 8,
  5361. rssi2_ext40: 8,
  5362. rssi2_ext80: 8;
  5363. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  5364. } u2;
  5365. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  5366. union {
  5367. A_UINT32 /* word 4 */
  5368. rssi3_pri20: 8,
  5369. rssi3_ext20: 8,
  5370. rssi3_ext40: 8,
  5371. rssi3_ext80: 8;
  5372. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  5373. } u3;
  5374. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  5375. A_UINT32 tsf32; /* word 5 */
  5376. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  5377. A_UINT32 timestamp_microsec; /* word 6 */
  5378. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  5379. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  5380. A_UINT32 /* word 7 */
  5381. vht_sig_a1: 24,
  5382. preamble_type: 8;
  5383. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  5384. A_UINT32 /* word 8 */
  5385. vht_sig_a2: 24,
  5386. reserved0: 8;
  5387. } POSTPACK;
  5388. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  5389. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  5390. PREPACK struct htt_rx_ind_hdr_suffix_t
  5391. {
  5392. A_UINT32 /* word 0 */
  5393. fw_rx_desc_bytes: 16,
  5394. reserved0: 16;
  5395. } POSTPACK;
  5396. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  5397. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  5398. PREPACK struct htt_rx_ind_hdr_t
  5399. {
  5400. struct htt_rx_ind_hdr_prefix_t prefix;
  5401. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  5402. struct htt_rx_ind_hdr_suffix_t suffix;
  5403. } POSTPACK;
  5404. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  5405. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  5406. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  5407. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  5408. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  5409. /*
  5410. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  5411. * the offset into the HTT rx indication message at which the
  5412. * FW rx PPDU descriptor resides
  5413. */
  5414. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  5415. /*
  5416. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  5417. * the offset into the HTT rx indication message at which the
  5418. * header suffix (FW rx MSDU byte count) resides
  5419. */
  5420. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  5421. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  5422. /*
  5423. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  5424. * the offset into the HTT rx indication message at which the per-MSDU
  5425. * information starts
  5426. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  5427. * per-MSDU information portion of the message. The per-MSDU info itself
  5428. * starts at byte 12.
  5429. */
  5430. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  5431. /**
  5432. * @brief target -> host rx indication message definition
  5433. *
  5434. * @details
  5435. * The following field definitions describe the format of the rx indication
  5436. * message sent from the target to the host.
  5437. * The message consists of three major sections:
  5438. * 1. a fixed-length header
  5439. * 2. a variable-length list of firmware rx MSDU descriptors
  5440. * 3. one or more 4-octet MPDU range information elements
  5441. * The fixed length header itself has two sub-sections
  5442. * 1. the message meta-information, including identification of the
  5443. * sender and type of the received data, and a 4-octet flush/release IE
  5444. * 2. the firmware rx PPDU descriptor
  5445. *
  5446. * The format of the message is depicted below.
  5447. * in this depiction, the following abbreviations are used for information
  5448. * elements within the message:
  5449. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  5450. * elements associated with the PPDU start are valid.
  5451. * Specifically, the following fields are valid only if SV is set:
  5452. * RSSI (all variants), L, legacy rate, preamble type, service,
  5453. * VHT-SIG-A
  5454. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  5455. * elements associated with the PPDU end are valid.
  5456. * Specifically, the following fields are valid only if EV is set:
  5457. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  5458. * - L - Legacy rate selector - if legacy rates are used, this flag
  5459. * indicates whether the rate is from a CCK (L == 1) or OFDM
  5460. * (L == 0) PHY.
  5461. * - P - PHY error flag - boolean indication of whether the rx frame had
  5462. * a PHY error
  5463. *
  5464. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  5465. * |----------------+-------------------+---------------------+---------------|
  5466. * | peer ID | |RV|FV| ext TID | msg type |
  5467. * |--------------------------------------------------------------------------|
  5468. * | num | release | release | flush | flush |
  5469. * | MPDU | end | start | end | start |
  5470. * | ranges | seq num | seq num | seq num | seq num |
  5471. * |==========================================================================|
  5472. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  5473. * |V|V| | rate | | | timestamp | RSSI |
  5474. * |--------------------------------------------------------------------------|
  5475. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  5476. * |--------------------------------------------------------------------------|
  5477. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  5478. * |--------------------------------------------------------------------------|
  5479. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  5480. * |--------------------------------------------------------------------------|
  5481. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  5482. * |--------------------------------------------------------------------------|
  5483. * | TSF LSBs |
  5484. * |--------------------------------------------------------------------------|
  5485. * | microsec timestamp |
  5486. * |--------------------------------------------------------------------------|
  5487. * | preamble type | HT-SIG / VHT-SIG-A1 |
  5488. * |--------------------------------------------------------------------------|
  5489. * | service | HT-SIG / VHT-SIG-A2 |
  5490. * |==========================================================================|
  5491. * | reserved | FW rx desc bytes |
  5492. * |--------------------------------------------------------------------------|
  5493. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  5494. * | desc B3 | desc B2 | desc B1 | desc B0 |
  5495. * |--------------------------------------------------------------------------|
  5496. * : : :
  5497. * |--------------------------------------------------------------------------|
  5498. * | alignment | MSDU Rx |
  5499. * | padding | desc Bn |
  5500. * |--------------------------------------------------------------------------|
  5501. * | reserved | MPDU range status | MPDU count |
  5502. * |--------------------------------------------------------------------------|
  5503. * : reserved : MPDU range status : MPDU count :
  5504. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  5505. *
  5506. * Header fields:
  5507. * - MSG_TYPE
  5508. * Bits 7:0
  5509. * Purpose: identifies this as an rx indication message
  5510. * Value: 0x1
  5511. * - EXT_TID
  5512. * Bits 12:8
  5513. * Purpose: identify the traffic ID of the rx data, including
  5514. * special "extended" TID values for multicast, broadcast, and
  5515. * non-QoS data frames
  5516. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  5517. * - FLUSH_VALID (FV)
  5518. * Bit 13
  5519. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  5520. * is valid
  5521. * Value:
  5522. * 1 -> flush IE is valid and needs to be processed
  5523. * 0 -> flush IE is not valid and should be ignored
  5524. * - REL_VALID (RV)
  5525. * Bit 13
  5526. * Purpose: indicate whether the release IE (start/end sequence numbers)
  5527. * is valid
  5528. * Value:
  5529. * 1 -> release IE is valid and needs to be processed
  5530. * 0 -> release IE is not valid and should be ignored
  5531. * - PEER_ID
  5532. * Bits 31:16
  5533. * Purpose: Identify, by ID, which peer sent the rx data
  5534. * Value: ID of the peer who sent the rx data
  5535. * - FLUSH_SEQ_NUM_START
  5536. * Bits 5:0
  5537. * Purpose: Indicate the start of a series of MPDUs to flush
  5538. * Not all MPDUs within this series are necessarily valid - the host
  5539. * must check each sequence number within this range to see if the
  5540. * corresponding MPDU is actually present.
  5541. * This field is only valid if the FV bit is set.
  5542. * Value:
  5543. * The sequence number for the first MPDUs to check to flush.
  5544. * The sequence number is masked by 0x3f.
  5545. * - FLUSH_SEQ_NUM_END
  5546. * Bits 11:6
  5547. * Purpose: Indicate the end of a series of MPDUs to flush
  5548. * Value:
  5549. * The sequence number one larger than the sequence number of the
  5550. * last MPDU to check to flush.
  5551. * The sequence number is masked by 0x3f.
  5552. * Not all MPDUs within this series are necessarily valid - the host
  5553. * must check each sequence number within this range to see if the
  5554. * corresponding MPDU is actually present.
  5555. * This field is only valid if the FV bit is set.
  5556. * - REL_SEQ_NUM_START
  5557. * Bits 17:12
  5558. * Purpose: Indicate the start of a series of MPDUs to release.
  5559. * All MPDUs within this series are present and valid - the host
  5560. * need not check each sequence number within this range to see if
  5561. * the corresponding MPDU is actually present.
  5562. * This field is only valid if the RV bit is set.
  5563. * Value:
  5564. * The sequence number for the first MPDUs to check to release.
  5565. * The sequence number is masked by 0x3f.
  5566. * - REL_SEQ_NUM_END
  5567. * Bits 23:18
  5568. * Purpose: Indicate the end of a series of MPDUs to release.
  5569. * Value:
  5570. * The sequence number one larger than the sequence number of the
  5571. * last MPDU to check to release.
  5572. * The sequence number is masked by 0x3f.
  5573. * All MPDUs within this series are present and valid - the host
  5574. * need not check each sequence number within this range to see if
  5575. * the corresponding MPDU is actually present.
  5576. * This field is only valid if the RV bit is set.
  5577. * - NUM_MPDU_RANGES
  5578. * Bits 31:24
  5579. * Purpose: Indicate how many ranges of MPDUs are present.
  5580. * Each MPDU range consists of a series of contiguous MPDUs within the
  5581. * rx frame sequence which all have the same MPDU status.
  5582. * Value: 1-63 (typically a small number, like 1-3)
  5583. *
  5584. * Rx PPDU descriptor fields:
  5585. * - RSSI_CMB
  5586. * Bits 7:0
  5587. * Purpose: Combined RSSI from all active rx chains, across the active
  5588. * bandwidth.
  5589. * Value: RSSI dB units w.r.t. noise floor
  5590. * - TIMESTAMP_SUBMICROSEC
  5591. * Bits 15:8
  5592. * Purpose: high-resolution timestamp
  5593. * Value:
  5594. * Sub-microsecond time of PPDU reception.
  5595. * This timestamp ranges from [0,MAC clock MHz).
  5596. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  5597. * to form a high-resolution, large range rx timestamp.
  5598. * - PHY_ERR_CODE
  5599. * Bits 23:16
  5600. * Purpose:
  5601. * If the rx frame processing resulted in a PHY error, indicate what
  5602. * type of rx PHY error occurred.
  5603. * Value:
  5604. * This field is valid if the "P" (PHY_ERR) flag is set.
  5605. * TBD: document/specify the values for this field
  5606. * - PHY_ERR
  5607. * Bit 24
  5608. * Purpose: indicate whether the rx PPDU had a PHY error
  5609. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  5610. * - LEGACY_RATE
  5611. * Bits 28:25
  5612. * Purpose:
  5613. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  5614. * specify which rate was used.
  5615. * Value:
  5616. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  5617. * flag.
  5618. * If LEGACY_RATE_SEL is 0:
  5619. * 0x8: OFDM 48 Mbps
  5620. * 0x9: OFDM 24 Mbps
  5621. * 0xA: OFDM 12 Mbps
  5622. * 0xB: OFDM 6 Mbps
  5623. * 0xC: OFDM 54 Mbps
  5624. * 0xD: OFDM 36 Mbps
  5625. * 0xE: OFDM 18 Mbps
  5626. * 0xF: OFDM 9 Mbps
  5627. * If LEGACY_RATE_SEL is 1:
  5628. * 0x8: CCK 11 Mbps long preamble
  5629. * 0x9: CCK 5.5 Mbps long preamble
  5630. * 0xA: CCK 2 Mbps long preamble
  5631. * 0xB: CCK 1 Mbps long preamble
  5632. * 0xC: CCK 11 Mbps short preamble
  5633. * 0xD: CCK 5.5 Mbps short preamble
  5634. * 0xE: CCK 2 Mbps short preamble
  5635. * - LEGACY_RATE_SEL
  5636. * Bit 29
  5637. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  5638. * Value:
  5639. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  5640. * used a legacy rate.
  5641. * 0 -> OFDM, 1 -> CCK
  5642. * - END_VALID
  5643. * Bit 30
  5644. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5645. * the start of the PPDU are valid. Specifically, the following
  5646. * fields are only valid if END_VALID is set:
  5647. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  5648. * TIMESTAMP_SUBMICROSEC
  5649. * Value:
  5650. * 0 -> rx PPDU desc end fields are not valid
  5651. * 1 -> rx PPDU desc end fields are valid
  5652. * - START_VALID
  5653. * Bit 31
  5654. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5655. * the end of the PPDU are valid. Specifically, the following
  5656. * fields are only valid if START_VALID is set:
  5657. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  5658. * VHT-SIG-A
  5659. * Value:
  5660. * 0 -> rx PPDU desc start fields are not valid
  5661. * 1 -> rx PPDU desc start fields are valid
  5662. * - RSSI0_PRI20
  5663. * Bits 7:0
  5664. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  5665. * Value: RSSI dB units w.r.t. noise floor
  5666. *
  5667. * - RSSI0_EXT20
  5668. * Bits 7:0
  5669. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  5670. * (if the rx bandwidth was >= 40 MHz)
  5671. * Value: RSSI dB units w.r.t. noise floor
  5672. * - RSSI0_EXT40
  5673. * Bits 7:0
  5674. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  5675. * (if the rx bandwidth was >= 80 MHz)
  5676. * Value: RSSI dB units w.r.t. noise floor
  5677. * - RSSI0_EXT80
  5678. * Bits 7:0
  5679. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  5680. * (if the rx bandwidth was >= 160 MHz)
  5681. * Value: RSSI dB units w.r.t. noise floor
  5682. *
  5683. * - RSSI1_PRI20
  5684. * Bits 7:0
  5685. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  5686. * Value: RSSI dB units w.r.t. noise floor
  5687. * - RSSI1_EXT20
  5688. * Bits 7:0
  5689. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  5690. * (if the rx bandwidth was >= 40 MHz)
  5691. * Value: RSSI dB units w.r.t. noise floor
  5692. * - RSSI1_EXT40
  5693. * Bits 7:0
  5694. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  5695. * (if the rx bandwidth was >= 80 MHz)
  5696. * Value: RSSI dB units w.r.t. noise floor
  5697. * - RSSI1_EXT80
  5698. * Bits 7:0
  5699. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  5700. * (if the rx bandwidth was >= 160 MHz)
  5701. * Value: RSSI dB units w.r.t. noise floor
  5702. *
  5703. * - RSSI2_PRI20
  5704. * Bits 7:0
  5705. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  5706. * Value: RSSI dB units w.r.t. noise floor
  5707. * - RSSI2_EXT20
  5708. * Bits 7:0
  5709. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  5710. * (if the rx bandwidth was >= 40 MHz)
  5711. * Value: RSSI dB units w.r.t. noise floor
  5712. * - RSSI2_EXT40
  5713. * Bits 7:0
  5714. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  5715. * (if the rx bandwidth was >= 80 MHz)
  5716. * Value: RSSI dB units w.r.t. noise floor
  5717. * - RSSI2_EXT80
  5718. * Bits 7:0
  5719. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  5720. * (if the rx bandwidth was >= 160 MHz)
  5721. * Value: RSSI dB units w.r.t. noise floor
  5722. *
  5723. * - RSSI3_PRI20
  5724. * Bits 7:0
  5725. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  5726. * Value: RSSI dB units w.r.t. noise floor
  5727. * - RSSI3_EXT20
  5728. * Bits 7:0
  5729. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  5730. * (if the rx bandwidth was >= 40 MHz)
  5731. * Value: RSSI dB units w.r.t. noise floor
  5732. * - RSSI3_EXT40
  5733. * Bits 7:0
  5734. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  5735. * (if the rx bandwidth was >= 80 MHz)
  5736. * Value: RSSI dB units w.r.t. noise floor
  5737. * - RSSI3_EXT80
  5738. * Bits 7:0
  5739. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  5740. * (if the rx bandwidth was >= 160 MHz)
  5741. * Value: RSSI dB units w.r.t. noise floor
  5742. *
  5743. * - TSF32
  5744. * Bits 31:0
  5745. * Purpose: specify the time the rx PPDU was received, in TSF units
  5746. * Value: 32 LSBs of the TSF
  5747. * - TIMESTAMP_MICROSEC
  5748. * Bits 31:0
  5749. * Purpose: specify the time the rx PPDU was received, in microsecond units
  5750. * Value: PPDU rx time, in microseconds
  5751. * - VHT_SIG_A1
  5752. * Bits 23:0
  5753. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  5754. * from the rx PPDU
  5755. * Value:
  5756. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5757. * VHT-SIG-A1 data.
  5758. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5759. * first 24 bits of the HT-SIG data.
  5760. * Otherwise, this field is invalid.
  5761. * Refer to the the 802.11 protocol for the definition of the
  5762. * HT-SIG and VHT-SIG-A1 fields
  5763. * - VHT_SIG_A2
  5764. * Bits 23:0
  5765. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  5766. * from the rx PPDU
  5767. * Value:
  5768. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5769. * VHT-SIG-A2 data.
  5770. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5771. * last 24 bits of the HT-SIG data.
  5772. * Otherwise, this field is invalid.
  5773. * Refer to the the 802.11 protocol for the definition of the
  5774. * HT-SIG and VHT-SIG-A2 fields
  5775. * - PREAMBLE_TYPE
  5776. * Bits 31:24
  5777. * Purpose: indicate the PHY format of the received burst
  5778. * Value:
  5779. * 0x4: Legacy (OFDM/CCK)
  5780. * 0x8: HT
  5781. * 0x9: HT with TxBF
  5782. * 0xC: VHT
  5783. * 0xD: VHT with TxBF
  5784. * - SERVICE
  5785. * Bits 31:24
  5786. * Purpose: TBD
  5787. * Value: TBD
  5788. *
  5789. * Rx MSDU descriptor fields:
  5790. * - FW_RX_DESC_BYTES
  5791. * Bits 15:0
  5792. * Purpose: Indicate how many bytes in the Rx indication are used for
  5793. * FW Rx descriptors
  5794. *
  5795. * Payload fields:
  5796. * - MPDU_COUNT
  5797. * Bits 7:0
  5798. * Purpose: Indicate how many sequential MPDUs share the same status.
  5799. * All MPDUs within the indicated list are from the same RA-TA-TID.
  5800. * - MPDU_STATUS
  5801. * Bits 15:8
  5802. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  5803. * received successfully.
  5804. * Value:
  5805. * 0x1: success
  5806. * 0x2: FCS error
  5807. * 0x3: duplicate error
  5808. * 0x4: replay error
  5809. * 0x5: invalid peer
  5810. */
  5811. /* header fields */
  5812. #define HTT_RX_IND_EXT_TID_M 0x1f00
  5813. #define HTT_RX_IND_EXT_TID_S 8
  5814. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  5815. #define HTT_RX_IND_FLUSH_VALID_S 13
  5816. #define HTT_RX_IND_REL_VALID_M 0x4000
  5817. #define HTT_RX_IND_REL_VALID_S 14
  5818. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  5819. #define HTT_RX_IND_PEER_ID_S 16
  5820. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  5821. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  5822. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  5823. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  5824. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  5825. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  5826. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  5827. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  5828. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  5829. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  5830. /* rx PPDU descriptor fields */
  5831. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  5832. #define HTT_RX_IND_RSSI_CMB_S 0
  5833. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  5834. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  5835. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  5836. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  5837. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  5838. #define HTT_RX_IND_PHY_ERR_S 24
  5839. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  5840. #define HTT_RX_IND_LEGACY_RATE_S 25
  5841. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  5842. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  5843. #define HTT_RX_IND_END_VALID_M 0x40000000
  5844. #define HTT_RX_IND_END_VALID_S 30
  5845. #define HTT_RX_IND_START_VALID_M 0x80000000
  5846. #define HTT_RX_IND_START_VALID_S 31
  5847. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  5848. #define HTT_RX_IND_RSSI_PRI20_S 0
  5849. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  5850. #define HTT_RX_IND_RSSI_EXT20_S 8
  5851. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  5852. #define HTT_RX_IND_RSSI_EXT40_S 16
  5853. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  5854. #define HTT_RX_IND_RSSI_EXT80_S 24
  5855. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  5856. #define HTT_RX_IND_VHT_SIG_A1_S 0
  5857. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  5858. #define HTT_RX_IND_VHT_SIG_A2_S 0
  5859. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  5860. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  5861. #define HTT_RX_IND_SERVICE_M 0xff000000
  5862. #define HTT_RX_IND_SERVICE_S 24
  5863. /* rx MSDU descriptor fields */
  5864. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  5865. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  5866. /* payload fields */
  5867. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  5868. #define HTT_RX_IND_MPDU_COUNT_S 0
  5869. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  5870. #define HTT_RX_IND_MPDU_STATUS_S 8
  5871. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  5872. do { \
  5873. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  5874. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  5875. } while (0)
  5876. #define HTT_RX_IND_EXT_TID_GET(word) \
  5877. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  5878. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  5879. do { \
  5880. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  5881. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  5882. } while (0)
  5883. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  5884. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  5885. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  5886. do { \
  5887. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  5888. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  5889. } while (0)
  5890. #define HTT_RX_IND_REL_VALID_GET(word) \
  5891. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  5892. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  5893. do { \
  5894. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  5895. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  5896. } while (0)
  5897. #define HTT_RX_IND_PEER_ID_GET(word) \
  5898. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  5899. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  5900. do { \
  5901. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  5902. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  5903. } while (0)
  5904. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  5905. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  5906. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  5907. do { \
  5908. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  5909. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  5910. } while (0)
  5911. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  5912. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  5913. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  5914. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  5915. do { \
  5916. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  5917. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  5918. } while (0)
  5919. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  5920. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  5921. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  5922. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  5923. do { \
  5924. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  5925. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  5926. } while (0)
  5927. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  5928. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  5929. HTT_RX_IND_REL_SEQ_NUM_START_S)
  5930. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  5931. do { \
  5932. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  5933. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  5934. } while (0)
  5935. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  5936. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  5937. HTT_RX_IND_REL_SEQ_NUM_END_S)
  5938. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  5939. do { \
  5940. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  5941. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  5942. } while (0)
  5943. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  5944. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  5945. HTT_RX_IND_NUM_MPDU_RANGES_S)
  5946. /* FW rx PPDU descriptor fields */
  5947. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  5948. do { \
  5949. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  5950. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  5951. } while (0)
  5952. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  5953. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  5954. HTT_RX_IND_RSSI_CMB_S)
  5955. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  5956. do { \
  5957. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  5958. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  5959. } while (0)
  5960. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  5961. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  5962. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  5963. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  5964. do { \
  5965. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  5966. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  5967. } while (0)
  5968. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  5969. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  5970. HTT_RX_IND_PHY_ERR_CODE_S)
  5971. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  5972. do { \
  5973. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  5974. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  5975. } while (0)
  5976. #define HTT_RX_IND_PHY_ERR_GET(word) \
  5977. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  5978. HTT_RX_IND_PHY_ERR_S)
  5979. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  5980. do { \
  5981. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  5982. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  5983. } while (0)
  5984. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  5985. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  5986. HTT_RX_IND_LEGACY_RATE_S)
  5987. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  5988. do { \
  5989. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  5990. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  5991. } while (0)
  5992. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  5993. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  5994. HTT_RX_IND_LEGACY_RATE_SEL_S)
  5995. #define HTT_RX_IND_END_VALID_SET(word, value) \
  5996. do { \
  5997. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  5998. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  5999. } while (0)
  6000. #define HTT_RX_IND_END_VALID_GET(word) \
  6001. (((word) & HTT_RX_IND_END_VALID_M) >> \
  6002. HTT_RX_IND_END_VALID_S)
  6003. #define HTT_RX_IND_START_VALID_SET(word, value) \
  6004. do { \
  6005. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  6006. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  6007. } while (0)
  6008. #define HTT_RX_IND_START_VALID_GET(word) \
  6009. (((word) & HTT_RX_IND_START_VALID_M) >> \
  6010. HTT_RX_IND_START_VALID_S)
  6011. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  6012. do { \
  6013. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  6014. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  6015. } while (0)
  6016. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  6017. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  6018. HTT_RX_IND_RSSI_PRI20_S)
  6019. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  6020. do { \
  6021. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  6022. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  6023. } while (0)
  6024. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  6025. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  6026. HTT_RX_IND_RSSI_EXT20_S)
  6027. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  6028. do { \
  6029. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  6030. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  6031. } while (0)
  6032. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  6033. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  6034. HTT_RX_IND_RSSI_EXT40_S)
  6035. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  6036. do { \
  6037. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  6038. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  6039. } while (0)
  6040. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  6041. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  6042. HTT_RX_IND_RSSI_EXT80_S)
  6043. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  6044. do { \
  6045. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  6046. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  6047. } while (0)
  6048. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  6049. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  6050. HTT_RX_IND_VHT_SIG_A1_S)
  6051. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  6052. do { \
  6053. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  6054. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  6055. } while (0)
  6056. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  6057. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  6058. HTT_RX_IND_VHT_SIG_A2_S)
  6059. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  6060. do { \
  6061. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  6062. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  6063. } while (0)
  6064. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  6065. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  6066. HTT_RX_IND_PREAMBLE_TYPE_S)
  6067. #define HTT_RX_IND_SERVICE_SET(word, value) \
  6068. do { \
  6069. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  6070. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  6071. } while (0)
  6072. #define HTT_RX_IND_SERVICE_GET(word) \
  6073. (((word) & HTT_RX_IND_SERVICE_M) >> \
  6074. HTT_RX_IND_SERVICE_S)
  6075. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  6076. do { \
  6077. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  6078. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  6079. } while (0)
  6080. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  6081. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  6082. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  6083. do { \
  6084. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  6085. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  6086. } while (0)
  6087. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  6088. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  6089. #define HTT_RX_IND_HL_BYTES \
  6090. (HTT_RX_IND_HDR_BYTES + \
  6091. 4 /* single FW rx MSDU descriptor, plus padding */ + \
  6092. 4 /* single MPDU range information element */)
  6093. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  6094. /* Could we use one macro entry? */
  6095. #define HTT_WORD_SET(word, field, value) \
  6096. do { \
  6097. HTT_CHECK_SET_VAL(field, value); \
  6098. (word) |= ((value) << field ## _S); \
  6099. } while (0)
  6100. #define HTT_WORD_GET(word, field) \
  6101. (((word) & field ## _M) >> field ## _S)
  6102. PREPACK struct hl_htt_rx_ind_base {
  6103. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  6104. } POSTPACK;
  6105. /*
  6106. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  6107. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  6108. * HL host needed info. The field is just after the msdu fw rx desc.
  6109. */
  6110. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  6111. struct htt_rx_ind_hl_rx_desc_t {
  6112. A_UINT8 ver;
  6113. A_UINT8 len;
  6114. struct {
  6115. A_UINT8
  6116. first_msdu: 1,
  6117. last_msdu: 1,
  6118. c3_failed: 1,
  6119. c4_failed: 1,
  6120. ipv6: 1,
  6121. tcp: 1,
  6122. udp: 1,
  6123. reserved: 1;
  6124. } flags;
  6125. };
  6126. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  6127. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6128. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  6129. #define HTT_RX_IND_HL_RX_DESC_VER 0
  6130. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  6131. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6132. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  6133. #define HTT_RX_IND_HL_FLAG_OFFSET \
  6134. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6135. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  6136. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  6137. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  6138. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  6139. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  6140. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  6141. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  6142. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  6143. /* This structure is used in HL, the basic descriptor information
  6144. * used by host. the structure is translated by FW from HW desc
  6145. * or generated by FW. But in HL monitor mode, the host would use
  6146. * the same structure with LL.
  6147. */
  6148. PREPACK struct hl_htt_rx_desc_base {
  6149. A_UINT32
  6150. seq_num:12,
  6151. encrypted:1,
  6152. chan_info_present:1,
  6153. resv0:2,
  6154. mcast_bcast:1,
  6155. fragment:1,
  6156. key_id_oct:8,
  6157. resv1:6;
  6158. A_UINT32
  6159. pn_31_0;
  6160. union {
  6161. struct {
  6162. A_UINT16 pn_47_32;
  6163. A_UINT16 pn_63_48;
  6164. } pn16;
  6165. A_UINT32 pn_63_32;
  6166. } u0;
  6167. A_UINT32
  6168. pn_95_64;
  6169. A_UINT32
  6170. pn_127_96;
  6171. } POSTPACK;
  6172. /*
  6173. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  6174. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  6175. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  6176. * Please see htt_chan_change_t for description of the fields.
  6177. */
  6178. PREPACK struct htt_chan_info_t
  6179. {
  6180. A_UINT32 primary_chan_center_freq_mhz: 16,
  6181. contig_chan1_center_freq_mhz: 16;
  6182. A_UINT32 contig_chan2_center_freq_mhz: 16,
  6183. phy_mode: 8,
  6184. reserved: 8;
  6185. } POSTPACK;
  6186. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  6187. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  6188. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  6189. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  6190. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  6191. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  6192. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  6193. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  6194. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  6195. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  6196. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  6197. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  6198. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  6199. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  6200. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  6201. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  6202. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  6203. /* Channel information */
  6204. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  6205. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  6206. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  6207. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  6208. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  6209. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  6210. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  6211. #define HTT_CHAN_INFO_PHY_MODE_S 16
  6212. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  6213. do { \
  6214. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  6215. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  6216. } while (0)
  6217. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  6218. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  6219. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  6220. do { \
  6221. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  6222. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  6223. } while (0)
  6224. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  6225. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  6226. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  6227. do { \
  6228. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  6229. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  6230. } while (0)
  6231. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  6232. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  6233. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  6234. do { \
  6235. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  6236. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  6237. } while (0)
  6238. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  6239. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  6240. /*
  6241. * @brief target -> host rx reorder flush message definition
  6242. *
  6243. * @details
  6244. * The following field definitions describe the format of the rx flush
  6245. * message sent from the target to the host.
  6246. * The message consists of a 4-octet header, followed by one or more
  6247. * 4-octet payload information elements.
  6248. *
  6249. * |31 24|23 8|7 0|
  6250. * |--------------------------------------------------------------|
  6251. * | TID | peer ID | msg type |
  6252. * |--------------------------------------------------------------|
  6253. * | seq num end | seq num start | MPDU status | reserved |
  6254. * |--------------------------------------------------------------|
  6255. * First DWORD:
  6256. * - MSG_TYPE
  6257. * Bits 7:0
  6258. * Purpose: identifies this as an rx flush message
  6259. * Value: 0x2
  6260. * - PEER_ID
  6261. * Bits 23:8 (only bits 18:8 actually used)
  6262. * Purpose: identify which peer's rx data is being flushed
  6263. * Value: (rx) peer ID
  6264. * - TID
  6265. * Bits 31:24 (only bits 27:24 actually used)
  6266. * Purpose: Specifies which traffic identifier's rx data is being flushed
  6267. * Value: traffic identifier
  6268. * Second DWORD:
  6269. * - MPDU_STATUS
  6270. * Bits 15:8
  6271. * Purpose:
  6272. * Indicate whether the flushed MPDUs should be discarded or processed.
  6273. * Value:
  6274. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  6275. * stages of rx processing
  6276. * other: discard the MPDUs
  6277. * It is anticipated that flush messages will always have
  6278. * MPDU status == 1, but the status flag is included for
  6279. * flexibility.
  6280. * - SEQ_NUM_START
  6281. * Bits 23:16
  6282. * Purpose:
  6283. * Indicate the start of a series of consecutive MPDUs being flushed.
  6284. * Not all MPDUs within this range are necessarily valid - the host
  6285. * must check each sequence number within this range to see if the
  6286. * corresponding MPDU is actually present.
  6287. * Value:
  6288. * The sequence number for the first MPDU in the sequence.
  6289. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6290. * - SEQ_NUM_END
  6291. * Bits 30:24
  6292. * Purpose:
  6293. * Indicate the end of a series of consecutive MPDUs being flushed.
  6294. * Value:
  6295. * The sequence number one larger than the sequence number of the
  6296. * last MPDU being flushed.
  6297. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6298. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  6299. * are to be released for further rx processing.
  6300. * Not all MPDUs within this range are necessarily valid - the host
  6301. * must check each sequence number within this range to see if the
  6302. * corresponding MPDU is actually present.
  6303. */
  6304. /* first DWORD */
  6305. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  6306. #define HTT_RX_FLUSH_PEER_ID_S 8
  6307. #define HTT_RX_FLUSH_TID_M 0xff000000
  6308. #define HTT_RX_FLUSH_TID_S 24
  6309. /* second DWORD */
  6310. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  6311. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  6312. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  6313. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  6314. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  6315. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  6316. #define HTT_RX_FLUSH_BYTES 8
  6317. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  6318. do { \
  6319. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  6320. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  6321. } while (0)
  6322. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  6323. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  6324. #define HTT_RX_FLUSH_TID_SET(word, value) \
  6325. do { \
  6326. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  6327. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  6328. } while (0)
  6329. #define HTT_RX_FLUSH_TID_GET(word) \
  6330. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  6331. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  6332. do { \
  6333. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  6334. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  6335. } while (0)
  6336. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  6337. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  6338. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  6339. do { \
  6340. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  6341. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  6342. } while (0)
  6343. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  6344. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  6345. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  6346. do { \
  6347. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  6348. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  6349. } while (0)
  6350. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  6351. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  6352. /*
  6353. * @brief target -> host rx pn check indication message
  6354. *
  6355. * @details
  6356. * The following field definitions describe the format of the Rx PN check
  6357. * indication message sent from the target to the host.
  6358. * The message consists of a 4-octet header, followed by the start and
  6359. * end sequence numbers to be released, followed by the PN IEs. Each PN
  6360. * IE is one octet containing the sequence number that failed the PN
  6361. * check.
  6362. *
  6363. * |31 24|23 8|7 0|
  6364. * |--------------------------------------------------------------|
  6365. * | TID | peer ID | msg type |
  6366. * |--------------------------------------------------------------|
  6367. * | Reserved | PN IE count | seq num end | seq num start|
  6368. * |--------------------------------------------------------------|
  6369. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  6370. * |--------------------------------------------------------------|
  6371. * First DWORD:
  6372. * - MSG_TYPE
  6373. * Bits 7:0
  6374. * Purpose: Identifies this as an rx pn check indication message
  6375. * Value: 0x2
  6376. * - PEER_ID
  6377. * Bits 23:8 (only bits 18:8 actually used)
  6378. * Purpose: identify which peer
  6379. * Value: (rx) peer ID
  6380. * - TID
  6381. * Bits 31:24 (only bits 27:24 actually used)
  6382. * Purpose: identify traffic identifier
  6383. * Value: traffic identifier
  6384. * Second DWORD:
  6385. * - SEQ_NUM_START
  6386. * Bits 7:0
  6387. * Purpose:
  6388. * Indicates the starting sequence number of the MPDU in this
  6389. * series of MPDUs that went though PN check.
  6390. * Value:
  6391. * The sequence number for the first MPDU in the sequence.
  6392. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6393. * - SEQ_NUM_END
  6394. * Bits 15:8
  6395. * Purpose:
  6396. * Indicates the ending sequence number of the MPDU in this
  6397. * series of MPDUs that went though PN check.
  6398. * Value:
  6399. * The sequence number one larger then the sequence number of the last
  6400. * MPDU being flushed.
  6401. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6402. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  6403. * for invalid PN numbers and are ready to be released for further processing.
  6404. * Not all MPDUs within this range are necessarily valid - the host
  6405. * must check each sequence number within this range to see if the
  6406. * corresponding MPDU is actually present.
  6407. * - PN_IE_COUNT
  6408. * Bits 23:16
  6409. * Purpose:
  6410. * Used to determine the variable number of PN information elements in this
  6411. * message
  6412. *
  6413. * PN information elements:
  6414. * - PN_IE_x-
  6415. * Purpose:
  6416. * Each PN information element contains the sequence number of the MPDU that
  6417. * has failed the target PN check.
  6418. * Value:
  6419. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  6420. * that failed the PN check.
  6421. */
  6422. /* first DWORD */
  6423. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  6424. #define HTT_RX_PN_IND_PEER_ID_S 8
  6425. #define HTT_RX_PN_IND_TID_M 0xff000000
  6426. #define HTT_RX_PN_IND_TID_S 24
  6427. /* second DWORD */
  6428. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  6429. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  6430. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  6431. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  6432. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  6433. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  6434. #define HTT_RX_PN_IND_BYTES 8
  6435. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  6436. do { \
  6437. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  6438. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  6439. } while (0)
  6440. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  6441. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  6442. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  6443. do { \
  6444. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  6445. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  6446. } while (0)
  6447. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  6448. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  6449. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  6450. do { \
  6451. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  6452. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  6453. } while (0)
  6454. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  6455. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  6456. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  6457. do { \
  6458. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  6459. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  6460. } while (0)
  6461. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  6462. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  6463. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  6464. do { \
  6465. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  6466. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  6467. } while (0)
  6468. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  6469. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  6470. /*
  6471. * @brief target -> host rx offload deliver message for LL system
  6472. *
  6473. * @details
  6474. * In a low latency system this message is sent whenever the offload
  6475. * manager flushes out the packets it has coalesced in its coalescing buffer.
  6476. * The DMA of the actual packets into host memory is done before sending out
  6477. * this message. This message indicates only how many MSDUs to reap. The
  6478. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  6479. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  6480. * DMA'd by the MAC directly into host memory these packets do not contain
  6481. * the MAC descriptors in the header portion of the packet. Instead they contain
  6482. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  6483. * message, the packets are delivered directly to the NW stack without going
  6484. * through the regular reorder buffering and PN checking path since it has
  6485. * already been done in target.
  6486. *
  6487. * |31 24|23 16|15 8|7 0|
  6488. * |-----------------------------------------------------------------------|
  6489. * | Total MSDU count | reserved | msg type |
  6490. * |-----------------------------------------------------------------------|
  6491. *
  6492. * @brief target -> host rx offload deliver message for HL system
  6493. *
  6494. * @details
  6495. * In a high latency system this message is sent whenever the offload manager
  6496. * flushes out the packets it has coalesced in its coalescing buffer. The
  6497. * actual packets are also carried along with this message. When the host
  6498. * receives this message, it is expected to deliver these packets to the NW
  6499. * stack directly instead of routing them through the reorder buffering and
  6500. * PN checking path since it has already been done in target.
  6501. *
  6502. * |31 24|23 16|15 8|7 0|
  6503. * |-----------------------------------------------------------------------|
  6504. * | Total MSDU count | reserved | msg type |
  6505. * |-----------------------------------------------------------------------|
  6506. * | peer ID | MSDU length |
  6507. * |-----------------------------------------------------------------------|
  6508. * | MSDU payload | FW Desc | tid | vdev ID |
  6509. * |-----------------------------------------------------------------------|
  6510. * | MSDU payload contd. |
  6511. * |-----------------------------------------------------------------------|
  6512. * | peer ID | MSDU length |
  6513. * |-----------------------------------------------------------------------|
  6514. * | MSDU payload | FW Desc | tid | vdev ID |
  6515. * |-----------------------------------------------------------------------|
  6516. * | MSDU payload contd. |
  6517. * |-----------------------------------------------------------------------|
  6518. *
  6519. */
  6520. /* first DWORD */
  6521. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  6522. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  6523. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  6524. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  6525. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  6526. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  6527. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  6528. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  6529. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  6530. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  6531. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  6532. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  6533. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  6534. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  6535. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  6536. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  6537. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  6538. do { \
  6539. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  6540. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  6541. } while (0)
  6542. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  6543. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  6544. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  6545. do { \
  6546. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  6547. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  6548. } while (0)
  6549. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  6550. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  6551. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  6552. do { \
  6553. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  6554. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  6555. } while (0)
  6556. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  6557. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  6558. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  6559. do { \
  6560. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  6561. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  6562. } while (0)
  6563. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  6564. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  6565. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  6566. do { \
  6567. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  6568. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  6569. } while (0)
  6570. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  6571. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  6572. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  6573. do { \
  6574. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  6575. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  6576. } while (0)
  6577. /**
  6578. * @brief target -> host rx peer map/unmap message definition
  6579. *
  6580. * @details
  6581. * The following diagram shows the format of the rx peer map message sent
  6582. * from the target to the host. This layout assumes the target operates
  6583. * as little-endian.
  6584. *
  6585. * This message always contains a SW peer ID. The main purpose of the
  6586. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6587. * with, so that the host can use that peer ID to determine which peer
  6588. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6589. * other purposes, such as identifying during tx completions which peer
  6590. * the tx frames in question were transmitted to.
  6591. *
  6592. * In certain generations of chips, the peer map message also contains
  6593. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  6594. * to identify which peer the frame needs to be forwarded to (i.e. the
  6595. * peer assocated with the Destination MAC Address within the packet),
  6596. * and particularly which vdev needs to transmit the frame (for cases
  6597. * of inter-vdev rx --> tx forwarding).
  6598. * This DA-based peer ID that is provided for certain rx frames
  6599. * (the rx frames that need to be re-transmitted as tx frames)
  6600. * is the ID that the HW uses for referring to the peer in question,
  6601. * rather than the peer ID that the SW+FW use to refer to the peer.
  6602. *
  6603. *
  6604. * |31 24|23 16|15 8|7 0|
  6605. * |-----------------------------------------------------------------------|
  6606. * | SW peer ID | VDEV ID | msg type |
  6607. * |-----------------------------------------------------------------------|
  6608. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6609. * |-----------------------------------------------------------------------|
  6610. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6611. * |-----------------------------------------------------------------------|
  6612. *
  6613. *
  6614. * The following diagram shows the format of the rx peer unmap message sent
  6615. * from the target to the host.
  6616. *
  6617. * |31 24|23 16|15 8|7 0|
  6618. * |-----------------------------------------------------------------------|
  6619. * | SW peer ID | VDEV ID | msg type |
  6620. * |-----------------------------------------------------------------------|
  6621. *
  6622. * The following field definitions describe the format of the rx peer map
  6623. * and peer unmap messages sent from the target to the host.
  6624. * - MSG_TYPE
  6625. * Bits 7:0
  6626. * Purpose: identifies this as an rx peer map or peer unmap message
  6627. * Value: peer map -> 0x3, peer unmap -> 0x4
  6628. * - VDEV_ID
  6629. * Bits 15:8
  6630. * Purpose: Indicates which virtual device the peer is associated
  6631. * with.
  6632. * Value: vdev ID (used in the host to look up the vdev object)
  6633. * - PEER_ID (a.k.a. SW_PEER_ID)
  6634. * Bits 31:16
  6635. * Purpose: The peer ID (index) that WAL is allocating (map) or
  6636. * freeing (unmap)
  6637. * Value: (rx) peer ID
  6638. * - MAC_ADDR_L32 (peer map only)
  6639. * Bits 31:0
  6640. * Purpose: Identifies which peer node the peer ID is for.
  6641. * Value: lower 4 bytes of peer node's MAC address
  6642. * - MAC_ADDR_U16 (peer map only)
  6643. * Bits 15:0
  6644. * Purpose: Identifies which peer node the peer ID is for.
  6645. * Value: upper 2 bytes of peer node's MAC address
  6646. * - HW_PEER_ID
  6647. * Bits 31:16
  6648. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6649. * address, so for rx frames marked for rx --> tx forwarding, the
  6650. * host can determine from the HW peer ID provided as meta-data with
  6651. * the rx frame which peer the frame is supposed to be forwarded to.
  6652. * Value: ID used by the MAC HW to identify the peer
  6653. */
  6654. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  6655. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  6656. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  6657. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  6658. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  6659. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  6660. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  6661. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  6662. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  6663. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  6664. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  6665. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  6666. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  6667. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  6668. do { \
  6669. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  6670. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  6671. } while (0)
  6672. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  6673. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  6674. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  6675. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  6676. do { \
  6677. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  6678. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  6679. } while (0)
  6680. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  6681. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  6682. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  6683. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  6684. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  6685. do { \
  6686. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  6687. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  6688. } while (0)
  6689. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  6690. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  6691. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  6692. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  6693. #define HTT_RX_PEER_MAP_BYTES 12
  6694. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  6695. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  6696. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  6697. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  6698. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  6699. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  6700. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  6701. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  6702. #define HTT_RX_PEER_UNMAP_BYTES 4
  6703. /**
  6704. * @brief target -> host rx peer map V2 message definition
  6705. *
  6706. * @details
  6707. * The following diagram shows the format of the rx peer map v2 message sent
  6708. * from the target to the host. This layout assumes the target operates
  6709. * as little-endian.
  6710. *
  6711. * This message always contains a SW peer ID. The main purpose of the
  6712. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6713. * with, so that the host can use that peer ID to determine which peer
  6714. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6715. * other purposes, such as identifying during tx completions which peer
  6716. * the tx frames in question were transmitted to.
  6717. *
  6718. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  6719. * is used during rx --> tx frame forwarding to identify which peer the
  6720. * frame needs to be forwarded to (i.e. the peer assocated with the
  6721. * Destination MAC Address within the packet), and particularly which vdev
  6722. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  6723. * This DA-based peer ID that is provided for certain rx frames
  6724. * (the rx frames that need to be re-transmitted as tx frames)
  6725. * is the ID that the HW uses for referring to the peer in question,
  6726. * rather than the peer ID that the SW+FW use to refer to the peer.
  6727. *
  6728. *
  6729. * |31 24|23 16|15 8|7 0|
  6730. * |-----------------------------------------------------------------------|
  6731. * | SW peer ID | VDEV ID | msg type |
  6732. * |-----------------------------------------------------------------------|
  6733. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6734. * |-----------------------------------------------------------------------|
  6735. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6736. * |-----------------------------------------------------------------------|
  6737. * | Reserved_17_31 | Next Hop | AST Hash Value |
  6738. * |-----------------------------------------------------------------------|
  6739. * | Reserved_0 |
  6740. * |-----------------------------------------------------------------------|
  6741. * | Reserved_1 |
  6742. * |-----------------------------------------------------------------------|
  6743. * | Reserved_2 |
  6744. * |-----------------------------------------------------------------------|
  6745. * | Reserved_3 |
  6746. * |-----------------------------------------------------------------------|
  6747. *
  6748. *
  6749. * The following field definitions describe the format of the rx peer map v2
  6750. * messages sent from the target to the host.
  6751. * - MSG_TYPE
  6752. * Bits 7:0
  6753. * Purpose: identifies this as an rx peer map v2 message
  6754. * Value: peer map v2 -> 0x1e
  6755. * - VDEV_ID
  6756. * Bits 15:8
  6757. * Purpose: Indicates which virtual device the peer is associated with.
  6758. * Value: vdev ID (used in the host to look up the vdev object)
  6759. * - SW_PEER_ID
  6760. * Bits 31:16
  6761. * Purpose: The peer ID (index) that WAL is allocating
  6762. * Value: (rx) peer ID
  6763. * - MAC_ADDR_L32
  6764. * Bits 31:0
  6765. * Purpose: Identifies which peer node the peer ID is for.
  6766. * Value: lower 4 bytes of peer node's MAC address
  6767. * - MAC_ADDR_U16
  6768. * Bits 15:0
  6769. * Purpose: Identifies which peer node the peer ID is for.
  6770. * Value: upper 2 bytes of peer node's MAC address
  6771. * - HW_PEER_ID
  6772. * Bits 31:16
  6773. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6774. * address, so for rx frames marked for rx --> tx forwarding, the
  6775. * host can determine from the HW peer ID provided as meta-data with
  6776. * the rx frame which peer the frame is supposed to be forwarded to.
  6777. * Value: ID used by the MAC HW to identify the peer
  6778. * - AST_HASH_VALUE
  6779. * Bits 15:0
  6780. * Purpose: Indicates AST Hash value is required for the TCL AST index
  6781. * override feature.
  6782. * - NEXT_HOP
  6783. * Bit 16
  6784. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  6785. * (Wireless Distribution System).
  6786. */
  6787. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  6788. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  6789. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  6790. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  6791. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  6792. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  6793. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  6794. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  6795. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  6796. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  6797. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  6798. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  6799. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  6800. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  6801. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  6802. do { \
  6803. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  6804. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  6805. } while (0)
  6806. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  6807. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  6808. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  6809. do { \
  6810. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  6811. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  6812. } while (0)
  6813. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  6814. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  6815. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  6816. do { \
  6817. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  6818. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  6819. } while (0)
  6820. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  6821. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  6822. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  6823. do { \
  6824. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  6825. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  6826. } while (0)
  6827. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  6828. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  6829. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  6830. do { \
  6831. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  6832. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  6833. } while (0)
  6834. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  6835. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  6836. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  6837. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  6838. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  6839. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  6840. #define HTT_RX_PEER_MAP_V2_BYTES 32
  6841. /**
  6842. * @brief target -> host rx peer unmap V2 message definition
  6843. *
  6844. *
  6845. * The following diagram shows the format of the rx peer unmap message sent
  6846. * from the target to the host.
  6847. *
  6848. * |31 24|23 16|15 8|7 0|
  6849. * |-----------------------------------------------------------------------|
  6850. * | SW peer ID | VDEV ID | msg type |
  6851. * |-----------------------------------------------------------------------|
  6852. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6853. * |-----------------------------------------------------------------------|
  6854. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  6855. * |-----------------------------------------------------------------------|
  6856. * | Peer Delete Duration |
  6857. * |-----------------------------------------------------------------------|
  6858. * | Reserved_0 |
  6859. * |-----------------------------------------------------------------------|
  6860. * | Reserved_1 |
  6861. * |-----------------------------------------------------------------------|
  6862. * | Reserved_2 |
  6863. * |-----------------------------------------------------------------------|
  6864. *
  6865. *
  6866. * The following field definitions describe the format of the rx peer unmap
  6867. * messages sent from the target to the host.
  6868. * - MSG_TYPE
  6869. * Bits 7:0
  6870. * Purpose: identifies this as an rx peer unmap v2 message
  6871. * Value: peer unmap v2 -> 0x1f
  6872. * - VDEV_ID
  6873. * Bits 15:8
  6874. * Purpose: Indicates which virtual device the peer is associated
  6875. * with.
  6876. * Value: vdev ID (used in the host to look up the vdev object)
  6877. * - SW_PEER_ID
  6878. * Bits 31:16
  6879. * Purpose: The peer ID (index) that WAL is freeing
  6880. * Value: (rx) peer ID
  6881. * - MAC_ADDR_L32
  6882. * Bits 31:0
  6883. * Purpose: Identifies which peer node the peer ID is for.
  6884. * Value: lower 4 bytes of peer node's MAC address
  6885. * - MAC_ADDR_U16
  6886. * Bits 15:0
  6887. * Purpose: Identifies which peer node the peer ID is for.
  6888. * Value: upper 2 bytes of peer node's MAC address
  6889. * - NEXT_HOP
  6890. * Bits 16
  6891. * Purpose: Bit indicates next_hop AST entry used for WDS
  6892. * (Wireless Distribution System).
  6893. * - PEER_DELETE_DURATION
  6894. * Bits 31:0
  6895. * Purpose: Time taken to delete peer, in msec,
  6896. * Used for monitoring / debugging PEER delete response delay
  6897. */
  6898. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  6899. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  6900. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  6901. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  6902. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  6903. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  6904. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  6905. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  6906. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  6907. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  6908. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  6909. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  6910. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  6911. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  6912. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  6913. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  6914. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  6915. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  6916. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  6917. do { \
  6918. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  6919. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  6920. } while (0)
  6921. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  6922. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  6923. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  6924. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  6925. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  6926. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  6927. /**
  6928. * @brief target -> host message specifying security parameters
  6929. *
  6930. * @details
  6931. * The following diagram shows the format of the security specification
  6932. * message sent from the target to the host.
  6933. * This security specification message tells the host whether a PN check is
  6934. * necessary on rx data frames, and if so, how large the PN counter is.
  6935. * This message also tells the host about the security processing to apply
  6936. * to defragmented rx frames - specifically, whether a Message Integrity
  6937. * Check is required, and the Michael key to use.
  6938. *
  6939. * |31 24|23 16|15|14 8|7 0|
  6940. * |-----------------------------------------------------------------------|
  6941. * | peer ID | U| security type | msg type |
  6942. * |-----------------------------------------------------------------------|
  6943. * | Michael Key K0 |
  6944. * |-----------------------------------------------------------------------|
  6945. * | Michael Key K1 |
  6946. * |-----------------------------------------------------------------------|
  6947. * | WAPI RSC Low0 |
  6948. * |-----------------------------------------------------------------------|
  6949. * | WAPI RSC Low1 |
  6950. * |-----------------------------------------------------------------------|
  6951. * | WAPI RSC Hi0 |
  6952. * |-----------------------------------------------------------------------|
  6953. * | WAPI RSC Hi1 |
  6954. * |-----------------------------------------------------------------------|
  6955. *
  6956. * The following field definitions describe the format of the security
  6957. * indication message sent from the target to the host.
  6958. * - MSG_TYPE
  6959. * Bits 7:0
  6960. * Purpose: identifies this as a security specification message
  6961. * Value: 0xb
  6962. * - SEC_TYPE
  6963. * Bits 14:8
  6964. * Purpose: specifies which type of security applies to the peer
  6965. * Value: htt_sec_type enum value
  6966. * - UNICAST
  6967. * Bit 15
  6968. * Purpose: whether this security is applied to unicast or multicast data
  6969. * Value: 1 -> unicast, 0 -> multicast
  6970. * - PEER_ID
  6971. * Bits 31:16
  6972. * Purpose: The ID number for the peer the security specification is for
  6973. * Value: peer ID
  6974. * - MICHAEL_KEY_K0
  6975. * Bits 31:0
  6976. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  6977. * Value: Michael Key K0 (if security type is TKIP)
  6978. * - MICHAEL_KEY_K1
  6979. * Bits 31:0
  6980. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  6981. * Value: Michael Key K1 (if security type is TKIP)
  6982. * - WAPI_RSC_LOW0
  6983. * Bits 31:0
  6984. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  6985. * Value: WAPI RSC Low0 (if security type is WAPI)
  6986. * - WAPI_RSC_LOW1
  6987. * Bits 31:0
  6988. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  6989. * Value: WAPI RSC Low1 (if security type is WAPI)
  6990. * - WAPI_RSC_HI0
  6991. * Bits 31:0
  6992. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  6993. * Value: WAPI RSC Hi0 (if security type is WAPI)
  6994. * - WAPI_RSC_HI1
  6995. * Bits 31:0
  6996. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  6997. * Value: WAPI RSC Hi1 (if security type is WAPI)
  6998. */
  6999. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  7000. #define HTT_SEC_IND_SEC_TYPE_S 8
  7001. #define HTT_SEC_IND_UNICAST_M 0x00008000
  7002. #define HTT_SEC_IND_UNICAST_S 15
  7003. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  7004. #define HTT_SEC_IND_PEER_ID_S 16
  7005. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  7006. do { \
  7007. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  7008. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  7009. } while (0)
  7010. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  7011. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  7012. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  7013. do { \
  7014. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  7015. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  7016. } while (0)
  7017. #define HTT_SEC_IND_UNICAST_GET(word) \
  7018. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  7019. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  7020. do { \
  7021. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  7022. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  7023. } while (0)
  7024. #define HTT_SEC_IND_PEER_ID_GET(word) \
  7025. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  7026. #define HTT_SEC_IND_BYTES 28
  7027. /**
  7028. * @brief target -> host rx ADDBA / DELBA message definitions
  7029. *
  7030. * @details
  7031. * The following diagram shows the format of the rx ADDBA message sent
  7032. * from the target to the host:
  7033. *
  7034. * |31 20|19 16|15 8|7 0|
  7035. * |---------------------------------------------------------------------|
  7036. * | peer ID | TID | window size | msg type |
  7037. * |---------------------------------------------------------------------|
  7038. *
  7039. * The following diagram shows the format of the rx DELBA message sent
  7040. * from the target to the host:
  7041. *
  7042. * |31 20|19 16|15 10|9 8|7 0|
  7043. * |---------------------------------------------------------------------|
  7044. * | peer ID | TID | reserved | IR| msg type |
  7045. * |---------------------------------------------------------------------|
  7046. *
  7047. * The following field definitions describe the format of the rx ADDBA
  7048. * and DELBA messages sent from the target to the host.
  7049. * - MSG_TYPE
  7050. * Bits 7:0
  7051. * Purpose: identifies this as an rx ADDBA or DELBA message
  7052. * Value: ADDBA -> 0x5, DELBA -> 0x6
  7053. * - IR (initiator / recipient)
  7054. * Bits 9:8 (DELBA only)
  7055. * Purpose: specify whether the DELBA handshake was initiated by the
  7056. * local STA/AP, or by the peer STA/AP
  7057. * Value:
  7058. * 0 - unspecified
  7059. * 1 - initiator (a.k.a. originator)
  7060. * 2 - recipient (a.k.a. responder)
  7061. * 3 - unused / reserved
  7062. * - WIN_SIZE
  7063. * Bits 15:8 (ADDBA only)
  7064. * Purpose: Specifies the length of the block ack window (max = 64).
  7065. * Value:
  7066. * block ack window length specified by the received ADDBA
  7067. * management message.
  7068. * - TID
  7069. * Bits 19:16
  7070. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  7071. * Value:
  7072. * TID specified by the received ADDBA or DELBA management message.
  7073. * - PEER_ID
  7074. * Bits 31:20
  7075. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  7076. * Value:
  7077. * ID (hash value) used by the host for fast, direct lookup of
  7078. * host SW peer info, including rx reorder states.
  7079. */
  7080. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  7081. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  7082. #define HTT_RX_ADDBA_TID_M 0xf0000
  7083. #define HTT_RX_ADDBA_TID_S 16
  7084. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  7085. #define HTT_RX_ADDBA_PEER_ID_S 20
  7086. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  7087. do { \
  7088. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  7089. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  7090. } while (0)
  7091. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  7092. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  7093. #define HTT_RX_ADDBA_TID_SET(word, value) \
  7094. do { \
  7095. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  7096. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  7097. } while (0)
  7098. #define HTT_RX_ADDBA_TID_GET(word) \
  7099. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  7100. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  7101. do { \
  7102. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  7103. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  7104. } while (0)
  7105. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  7106. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  7107. #define HTT_RX_ADDBA_BYTES 4
  7108. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  7109. #define HTT_RX_DELBA_INITIATOR_S 8
  7110. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  7111. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  7112. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  7113. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  7114. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  7115. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  7116. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  7117. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  7118. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  7119. do { \
  7120. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  7121. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  7122. } while (0)
  7123. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  7124. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  7125. #define HTT_RX_DELBA_BYTES 4
  7126. /**
  7127. * @brief tx queue group information element definition
  7128. *
  7129. * @details
  7130. * The following diagram shows the format of the tx queue group
  7131. * information element, which can be included in target --> host
  7132. * messages to specify the number of tx "credits" (tx descriptors
  7133. * for LL, or tx buffers for HL) available to a particular group
  7134. * of host-side tx queues, and which host-side tx queues belong to
  7135. * the group.
  7136. *
  7137. * |31|30 24|23 16|15|14|13 0|
  7138. * |------------------------------------------------------------------------|
  7139. * | X| reserved | tx queue grp ID | A| S| credit count |
  7140. * |------------------------------------------------------------------------|
  7141. * | vdev ID mask | AC mask |
  7142. * |------------------------------------------------------------------------|
  7143. *
  7144. * The following definitions describe the fields within the tx queue group
  7145. * information element:
  7146. * - credit_count
  7147. * Bits 13:1
  7148. * Purpose: specify how many tx credits are available to the tx queue group
  7149. * Value: An absolute or relative, positive or negative credit value
  7150. * The 'A' bit specifies whether the value is absolute or relative.
  7151. * The 'S' bit specifies whether the value is positive or negative.
  7152. * A negative value can only be relative, not absolute.
  7153. * An absolute value replaces any prior credit value the host has for
  7154. * the tx queue group in question.
  7155. * A relative value is added to the prior credit value the host has for
  7156. * the tx queue group in question.
  7157. * - sign
  7158. * Bit 14
  7159. * Purpose: specify whether the credit count is positive or negative
  7160. * Value: 0 -> positive, 1 -> negative
  7161. * - absolute
  7162. * Bit 15
  7163. * Purpose: specify whether the credit count is absolute or relative
  7164. * Value: 0 -> relative, 1 -> absolute
  7165. * - txq_group_id
  7166. * Bits 23:16
  7167. * Purpose: indicate which tx queue group's credit and/or membership are
  7168. * being specified
  7169. * Value: 0 to max_tx_queue_groups-1
  7170. * - reserved
  7171. * Bits 30:16
  7172. * Value: 0x0
  7173. * - eXtension
  7174. * Bit 31
  7175. * Purpose: specify whether another tx queue group info element follows
  7176. * Value: 0 -> no more tx queue group information elements
  7177. * 1 -> another tx queue group information element immediately follows
  7178. * - ac_mask
  7179. * Bits 15:0
  7180. * Purpose: specify which Access Categories belong to the tx queue group
  7181. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  7182. * the tx queue group.
  7183. * The AC bit-mask values are obtained by left-shifting by the
  7184. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  7185. * - vdev_id_mask
  7186. * Bits 31:16
  7187. * Purpose: specify which vdev's tx queues belong to the tx queue group
  7188. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  7189. * belong to the tx queue group.
  7190. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  7191. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  7192. */
  7193. PREPACK struct htt_txq_group {
  7194. A_UINT32
  7195. credit_count: 14,
  7196. sign: 1,
  7197. absolute: 1,
  7198. tx_queue_group_id: 8,
  7199. reserved0: 7,
  7200. extension: 1;
  7201. A_UINT32
  7202. ac_mask: 16,
  7203. vdev_id_mask: 16;
  7204. } POSTPACK;
  7205. /* first word */
  7206. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  7207. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  7208. #define HTT_TXQ_GROUP_SIGN_S 14
  7209. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  7210. #define HTT_TXQ_GROUP_ABS_S 15
  7211. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  7212. #define HTT_TXQ_GROUP_ID_S 16
  7213. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  7214. #define HTT_TXQ_GROUP_EXT_S 31
  7215. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  7216. /* second word */
  7217. #define HTT_TXQ_GROUP_AC_MASK_S 0
  7218. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  7219. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  7220. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  7221. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  7222. do { \
  7223. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  7224. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  7225. } while (0)
  7226. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  7227. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  7228. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  7229. do { \
  7230. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  7231. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  7232. } while (0)
  7233. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  7234. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  7235. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  7236. do { \
  7237. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  7238. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  7239. } while (0)
  7240. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  7241. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  7242. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  7243. do { \
  7244. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  7245. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  7246. } while (0)
  7247. #define HTT_TXQ_GROUP_ID_GET(_info) \
  7248. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  7249. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  7250. do { \
  7251. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  7252. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  7253. } while (0)
  7254. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  7255. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  7256. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  7257. do { \
  7258. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  7259. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  7260. } while (0)
  7261. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  7262. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  7263. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  7264. do { \
  7265. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  7266. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  7267. } while (0)
  7268. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  7269. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  7270. /**
  7271. * @brief target -> host TX completion indication message definition
  7272. *
  7273. * @details
  7274. * The following diagram shows the format of the TX completion indication sent
  7275. * from the target to the host
  7276. *
  7277. * |31 27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  7278. * |------------------------------------------------------------|
  7279. * header: | rsvd |TP|A1|A0| num | t_i| tid |status| msg_type |
  7280. * |------------------------------------------------------------|
  7281. * payload: | MSDU1 ID | MSDU0 ID |
  7282. * |------------------------------------------------------------|
  7283. * : MSDU3 ID : MSDU2 ID :
  7284. * |------------------------------------------------------------|
  7285. * | struct htt_tx_compl_ind_append_retries |
  7286. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7287. * | struct htt_tx_compl_ind_append_tx_tstamp |
  7288. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7289. * Where:
  7290. * A0 = append (a.k.a. append0)
  7291. * A1 = append1
  7292. * TP = MSDU tx power presence
  7293. *
  7294. * The following field definitions describe the format of the TX completion
  7295. * indication sent from the target to the host
  7296. * Header fields:
  7297. * - msg_type
  7298. * Bits 7:0
  7299. * Purpose: identifies this as HTT TX completion indication
  7300. * Value: 0x7
  7301. * - status
  7302. * Bits 10:8
  7303. * Purpose: the TX completion status of payload fragmentations descriptors
  7304. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  7305. * - tid
  7306. * Bits 14:11
  7307. * Purpose: the tid associated with those fragmentation descriptors. It is
  7308. * valid or not, depending on the tid_invalid bit.
  7309. * Value: 0 to 15
  7310. * - tid_invalid
  7311. * Bits 15:15
  7312. * Purpose: this bit indicates whether the tid field is valid or not
  7313. * Value: 0 indicates valid; 1 indicates invalid
  7314. * - num
  7315. * Bits 23:16
  7316. * Purpose: the number of payload in this indication
  7317. * Value: 1 to 255
  7318. * - append (a.k.a. append0)
  7319. * Bits 24:24
  7320. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  7321. * the number of tx retries for one MSDU at the end of this message
  7322. * Value: 0 indicates no appending; 1 indicates appending
  7323. * - append1
  7324. * Bits 25:25
  7325. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  7326. * contains the timestamp info for each TX msdu id in payload.
  7327. * The order of the timestamps matches the order of the MSDU IDs.
  7328. * Note that a big-endian host needs to account for the reordering
  7329. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7330. * conversion) when determining which tx timestamp corresponds to
  7331. * which MSDU ID.
  7332. * Value: 0 indicates no appending; 1 indicates appending
  7333. * - msdu_tx_power_presence
  7334. * Bits 26:26
  7335. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  7336. * for each MSDU referenced by the TX_COMPL_IND message.
  7337. * The tx power is reported in 0.5 dBm units.
  7338. * The order of the per-MSDU tx power reports matches the order
  7339. * of the MSDU IDs.
  7340. * Note that a big-endian host needs to account for the reordering
  7341. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7342. * conversion) when determining which Tx Power corresponds to
  7343. * which MSDU ID.
  7344. * Value: 0 indicates MSDU tx power reports are not appended,
  7345. * 1 indicates MSDU tx power reports are appended
  7346. * Payload fields:
  7347. * - hmsdu_id
  7348. * Bits 15:0
  7349. * Purpose: this ID is used to track the Tx buffer in host
  7350. * Value: 0 to "size of host MSDU descriptor pool - 1"
  7351. */
  7352. #define HTT_TX_COMPL_IND_STATUS_S 8
  7353. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  7354. #define HTT_TX_COMPL_IND_TID_S 11
  7355. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  7356. #define HTT_TX_COMPL_IND_TID_INV_S 15
  7357. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  7358. #define HTT_TX_COMPL_IND_NUM_S 16
  7359. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  7360. #define HTT_TX_COMPL_IND_APPEND_S 24
  7361. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  7362. #define HTT_TX_COMPL_IND_APPEND1_S 25
  7363. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  7364. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  7365. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  7366. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  7367. do { \
  7368. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  7369. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  7370. } while (0)
  7371. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  7372. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  7373. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  7374. do { \
  7375. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  7376. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  7377. } while (0)
  7378. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  7379. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  7380. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  7381. do { \
  7382. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  7383. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  7384. } while (0)
  7385. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  7386. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  7387. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  7388. do { \
  7389. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  7390. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  7391. } while (0)
  7392. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  7393. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  7394. HTT_TX_COMPL_IND_TID_INV_S)
  7395. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  7396. do { \
  7397. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  7398. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  7399. } while (0)
  7400. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  7401. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  7402. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  7403. do { \
  7404. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  7405. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  7406. } while (0)
  7407. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  7408. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  7409. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  7410. do { \
  7411. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  7412. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  7413. } while (0)
  7414. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  7415. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  7416. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  7417. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  7418. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  7419. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  7420. #define HTT_TX_COMPL_IND_STAT_OK 0
  7421. /* DISCARD:
  7422. * current meaning:
  7423. * MSDUs were queued for transmission but filtered by HW or SW
  7424. * without any over the air attempts
  7425. * legacy meaning (HL Rome):
  7426. * MSDUs were discarded by the target FW without any over the air
  7427. * attempts due to lack of space
  7428. */
  7429. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  7430. /* NO_ACK:
  7431. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  7432. */
  7433. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  7434. /* POSTPONE:
  7435. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  7436. * be downloaded again later (in the appropriate order), when they are
  7437. * deliverable.
  7438. */
  7439. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  7440. /*
  7441. * The PEER_DEL tx completion status is used for HL cases
  7442. * where the peer the frame is for has been deleted.
  7443. * The host has already discarded its copy of the frame, but
  7444. * it still needs the tx completion to restore its credit.
  7445. */
  7446. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  7447. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  7448. #define HTT_TX_COMPL_IND_STAT_DROP 5
  7449. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  7450. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  7451. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  7452. PREPACK struct htt_tx_compl_ind_base {
  7453. A_UINT32 hdr;
  7454. A_UINT16 payload[1/*or more*/];
  7455. } POSTPACK;
  7456. PREPACK struct htt_tx_compl_ind_append_retries {
  7457. A_UINT16 msdu_id;
  7458. A_UINT8 tx_retries;
  7459. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  7460. 0: this is the last append_retries struct */
  7461. } POSTPACK;
  7462. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  7463. A_UINT32 timestamp[1/*or more*/];
  7464. } POSTPACK;
  7465. /**
  7466. * @brief target -> host rate-control update indication message
  7467. *
  7468. * @details
  7469. * The following diagram shows the format of the RC Update message
  7470. * sent from the target to the host, while processing the tx-completion
  7471. * of a transmitted PPDU.
  7472. *
  7473. * |31 24|23 16|15 8|7 0|
  7474. * |-------------------------------------------------------------|
  7475. * | peer ID | vdev ID | msg_type |
  7476. * |-------------------------------------------------------------|
  7477. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7478. * |-------------------------------------------------------------|
  7479. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  7480. * |-------------------------------------------------------------|
  7481. * | : |
  7482. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7483. * | : |
  7484. * |-------------------------------------------------------------|
  7485. * | : |
  7486. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7487. * | : |
  7488. * |-------------------------------------------------------------|
  7489. * : :
  7490. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7491. *
  7492. */
  7493. typedef struct {
  7494. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  7495. A_UINT32 rate_code_flags;
  7496. A_UINT32 flags; /* Encodes information such as excessive
  7497. retransmission, aggregate, some info
  7498. from .11 frame control,
  7499. STBC, LDPC, (SGI and Tx Chain Mask
  7500. are encoded in ptx_rc->flags field),
  7501. AMPDU truncation (BT/time based etc.),
  7502. RTS/CTS attempt */
  7503. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  7504. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  7505. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  7506. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  7507. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  7508. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  7509. } HTT_RC_TX_DONE_PARAMS;
  7510. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  7511. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  7512. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  7513. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  7514. #define HTT_RC_UPDATE_VDEVID_S 8
  7515. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  7516. #define HTT_RC_UPDATE_PEERID_S 16
  7517. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  7518. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  7519. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  7520. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  7521. do { \
  7522. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  7523. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  7524. } while (0)
  7525. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  7526. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  7527. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  7528. do { \
  7529. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  7530. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  7531. } while (0)
  7532. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  7533. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  7534. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  7535. do { \
  7536. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  7537. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  7538. } while (0)
  7539. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  7540. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  7541. /**
  7542. * @brief target -> host rx fragment indication message definition
  7543. *
  7544. * @details
  7545. * The following field definitions describe the format of the rx fragment
  7546. * indication message sent from the target to the host.
  7547. * The rx fragment indication message shares the format of the
  7548. * rx indication message, but not all fields from the rx indication message
  7549. * are relevant to the rx fragment indication message.
  7550. *
  7551. *
  7552. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  7553. * |-----------+-------------------+---------------------+-------------|
  7554. * | peer ID | |FV| ext TID | msg type |
  7555. * |-------------------------------------------------------------------|
  7556. * | | flush | flush |
  7557. * | | end | start |
  7558. * | | seq num | seq num |
  7559. * |-------------------------------------------------------------------|
  7560. * | reserved | FW rx desc bytes |
  7561. * |-------------------------------------------------------------------|
  7562. * | | FW MSDU Rx |
  7563. * | | desc B0 |
  7564. * |-------------------------------------------------------------------|
  7565. * Header fields:
  7566. * - MSG_TYPE
  7567. * Bits 7:0
  7568. * Purpose: identifies this as an rx fragment indication message
  7569. * Value: 0xa
  7570. * - EXT_TID
  7571. * Bits 12:8
  7572. * Purpose: identify the traffic ID of the rx data, including
  7573. * special "extended" TID values for multicast, broadcast, and
  7574. * non-QoS data frames
  7575. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  7576. * - FLUSH_VALID (FV)
  7577. * Bit 13
  7578. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  7579. * is valid
  7580. * Value:
  7581. * 1 -> flush IE is valid and needs to be processed
  7582. * 0 -> flush IE is not valid and should be ignored
  7583. * - PEER_ID
  7584. * Bits 31:16
  7585. * Purpose: Identify, by ID, which peer sent the rx data
  7586. * Value: ID of the peer who sent the rx data
  7587. * - FLUSH_SEQ_NUM_START
  7588. * Bits 5:0
  7589. * Purpose: Indicate the start of a series of MPDUs to flush
  7590. * Not all MPDUs within this series are necessarily valid - the host
  7591. * must check each sequence number within this range to see if the
  7592. * corresponding MPDU is actually present.
  7593. * This field is only valid if the FV bit is set.
  7594. * Value:
  7595. * The sequence number for the first MPDUs to check to flush.
  7596. * The sequence number is masked by 0x3f.
  7597. * - FLUSH_SEQ_NUM_END
  7598. * Bits 11:6
  7599. * Purpose: Indicate the end of a series of MPDUs to flush
  7600. * Value:
  7601. * The sequence number one larger than the sequence number of the
  7602. * last MPDU to check to flush.
  7603. * The sequence number is masked by 0x3f.
  7604. * Not all MPDUs within this series are necessarily valid - the host
  7605. * must check each sequence number within this range to see if the
  7606. * corresponding MPDU is actually present.
  7607. * This field is only valid if the FV bit is set.
  7608. * Rx descriptor fields:
  7609. * - FW_RX_DESC_BYTES
  7610. * Bits 15:0
  7611. * Purpose: Indicate how many bytes in the Rx indication are used for
  7612. * FW Rx descriptors
  7613. * Value: 1
  7614. */
  7615. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  7616. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  7617. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  7618. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  7619. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  7620. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  7621. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  7622. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  7623. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  7624. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  7625. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  7626. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  7627. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  7628. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  7629. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  7630. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  7631. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  7632. #define HTT_RX_FRAG_IND_BYTES \
  7633. (4 /* msg hdr */ + \
  7634. 4 /* flush spec */ + \
  7635. 4 /* (unused) FW rx desc bytes spec */ + \
  7636. 4 /* FW rx desc */)
  7637. /**
  7638. * @brief target -> host test message definition
  7639. *
  7640. * @details
  7641. * The following field definitions describe the format of the test
  7642. * message sent from the target to the host.
  7643. * The message consists of a 4-octet header, followed by a variable
  7644. * number of 32-bit integer values, followed by a variable number
  7645. * of 8-bit character values.
  7646. *
  7647. * |31 16|15 8|7 0|
  7648. * |-----------------------------------------------------------|
  7649. * | num chars | num ints | msg type |
  7650. * |-----------------------------------------------------------|
  7651. * | int 0 |
  7652. * |-----------------------------------------------------------|
  7653. * | int 1 |
  7654. * |-----------------------------------------------------------|
  7655. * | ... |
  7656. * |-----------------------------------------------------------|
  7657. * | char 3 | char 2 | char 1 | char 0 |
  7658. * |-----------------------------------------------------------|
  7659. * | | | ... | char 4 |
  7660. * |-----------------------------------------------------------|
  7661. * - MSG_TYPE
  7662. * Bits 7:0
  7663. * Purpose: identifies this as a test message
  7664. * Value: HTT_MSG_TYPE_TEST
  7665. * - NUM_INTS
  7666. * Bits 15:8
  7667. * Purpose: indicate how many 32-bit integers follow the message header
  7668. * - NUM_CHARS
  7669. * Bits 31:16
  7670. * Purpose: indicate how many 8-bit charaters follow the series of integers
  7671. */
  7672. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  7673. #define HTT_RX_TEST_NUM_INTS_S 8
  7674. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  7675. #define HTT_RX_TEST_NUM_CHARS_S 16
  7676. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  7677. do { \
  7678. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  7679. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  7680. } while (0)
  7681. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  7682. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  7683. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  7684. do { \
  7685. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  7686. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  7687. } while (0)
  7688. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  7689. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  7690. /**
  7691. * @brief target -> host packet log message
  7692. *
  7693. * @details
  7694. * The following field definitions describe the format of the packet log
  7695. * message sent from the target to the host.
  7696. * The message consists of a 4-octet header,followed by a variable number
  7697. * of 32-bit character values.
  7698. *
  7699. * |31 16|15 12|11 10|9 8|7 0|
  7700. * |------------------------------------------------------------------|
  7701. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  7702. * |------------------------------------------------------------------|
  7703. * | payload |
  7704. * |------------------------------------------------------------------|
  7705. * - MSG_TYPE
  7706. * Bits 7:0
  7707. * Purpose: identifies this as a pktlog message
  7708. * Value: HTT_T2H_MSG_TYPE_PKTLOG
  7709. * - mac_id
  7710. * Bits 9:8
  7711. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  7712. * Value: 0-3
  7713. * - pdev_id
  7714. * Bits 11:10
  7715. * Purpose: pdev_id
  7716. * Value: 0-3
  7717. * 0 (for rings at SOC level),
  7718. * 1/2/3 PDEV -> 0/1/2
  7719. * - payload_size
  7720. * Bits 31:16
  7721. * Purpose: explicitly specify the payload size
  7722. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  7723. */
  7724. PREPACK struct htt_pktlog_msg {
  7725. A_UINT32 header;
  7726. A_UINT32 payload[1/* or more */];
  7727. } POSTPACK;
  7728. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  7729. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  7730. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  7731. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  7732. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  7733. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  7734. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  7735. do { \
  7736. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  7737. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  7738. } while (0)
  7739. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  7740. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  7741. HTT_T2H_PKTLOG_MAC_ID_S)
  7742. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  7743. do { \
  7744. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  7745. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  7746. } while (0)
  7747. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  7748. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  7749. HTT_T2H_PKTLOG_PDEV_ID_S)
  7750. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  7751. do { \
  7752. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  7753. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  7754. } while (0)
  7755. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  7756. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  7757. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  7758. /*
  7759. * Rx reorder statistics
  7760. * NB: all the fields must be defined in 4 octets size.
  7761. */
  7762. struct rx_reorder_stats {
  7763. /* Non QoS MPDUs received */
  7764. A_UINT32 deliver_non_qos;
  7765. /* MPDUs received in-order */
  7766. A_UINT32 deliver_in_order;
  7767. /* Flush due to reorder timer expired */
  7768. A_UINT32 deliver_flush_timeout;
  7769. /* Flush due to move out of window */
  7770. A_UINT32 deliver_flush_oow;
  7771. /* Flush due to DELBA */
  7772. A_UINT32 deliver_flush_delba;
  7773. /* MPDUs dropped due to FCS error */
  7774. A_UINT32 fcs_error;
  7775. /* MPDUs dropped due to monitor mode non-data packet */
  7776. A_UINT32 mgmt_ctrl;
  7777. /* Unicast-data MPDUs dropped due to invalid peer */
  7778. A_UINT32 invalid_peer;
  7779. /* MPDUs dropped due to duplication (non aggregation) */
  7780. A_UINT32 dup_non_aggr;
  7781. /* MPDUs dropped due to processed before */
  7782. A_UINT32 dup_past;
  7783. /* MPDUs dropped due to duplicate in reorder queue */
  7784. A_UINT32 dup_in_reorder;
  7785. /* Reorder timeout happened */
  7786. A_UINT32 reorder_timeout;
  7787. /* invalid bar ssn */
  7788. A_UINT32 invalid_bar_ssn;
  7789. /* reorder reset due to bar ssn */
  7790. A_UINT32 ssn_reset;
  7791. /* Flush due to delete peer */
  7792. A_UINT32 deliver_flush_delpeer;
  7793. /* Flush due to offload*/
  7794. A_UINT32 deliver_flush_offload;
  7795. /* Flush due to out of buffer*/
  7796. A_UINT32 deliver_flush_oob;
  7797. /* MPDUs dropped due to PN check fail */
  7798. A_UINT32 pn_fail;
  7799. /* MPDUs dropped due to unable to allocate memory */
  7800. A_UINT32 store_fail;
  7801. /* Number of times the tid pool alloc succeeded */
  7802. A_UINT32 tid_pool_alloc_succ;
  7803. /* Number of times the MPDU pool alloc succeeded */
  7804. A_UINT32 mpdu_pool_alloc_succ;
  7805. /* Number of times the MSDU pool alloc succeeded */
  7806. A_UINT32 msdu_pool_alloc_succ;
  7807. /* Number of times the tid pool alloc failed */
  7808. A_UINT32 tid_pool_alloc_fail;
  7809. /* Number of times the MPDU pool alloc failed */
  7810. A_UINT32 mpdu_pool_alloc_fail;
  7811. /* Number of times the MSDU pool alloc failed */
  7812. A_UINT32 msdu_pool_alloc_fail;
  7813. /* Number of times the tid pool freed */
  7814. A_UINT32 tid_pool_free;
  7815. /* Number of times the MPDU pool freed */
  7816. A_UINT32 mpdu_pool_free;
  7817. /* Number of times the MSDU pool freed */
  7818. A_UINT32 msdu_pool_free;
  7819. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  7820. A_UINT32 msdu_queued;
  7821. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  7822. A_UINT32 msdu_recycled;
  7823. /* Number of MPDUs with invalid peer but A2 found in AST */
  7824. A_UINT32 invalid_peer_a2_in_ast;
  7825. /* Number of MPDUs with invalid peer but A3 found in AST */
  7826. A_UINT32 invalid_peer_a3_in_ast;
  7827. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  7828. A_UINT32 invalid_peer_bmc_mpdus;
  7829. /* Number of MSDUs with err attention word */
  7830. A_UINT32 rxdesc_err_att;
  7831. /* Number of MSDUs with flag of peer_idx_invalid */
  7832. A_UINT32 rxdesc_err_peer_idx_inv;
  7833. /* Number of MSDUs with flag of peer_idx_timeout */
  7834. A_UINT32 rxdesc_err_peer_idx_to;
  7835. /* Number of MSDUs with flag of overflow */
  7836. A_UINT32 rxdesc_err_ov;
  7837. /* Number of MSDUs with flag of msdu_length_err */
  7838. A_UINT32 rxdesc_err_msdu_len;
  7839. /* Number of MSDUs with flag of mpdu_length_err */
  7840. A_UINT32 rxdesc_err_mpdu_len;
  7841. /* Number of MSDUs with flag of tkip_mic_err */
  7842. A_UINT32 rxdesc_err_tkip_mic;
  7843. /* Number of MSDUs with flag of decrypt_err */
  7844. A_UINT32 rxdesc_err_decrypt;
  7845. /* Number of MSDUs with flag of fcs_err */
  7846. A_UINT32 rxdesc_err_fcs;
  7847. /* Number of Unicast (bc_mc bit is not set in attention word)
  7848. * frames with invalid peer handler
  7849. */
  7850. A_UINT32 rxdesc_uc_msdus_inv_peer;
  7851. /* Number of unicast frame directly (direct bit is set in attention word)
  7852. * to DUT with invalid peer handler
  7853. */
  7854. A_UINT32 rxdesc_direct_msdus_inv_peer;
  7855. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  7856. * frames with invalid peer handler
  7857. */
  7858. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  7859. /* Number of MSDUs dropped due to no first MSDU flag */
  7860. A_UINT32 rxdesc_no_1st_msdu;
  7861. /* Number of MSDUs droped due to ring overflow */
  7862. A_UINT32 msdu_drop_ring_ov;
  7863. /* Number of MSDUs dropped due to FC mismatch */
  7864. A_UINT32 msdu_drop_fc_mismatch;
  7865. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  7866. A_UINT32 msdu_drop_mgmt_remote_ring;
  7867. /* Number of MSDUs dropped due to errors not reported in attention word */
  7868. A_UINT32 msdu_drop_misc;
  7869. /* Number of MSDUs go to offload before reorder */
  7870. A_UINT32 offload_msdu_wal;
  7871. /* Number of data frame dropped by offload after reorder */
  7872. A_UINT32 offload_msdu_reorder;
  7873. /* Number of MPDUs with sequence number in the past and within the BA window */
  7874. A_UINT32 dup_past_within_window;
  7875. /* Number of MPDUs with sequence number in the past and outside the BA window */
  7876. A_UINT32 dup_past_outside_window;
  7877. /* Number of MSDUs with decrypt/MIC error */
  7878. A_UINT32 rxdesc_err_decrypt_mic;
  7879. /* Number of data MSDUs received on both local and remote rings */
  7880. A_UINT32 data_msdus_on_both_rings;
  7881. /* MPDUs never filled */
  7882. A_UINT32 holes_not_filled;
  7883. };
  7884. /*
  7885. * Rx Remote buffer statistics
  7886. * NB: all the fields must be defined in 4 octets size.
  7887. */
  7888. struct rx_remote_buffer_mgmt_stats {
  7889. /* Total number of MSDUs reaped for Rx processing */
  7890. A_UINT32 remote_reaped;
  7891. /* MSDUs recycled within firmware */
  7892. A_UINT32 remote_recycled;
  7893. /* MSDUs stored by Data Rx */
  7894. A_UINT32 data_rx_msdus_stored;
  7895. /* Number of HTT indications from WAL Rx MSDU */
  7896. A_UINT32 wal_rx_ind;
  7897. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  7898. A_UINT32 wal_rx_ind_unconsumed;
  7899. /* Number of HTT indications from Data Rx MSDU */
  7900. A_UINT32 data_rx_ind;
  7901. /* Number of unconsumed HTT indications from Data Rx MSDU */
  7902. A_UINT32 data_rx_ind_unconsumed;
  7903. /* Number of HTT indications from ATHBUF */
  7904. A_UINT32 athbuf_rx_ind;
  7905. /* Number of remote buffers requested for refill */
  7906. A_UINT32 refill_buf_req;
  7907. /* Number of remote buffers filled by the host */
  7908. A_UINT32 refill_buf_rsp;
  7909. /* Number of times MAC hw_index = f/w write_index */
  7910. A_INT32 mac_no_bufs;
  7911. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  7912. A_INT32 fw_indices_equal;
  7913. /* Number of times f/w finds no buffers to post */
  7914. A_INT32 host_no_bufs;
  7915. };
  7916. /*
  7917. * TXBF MU/SU packets and NDPA statistics
  7918. * NB: all the fields must be defined in 4 octets size.
  7919. */
  7920. struct rx_txbf_musu_ndpa_pkts_stats {
  7921. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  7922. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  7923. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  7924. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  7925. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  7926. A_UINT32 reserved[3]; /* must be set to 0x0 */
  7927. };
  7928. /*
  7929. * htt_dbg_stats_status -
  7930. * present - The requested stats have been delivered in full.
  7931. * This indicates that either the stats information was contained
  7932. * in its entirety within this message, or else this message
  7933. * completes the delivery of the requested stats info that was
  7934. * partially delivered through earlier STATS_CONF messages.
  7935. * partial - The requested stats have been delivered in part.
  7936. * One or more subsequent STATS_CONF messages with the same
  7937. * cookie value will be sent to deliver the remainder of the
  7938. * information.
  7939. * error - The requested stats could not be delivered, for example due
  7940. * to a shortage of memory to construct a message holding the
  7941. * requested stats.
  7942. * invalid - The requested stat type is either not recognized, or the
  7943. * target is configured to not gather the stats type in question.
  7944. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7945. * series_done - This special value indicates that no further stats info
  7946. * elements are present within a series of stats info elems
  7947. * (within a stats upload confirmation message).
  7948. */
  7949. enum htt_dbg_stats_status {
  7950. HTT_DBG_STATS_STATUS_PRESENT = 0,
  7951. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  7952. HTT_DBG_STATS_STATUS_ERROR = 2,
  7953. HTT_DBG_STATS_STATUS_INVALID = 3,
  7954. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  7955. };
  7956. /**
  7957. * @brief target -> host statistics upload
  7958. *
  7959. * @details
  7960. * The following field definitions describe the format of the HTT target
  7961. * to host stats upload confirmation message.
  7962. * The message contains a cookie echoed from the HTT host->target stats
  7963. * upload request, which identifies which request the confirmation is
  7964. * for, and a series of tag-length-value stats information elements.
  7965. * The tag-length header for each stats info element also includes a
  7966. * status field, to indicate whether the request for the stat type in
  7967. * question was fully met, partially met, unable to be met, or invalid
  7968. * (if the stat type in question is disabled in the target).
  7969. * A special value of all 1's in this status field is used to indicate
  7970. * the end of the series of stats info elements.
  7971. *
  7972. *
  7973. * |31 16|15 8|7 5|4 0|
  7974. * |------------------------------------------------------------|
  7975. * | reserved | msg type |
  7976. * |------------------------------------------------------------|
  7977. * | cookie LSBs |
  7978. * |------------------------------------------------------------|
  7979. * | cookie MSBs |
  7980. * |------------------------------------------------------------|
  7981. * | stats entry length | reserved | S |stat type|
  7982. * |------------------------------------------------------------|
  7983. * | |
  7984. * | type-specific stats info |
  7985. * | |
  7986. * |------------------------------------------------------------|
  7987. * | stats entry length | reserved | S |stat type|
  7988. * |------------------------------------------------------------|
  7989. * | |
  7990. * | type-specific stats info |
  7991. * | |
  7992. * |------------------------------------------------------------|
  7993. * | n/a | reserved | 111 | n/a |
  7994. * |------------------------------------------------------------|
  7995. * Header fields:
  7996. * - MSG_TYPE
  7997. * Bits 7:0
  7998. * Purpose: identifies this is a statistics upload confirmation message
  7999. * Value: 0x9
  8000. * - COOKIE_LSBS
  8001. * Bits 31:0
  8002. * Purpose: Provide a mechanism to match a target->host stats confirmation
  8003. * message with its preceding host->target stats request message.
  8004. * Value: LSBs of the opaque cookie specified by the host-side requestor
  8005. * - COOKIE_MSBS
  8006. * Bits 31:0
  8007. * Purpose: Provide a mechanism to match a target->host stats confirmation
  8008. * message with its preceding host->target stats request message.
  8009. * Value: MSBs of the opaque cookie specified by the host-side requestor
  8010. *
  8011. * Stats Information Element tag-length header fields:
  8012. * - STAT_TYPE
  8013. * Bits 4:0
  8014. * Purpose: identifies the type of statistics info held in the
  8015. * following information element
  8016. * Value: htt_dbg_stats_type
  8017. * - STATUS
  8018. * Bits 7:5
  8019. * Purpose: indicate whether the requested stats are present
  8020. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  8021. * the completion of the stats entry series
  8022. * - LENGTH
  8023. * Bits 31:16
  8024. * Purpose: indicate the stats information size
  8025. * Value: This field specifies the number of bytes of stats information
  8026. * that follows the element tag-length header.
  8027. * It is expected but not required that this length is a multiple of
  8028. * 4 bytes. Even if the length is not an integer multiple of 4, the
  8029. * subsequent stats entry header will begin on a 4-byte aligned
  8030. * boundary.
  8031. */
  8032. #define HTT_T2H_STATS_COOKIE_SIZE 8
  8033. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  8034. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  8035. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  8036. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  8037. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  8038. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  8039. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  8040. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  8041. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  8042. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  8043. do { \
  8044. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  8045. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  8046. } while (0)
  8047. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  8048. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  8049. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  8050. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  8051. do { \
  8052. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  8053. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  8054. } while (0)
  8055. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  8056. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  8057. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  8058. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  8059. do { \
  8060. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  8061. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  8062. } while (0)
  8063. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  8064. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  8065. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  8066. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  8067. #define HTT_MAX_AGGR 64
  8068. #define HTT_HL_MAX_AGGR 18
  8069. /**
  8070. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  8071. *
  8072. * @details
  8073. * The following field definitions describe the format of the HTT host
  8074. * to target frag_desc/msdu_ext bank configuration message.
  8075. * The message contains the based address and the min and max id of the
  8076. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  8077. * MSDU_EXT/FRAG_DESC.
  8078. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  8079. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  8080. * the hardware does the mapping/translation.
  8081. *
  8082. * Total banks that can be configured is configured to 16.
  8083. *
  8084. * This should be called before any TX has be initiated by the HTT
  8085. *
  8086. * |31 16|15 8|7 5|4 0|
  8087. * |------------------------------------------------------------|
  8088. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  8089. * |------------------------------------------------------------|
  8090. * | BANK0_BASE_ADDRESS (bits 31:0) |
  8091. #if HTT_PADDR64
  8092. * | BANK0_BASE_ADDRESS (bits 63:32) |
  8093. #endif
  8094. * |------------------------------------------------------------|
  8095. * | ... |
  8096. * |------------------------------------------------------------|
  8097. * | BANK15_BASE_ADDRESS (bits 31:0) |
  8098. #if HTT_PADDR64
  8099. * | BANK15_BASE_ADDRESS (bits 63:32) |
  8100. #endif
  8101. * |------------------------------------------------------------|
  8102. * | BANK0_MAX_ID | BANK0_MIN_ID |
  8103. * |------------------------------------------------------------|
  8104. * | ... |
  8105. * |------------------------------------------------------------|
  8106. * | BANK15_MAX_ID | BANK15_MIN_ID |
  8107. * |------------------------------------------------------------|
  8108. * Header fields:
  8109. * - MSG_TYPE
  8110. * Bits 7:0
  8111. * Value: 0x6
  8112. * for systems with 64-bit format for bus addresses:
  8113. * - BANKx_BASE_ADDRESS_LO
  8114. * Bits 31:0
  8115. * Purpose: Provide a mechanism to specify the base address of the
  8116. * MSDU_EXT bank physical/bus address.
  8117. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  8118. * - BANKx_BASE_ADDRESS_HI
  8119. * Bits 31:0
  8120. * Purpose: Provide a mechanism to specify the base address of the
  8121. * MSDU_EXT bank physical/bus address.
  8122. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  8123. * for systems with 32-bit format for bus addresses:
  8124. * - BANKx_BASE_ADDRESS
  8125. * Bits 31:0
  8126. * Purpose: Provide a mechanism to specify the base address of the
  8127. * MSDU_EXT bank physical/bus address.
  8128. * Value: MSDU_EXT bank physical / bus address
  8129. * - BANKx_MIN_ID
  8130. * Bits 15:0
  8131. * Purpose: Provide a mechanism to specify the min index that needs to
  8132. * mapped.
  8133. * - BANKx_MAX_ID
  8134. * Bits 31:16
  8135. * Purpose: Provide a mechanism to specify the max index that needs to
  8136. * mapped.
  8137. *
  8138. */
  8139. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  8140. * safe value.
  8141. * @note MAX supported banks is 16.
  8142. */
  8143. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  8144. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  8145. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  8146. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  8147. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  8148. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  8149. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  8150. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  8151. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  8152. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  8153. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  8154. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  8155. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  8156. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  8157. do { \
  8158. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  8159. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  8160. } while (0)
  8161. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  8162. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  8163. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  8164. do { \
  8165. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  8166. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  8167. } while (0)
  8168. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  8169. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  8170. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  8171. do { \
  8172. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  8173. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  8174. } while (0)
  8175. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  8176. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  8177. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  8178. do { \
  8179. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  8180. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  8181. } while (0)
  8182. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  8183. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  8184. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  8185. do { \
  8186. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  8187. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  8188. } while (0)
  8189. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  8190. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  8191. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  8192. do { \
  8193. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  8194. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  8195. } while (0)
  8196. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  8197. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  8198. /*
  8199. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  8200. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  8201. * addresses are stored in a XXX-bit field.
  8202. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  8203. * htt_tx_frag_desc64_bank_cfg_t structs.
  8204. */
  8205. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  8206. _paddr_bits_, \
  8207. _paddr__bank_base_address_) \
  8208. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  8209. /** word 0 \
  8210. * msg_type: 8, \
  8211. * pdev_id: 2, \
  8212. * swap: 1, \
  8213. * reserved0: 5, \
  8214. * num_banks: 8, \
  8215. * desc_size: 8; \
  8216. */ \
  8217. A_UINT32 word0; \
  8218. /* \
  8219. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  8220. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  8221. * the second A_UINT32). \
  8222. */ \
  8223. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8224. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8225. } POSTPACK
  8226. /* define htt_tx_frag_desc32_bank_cfg_t */
  8227. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  8228. /* define htt_tx_frag_desc64_bank_cfg_t */
  8229. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  8230. /*
  8231. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  8232. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  8233. */
  8234. #if HTT_PADDR64
  8235. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  8236. #else
  8237. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  8238. #endif
  8239. /**
  8240. * @brief target -> host HTT TX Credit total count update message definition
  8241. *
  8242. *|31 16|15|14 9| 8 |7 0 |
  8243. *|---------------------+--+----------+-------+----------|
  8244. *|cur htt credit delta | Q| reserved | sign | msg type |
  8245. *|------------------------------------------------------|
  8246. *
  8247. * Header fields:
  8248. * - MSG_TYPE
  8249. * Bits 7:0
  8250. * Purpose: identifies this as a htt tx credit delta update message
  8251. * Value: 0xe
  8252. * - SIGN
  8253. * Bits 8
  8254. * identifies whether credit delta is positive or negative
  8255. * Value:
  8256. * - 0x0: credit delta is positive, rebalance in some buffers
  8257. * - 0x1: credit delta is negative, rebalance out some buffers
  8258. * - reserved
  8259. * Bits 14:9
  8260. * Value: 0x0
  8261. * - TXQ_GRP
  8262. * Bit 15
  8263. * Purpose: indicates whether any tx queue group information elements
  8264. * are appended to the tx credit update message
  8265. * Value: 0 -> no tx queue group information element is present
  8266. * 1 -> a tx queue group information element immediately follows
  8267. * - DELTA_COUNT
  8268. * Bits 31:16
  8269. * Purpose: Specify current htt credit delta absolute count
  8270. */
  8271. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  8272. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  8273. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  8274. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  8275. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  8276. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  8277. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  8278. do { \
  8279. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  8280. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  8281. } while (0)
  8282. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  8283. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  8284. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  8285. do { \
  8286. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  8287. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  8288. } while (0)
  8289. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  8290. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  8291. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  8292. do { \
  8293. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  8294. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  8295. } while (0)
  8296. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  8297. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  8298. #define HTT_TX_CREDIT_MSG_BYTES 4
  8299. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  8300. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  8301. /**
  8302. * @brief HTT WDI_IPA Operation Response Message
  8303. *
  8304. * @details
  8305. * HTT WDI_IPA Operation Response message is sent by target
  8306. * to host confirming suspend or resume operation.
  8307. * |31 24|23 16|15 8|7 0|
  8308. * |----------------+----------------+----------------+----------------|
  8309. * | op_code | Rsvd | msg_type |
  8310. * |-------------------------------------------------------------------|
  8311. * | Rsvd | Response len |
  8312. * |-------------------------------------------------------------------|
  8313. * | |
  8314. * | Response-type specific info |
  8315. * | |
  8316. * | |
  8317. * |-------------------------------------------------------------------|
  8318. * Header fields:
  8319. * - MSG_TYPE
  8320. * Bits 7:0
  8321. * Purpose: Identifies this as WDI_IPA Operation Response message
  8322. * value: = 0x13
  8323. * - OP_CODE
  8324. * Bits 31:16
  8325. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  8326. * value: = enum htt_wdi_ipa_op_code
  8327. * - RSP_LEN
  8328. * Bits 16:0
  8329. * Purpose: length for the response-type specific info
  8330. * value: = length in bytes for response-type specific info
  8331. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  8332. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  8333. */
  8334. PREPACK struct htt_wdi_ipa_op_response_t
  8335. {
  8336. /* DWORD 0: flags and meta-data */
  8337. A_UINT32
  8338. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8339. reserved1: 8,
  8340. op_code: 16;
  8341. A_UINT32
  8342. rsp_len: 16,
  8343. reserved2: 16;
  8344. } POSTPACK;
  8345. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  8346. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  8347. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  8348. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  8349. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  8350. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  8351. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  8352. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  8353. do { \
  8354. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  8355. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  8356. } while (0)
  8357. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  8358. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  8359. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  8360. do { \
  8361. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  8362. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  8363. } while (0)
  8364. enum htt_phy_mode {
  8365. htt_phy_mode_11a = 0,
  8366. htt_phy_mode_11g = 1,
  8367. htt_phy_mode_11b = 2,
  8368. htt_phy_mode_11g_only = 3,
  8369. htt_phy_mode_11na_ht20 = 4,
  8370. htt_phy_mode_11ng_ht20 = 5,
  8371. htt_phy_mode_11na_ht40 = 6,
  8372. htt_phy_mode_11ng_ht40 = 7,
  8373. htt_phy_mode_11ac_vht20 = 8,
  8374. htt_phy_mode_11ac_vht40 = 9,
  8375. htt_phy_mode_11ac_vht80 = 10,
  8376. htt_phy_mode_11ac_vht20_2g = 11,
  8377. htt_phy_mode_11ac_vht40_2g = 12,
  8378. htt_phy_mode_11ac_vht80_2g = 13,
  8379. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  8380. htt_phy_mode_11ac_vht160 = 15,
  8381. htt_phy_mode_max,
  8382. };
  8383. /**
  8384. * @brief target -> host HTT channel change indication
  8385. * @details
  8386. * Specify when a channel change occurs.
  8387. * This allows the host to precisely determine which rx frames arrived
  8388. * on the old channel and which rx frames arrived on the new channel.
  8389. *
  8390. *|31 |7 0 |
  8391. *|-------------------------------------------+----------|
  8392. *| reserved | msg type |
  8393. *|------------------------------------------------------|
  8394. *| primary_chan_center_freq_mhz |
  8395. *|------------------------------------------------------|
  8396. *| contiguous_chan1_center_freq_mhz |
  8397. *|------------------------------------------------------|
  8398. *| contiguous_chan2_center_freq_mhz |
  8399. *|------------------------------------------------------|
  8400. *| phy_mode |
  8401. *|------------------------------------------------------|
  8402. *
  8403. * Header fields:
  8404. * - MSG_TYPE
  8405. * Bits 7:0
  8406. * Purpose: identifies this as a htt channel change indication message
  8407. * Value: 0x15
  8408. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  8409. * Bits 31:0
  8410. * Purpose: identify the (center of the) new 20 MHz primary channel
  8411. * Value: center frequency of the 20 MHz primary channel, in MHz units
  8412. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  8413. * Bits 31:0
  8414. * Purpose: identify the (center of the) contiguous frequency range
  8415. * comprising the new channel.
  8416. * For example, if the new channel is a 80 MHz channel extending
  8417. * 60 MHz beyond the primary channel, this field would be 30 larger
  8418. * than the primary channel center frequency field.
  8419. * Value: center frequency of the contiguous frequency range comprising
  8420. * the full channel in MHz units
  8421. * (80+80 channels also use the CONTIG_CHAN2 field)
  8422. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  8423. * Bits 31:0
  8424. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  8425. * within a VHT 80+80 channel.
  8426. * This field is only relevant for VHT 80+80 channels.
  8427. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  8428. * channel (arbitrary value for cases besides VHT 80+80)
  8429. * - PHY_MODE
  8430. * Bits 31:0
  8431. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  8432. * and band
  8433. * Value: htt_phy_mode enum value
  8434. */
  8435. PREPACK struct htt_chan_change_t
  8436. {
  8437. /* DWORD 0: flags and meta-data */
  8438. A_UINT32
  8439. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8440. reserved1: 24;
  8441. A_UINT32 primary_chan_center_freq_mhz;
  8442. A_UINT32 contig_chan1_center_freq_mhz;
  8443. A_UINT32 contig_chan2_center_freq_mhz;
  8444. A_UINT32 phy_mode;
  8445. } POSTPACK;
  8446. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  8447. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  8448. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  8449. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  8450. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  8451. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  8452. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  8453. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  8454. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  8455. do { \
  8456. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  8457. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  8458. } while (0)
  8459. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  8460. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  8461. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  8462. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  8463. do { \
  8464. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  8465. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  8466. } while (0)
  8467. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  8468. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  8469. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  8470. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  8471. do { \
  8472. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  8473. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  8474. } while (0)
  8475. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  8476. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  8477. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  8478. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  8479. do { \
  8480. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  8481. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  8482. } while (0)
  8483. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  8484. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  8485. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  8486. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  8487. /**
  8488. * @brief rx offload packet error message
  8489. *
  8490. * @details
  8491. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  8492. * of target payload like mic err.
  8493. *
  8494. * |31 24|23 16|15 8|7 0|
  8495. * |----------------+----------------+----------------+----------------|
  8496. * | tid | vdev_id | msg_sub_type | msg_type |
  8497. * |-------------------------------------------------------------------|
  8498. * : (sub-type dependent content) :
  8499. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8500. * Header fields:
  8501. * - msg_type
  8502. * Bits 7:0
  8503. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  8504. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  8505. * - msg_sub_type
  8506. * Bits 15:8
  8507. * Purpose: Identifies which type of rx error is reported by this message
  8508. * value: htt_rx_ofld_pkt_err_type
  8509. * - vdev_id
  8510. * Bits 23:16
  8511. * Purpose: Identifies which vdev received the erroneous rx frame
  8512. * value:
  8513. * - tid
  8514. * Bits 31:24
  8515. * Purpose: Identifies the traffic type of the rx frame
  8516. * value:
  8517. *
  8518. * - The payload fields used if the sub-type == MIC error are shown below.
  8519. * Note - MIC err is per MSDU, while PN is per MPDU.
  8520. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  8521. * with MIC err in A-MSDU case, so FW will send only one HTT message
  8522. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  8523. * instead of sending separate HTT messages for each wrong MSDU within
  8524. * the MPDU.
  8525. *
  8526. * |31 24|23 16|15 8|7 0|
  8527. * |----------------+----------------+----------------+----------------|
  8528. * | Rsvd | key_id | peer_id |
  8529. * |-------------------------------------------------------------------|
  8530. * | receiver MAC addr 31:0 |
  8531. * |-------------------------------------------------------------------|
  8532. * | Rsvd | receiver MAC addr 47:32 |
  8533. * |-------------------------------------------------------------------|
  8534. * | transmitter MAC addr 31:0 |
  8535. * |-------------------------------------------------------------------|
  8536. * | Rsvd | transmitter MAC addr 47:32 |
  8537. * |-------------------------------------------------------------------|
  8538. * | PN 31:0 |
  8539. * |-------------------------------------------------------------------|
  8540. * | Rsvd | PN 47:32 |
  8541. * |-------------------------------------------------------------------|
  8542. * - peer_id
  8543. * Bits 15:0
  8544. * Purpose: identifies which peer is frame is from
  8545. * value:
  8546. * - key_id
  8547. * Bits 23:16
  8548. * Purpose: identifies key_id of rx frame
  8549. * value:
  8550. * - RA_31_0 (receiver MAC addr 31:0)
  8551. * Bits 31:0
  8552. * Purpose: identifies by MAC address which vdev received the frame
  8553. * value: MAC address lower 4 bytes
  8554. * - RA_47_32 (receiver MAC addr 47:32)
  8555. * Bits 15:0
  8556. * Purpose: identifies by MAC address which vdev received the frame
  8557. * value: MAC address upper 2 bytes
  8558. * - TA_31_0 (transmitter MAC addr 31:0)
  8559. * Bits 31:0
  8560. * Purpose: identifies by MAC address which peer transmitted the frame
  8561. * value: MAC address lower 4 bytes
  8562. * - TA_47_32 (transmitter MAC addr 47:32)
  8563. * Bits 15:0
  8564. * Purpose: identifies by MAC address which peer transmitted the frame
  8565. * value: MAC address upper 2 bytes
  8566. * - PN_31_0
  8567. * Bits 31:0
  8568. * Purpose: Identifies pn of rx frame
  8569. * value: PN lower 4 bytes
  8570. * - PN_47_32
  8571. * Bits 15:0
  8572. * Purpose: Identifies pn of rx frame
  8573. * value:
  8574. * TKIP or CCMP: PN upper 2 bytes
  8575. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  8576. */
  8577. enum htt_rx_ofld_pkt_err_type {
  8578. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  8579. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  8580. };
  8581. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  8582. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  8583. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  8584. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  8585. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  8586. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  8587. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  8588. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  8589. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  8590. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  8591. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  8592. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  8593. do { \
  8594. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  8595. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  8596. } while (0)
  8597. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  8598. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  8599. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  8600. do { \
  8601. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  8602. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  8603. } while (0)
  8604. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  8605. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  8606. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  8607. do { \
  8608. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  8609. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  8610. } while (0)
  8611. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  8612. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  8613. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  8614. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  8615. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  8616. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  8617. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  8618. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  8619. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  8620. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  8621. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  8622. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  8623. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  8624. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  8625. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  8626. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  8627. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  8628. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  8629. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  8630. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  8631. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  8632. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  8633. do { \
  8634. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  8635. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  8636. } while (0)
  8637. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  8638. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  8639. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  8640. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  8641. do { \
  8642. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  8643. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  8644. } while (0)
  8645. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  8646. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  8647. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  8648. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  8649. do { \
  8650. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  8651. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  8652. } while (0)
  8653. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  8654. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  8655. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  8656. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  8657. do { \
  8658. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  8659. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  8660. } while (0)
  8661. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  8662. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  8663. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  8664. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  8665. do { \
  8666. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  8667. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  8668. } while (0)
  8669. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  8670. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  8671. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  8672. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  8673. do { \
  8674. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  8675. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  8676. } while (0)
  8677. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  8678. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  8679. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  8680. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  8681. do { \
  8682. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  8683. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  8684. } while (0)
  8685. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  8686. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  8687. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  8688. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  8689. do { \
  8690. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  8691. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  8692. } while (0)
  8693. /**
  8694. * @brief peer rate report message
  8695. *
  8696. * @details
  8697. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  8698. * justified rate of all the peers.
  8699. *
  8700. * |31 24|23 16|15 8|7 0|
  8701. * |----------------+----------------+----------------+----------------|
  8702. * | peer_count | | msg_type |
  8703. * |-------------------------------------------------------------------|
  8704. * : Payload (variant number of peer rate report) :
  8705. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8706. * Header fields:
  8707. * - msg_type
  8708. * Bits 7:0
  8709. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  8710. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  8711. * - reserved
  8712. * Bits 15:8
  8713. * Purpose:
  8714. * value:
  8715. * - peer_count
  8716. * Bits 31:16
  8717. * Purpose: Specify how many peer rate report elements are present in the payload.
  8718. * value:
  8719. *
  8720. * Payload:
  8721. * There are variant number of peer rate report follow the first 32 bits.
  8722. * The peer rate report is defined as follows.
  8723. *
  8724. * |31 20|19 16|15 0|
  8725. * |-----------------------+---------+---------------------------------|-
  8726. * | reserved | phy | peer_id | \
  8727. * |-------------------------------------------------------------------| -> report #0
  8728. * | rate | /
  8729. * |-----------------------+---------+---------------------------------|-
  8730. * | reserved | phy | peer_id | \
  8731. * |-------------------------------------------------------------------| -> report #1
  8732. * | rate | /
  8733. * |-----------------------+---------+---------------------------------|-
  8734. * | reserved | phy | peer_id | \
  8735. * |-------------------------------------------------------------------| -> report #2
  8736. * | rate | /
  8737. * |-------------------------------------------------------------------|-
  8738. * : :
  8739. * : :
  8740. * : :
  8741. * :-------------------------------------------------------------------:
  8742. *
  8743. * - peer_id
  8744. * Bits 15:0
  8745. * Purpose: identify the peer
  8746. * value:
  8747. * - phy
  8748. * Bits 19:16
  8749. * Purpose: identify which phy is in use
  8750. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  8751. * Please see enum htt_peer_report_phy_type for detail.
  8752. * - reserved
  8753. * Bits 31:20
  8754. * Purpose:
  8755. * value:
  8756. * - rate
  8757. * Bits 31:0
  8758. * Purpose: represent the justified rate of the peer specified by peer_id
  8759. * value:
  8760. */
  8761. enum htt_peer_rate_report_phy_type {
  8762. HTT_PEER_RATE_REPORT_11B = 0,
  8763. HTT_PEER_RATE_REPORT_11A_G,
  8764. HTT_PEER_RATE_REPORT_11N,
  8765. HTT_PEER_RATE_REPORT_11AC,
  8766. };
  8767. #define HTT_PEER_RATE_REPORT_SIZE 8
  8768. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  8769. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  8770. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  8771. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  8772. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  8773. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  8774. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  8775. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  8776. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  8777. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  8778. do { \
  8779. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  8780. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  8781. } while (0)
  8782. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  8783. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  8784. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  8785. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  8786. do { \
  8787. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  8788. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  8789. } while (0)
  8790. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  8791. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  8792. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  8793. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  8794. do { \
  8795. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  8796. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  8797. } while (0)
  8798. /**
  8799. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  8800. *
  8801. * @details
  8802. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  8803. * a flow of descriptors.
  8804. *
  8805. * This message is in TLV format and indicates the parameters to be setup a
  8806. * flow in the host. Each entry indicates that a particular flow ID is ready to
  8807. * receive descriptors from a specified pool.
  8808. *
  8809. * The message would appear as follows:
  8810. *
  8811. * |31 24|23 16|15 8|7 0|
  8812. * |----------------+----------------+----------------+----------------|
  8813. * header | reserved | num_flows | msg_type |
  8814. * |-------------------------------------------------------------------|
  8815. * | |
  8816. * : payload :
  8817. * | |
  8818. * |-------------------------------------------------------------------|
  8819. *
  8820. * The header field is one DWORD long and is interpreted as follows:
  8821. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  8822. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  8823. * this message
  8824. * b'16-31 - reserved: These bits are reserved for future use
  8825. *
  8826. * Payload:
  8827. * The payload would contain multiple objects of the following structure. Each
  8828. * object represents a flow.
  8829. *
  8830. * |31 24|23 16|15 8|7 0|
  8831. * |----------------+----------------+----------------+----------------|
  8832. * header | reserved | num_flows | msg_type |
  8833. * |-------------------------------------------------------------------|
  8834. * payload0| flow_type |
  8835. * |-------------------------------------------------------------------|
  8836. * | flow_id |
  8837. * |-------------------------------------------------------------------|
  8838. * | reserved0 | flow_pool_id |
  8839. * |-------------------------------------------------------------------|
  8840. * | reserved1 | flow_pool_size |
  8841. * |-------------------------------------------------------------------|
  8842. * | reserved2 |
  8843. * |-------------------------------------------------------------------|
  8844. * payload1| flow_type |
  8845. * |-------------------------------------------------------------------|
  8846. * | flow_id |
  8847. * |-------------------------------------------------------------------|
  8848. * | reserved0 | flow_pool_id |
  8849. * |-------------------------------------------------------------------|
  8850. * | reserved1 | flow_pool_size |
  8851. * |-------------------------------------------------------------------|
  8852. * | reserved2 |
  8853. * |-------------------------------------------------------------------|
  8854. * | . |
  8855. * | . |
  8856. * | . |
  8857. * |-------------------------------------------------------------------|
  8858. *
  8859. * Each payload is 5 DWORDS long and is interpreted as follows:
  8860. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  8861. * this flow is associated. It can be VDEV, peer,
  8862. * or tid (AC). Based on enum htt_flow_type.
  8863. *
  8864. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  8865. * object. For flow_type vdev it is set to the
  8866. * vdevid, for peer it is peerid and for tid, it is
  8867. * tid_num.
  8868. *
  8869. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  8870. * in the host for this flow
  8871. * b'16:31 - reserved0: This field in reserved for the future. In case
  8872. * we have a hierarchical implementation (HCM) of
  8873. * pools, it can be used to indicate the ID of the
  8874. * parent-pool.
  8875. *
  8876. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  8877. * Descriptors for this flow will be
  8878. * allocated from this pool in the host.
  8879. * b'16:31 - reserved1: This field in reserved for the future. In case
  8880. * we have a hierarchical implementation of pools,
  8881. * it can be used to indicate the max number of
  8882. * descriptors in the pool. The b'0:15 can be used
  8883. * to indicate min number of descriptors in the
  8884. * HCM scheme.
  8885. *
  8886. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  8887. * we have a hierarchical implementation of pools,
  8888. * b'0:15 can be used to indicate the
  8889. * priority-based borrowing (PBB) threshold of
  8890. * the flow's pool. The b'16:31 are still left
  8891. * reserved.
  8892. */
  8893. enum htt_flow_type {
  8894. FLOW_TYPE_VDEV = 0,
  8895. /* Insert new flow types above this line */
  8896. };
  8897. PREPACK struct htt_flow_pool_map_payload_t {
  8898. A_UINT32 flow_type;
  8899. A_UINT32 flow_id;
  8900. A_UINT32 flow_pool_id:16,
  8901. reserved0:16;
  8902. A_UINT32 flow_pool_size:16,
  8903. reserved1:16;
  8904. A_UINT32 reserved2;
  8905. } POSTPACK;
  8906. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  8907. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  8908. (sizeof(struct htt_flow_pool_map_payload_t))
  8909. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  8910. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  8911. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  8912. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  8913. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  8914. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  8915. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  8916. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  8917. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  8918. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  8919. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  8920. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  8921. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  8922. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  8923. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  8924. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  8925. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  8926. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  8927. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  8928. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  8929. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  8930. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  8931. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  8932. do { \
  8933. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  8934. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  8935. } while (0)
  8936. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  8937. do { \
  8938. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  8939. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  8940. } while (0)
  8941. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  8942. do { \
  8943. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  8944. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  8945. } while (0)
  8946. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  8947. do { \
  8948. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  8949. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  8950. } while (0)
  8951. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  8952. do { \
  8953. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  8954. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  8955. } while (0)
  8956. /**
  8957. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  8958. *
  8959. * @details
  8960. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  8961. * down a flow of descriptors.
  8962. * This message indicates that for the flow (whose ID is provided) is wanting
  8963. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  8964. * pool of descriptors from where descriptors are being allocated for this
  8965. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  8966. * be unmapped by the host.
  8967. *
  8968. * The message would appear as follows:
  8969. *
  8970. * |31 24|23 16|15 8|7 0|
  8971. * |----------------+----------------+----------------+----------------|
  8972. * | reserved0 | msg_type |
  8973. * |-------------------------------------------------------------------|
  8974. * | flow_type |
  8975. * |-------------------------------------------------------------------|
  8976. * | flow_id |
  8977. * |-------------------------------------------------------------------|
  8978. * | reserved1 | flow_pool_id |
  8979. * |-------------------------------------------------------------------|
  8980. *
  8981. * The message is interpreted as follows:
  8982. * dword0 - b'0:7 - msg_type: This will be set to
  8983. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  8984. * b'8:31 - reserved0: Reserved for future use
  8985. *
  8986. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  8987. * this flow is associated. It can be VDEV, peer,
  8988. * or tid (AC). Based on enum htt_flow_type.
  8989. *
  8990. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  8991. * object. For flow_type vdev it is set to the
  8992. * vdevid, for peer it is peerid and for tid, it is
  8993. * tid_num.
  8994. *
  8995. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  8996. * used in the host for this flow
  8997. * b'16:31 - reserved0: This field in reserved for the future.
  8998. *
  8999. */
  9000. PREPACK struct htt_flow_pool_unmap_t {
  9001. A_UINT32 msg_type:8,
  9002. reserved0:24;
  9003. A_UINT32 flow_type;
  9004. A_UINT32 flow_id;
  9005. A_UINT32 flow_pool_id:16,
  9006. reserved1:16;
  9007. } POSTPACK;
  9008. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  9009. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  9010. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  9011. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  9012. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  9013. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  9014. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  9015. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  9016. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  9017. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  9018. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  9019. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  9020. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  9021. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  9022. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  9023. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  9024. do { \
  9025. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  9026. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  9027. } while (0)
  9028. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  9029. do { \
  9030. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  9031. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  9032. } while (0)
  9033. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  9034. do { \
  9035. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  9036. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  9037. } while (0)
  9038. /**
  9039. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  9040. *
  9041. * @details
  9042. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  9043. * SRNG ring setup is done
  9044. *
  9045. * This message indicates whether the last setup operation is successful.
  9046. * It will be sent to host when host set respose_required bit in
  9047. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  9048. * The message would appear as follows:
  9049. *
  9050. * |31 24|23 16|15 8|7 0|
  9051. * |--------------- +----------------+----------------+----------------|
  9052. * | setup_status | ring_id | pdev_id | msg_type |
  9053. * |-------------------------------------------------------------------|
  9054. *
  9055. * The message is interpreted as follows:
  9056. * dword0 - b'0:7 - msg_type: This will be set to
  9057. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  9058. * b'8:15 - pdev_id:
  9059. * 0 (for rings at SOC/UMAC level),
  9060. * 1/2/3 mac id (for rings at LMAC level)
  9061. * b'16:23 - ring_id: Identify the ring which is set up
  9062. * More details can be got from enum htt_srng_ring_id
  9063. * b'24:31 - setup_status: Indicate status of setup operation
  9064. * Refer to htt_ring_setup_status
  9065. */
  9066. PREPACK struct htt_sring_setup_done_t {
  9067. A_UINT32 msg_type: 8,
  9068. pdev_id: 8,
  9069. ring_id: 8,
  9070. setup_status: 8;
  9071. } POSTPACK;
  9072. enum htt_ring_setup_status {
  9073. htt_ring_setup_status_ok = 0,
  9074. htt_ring_setup_status_error,
  9075. };
  9076. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  9077. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  9078. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  9079. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  9080. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  9081. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  9082. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  9083. do { \
  9084. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  9085. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  9086. } while (0)
  9087. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  9088. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  9089. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  9090. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  9091. HTT_SRING_SETUP_DONE_RING_ID_S)
  9092. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  9093. do { \
  9094. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  9095. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  9096. } while (0)
  9097. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  9098. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  9099. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  9100. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  9101. HTT_SRING_SETUP_DONE_STATUS_S)
  9102. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  9103. do { \
  9104. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  9105. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  9106. } while (0)
  9107. /**
  9108. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  9109. *
  9110. * @details
  9111. * HTT TX map flow entry with tqm flow pointer
  9112. * Sent from firmware to host to add tqm flow pointer in corresponding
  9113. * flow search entry. Flow metadata is replayed back to host as part of this
  9114. * struct to enable host to find the specific flow search entry
  9115. *
  9116. * The message would appear as follows:
  9117. *
  9118. * |31 28|27 18|17 14|13 8|7 0|
  9119. * |-------+------------------------------------------+----------------|
  9120. * | rsvd0 | fse_hsh_idx | msg_type |
  9121. * |-------------------------------------------------------------------|
  9122. * | rsvd1 | tid | peer_id |
  9123. * |-------------------------------------------------------------------|
  9124. * | tqm_flow_pntr_lo |
  9125. * |-------------------------------------------------------------------|
  9126. * | tqm_flow_pntr_hi |
  9127. * |-------------------------------------------------------------------|
  9128. * | fse_meta_data |
  9129. * |-------------------------------------------------------------------|
  9130. *
  9131. * The message is interpreted as follows:
  9132. *
  9133. * dword0 - b'0:7 - msg_type: This will be set to
  9134. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  9135. *
  9136. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  9137. * for this flow entry
  9138. *
  9139. * dword0 - b'28:31 - rsvd0: Reserved for future use
  9140. *
  9141. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  9142. *
  9143. * dword1 - b'14:17 - tid
  9144. *
  9145. * dword1 - b'18:31 - rsvd1: Reserved for future use
  9146. *
  9147. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  9148. *
  9149. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  9150. *
  9151. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  9152. * given by host
  9153. */
  9154. PREPACK struct htt_tx_map_flow_info {
  9155. A_UINT32
  9156. msg_type: 8,
  9157. fse_hsh_idx: 20,
  9158. rsvd0: 4;
  9159. A_UINT32
  9160. peer_id: 14,
  9161. tid: 4,
  9162. rsvd1: 14;
  9163. A_UINT32 tqm_flow_pntr_lo;
  9164. A_UINT32 tqm_flow_pntr_hi;
  9165. struct htt_tx_flow_metadata fse_meta_data;
  9166. } POSTPACK;
  9167. /* DWORD 0 */
  9168. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  9169. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  9170. /* DWORD 1 */
  9171. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  9172. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  9173. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  9174. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  9175. /* DWORD 0 */
  9176. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  9177. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  9178. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  9179. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  9180. do { \
  9181. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  9182. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  9183. } while (0)
  9184. /* DWORD 1 */
  9185. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  9186. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  9187. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  9188. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  9189. do { \
  9190. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  9191. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  9192. } while (0)
  9193. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  9194. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  9195. HTT_TX_MAP_FLOW_INFO_TID_S)
  9196. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  9197. do { \
  9198. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  9199. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  9200. } while (0)
  9201. /*
  9202. * htt_dbg_ext_stats_status -
  9203. * present - The requested stats have been delivered in full.
  9204. * This indicates that either the stats information was contained
  9205. * in its entirety within this message, or else this message
  9206. * completes the delivery of the requested stats info that was
  9207. * partially delivered through earlier STATS_CONF messages.
  9208. * partial - The requested stats have been delivered in part.
  9209. * One or more subsequent STATS_CONF messages with the same
  9210. * cookie value will be sent to deliver the remainder of the
  9211. * information.
  9212. * error - The requested stats could not be delivered, for example due
  9213. * to a shortage of memory to construct a message holding the
  9214. * requested stats.
  9215. * invalid - The requested stat type is either not recognized, or the
  9216. * target is configured to not gather the stats type in question.
  9217. */
  9218. enum htt_dbg_ext_stats_status {
  9219. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  9220. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  9221. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  9222. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  9223. };
  9224. /**
  9225. * @brief target -> host ppdu stats upload
  9226. *
  9227. * @details
  9228. * The following field definitions describe the format of the HTT target
  9229. * to host ppdu stats indication message.
  9230. *
  9231. *
  9232. * |31 16|15 12|11 10|9 8|7 0 |
  9233. * |----------------------------------------------------------------------|
  9234. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  9235. * |----------------------------------------------------------------------|
  9236. * | ppdu_id |
  9237. * |----------------------------------------------------------------------|
  9238. * | Timestamp in us |
  9239. * |----------------------------------------------------------------------|
  9240. * | reserved |
  9241. * |----------------------------------------------------------------------|
  9242. * | type-specific stats info |
  9243. * | (see htt_ppdu_stats.h) |
  9244. * |----------------------------------------------------------------------|
  9245. * Header fields:
  9246. * - MSG_TYPE
  9247. * Bits 7:0
  9248. * Purpose: Identifies this is a PPDU STATS indication
  9249. * message.
  9250. * Value: 0x1d
  9251. * - mac_id
  9252. * Bits 9:8
  9253. * Purpose: mac_id of this ppdu_id
  9254. * Value: 0-3
  9255. * - pdev_id
  9256. * Bits 11:10
  9257. * Purpose: pdev_id of this ppdu_id
  9258. * Value: 0-3
  9259. * 0 (for rings at SOC level),
  9260. * 1/2/3 PDEV -> 0/1/2
  9261. * - payload_size
  9262. * Bits 31:16
  9263. * Purpose: total tlv size
  9264. * Value: payload_size in bytes
  9265. */
  9266. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  9267. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  9268. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  9269. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  9270. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  9271. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  9272. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  9273. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  9274. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  9275. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  9276. do { \
  9277. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  9278. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  9279. } while (0)
  9280. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  9281. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  9282. HTT_T2H_PPDU_STATS_MAC_ID_S)
  9283. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  9284. do { \
  9285. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  9286. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  9287. } while (0)
  9288. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  9289. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  9290. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  9291. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  9292. do { \
  9293. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  9294. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  9295. } while (0)
  9296. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  9297. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  9298. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  9299. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  9300. do { \
  9301. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  9302. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  9303. } while (0)
  9304. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  9305. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  9306. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  9307. /**
  9308. * @brief target -> host extended statistics upload
  9309. *
  9310. * @details
  9311. * The following field definitions describe the format of the HTT target
  9312. * to host stats upload confirmation message.
  9313. * The message contains a cookie echoed from the HTT host->target stats
  9314. * upload request, which identifies which request the confirmation is
  9315. * for, and a single stats can span over multiple HTT stats indication
  9316. * due to the HTT message size limitation so every HTT ext stats indication
  9317. * will have tag-length-value stats information elements.
  9318. * The tag-length header for each HTT stats IND message also includes a
  9319. * status field, to indicate whether the request for the stat type in
  9320. * question was fully met, partially met, unable to be met, or invalid
  9321. * (if the stat type in question is disabled in the target).
  9322. * A Done bit 1's indicate the end of the of stats info elements.
  9323. *
  9324. *
  9325. * |31 16|15 12|11|10 8|7 5|4 0|
  9326. * |--------------------------------------------------------------|
  9327. * | reserved | msg type |
  9328. * |--------------------------------------------------------------|
  9329. * | cookie LSBs |
  9330. * |--------------------------------------------------------------|
  9331. * | cookie MSBs |
  9332. * |--------------------------------------------------------------|
  9333. * | stats entry length | rsvd | D| S | stat type |
  9334. * |--------------------------------------------------------------|
  9335. * | type-specific stats info |
  9336. * | (see htt_stats.h) |
  9337. * |--------------------------------------------------------------|
  9338. * Header fields:
  9339. * - MSG_TYPE
  9340. * Bits 7:0
  9341. * Purpose: Identifies this is a extended statistics upload confirmation
  9342. * message.
  9343. * Value: 0x1c
  9344. * - COOKIE_LSBS
  9345. * Bits 31:0
  9346. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9347. * message with its preceding host->target stats request message.
  9348. * Value: LSBs of the opaque cookie specified by the host-side requestor
  9349. * - COOKIE_MSBS
  9350. * Bits 31:0
  9351. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9352. * message with its preceding host->target stats request message.
  9353. * Value: MSBs of the opaque cookie specified by the host-side requestor
  9354. *
  9355. * Stats Information Element tag-length header fields:
  9356. * - STAT_TYPE
  9357. * Bits 7:0
  9358. * Purpose: identifies the type of statistics info held in the
  9359. * following information element
  9360. * Value: htt_dbg_ext_stats_type
  9361. * - STATUS
  9362. * Bits 10:8
  9363. * Purpose: indicate whether the requested stats are present
  9364. * Value: htt_dbg_ext_stats_status
  9365. * - DONE
  9366. * Bits 11
  9367. * Purpose:
  9368. * Indicates the completion of the stats entry, this will be the last
  9369. * stats conf HTT segment for the requested stats type.
  9370. * Value:
  9371. * 0 -> the stats retrieval is ongoing
  9372. * 1 -> the stats retrieval is complete
  9373. * - LENGTH
  9374. * Bits 31:16
  9375. * Purpose: indicate the stats information size
  9376. * Value: This field specifies the number of bytes of stats information
  9377. * that follows the element tag-length header.
  9378. * It is expected but not required that this length is a multiple of
  9379. * 4 bytes.
  9380. */
  9381. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  9382. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  9383. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  9384. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  9385. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  9386. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  9387. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  9388. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  9389. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  9390. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  9391. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  9392. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  9393. do { \
  9394. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  9395. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  9396. } while (0)
  9397. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  9398. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  9399. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  9400. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  9401. do { \
  9402. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  9403. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  9404. } while (0)
  9405. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  9406. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  9407. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  9408. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  9409. do { \
  9410. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  9411. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  9412. } while (0)
  9413. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  9414. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  9415. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  9416. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  9417. do { \
  9418. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  9419. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  9420. } while (0)
  9421. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  9422. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  9423. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  9424. typedef enum {
  9425. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  9426. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  9427. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  9428. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  9429. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  9430. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  9431. /* Reserved from 128 - 255 for target internal use.*/
  9432. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  9433. } HTT_PEER_TYPE;
  9434. /** 2 word representation of MAC addr */
  9435. typedef struct {
  9436. /** upper 4 bytes of MAC address */
  9437. A_UINT32 mac_addr31to0;
  9438. /** lower 2 bytes of MAC address */
  9439. A_UINT32 mac_addr47to32;
  9440. } htt_mac_addr;
  9441. /** macro to convert MAC address from char array to HTT word format */
  9442. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  9443. (phtt_mac_addr)->mac_addr31to0 = \
  9444. (((c_macaddr)[0] << 0) | \
  9445. ((c_macaddr)[1] << 8) | \
  9446. ((c_macaddr)[2] << 16) | \
  9447. ((c_macaddr)[3] << 24)); \
  9448. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  9449. } while (0)
  9450. /**
  9451. * @brief target -> host monitor mac header indication message
  9452. *
  9453. * @details
  9454. * The following diagram shows the format of the monitor mac header message
  9455. * sent from the target to the host.
  9456. * This message is primarily sent when promiscuous rx mode is enabled.
  9457. * One message is sent per rx PPDU.
  9458. *
  9459. * |31 24|23 16|15 8|7 0|
  9460. * |-------------------------------------------------------------|
  9461. * | peer_id | reserved0 | msg_type |
  9462. * |-------------------------------------------------------------|
  9463. * | reserved1 | num_mpdu |
  9464. * |-------------------------------------------------------------|
  9465. * | struct hw_rx_desc |
  9466. * | (see wal_rx_desc.h) |
  9467. * |-------------------------------------------------------------|
  9468. * | struct ieee80211_frame_addr4 |
  9469. * | (see ieee80211_defs.h) |
  9470. * |-------------------------------------------------------------|
  9471. * | struct ieee80211_frame_addr4 |
  9472. * | (see ieee80211_defs.h) |
  9473. * |-------------------------------------------------------------|
  9474. * | ...... |
  9475. * |-------------------------------------------------------------|
  9476. *
  9477. * Header fields:
  9478. * - msg_type
  9479. * Bits 7:0
  9480. * Purpose: Identifies this is a monitor mac header indication message.
  9481. * Value: 0x20
  9482. * - peer_id
  9483. * Bits 31:16
  9484. * Purpose: Software peer id given by host during association,
  9485. * During promiscuous mode, the peer ID will be invalid (0xFF)
  9486. * for rx PPDUs received from unassociated peers.
  9487. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  9488. * - num_mpdu
  9489. * Bits 15:0
  9490. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  9491. * delivered within the message.
  9492. * Value: 1 to 32
  9493. * num_mpdu is limited to a maximum value of 32, due to buffer
  9494. * size limits. For PPDUs with more than 32 MPDUs, only the
  9495. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  9496. * the PPDU will be provided.
  9497. */
  9498. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  9499. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  9500. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  9501. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  9502. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  9503. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  9504. do { \
  9505. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  9506. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  9507. } while (0)
  9508. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  9509. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  9510. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  9511. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  9512. do { \
  9513. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  9514. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  9515. } while (0)
  9516. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  9517. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  9518. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  9519. /**
  9520. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE Message
  9521. *
  9522. * @details
  9523. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  9524. * the flow pool associated with the specified ID is resized
  9525. *
  9526. * The message would appear as follows:
  9527. *
  9528. * |31 16|15 8|7 0|
  9529. * |---------------------------------+----------------+----------------|
  9530. * | reserved0 | Msg type |
  9531. * |-------------------------------------------------------------------|
  9532. * | flow pool new size | flow pool ID |
  9533. * |-------------------------------------------------------------------|
  9534. *
  9535. * The message is interpreted as follows:
  9536. * b'0:7 - msg_type: This will be set to
  9537. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  9538. *
  9539. * b'0:15 - flow pool ID: Existing flow pool ID
  9540. *
  9541. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  9542. *
  9543. */
  9544. PREPACK struct htt_flow_pool_resize_t {
  9545. A_UINT32 msg_type:8,
  9546. reserved0:24;
  9547. A_UINT32 flow_pool_id:16,
  9548. flow_pool_new_size:16;
  9549. } POSTPACK;
  9550. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  9551. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  9552. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  9553. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  9554. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  9555. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  9556. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  9557. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  9558. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  9559. do { \
  9560. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  9561. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  9562. } while (0)
  9563. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  9564. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  9565. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  9566. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  9567. do { \
  9568. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  9569. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  9570. } while (0)
  9571. /**
  9572. * @brief host -> target channel change message
  9573. *
  9574. * @details
  9575. * the meesage is generated by FW every time FW changes channel. This will be used by host mainly
  9576. * to associate RX frames to correct channel they were received on.
  9577. * The following field definitions describe the format of the HTT target
  9578. * to host channel change message.
  9579. * |31 16|15 8|7 5|4 0|
  9580. * |------------------------------------------------------------|
  9581. * | reserved | MSG_TYPE |
  9582. * |------------------------------------------------------------|
  9583. * | CHAN_MHZ |
  9584. * |------------------------------------------------------------|
  9585. * | BAND_CENTER_FREQ1 |
  9586. * |------------------------------------------------------------|
  9587. * | BAND_CENTER_FREQ2 |
  9588. * |------------------------------------------------------------|
  9589. * | CHAN_PHY_MODE |
  9590. * |------------------------------------------------------------|
  9591. * Header fields:
  9592. * - MSG_TYPE
  9593. * Bits 7:0
  9594. * Value: 0xf
  9595. * - CHAN_MHZ
  9596. * Bits 31:0
  9597. * Purpose: frequency of the primary 20mhz channel.
  9598. * - BAND_CENTER_FREQ1
  9599. * Bits 31:0
  9600. * Purpose: centre frequency of the full channel.
  9601. * - BAND_CENTER_FREQ2
  9602. * Bits 31:0
  9603. * Purpose: centre frequency2 of the channel. is only valid for 11acvht 80plus80.
  9604. * - CHAN_PHY_MODE
  9605. * Bits 31:0
  9606. * Purpose: phy mode of the channel.
  9607. */
  9608. PREPACK struct htt_chan_change_msg {
  9609. A_UINT32 chan_mhz; /* frequency in mhz */
  9610. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz*/
  9611. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  9612. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  9613. } POSTPACK;
  9614. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  9615. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  9616. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  9617. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  9618. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  9619. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  9620. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  9621. /*
  9622. * The read and write indices point to the data within the host buffer.
  9623. * Because the first 4 bytes of the host buffer is used for the read index and
  9624. * the next 4 bytes for the write index, the data itself starts at offset 8.
  9625. * The read index and write index are the byte offsets from the base of the
  9626. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  9627. * Refer the ASCII text picture below.
  9628. */
  9629. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  9630. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  9631. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  9632. /*
  9633. ***************************************************************************
  9634. *
  9635. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  9636. *
  9637. ***************************************************************************
  9638. *
  9639. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  9640. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  9641. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  9642. * written into the Host memory region mentioned below.
  9643. *
  9644. * Read index is updated by the Host. At any point of time, the read index will
  9645. * indicate the index that will next be read by the Host. The read index is
  9646. * in units of bytes offset from the base of the meta-data buffer.
  9647. *
  9648. * Write index is updated by the FW. At any point of time, the write index will
  9649. * indicate from where the FW can start writing any new data. The write index is
  9650. * in units of bytes offset from the base of the meta-data buffer.
  9651. *
  9652. * If the Host is not fast enough in reading the CFR data, any new capture data
  9653. * would be dropped if there is no space left to write the new captures.
  9654. *
  9655. * The last 4 bytes of the memory region will have the magic pattern
  9656. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  9657. * not overrun the host buffer.
  9658. *
  9659. * ,--------------------. read and write indices store the
  9660. * | | byte offset from the base of the
  9661. * | ,--------+--------. meta-data buffer to the next
  9662. * | | | | location within the data buffer
  9663. * | | v v that will be read / written
  9664. * ************************************************************************
  9665. * * Read * Write * * Magic *
  9666. * * index * index * CFR data1 ...... CFR data N * pattern *
  9667. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  9668. * ************************************************************************
  9669. * |<---------- data buffer ---------->|
  9670. *
  9671. * |<----------------- meta-data buffer allocated in Host ----------------|
  9672. *
  9673. * Note:
  9674. * - Considering the 4 bytes needed to store the Read index (R) and the
  9675. * Write index (W), the initial value is as follows:
  9676. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  9677. * - Buffer empty condition:
  9678. * R = W
  9679. *
  9680. * Regarding CFR data format:
  9681. * --------------------------
  9682. *
  9683. * Each CFR tone is stored in HW as 16-bits with the following format:
  9684. * {bits[15:12], bits[11:6], bits[5:0]} =
  9685. * {unsigned exponent (4 bits),
  9686. * signed mantissa_real (6 bits),
  9687. * signed mantissa_imag (6 bits)}
  9688. *
  9689. * CFR_real = mantissa_real * 2^(exponent-5)
  9690. * CFR_imag = mantissa_imag * 2^(exponent-5)
  9691. *
  9692. *
  9693. * The CFR data is written to the 16-bit unsigned output array (buff) in
  9694. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  9695. *
  9696. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  9697. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  9698. * .
  9699. * .
  9700. * .
  9701. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  9702. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  9703. */
  9704. /* Bandwidth of peer CFR captures */
  9705. typedef enum {
  9706. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  9707. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  9708. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  9709. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  9710. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  9711. HTT_PEER_CFR_CAPTURE_BW_MAX,
  9712. } HTT_PEER_CFR_CAPTURE_BW;
  9713. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  9714. * was captured
  9715. */
  9716. typedef enum {
  9717. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  9718. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  9719. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  9720. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  9721. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  9722. } HTT_PEER_CFR_CAPTURE_MODE;
  9723. typedef enum {
  9724. /* This message type is currently used for the below purpose:
  9725. *
  9726. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  9727. * wmi_peer_cfr_capture_cmd.
  9728. * If payload_present bit is set to 0 then the associated memory region
  9729. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  9730. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  9731. * message; the CFR dump will be present at the end of the message,
  9732. * after the chan_phy_mode.
  9733. */
  9734. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  9735. /* Always keep this last */
  9736. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  9737. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  9738. /**
  9739. * @brief target -> host CFR dump completion indication message definition
  9740. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  9741. *
  9742. * @details
  9743. * The following diagram shows the format of the Channel Frequency Response
  9744. * (CFR) dump completion indication. This inidcation is sent to the Host when
  9745. * the channel capture of a peer is copied by Firmware into the Host memory
  9746. *
  9747. * **************************************************************************
  9748. *
  9749. * Message format when the CFR capture message type is
  9750. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  9751. *
  9752. * **************************************************************************
  9753. *
  9754. * |31 16|15 |8|7 0|
  9755. * |----------------------------------------------------------------|
  9756. * header: | reserved |P| msg_type |
  9757. * word 0 | | | |
  9758. * |----------------------------------------------------------------|
  9759. * payload: | cfr_capture_msg_type |
  9760. * word 1 | |
  9761. * |----------------------------------------------------------------|
  9762. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  9763. * word 2 | | | | | | | | |
  9764. * |----------------------------------------------------------------|
  9765. * | mac_addr31to0 |
  9766. * word 3 | |
  9767. * |----------------------------------------------------------------|
  9768. * | unused / reserved | mac_addr47to32 |
  9769. * word 4 | | |
  9770. * |----------------------------------------------------------------|
  9771. * | index |
  9772. * word 5 | |
  9773. * |----------------------------------------------------------------|
  9774. * | length |
  9775. * word 6 | |
  9776. * |----------------------------------------------------------------|
  9777. * | timestamp |
  9778. * word 7 | |
  9779. * |----------------------------------------------------------------|
  9780. * | counter |
  9781. * word 8 | |
  9782. * |----------------------------------------------------------------|
  9783. * | chan_mhz |
  9784. * word 9 | |
  9785. * |----------------------------------------------------------------|
  9786. * | band_center_freq1 |
  9787. * word 10 | |
  9788. * |----------------------------------------------------------------|
  9789. * | band_center_freq2 |
  9790. * word 11 | |
  9791. * |----------------------------------------------------------------|
  9792. * | chan_phy_mode |
  9793. * word 12 | |
  9794. * |----------------------------------------------------------------|
  9795. * where,
  9796. * P - payload present bit (payload_present explained below)
  9797. * req_id - memory request id (mem_req_id explained below)
  9798. * S - status field (status explained below)
  9799. * capbw - capture bandwidth (capture_bw explained below)
  9800. * mode - mode of capture (mode explained below)
  9801. * sts - space time streams (sts_count explained below)
  9802. * chbw - channel bandwidth (channel_bw explained below)
  9803. * captype - capture type (cap_type explained below)
  9804. *
  9805. * The following field definitions describe the format of the CFR dump
  9806. * completion indication sent from the target to the host
  9807. *
  9808. * Header fields:
  9809. *
  9810. * Word 0
  9811. * - msg_type
  9812. * Bits 7:0
  9813. * Purpose: Identifies this as CFR TX completion indication
  9814. * Value: HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  9815. * - payload_present
  9816. * Bit 8
  9817. * Purpose: Identifies how CFR data is sent to host
  9818. * Value: 0 - If CFR Payload is written to host memory
  9819. * 1 - If CFR Payload is sent as part of HTT message
  9820. * (This is the requirement for SDIO/USB where it is
  9821. * not possible to write CFR data to host memory)
  9822. * - reserved
  9823. * Bits 31:9
  9824. * Purpose: Reserved
  9825. * Value: 0
  9826. *
  9827. * Payload fields:
  9828. *
  9829. * Word 1
  9830. * - cfr_capture_msg_type
  9831. * Bits 31:0
  9832. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  9833. * to specify the format used for the remainder of the message
  9834. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  9835. * (currently only MSG_TYPE_1 is defined)
  9836. *
  9837. * Word 2
  9838. * - mem_req_id
  9839. * Bits 6:0
  9840. * Purpose: Contain the mem request id of the region where the CFR capture
  9841. * has been stored - of type WMI_HOST_MEM_REQ_ID
  9842. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  9843. this value is invalid)
  9844. * - status
  9845. * Bit 7
  9846. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  9847. * Value: 1 (True) - Successful; 0 (False) - Not successful
  9848. * - capture_bw
  9849. * Bits 10:8
  9850. * Purpose: Carry the bandwidth of the CFR capture
  9851. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  9852. * - mode
  9853. * Bits 13:11
  9854. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  9855. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  9856. * - sts_count
  9857. * Bits 16:14
  9858. * Purpose: Carry the number of space time streams
  9859. * Value: Number of space time streams
  9860. * - channel_bw
  9861. * Bits 19:17
  9862. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  9863. * measurement
  9864. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  9865. * - cap_type
  9866. * Bits 23:20
  9867. * Purpose: Carry the type of the capture
  9868. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  9869. * - vdev_id
  9870. * Bits 31:24
  9871. * Purpose: Carry the virtual device id
  9872. * Value: vdev ID
  9873. *
  9874. * Word 3
  9875. * - mac_addr31to0
  9876. * Bits 31:0
  9877. * Purpose: Contain the bits 31:0 of the peer MAC address
  9878. * Value: Bits 31:0 of the peer MAC address
  9879. *
  9880. * Word 4
  9881. * - mac_addr47to32
  9882. * Bits 15:0
  9883. * Purpose: Contain the bits 47:32 of the peer MAC address
  9884. * Value: Bits 47:32 of the peer MAC address
  9885. *
  9886. * Word 5
  9887. * - index
  9888. * Bits 31:0
  9889. * Purpose: Contain the index at which this CFR dump was written in the Host
  9890. * allocated memory. This index is the number of bytes from the base address.
  9891. * Value: Index position
  9892. *
  9893. * Word 6
  9894. * - length
  9895. * Bits 31:0
  9896. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  9897. * Value: Length of the CFR capture of the peer
  9898. *
  9899. * Word 7
  9900. * - timestamp
  9901. * Bits 31:0
  9902. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  9903. * clock used for this timestamp is private to the target and not visible to
  9904. * the host i.e., Host can interpret only the relative timestamp deltas from
  9905. * one message to the next, but can't interpret the absolute timestamp from a
  9906. * single message.
  9907. * Value: Timestamp in microseconds
  9908. *
  9909. * Word 8
  9910. * - counter
  9911. * Bits 31:0
  9912. * Purpose: Carry the count of the current CFR capture from FW. This is
  9913. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  9914. * in host memory)
  9915. * Value: Count of the current CFR capture
  9916. *
  9917. * Word 9
  9918. * - chan_mhz
  9919. * Bits 31:0
  9920. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  9921. * Value: Primary 20 channel frequency
  9922. *
  9923. * Word 10
  9924. * - band_center_freq1
  9925. * Bits 31:0
  9926. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  9927. * Value: Center frequency 1 in MHz
  9928. *
  9929. * Word 11
  9930. * - band_center_freq2
  9931. * Bits 31:0
  9932. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  9933. * the VDEV
  9934. * 80plus80 mode
  9935. * Value: Center frequency 2 in MHz
  9936. *
  9937. * Word 12
  9938. * - chan_phy_mode
  9939. * Bits 31:0
  9940. * Purpose: Carry the phy mode of the channel, of the VDEV
  9941. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  9942. */
  9943. PREPACK struct htt_cfr_dump_ind_type_1 {
  9944. A_UINT32 mem_req_id:7,
  9945. status:1,
  9946. capture_bw:3,
  9947. mode:3,
  9948. sts_count:3,
  9949. channel_bw:3,
  9950. cap_type:4,
  9951. vdev_id:8;
  9952. htt_mac_addr addr;
  9953. A_UINT32 index;
  9954. A_UINT32 length;
  9955. A_UINT32 timestamp;
  9956. A_UINT32 counter;
  9957. struct htt_chan_change_msg chan;
  9958. } POSTPACK;
  9959. PREPACK struct htt_cfr_dump_compl_ind {
  9960. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  9961. union {
  9962. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  9963. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  9964. /* If there is a need to change the memory layout and its associated
  9965. * HTT indication format, a new CFR capture message type can be
  9966. * introduced and added into this union.
  9967. */
  9968. };
  9969. } POSTPACK;
  9970. /*
  9971. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  9972. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  9973. */
  9974. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  9975. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  9976. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  9977. do { \
  9978. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  9979. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  9980. } while(0)
  9981. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  9982. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  9983. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  9984. /*
  9985. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  9986. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  9987. */
  9988. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  9989. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  9990. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  9991. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  9992. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  9993. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  9994. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  9995. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  9996. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  9997. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  9998. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  9999. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  10000. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  10001. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  10002. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  10003. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  10004. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  10005. do { \
  10006. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  10007. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  10008. } while (0)
  10009. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  10010. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  10011. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  10012. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  10013. do { \
  10014. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  10015. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  10016. } while (0)
  10017. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  10018. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  10019. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  10020. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  10021. do { \
  10022. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  10023. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  10024. } while (0)
  10025. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  10026. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  10027. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  10028. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  10029. do { \
  10030. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  10031. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  10032. } while (0)
  10033. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  10034. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  10035. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  10036. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  10037. do { \
  10038. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  10039. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  10040. } while (0)
  10041. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  10042. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  10043. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  10044. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  10045. do { \
  10046. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  10047. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  10048. } while (0)
  10049. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  10050. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  10051. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  10052. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  10053. do { \
  10054. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  10055. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  10056. } while (0)
  10057. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  10058. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  10059. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  10060. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  10061. do { \
  10062. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  10063. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  10064. } while (0)
  10065. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  10066. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  10067. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  10068. #endif