htt.h 468 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333
  1. /*
  2. * Copyright (c) 2011-2017 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. */
  160. #define HTT_CURRENT_VERSION_MAJOR 3
  161. #define HTT_CURRENT_VERSION_MINOR 48
  162. #define HTT_NUM_TX_FRAG_DESC 1024
  163. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  164. #define HTT_CHECK_SET_VAL(field, val) \
  165. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  166. /* macros to assist in sign-extending fields from HTT messages */
  167. #define HTT_SIGN_BIT_MASK(field) \
  168. ((field ## _M + (1 << field ## _S)) >> 1)
  169. #define HTT_SIGN_BIT(_val, field) \
  170. (_val & HTT_SIGN_BIT_MASK(field))
  171. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  172. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  173. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  174. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  175. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  176. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  177. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  178. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  179. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  180. /*
  181. * TEMPORARY:
  182. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  183. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  184. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  185. * updated.
  186. */
  187. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  188. /*
  189. * TEMPORARY:
  190. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  191. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  192. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  193. * updated.
  194. */
  195. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  196. /* HTT Access Category values */
  197. enum HTT_AC_WMM {
  198. /* WMM Access Categories */
  199. HTT_AC_WMM_BE = 0x0,
  200. HTT_AC_WMM_BK = 0x1,
  201. HTT_AC_WMM_VI = 0x2,
  202. HTT_AC_WMM_VO = 0x3,
  203. /* extension Access Categories */
  204. HTT_AC_EXT_NON_QOS = 0x4,
  205. HTT_AC_EXT_UCAST_MGMT = 0x5,
  206. HTT_AC_EXT_MCAST_DATA = 0x6,
  207. HTT_AC_EXT_MCAST_MGMT = 0x7,
  208. };
  209. enum HTT_AC_WMM_MASK {
  210. /* WMM Access Categories */
  211. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  212. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  213. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  214. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  215. /* extension Access Categories */
  216. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  217. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  218. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  219. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  220. };
  221. #define HTT_AC_MASK_WMM \
  222. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  223. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  224. #define HTT_AC_MASK_EXT \
  225. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  226. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  227. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  228. /*
  229. * htt_dbg_stats_type -
  230. * bit positions for each stats type within a stats type bitmask
  231. * The bitmask contains 24 bits.
  232. */
  233. enum htt_dbg_stats_type {
  234. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  235. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  236. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  237. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  238. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  239. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  240. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  241. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  242. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  243. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  244. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  245. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  246. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  247. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  248. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  249. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  250. /* bits 16-23 currently reserved */
  251. /* keep this last */
  252. HTT_DBG_NUM_STATS
  253. };
  254. /*=== HTT option selection TLVs ===
  255. * Certain HTT messages have alternatives or options.
  256. * For such cases, the host and target need to agree on which option to use.
  257. * Option specification TLVs can be appended to the VERSION_REQ and
  258. * VERSION_CONF messages to select options other than the default.
  259. * These TLVs are entirely optional - if they are not provided, there is a
  260. * well-defined default for each option. If they are provided, they can be
  261. * provided in any order. Each TLV can be present or absent independent of
  262. * the presence / absence of other TLVs.
  263. *
  264. * The HTT option selection TLVs use the following format:
  265. * |31 16|15 8|7 0|
  266. * |---------------------------------+----------------+----------------|
  267. * | value (payload) | length | tag |
  268. * |-------------------------------------------------------------------|
  269. * The value portion need not be only 2 bytes; it can be extended by any
  270. * integer number of 4-byte units. The total length of the TLV, including
  271. * the tag and length fields, must be a multiple of 4 bytes. The length
  272. * field specifies the total TLV size in 4-byte units. Thus, the typical
  273. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  274. * field, would store 0x1 in its length field, to show that the TLV occupies
  275. * a single 4-byte unit.
  276. */
  277. /*--- TLV header format - applies to all HTT option TLVs ---*/
  278. enum HTT_OPTION_TLV_TAGS {
  279. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  280. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  281. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  282. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  283. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  284. };
  285. PREPACK struct htt_option_tlv_header_t {
  286. A_UINT8 tag;
  287. A_UINT8 length;
  288. } POSTPACK;
  289. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  290. #define HTT_OPTION_TLV_TAG_S 0
  291. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  292. #define HTT_OPTION_TLV_LENGTH_S 8
  293. /*
  294. * value0 - 16 bit value field stored in word0
  295. * The TLV's value field may be longer than 2 bytes, in which case
  296. * the remainder of the value is stored in word1, word2, etc.
  297. */
  298. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  299. #define HTT_OPTION_TLV_VALUE0_S 16
  300. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  301. do { \
  302. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  303. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  304. } while (0)
  305. #define HTT_OPTION_TLV_TAG_GET(word) \
  306. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  307. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  308. do { \
  309. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  310. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  311. } while (0)
  312. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  313. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  314. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  315. do { \
  316. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  317. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  318. } while (0)
  319. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  320. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  321. /*--- format of specific HTT option TLVs ---*/
  322. /*
  323. * HTT option TLV for specifying LL bus address size
  324. * Some chips require bus addresses used by the target to access buffers
  325. * within the host's memory to be 32 bits; others require bus addresses
  326. * used by the target to access buffers within the host's memory to be
  327. * 64 bits.
  328. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  329. * a suffix to the VERSION_CONF message to specify which bus address format
  330. * the target requires.
  331. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  332. * default to providing bus addresses to the target in 32-bit format.
  333. */
  334. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  335. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  336. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  337. };
  338. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  339. struct htt_option_tlv_header_t hdr;
  340. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  341. } POSTPACK;
  342. /*
  343. * HTT option TLV for specifying whether HL systems should indicate
  344. * over-the-air tx completion for individual frames, or should instead
  345. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  346. * requests an OTA tx completion for a particular tx frame.
  347. * This option does not apply to LL systems, where the TX_COMPL_IND
  348. * is mandatory.
  349. * This option is primarily intended for HL systems in which the tx frame
  350. * downloads over the host --> target bus are as slow as or slower than
  351. * the transmissions over the WLAN PHY. For cases where the bus is faster
  352. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  353. * and consquently will send one TX_COMPL_IND message that covers several
  354. * tx frames. For cases where the WLAN PHY is faster than the bus,
  355. * the target will end up transmitting very short A-MPDUs, and consequently
  356. * sending many TX_COMPL_IND messages, which each cover a very small number
  357. * of tx frames.
  358. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  359. * a suffix to the VERSION_REQ message to request whether the host desires to
  360. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  361. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  362. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  363. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  364. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  365. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  366. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  367. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  368. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  369. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  370. * TLV.
  371. */
  372. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  373. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  374. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  375. };
  376. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  377. struct htt_option_tlv_header_t hdr;
  378. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  379. } POSTPACK;
  380. /*
  381. * HTT option TLV for specifying how many tx queue groups the target
  382. * may establish.
  383. * This TLV specifies the maximum value the target may send in the
  384. * txq_group_id field of any TXQ_GROUP information elements sent by
  385. * the target to the host. This allows the host to pre-allocate an
  386. * appropriate number of tx queue group structs.
  387. *
  388. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  389. * a suffix to the VERSION_REQ message to specify whether the host supports
  390. * tx queue groups at all, and if so if there is any limit on the number of
  391. * tx queue groups that the host supports.
  392. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  393. * a suffix to the VERSION_CONF message. If the host has specified in the
  394. * VER_REQ message a limit on the number of tx queue groups the host can
  395. * supprt, the target shall limit its specification of the maximum tx groups
  396. * to be no larger than this host-specified limit.
  397. *
  398. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  399. * shall preallocate 4 tx queue group structs, and the target shall not
  400. * specify a txq_group_id larger than 3.
  401. */
  402. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  403. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  404. /*
  405. * values 1 through N specify the max number of tx queue groups
  406. * the sender supports
  407. */
  408. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  409. };
  410. /* TEMPORARY backwards-compatibility alias for a typo fix -
  411. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  412. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  413. * to support the old name (with the typo) until all references to the
  414. * old name are replaced with the new name.
  415. */
  416. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  417. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  418. struct htt_option_tlv_header_t hdr;
  419. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  420. } POSTPACK;
  421. /*
  422. * HTT option TLV for specifying whether the target supports an extended
  423. * version of the HTT tx descriptor. If the target provides this TLV
  424. * and specifies in the TLV that the target supports an extended version
  425. * of the HTT tx descriptor, the target must check the "extension" bit in
  426. * the HTT tx descriptor, and if the extension bit is set, to expect a
  427. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  428. * descriptor. Furthermore, the target must provide room for the HTT
  429. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  430. * This option is intended for systems where the host needs to explicitly
  431. * control the transmission parameters such as tx power for individual
  432. * tx frames.
  433. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  434. * as a suffix to the VERSION_CONF message to explicitly specify whether
  435. * the target supports the HTT tx MSDU extension descriptor.
  436. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  437. * by the host as lack of target support for the HTT tx MSDU extension
  438. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  439. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  440. * the HTT tx MSDU extension descriptor.
  441. * The host is not required to provide the HTT tx MSDU extension descriptor
  442. * just because the target supports it; the target must check the
  443. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  444. * extension descriptor is present.
  445. */
  446. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  447. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  448. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  449. };
  450. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  451. struct htt_option_tlv_header_t hdr;
  452. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  453. } POSTPACK;
  454. /*=== host -> target messages ===============================================*/
  455. enum htt_h2t_msg_type {
  456. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  457. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  458. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  459. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  460. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  461. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  462. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  463. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  464. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  465. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  466. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  467. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  468. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  469. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  470. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  471. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  472. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  473. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  474. /* keep this last */
  475. HTT_H2T_NUM_MSGS
  476. };
  477. /*
  478. * HTT host to target message type -
  479. * stored in bits 7:0 of the first word of the message
  480. */
  481. #define HTT_H2T_MSG_TYPE_M 0xff
  482. #define HTT_H2T_MSG_TYPE_S 0
  483. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  484. do { \
  485. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  486. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  487. } while (0)
  488. #define HTT_H2T_MSG_TYPE_GET(word) \
  489. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  490. /**
  491. * @brief host -> target version number request message definition
  492. *
  493. * |31 24|23 16|15 8|7 0|
  494. * |----------------+----------------+----------------+----------------|
  495. * | reserved | msg type |
  496. * |-------------------------------------------------------------------|
  497. * : option request TLV (optional) |
  498. * :...................................................................:
  499. *
  500. * The VER_REQ message may consist of a single 4-byte word, or may be
  501. * extended with TLVs that specify which HTT options the host is requesting
  502. * from the target.
  503. * The following option TLVs may be appended to the VER_REQ message:
  504. * - HL_SUPPRESS_TX_COMPL_IND
  505. * - HL_MAX_TX_QUEUE_GROUPS
  506. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  507. * may be appended to the VER_REQ message (but only one TLV of each type).
  508. *
  509. * Header fields:
  510. * - MSG_TYPE
  511. * Bits 7:0
  512. * Purpose: identifies this as a version number request message
  513. * Value: 0x0
  514. */
  515. #define HTT_VER_REQ_BYTES 4
  516. /* TBDXXX: figure out a reasonable number */
  517. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  518. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  519. /**
  520. * @brief HTT tx MSDU descriptor
  521. *
  522. * @details
  523. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  524. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  525. * the target firmware needs for the FW's tx processing, particularly
  526. * for creating the HW msdu descriptor.
  527. * The same HTT tx descriptor is used for HL and LL systems, though
  528. * a few fields within the tx descriptor are used only by LL or
  529. * only by HL.
  530. * The HTT tx descriptor is defined in two manners: by a struct with
  531. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  532. * definitions.
  533. * The target should use the struct def, for simplicitly and clarity,
  534. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  535. * neutral. Specifically, the host shall use the get/set macros built
  536. * around the mask + shift defs.
  537. */
  538. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  539. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  540. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  541. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  542. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  543. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  544. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  545. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  546. #define HTT_TX_VDEV_ID_WORD 0
  547. #define HTT_TX_VDEV_ID_MASK 0x3f
  548. #define HTT_TX_VDEV_ID_SHIFT 16
  549. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  550. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  551. #define HTT_TX_MSDU_LEN_DWORD 1
  552. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  553. /*
  554. * HTT_VAR_PADDR macros
  555. * Allow physical / bus addresses to be either a single 32-bit value,
  556. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  557. */
  558. #define HTT_VAR_PADDR32(var_name) \
  559. A_UINT32 var_name
  560. #define HTT_VAR_PADDR64_LE(var_name) \
  561. struct { \
  562. /* little-endian: lo precedes hi */ \
  563. A_UINT32 lo; \
  564. A_UINT32 hi; \
  565. } var_name
  566. /*
  567. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  568. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  569. * addresses are stored in a XXX-bit field.
  570. * This macro is used to define both htt_tx_msdu_desc32_t and
  571. * htt_tx_msdu_desc64_t structs.
  572. */
  573. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  574. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  575. { \
  576. /* DWORD 0: flags and meta-data */ \
  577. A_UINT32 \
  578. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  579. \
  580. /* pkt_subtype - \
  581. * Detailed specification of the tx frame contents, extending the \
  582. * general specification provided by pkt_type. \
  583. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  584. * pkt_type | pkt_subtype \
  585. * ============================================================== \
  586. * 802.3 | bit 0:3 - Reserved \
  587. * | bit 4: 0x0 - Copy-Engine Classification Results \
  588. * | not appended to the HTT message \
  589. * | 0x1 - Copy-Engine Classification Results \
  590. * | appended to the HTT message in the \
  591. * | format: \
  592. * | [HTT tx desc, frame header, \
  593. * | CE classification results] \
  594. * | The CE classification results begin \
  595. * | at the next 4-byte boundary after \
  596. * | the frame header. \
  597. * ------------+------------------------------------------------- \
  598. * Eth2 | bit 0:3 - Reserved \
  599. * | bit 4: 0x0 - Copy-Engine Classification Results \
  600. * | not appended to the HTT message \
  601. * | 0x1 - Copy-Engine Classification Results \
  602. * | appended to the HTT message. \
  603. * | See the above specification of the \
  604. * | CE classification results location. \
  605. * ------------+------------------------------------------------- \
  606. * native WiFi | bit 0:3 - Reserved \
  607. * | bit 4: 0x0 - Copy-Engine Classification Results \
  608. * | not appended to the HTT message \
  609. * | 0x1 - Copy-Engine Classification Results \
  610. * | appended to the HTT message. \
  611. * | See the above specification of the \
  612. * | CE classification results location. \
  613. * ------------+------------------------------------------------- \
  614. * mgmt | 0x0 - 802.11 MAC header absent \
  615. * | 0x1 - 802.11 MAC header present \
  616. * ------------+------------------------------------------------- \
  617. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  618. * | 0x1 - 802.11 MAC header present \
  619. * | bit 1: 0x0 - allow aggregation \
  620. * | 0x1 - don't allow aggregation \
  621. * | bit 2: 0x0 - perform encryption \
  622. * | 0x1 - don't perform encryption \
  623. * | bit 3: 0x0 - perform tx classification / queuing \
  624. * | 0x1 - don't perform tx classification; \
  625. * | insert the frame into the "misc" \
  626. * | tx queue \
  627. * | bit 4: 0x0 - Copy-Engine Classification Results \
  628. * | not appended to the HTT message \
  629. * | 0x1 - Copy-Engine Classification Results \
  630. * | appended to the HTT message. \
  631. * | See the above specification of the \
  632. * | CE classification results location. \
  633. */ \
  634. pkt_subtype: 5, \
  635. \
  636. /* pkt_type - \
  637. * General specification of the tx frame contents. \
  638. * The htt_pkt_type enum should be used to specify and check the \
  639. * value of this field. \
  640. */ \
  641. pkt_type: 3, \
  642. \
  643. /* vdev_id - \
  644. * ID for the vdev that is sending this tx frame. \
  645. * For certain non-standard packet types, e.g. pkt_type == raw \
  646. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  647. * This field is used primarily for determining where to queue \
  648. * broadcast and multicast frames. \
  649. */ \
  650. vdev_id: 6, \
  651. /* ext_tid - \
  652. * The extended traffic ID. \
  653. * If the TID is unknown, the extended TID is set to \
  654. * HTT_TX_EXT_TID_INVALID. \
  655. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  656. * value of the QoS TID. \
  657. * If the tx frame is non-QoS data, then the extended TID is set to \
  658. * HTT_TX_EXT_TID_NON_QOS. \
  659. * If the tx frame is multicast or broadcast, then the extended TID \
  660. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  661. */ \
  662. ext_tid: 5, \
  663. \
  664. /* postponed - \
  665. * This flag indicates whether the tx frame has been downloaded to \
  666. * the target before but discarded by the target, and now is being \
  667. * downloaded again; or if this is a new frame that is being \
  668. * downloaded for the first time. \
  669. * This flag allows the target to determine the correct order for \
  670. * transmitting new vs. old frames. \
  671. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  672. * This flag only applies to HL systems, since in LL systems, \
  673. * the tx flow control is handled entirely within the target. \
  674. */ \
  675. postponed: 1, \
  676. \
  677. /* extension - \
  678. * This flag indicates whether a HTT tx MSDU extension descriptor \
  679. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  680. * \
  681. * 0x0 - no extension MSDU descriptor is present \
  682. * 0x1 - an extension MSDU descriptor immediately follows the \
  683. * regular MSDU descriptor \
  684. */ \
  685. extension: 1, \
  686. \
  687. /* cksum_offload - \
  688. * This flag indicates whether checksum offload is enabled or not \
  689. * for this frame. Target FW use this flag to turn on HW checksumming \
  690. * 0x0 - No checksum offload \
  691. * 0x1 - L3 header checksum only \
  692. * 0x2 - L4 checksum only \
  693. * 0x3 - L3 header checksum + L4 checksum \
  694. */ \
  695. cksum_offload: 2, \
  696. \
  697. /* tx_comp_req - \
  698. * This flag indicates whether Tx Completion \
  699. * from fw is required or not. \
  700. * This flag is only relevant if tx completion is not \
  701. * universally enabled. \
  702. * For all LL systems, tx completion is mandatory, \
  703. * so this flag will be irrelevant. \
  704. * For HL systems tx completion is optional, but HL systems in which \
  705. * the bus throughput exceeds the WLAN throughput will \
  706. * probably want to always use tx completion, and thus \
  707. * would not check this flag. \
  708. * This flag is required when tx completions are not used universally, \
  709. * but are still required for certain tx frames for which \
  710. * an OTA delivery acknowledgment is needed by the host. \
  711. * In practice, this would be for HL systems in which the \
  712. * bus throughput is less than the WLAN throughput. \
  713. * \
  714. * 0x0 - Tx Completion Indication from Fw not required \
  715. * 0x1 - Tx Completion Indication from Fw is required \
  716. */ \
  717. tx_compl_req: 1; \
  718. \
  719. \
  720. /* DWORD 1: MSDU length and ID */ \
  721. A_UINT32 \
  722. len: 16, /* MSDU length, in bytes */ \
  723. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  724. * and this id is used to calculate fragmentation \
  725. * descriptor pointer inside the target based on \
  726. * the base address, configured inside the target. \
  727. */ \
  728. \
  729. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  730. /* frags_desc_ptr - \
  731. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  732. * where the tx frame's fragments reside in memory. \
  733. * This field only applies to LL systems, since in HL systems the \
  734. * (degenerate single-fragment) fragmentation descriptor is created \
  735. * within the target. \
  736. */ \
  737. _paddr__frags_desc_ptr_; \
  738. \
  739. /* DWORD 3 (or 4): peerid, chanfreq */ \
  740. /* \
  741. * Peer ID : Target can use this value to know which peer-id packet \
  742. * destined to. \
  743. * It's intended to be specified by host in case of NAWDS. \
  744. */ \
  745. A_UINT16 peerid; \
  746. \
  747. /* \
  748. * Channel frequency: This identifies the desired channel \
  749. * frequency (in mhz) for tx frames. This is used by FW to help \
  750. * determine when it is safe to transmit or drop frames for \
  751. * off-channel operation. \
  752. * The default value of zero indicates to FW that the corresponding \
  753. * VDEV's home channel (if there is one) is the desired channel \
  754. * frequency. \
  755. */ \
  756. A_UINT16 chanfreq; \
  757. \
  758. /* Reason reserved is commented is increasing the htt structure size \
  759. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  760. * A_UINT32 reserved_dword3_bits0_31; \
  761. */ \
  762. } POSTPACK
  763. /* define a htt_tx_msdu_desc32_t type */
  764. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  765. /* define a htt_tx_msdu_desc64_t type */
  766. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  767. /*
  768. * Make htt_tx_msdu_desc_t be an alias for either
  769. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  770. */
  771. #if HTT_PADDR64
  772. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  773. #else
  774. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  775. #endif
  776. /* decriptor information for Management frame*/
  777. /*
  778. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  779. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  780. */
  781. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  782. extern A_UINT32 mgmt_hdr_len;
  783. PREPACK struct htt_mgmt_tx_desc_t {
  784. A_UINT32 msg_type;
  785. #if HTT_PADDR64
  786. A_UINT64 frag_paddr; /* DMAble address of the data */
  787. #else
  788. A_UINT32 frag_paddr; /* DMAble address of the data */
  789. #endif
  790. A_UINT32 desc_id; /* returned to host during completion
  791. * to free the meory*/
  792. A_UINT32 len; /* Fragment length */
  793. A_UINT32 vdev_id; /* virtual device ID*/
  794. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  795. } POSTPACK;
  796. PREPACK struct htt_mgmt_tx_compl_ind {
  797. A_UINT32 desc_id;
  798. A_UINT32 status;
  799. } POSTPACK;
  800. /*
  801. * This SDU header size comes from the summation of the following:
  802. * 1. Max of:
  803. * a. Native WiFi header, for native WiFi frames: 24 bytes
  804. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  805. * b. 802.11 header, for raw frames: 36 bytes
  806. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  807. * QoS header, HT header)
  808. * c. 802.3 header, for ethernet frames: 14 bytes
  809. * (destination address, source address, ethertype / length)
  810. * 2. Max of:
  811. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  812. * b. IPv6 header, up through the Traffic Class: 2 bytes
  813. * 3. 802.1Q VLAN header: 4 bytes
  814. * 4. LLC/SNAP header: 8 bytes
  815. */
  816. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  817. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  818. #define HTT_TX_HDR_SIZE_ETHERNET 14
  819. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  820. A_COMPILE_TIME_ASSERT(
  821. htt_encap_hdr_size_max_check_nwifi,
  822. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  823. A_COMPILE_TIME_ASSERT(
  824. htt_encap_hdr_size_max_check_enet,
  825. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  826. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  827. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  828. #define HTT_TX_HDR_SIZE_802_1Q 4
  829. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  830. #define HTT_COMMON_TX_FRM_HDR_LEN \
  831. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  832. HTT_TX_HDR_SIZE_802_1Q + \
  833. HTT_TX_HDR_SIZE_LLC_SNAP)
  834. #define HTT_HL_TX_FRM_HDR_LEN \
  835. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  836. #define HTT_LL_TX_FRM_HDR_LEN \
  837. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  838. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  839. /* dword 0 */
  840. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  841. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  842. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  843. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  844. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  845. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  846. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  847. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  848. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  849. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  850. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  851. #define HTT_TX_DESC_PKT_TYPE_S 13
  852. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  853. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  854. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  855. #define HTT_TX_DESC_VDEV_ID_S 16
  856. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  857. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  858. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  859. #define HTT_TX_DESC_EXT_TID_S 22
  860. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  861. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  862. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  863. #define HTT_TX_DESC_POSTPONED_S 27
  864. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  865. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  866. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  867. #define HTT_TX_DESC_EXTENSION_S 28
  868. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  869. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  870. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  871. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  872. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  873. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  874. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  875. #define HTT_TX_DESC_TX_COMP_S 31
  876. /* dword 1 */
  877. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  878. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  879. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  880. #define HTT_TX_DESC_FRM_LEN_S 0
  881. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  882. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  883. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  884. #define HTT_TX_DESC_FRM_ID_S 16
  885. /* dword 2 */
  886. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  887. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  888. /* for systems using 64-bit format for bus addresses */
  889. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  890. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  891. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  892. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  893. /* for systems using 32-bit format for bus addresses */
  894. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  895. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  896. /* dword 3 */
  897. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  898. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  899. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  900. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  901. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  902. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  903. #if HTT_PADDR64
  904. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  905. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  906. #else
  907. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  908. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  909. #endif
  910. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  911. #define HTT_TX_DESC_PEER_ID_S 0
  912. /*
  913. * TEMPORARY:
  914. * The original definitions for the PEER_ID fields contained typos
  915. * (with _DESC_PADDR appended to this PEER_ID field name).
  916. * Retain deprecated original names for PEER_ID fields until all code that
  917. * refers to them has been updated.
  918. */
  919. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  920. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  921. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  922. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  923. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  924. HTT_TX_DESC_PEER_ID_M
  925. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  926. HTT_TX_DESC_PEER_ID_S
  927. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  928. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  929. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  930. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  931. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  932. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  933. #if HTT_PADDR64
  934. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  935. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  936. #else
  937. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  938. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  939. #endif
  940. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  941. #define HTT_TX_DESC_CHAN_FREQ_S 16
  942. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  943. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  944. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  945. do { \
  946. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  947. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  948. } while (0)
  949. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  950. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  951. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  952. do { \
  953. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  954. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  955. } while (0)
  956. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  957. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  958. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  959. do { \
  960. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  961. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  962. } while (0)
  963. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  964. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  965. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  966. do { \
  967. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  968. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  969. } while (0)
  970. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  971. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  972. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  973. do { \
  974. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  975. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  976. } while (0)
  977. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  978. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  979. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  980. do { \
  981. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  982. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  983. } while (0)
  984. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  985. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  986. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  987. do { \
  988. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  989. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  990. } while (0)
  991. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  992. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  993. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  994. do { \
  995. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  996. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  997. } while (0)
  998. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  999. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1000. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1001. do { \
  1002. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1003. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1004. } while (0)
  1005. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1006. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1007. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1008. do { \
  1009. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1010. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1011. } while (0)
  1012. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1013. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1014. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1015. do { \
  1016. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1017. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1018. } while (0)
  1019. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1020. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1021. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1022. do { \
  1023. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1024. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1025. } while (0)
  1026. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1027. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1028. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1029. do { \
  1030. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1031. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1032. } while (0)
  1033. /* enums used in the HTT tx MSDU extension descriptor */
  1034. enum {
  1035. htt_tx_guard_interval_regular = 0,
  1036. htt_tx_guard_interval_short = 1,
  1037. };
  1038. enum {
  1039. htt_tx_preamble_type_ofdm = 0,
  1040. htt_tx_preamble_type_cck = 1,
  1041. htt_tx_preamble_type_ht = 2,
  1042. htt_tx_preamble_type_vht = 3,
  1043. };
  1044. enum {
  1045. htt_tx_bandwidth_5MHz = 0,
  1046. htt_tx_bandwidth_10MHz = 1,
  1047. htt_tx_bandwidth_20MHz = 2,
  1048. htt_tx_bandwidth_40MHz = 3,
  1049. htt_tx_bandwidth_80MHz = 4,
  1050. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1051. };
  1052. /**
  1053. * @brief HTT tx MSDU extension descriptor
  1054. * @details
  1055. * If the target supports HTT tx MSDU extension descriptors, the host has
  1056. * the option of appending the following struct following the regular
  1057. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1058. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1059. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1060. * tx specs for each frame.
  1061. */
  1062. PREPACK struct htt_tx_msdu_desc_ext_t {
  1063. /* DWORD 0: flags */
  1064. A_UINT32
  1065. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1066. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1067. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1068. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1069. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1070. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1071. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1072. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1073. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1074. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1075. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1076. /* DWORD 1: tx power, tx rate, tx BW */
  1077. A_UINT32
  1078. /* pwr -
  1079. * Specify what power the tx frame needs to be transmitted at.
  1080. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1081. * The value needs to be appropriately sign-extended when extracting
  1082. * the value from the message and storing it in a variable that is
  1083. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1084. * automatically handles this sign-extension.)
  1085. * If the transmission uses multiple tx chains, this power spec is
  1086. * the total transmit power, assuming incoherent combination of
  1087. * per-chain power to produce the total power.
  1088. */
  1089. pwr: 8,
  1090. /* mcs_mask -
  1091. * Specify the allowable values for MCS index (modulation and coding)
  1092. * to use for transmitting the frame.
  1093. *
  1094. * For HT / VHT preamble types, this mask directly corresponds to
  1095. * the HT or VHT MCS indices that are allowed. For each bit N set
  1096. * within the mask, MCS index N is allowed for transmitting the frame.
  1097. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1098. * rates versus OFDM rates, so the host has the option of specifying
  1099. * that the target must transmit the frame with CCK or OFDM rates
  1100. * (not HT or VHT), but leaving the decision to the target whether
  1101. * to use CCK or OFDM.
  1102. *
  1103. * For CCK and OFDM, the bits within this mask are interpreted as
  1104. * follows:
  1105. * bit 0 -> CCK 1 Mbps rate is allowed
  1106. * bit 1 -> CCK 2 Mbps rate is allowed
  1107. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1108. * bit 3 -> CCK 11 Mbps rate is allowed
  1109. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1110. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1111. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1112. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1113. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1114. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1115. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1116. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1117. *
  1118. * The MCS index specification needs to be compatible with the
  1119. * bandwidth mask specification. For example, a MCS index == 9
  1120. * specification is inconsistent with a preamble type == VHT,
  1121. * Nss == 1, and channel bandwidth == 20 MHz.
  1122. *
  1123. * Furthermore, the host has only a limited ability to specify to
  1124. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1125. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1126. */
  1127. mcs_mask: 12,
  1128. /* nss_mask -
  1129. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1130. * Each bit in this mask corresponds to a Nss value:
  1131. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1132. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1133. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1134. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1135. * The values in the Nss mask must be suitable for the recipient, e.g.
  1136. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1137. * recipient which only supports 2x2 MIMO.
  1138. */
  1139. nss_mask: 4,
  1140. /* guard_interval -
  1141. * Specify a htt_tx_guard_interval enum value to indicate whether
  1142. * the transmission should use a regular guard interval or a
  1143. * short guard interval.
  1144. */
  1145. guard_interval: 1,
  1146. /* preamble_type_mask -
  1147. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1148. * may choose from for transmitting this frame.
  1149. * The bits in this mask correspond to the values in the
  1150. * htt_tx_preamble_type enum. For example, to allow the target
  1151. * to transmit the frame as either CCK or OFDM, this field would
  1152. * be set to
  1153. * (1 << htt_tx_preamble_type_ofdm) |
  1154. * (1 << htt_tx_preamble_type_cck)
  1155. */
  1156. preamble_type_mask: 4,
  1157. reserved1_31_29: 3; /* unused, set to 0x0 */
  1158. /* DWORD 2: tx chain mask, tx retries */
  1159. A_UINT32
  1160. /* chain_mask - specify which chains to transmit from */
  1161. chain_mask: 4,
  1162. /* retry_limit -
  1163. * Specify the maximum number of transmissions, including the
  1164. * initial transmission, to attempt before giving up if no ack
  1165. * is received.
  1166. * If the tx rate is specified, then all retries shall use the
  1167. * same rate as the initial transmission.
  1168. * If no tx rate is specified, the target can choose whether to
  1169. * retain the original rate during the retransmissions, or to
  1170. * fall back to a more robust rate.
  1171. */
  1172. retry_limit: 4,
  1173. /* bandwidth_mask -
  1174. * Specify what channel widths may be used for the transmission.
  1175. * A value of zero indicates "don't care" - the target may choose
  1176. * the transmission bandwidth.
  1177. * The bits within this mask correspond to the htt_tx_bandwidth
  1178. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1179. * The bandwidth_mask must be consistent with the preamble_type_mask
  1180. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1181. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1182. */
  1183. bandwidth_mask: 6,
  1184. reserved2_31_14: 18; /* unused, set to 0x0 */
  1185. /* DWORD 3: tx expiry time (TSF) LSBs */
  1186. A_UINT32 expire_tsf_lo;
  1187. /* DWORD 4: tx expiry time (TSF) MSBs */
  1188. A_UINT32 expire_tsf_hi;
  1189. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1190. } POSTPACK;
  1191. /* DWORD 0 */
  1192. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1193. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1194. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1195. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1196. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1197. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1198. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1199. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1200. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1201. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1202. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1203. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1204. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1205. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1206. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1207. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1208. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1209. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1210. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1211. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1212. /* DWORD 1 */
  1213. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1214. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1215. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1216. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1217. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1218. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1219. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1220. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1221. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1222. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1223. /* DWORD 2 */
  1224. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1225. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1226. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1227. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1228. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1229. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1230. /* DWORD 0 */
  1231. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1232. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1233. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1234. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1235. do { \
  1236. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1237. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1238. } while (0)
  1239. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1240. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1241. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1242. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1243. do { \
  1244. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1245. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1246. } while (0)
  1247. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1248. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1249. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1250. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1251. do { \
  1252. HTT_CHECK_SET_VAL( \
  1253. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1254. ((_var) |= ((_val) \
  1255. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1256. } while (0)
  1257. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1258. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1259. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1260. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1261. do { \
  1262. HTT_CHECK_SET_VAL( \
  1263. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1264. ((_var) |= ((_val) \
  1265. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1266. } while (0)
  1267. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1268. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1269. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1270. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1271. do { \
  1272. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1273. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1274. } while (0)
  1275. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1276. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1277. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1278. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1279. do { \
  1280. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1281. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1282. } while (0)
  1283. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1284. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1285. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1286. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1287. do { \
  1288. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1289. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1290. } while (0)
  1291. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1292. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1293. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1294. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1295. do { \
  1296. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1297. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1298. } while (0)
  1299. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1300. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1301. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1302. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1303. do { \
  1304. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1305. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1306. } while (0)
  1307. /* DWORD 1 */
  1308. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1309. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1310. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1311. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1312. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1313. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1314. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1315. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1316. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1317. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1318. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1319. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1320. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1321. do { \
  1322. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1323. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1324. } while (0)
  1325. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1326. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1327. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1328. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1329. do { \
  1330. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1331. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1332. } while (0)
  1333. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1334. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1335. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1336. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1337. do { \
  1338. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1339. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1340. } while (0)
  1341. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1342. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1343. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1344. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1345. do { \
  1346. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1347. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1348. } while (0)
  1349. /* DWORD 2 */
  1350. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1351. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1352. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1353. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1354. do { \
  1355. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1356. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1357. } while (0)
  1358. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1359. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1360. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1361. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1362. do { \
  1363. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1364. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1365. } while (0)
  1366. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1367. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1368. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1369. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1370. do { \
  1371. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1372. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1373. } while (0)
  1374. typedef enum {
  1375. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1376. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1377. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1378. } htt_11ax_ltf_subtype_t;
  1379. typedef enum {
  1380. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1381. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1382. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1383. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1384. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1385. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1386. } htt_tx_ext2_preamble_type_t;
  1387. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1388. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1389. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1390. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1391. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1392. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1393. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1394. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1395. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1396. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1397. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1398. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1399. /**
  1400. * @brief HTT tx MSDU extension descriptor v2
  1401. * @details
  1402. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1403. * is received as tcl_exit_base->host_meta_info in firmware.
  1404. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1405. * are already part of tcl_exit_base.
  1406. */
  1407. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1408. /* DWORD 0: flags */
  1409. A_UINT32
  1410. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1411. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1412. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1413. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1414. valid_retries : 1, /* if set, tx retries spec is valid */
  1415. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1416. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1417. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1418. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1419. valid_key_flags : 1, /* if set, key flags is valid */
  1420. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1421. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1422. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1423. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1424. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1425. 1 = ENCRYPT,
  1426. 2 ~ 3 - Reserved */
  1427. /* retry_limit -
  1428. * Specify the maximum number of transmissions, including the
  1429. * initial transmission, to attempt before giving up if no ack
  1430. * is received.
  1431. * If the tx rate is specified, then all retries shall use the
  1432. * same rate as the initial transmission.
  1433. * If no tx rate is specified, the target can choose whether to
  1434. * retain the original rate during the retransmissions, or to
  1435. * fall back to a more robust rate.
  1436. */
  1437. retry_limit : 4,
  1438. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1439. * Valid only for 11ax preamble types HE_SU
  1440. * and HE_EXT_SU
  1441. */
  1442. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1443. * Valid only for 11ax preamble types HE_SU
  1444. * and HE_EXT_SU
  1445. */
  1446. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1447. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1448. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1449. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1450. */
  1451. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1452. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1453. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1454. * Use cases:
  1455. * Any time firmware uses TQM-BYPASS for Data
  1456. * TID, firmware expect host to set this bit.
  1457. */
  1458. /* DWORD 1: tx power, tx rate */
  1459. A_UINT32
  1460. power : 8, /* unit of the power field is 0.5 dbm
  1461. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1462. * signed value ranging from -64dbm to 63.5 dbm
  1463. */
  1464. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1465. * Setting more than one MCS isn't currently
  1466. * supported by the target (but is supported
  1467. * in the interface in case in the future
  1468. * the target supports specifications of
  1469. * a limited set of MCS values.
  1470. */
  1471. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1472. * Setting more than one Nss isn't currently
  1473. * supported by the target (but is supported
  1474. * in the interface in case in the future
  1475. * the target supports specifications of
  1476. * a limited set of Nss values.
  1477. */
  1478. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1479. update_peer_cache : 1; /* When set these custom values will be
  1480. * used for all packets, until the next
  1481. * update via this ext header.
  1482. * This is to make sure not all packets
  1483. * need to include this header.
  1484. */
  1485. /* DWORD 2: tx chain mask, tx retries */
  1486. A_UINT32
  1487. /* chain_mask - specify which chains to transmit from */
  1488. chain_mask : 8,
  1489. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1490. * TODO: Update Enum values for key_flags
  1491. */
  1492. /*
  1493. * Channel frequency: This identifies the desired channel
  1494. * frequency (in MHz) for tx frames. This is used by FW to help
  1495. * determine when it is safe to transmit or drop frames for
  1496. * off-channel operation.
  1497. * The default value of zero indicates to FW that the corresponding
  1498. * VDEV's home channel (if there is one) is the desired channel
  1499. * frequency.
  1500. */
  1501. chanfreq : 16;
  1502. /* DWORD 3: tx expiry time (TSF) LSBs */
  1503. A_UINT32 expire_tsf_lo;
  1504. /* DWORD 4: tx expiry time (TSF) MSBs */
  1505. A_UINT32 expire_tsf_hi;
  1506. /* DWORD 5: reserved
  1507. * This structure can be expanded further up to 60 bytes
  1508. * by adding further DWORDs as needed.
  1509. */
  1510. A_UINT32 rsvd0;
  1511. } POSTPACK;
  1512. /* DWORD 0 */
  1513. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1514. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1515. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1516. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1517. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1518. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1519. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1520. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1521. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1522. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1523. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1524. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1525. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1526. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1527. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1528. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1529. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1530. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1531. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1532. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1533. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1534. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1535. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1536. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1537. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1538. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1539. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1540. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1541. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1542. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1543. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1544. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1545. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1546. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1547. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1548. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1549. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1550. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1551. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1552. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1553. /* DWORD 1 */
  1554. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1555. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1556. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1557. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1558. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1559. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1560. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1561. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1562. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1563. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1564. /* DWORD 2 */
  1565. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1566. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1567. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1568. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1569. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1570. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1571. /* DWORD 0 */
  1572. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1573. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1574. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1575. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1576. do { \
  1577. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1578. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1579. } while (0)
  1580. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1581. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1582. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1583. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1584. do { \
  1585. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1586. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1587. } while (0)
  1588. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1589. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1590. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1591. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1592. do { \
  1593. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1594. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1595. } while (0)
  1596. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1597. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1598. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1599. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1600. do { \
  1601. HTT_CHECK_SET_VAL( \
  1602. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1603. ((_var) |= ((_val) \
  1604. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1605. } while (0)
  1606. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1607. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1608. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1609. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1610. do { \
  1611. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1612. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1613. } while (0)
  1614. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1615. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1616. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1617. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1618. do { \
  1619. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1620. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1621. } while (0)
  1622. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1623. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1624. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1625. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1626. do { \
  1627. HTT_CHECK_SET_VAL( \
  1628. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1629. ((_var) |= ((_val) \
  1630. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1631. } while (0)
  1632. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1633. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1634. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1635. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1636. do { \
  1637. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1638. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1639. } while (0)
  1640. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1641. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1642. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1643. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1644. do { \
  1645. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1646. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1647. } while (0)
  1648. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1649. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1650. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1651. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1652. do { \
  1653. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1654. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1655. } while (0)
  1656. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1657. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1658. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1659. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1660. do { \
  1661. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1662. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1663. } while (0)
  1664. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1665. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1666. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1667. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1668. do { \
  1669. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1670. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1671. } while (0)
  1672. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1673. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1674. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1675. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1676. do { \
  1677. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1678. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1679. } while (0)
  1680. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1681. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1682. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1683. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1684. do { \
  1685. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1686. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1687. } while (0)
  1688. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1689. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1690. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1691. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1692. do { \
  1693. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1694. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1695. } while (0)
  1696. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1697. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1698. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1699. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1700. do { \
  1701. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1702. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1703. } while (0)
  1704. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1705. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1706. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1707. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1708. do { \
  1709. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1710. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1711. } while (0)
  1712. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1713. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1714. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1715. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1716. do { \
  1717. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1718. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1719. } while (0)
  1720. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1721. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1722. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1723. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1724. do { \
  1725. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1726. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1727. } while (0)
  1728. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1729. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1730. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1731. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1732. do { \
  1733. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1734. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1735. } while (0)
  1736. /* DWORD 1 */
  1737. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1738. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1739. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1740. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1741. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1742. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1743. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1744. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1745. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1746. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1747. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1748. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1749. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1750. do { \
  1751. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1752. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1753. } while (0)
  1754. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1755. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1756. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1757. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1758. do { \
  1759. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1760. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1761. } while (0)
  1762. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1763. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1764. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1765. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1766. do { \
  1767. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1768. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1769. } while (0)
  1770. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1771. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1772. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1773. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1774. do { \
  1775. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1776. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1777. } while (0)
  1778. /* DWORD 2 */
  1779. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1780. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1781. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1782. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1783. do { \
  1784. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1785. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1786. } while (0)
  1787. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1788. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1789. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1790. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1791. do { \
  1792. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1793. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1794. } while (0)
  1795. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1796. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1797. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1798. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1799. do { \
  1800. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1801. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1802. } while (0)
  1803. typedef enum {
  1804. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1805. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1806. } htt_tcl_metadata_type;
  1807. /**
  1808. * @brief HTT TCL command number format
  1809. * @details
  1810. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1811. * available to firmware as tcl_exit_base->tcl_status_number.
  1812. * For regular / multicast packets host will send vdev and mac id and for
  1813. * NAWDS packets, host will send peer id.
  1814. * A_UINT32 is used to avoid endianness conversion problems.
  1815. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1816. */
  1817. typedef struct {
  1818. A_UINT32
  1819. type: 1, /* vdev_id based or peer_id based */
  1820. rsvd: 31;
  1821. } htt_tx_tcl_vdev_or_peer_t;
  1822. typedef struct {
  1823. A_UINT32
  1824. type: 1, /* vdev_id based or peer_id based */
  1825. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1826. vdev_id: 8,
  1827. pdev_id: 2,
  1828. host_inspected:1,
  1829. rsvd: 19;
  1830. } htt_tx_tcl_vdev_metadata;
  1831. typedef struct {
  1832. A_UINT32
  1833. type: 1, /* vdev_id based or peer_id based */
  1834. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1835. peer_id: 14,
  1836. rsvd: 16;
  1837. } htt_tx_tcl_peer_metadata;
  1838. PREPACK struct htt_tx_tcl_metadata {
  1839. union {
  1840. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1841. htt_tx_tcl_vdev_metadata vdev_meta;
  1842. htt_tx_tcl_peer_metadata peer_meta;
  1843. };
  1844. } POSTPACK;
  1845. /* DWORD 0 */
  1846. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1847. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1848. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1849. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1850. /* VDEV metadata */
  1851. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1852. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1853. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1854. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1855. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1856. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1857. /* PEER metadata */
  1858. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1859. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1860. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1861. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1862. HTT_TX_TCL_METADATA_TYPE_S)
  1863. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1864. do { \
  1865. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1866. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1867. } while (0)
  1868. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1869. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1870. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1871. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1872. do { \
  1873. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1874. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1875. } while (0)
  1876. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1877. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1878. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1879. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1880. do { \
  1881. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1882. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1883. } while (0)
  1884. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1885. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1886. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1887. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1888. do { \
  1889. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1890. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1891. } while (0)
  1892. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1893. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1894. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  1895. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  1896. do { \
  1897. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  1898. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  1899. } while (0)
  1900. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1901. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  1902. HTT_TX_TCL_METADATA_PEER_ID_S)
  1903. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  1904. do { \
  1905. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  1906. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  1907. } while (0)
  1908. typedef enum {
  1909. HTT_TX_FW2WBM_TX_STATUS_OK,
  1910. HTT_TX_FW2WBM_TX_STATUS_DROP,
  1911. HTT_TX_FW2WBM_TX_STATUS_TTL,
  1912. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  1913. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  1914. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  1915. HTT_TX_FW2WBM_TX_STATUS_MAX
  1916. } htt_tx_fw2wbm_tx_status_t;
  1917. typedef enum {
  1918. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  1919. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  1920. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  1921. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  1922. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  1923. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  1924. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  1925. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  1926. } htt_tx_fw2wbm_reinject_reason_t;
  1927. /**
  1928. * @brief HTT TX WBM Completion from firmware to host
  1929. * @details
  1930. * This structure is passed from firmware to host overlayed on wbm_release_ring
  1931. * DWORD 3 and 4 for software based completions (Exception frames and
  1932. * TQM bypass frames)
  1933. * For software based completions, wbm_release_ring->release_source_module will
  1934. * be set to release_source_fw
  1935. */
  1936. PREPACK struct htt_tx_wbm_completion {
  1937. A_UINT32
  1938. sch_cmd_id: 24,
  1939. exception_frame: 1, /* If set, this packet was queued via exception path */
  1940. rsvd0_31_25: 7;
  1941. A_UINT32
  1942. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  1943. * reception of an ACK or BA, this field indicates
  1944. * the RSSI of the received ACK or BA frame.
  1945. * When the frame is removed as result of a direct
  1946. * remove command from the SW, this field is set
  1947. * to 0x0 (which is never a valid value when real
  1948. * RSSI is available).
  1949. * Units: dB w.r.t noise floor
  1950. */
  1951. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  1952. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  1953. rsvd1_31_16: 16;
  1954. } POSTPACK;
  1955. /* DWORD 0 */
  1956. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  1957. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  1958. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  1959. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  1960. /* DWORD 1 */
  1961. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  1962. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  1963. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  1964. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  1965. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  1966. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  1967. /* DWORD 0 */
  1968. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  1969. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  1970. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  1971. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  1972. do { \
  1973. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  1974. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  1975. } while (0)
  1976. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  1977. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  1978. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  1979. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  1980. do { \
  1981. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  1982. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  1983. } while (0)
  1984. /* DWORD 1 */
  1985. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  1986. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  1987. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  1988. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  1989. do { \
  1990. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  1991. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  1992. } while (0)
  1993. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  1994. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  1995. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  1996. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  1997. do { \
  1998. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  1999. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2000. } while (0)
  2001. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2002. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2003. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2004. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2005. do { \
  2006. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2007. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2008. } while (0)
  2009. /**
  2010. * @brief HTT TX WBM Completion from firmware to host
  2011. * @details
  2012. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2013. * (WBM) offload HW.
  2014. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2015. * For software based completions, release_source_module will
  2016. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2017. * struct wbm_release_ring and then switch to this after looking at
  2018. * release_source_module.
  2019. */
  2020. PREPACK struct htt_tx_wbm_completion_v2 {
  2021. A_UINT32
  2022. used_by_hw0; /* Refer to struct wbm_release_ring */
  2023. A_UINT32
  2024. used_by_hw1; /* Refer to struct wbm_release_ring */
  2025. A_UINT32
  2026. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2027. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2028. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2029. exception_frame: 1,
  2030. rsvd0: 12, /* For future use */
  2031. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2032. rsvd1: 1; /* For future use */
  2033. A_UINT32
  2034. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2035. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2036. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2037. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2038. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2039. */
  2040. A_UINT32
  2041. data1: 32;
  2042. A_UINT32
  2043. data2: 32;
  2044. A_UINT32
  2045. used_by_hw3; /* Refer to struct wbm_release_ring */
  2046. } POSTPACK;
  2047. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2048. /* DWORD 3 */
  2049. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2050. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2051. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2052. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2053. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2054. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2055. /* DWORD 3 */
  2056. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2057. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2058. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2059. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2060. do { \
  2061. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2062. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2063. } while (0)
  2064. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2065. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2066. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2067. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2068. do { \
  2069. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2070. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2071. } while (0)
  2072. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2073. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2074. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2075. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2076. do { \
  2077. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2078. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2079. } while (0)
  2080. /**
  2081. * @brief HTT TX WBM transmit status from firmware to host
  2082. * @details
  2083. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2084. * (WBM) offload HW.
  2085. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2086. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2087. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2088. */
  2089. PREPACK struct htt_tx_wbm_transmit_status {
  2090. A_UINT32
  2091. sch_cmd_id: 24,
  2092. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2093. * reception of an ACK or BA, this field indicates
  2094. * the RSSI of the received ACK or BA frame.
  2095. * When the frame is removed as result of a direct
  2096. * remove command from the SW, this field is set
  2097. * to 0x0 (which is never a valid value when real
  2098. * RSSI is available).
  2099. * Units: dB w.r.t noise floor
  2100. */
  2101. A_UINT32
  2102. reserved0: 32;
  2103. A_UINT32
  2104. reserved1: 32;
  2105. } POSTPACK;
  2106. /* DWORD 4 */
  2107. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2108. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2109. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2110. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2111. /* DWORD 4 */
  2112. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2113. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2114. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2115. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2116. do { \
  2117. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2118. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2119. } while (0)
  2120. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2121. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2122. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2123. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2124. do { \
  2125. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2126. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2127. } while (0)
  2128. /**
  2129. * @brief HTT TX WBM reinject status from firmware to host
  2130. * @details
  2131. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2132. * (WBM) offload HW.
  2133. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2134. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2135. */
  2136. PREPACK struct htt_tx_wbm_reinject_status {
  2137. A_UINT32
  2138. reserved0: 32;
  2139. A_UINT32
  2140. reserved1: 32;
  2141. A_UINT32
  2142. reserved2: 32;
  2143. } POSTPACK;
  2144. /**
  2145. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2146. * @details
  2147. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2148. * (WBM) offload HW.
  2149. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2150. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2151. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2152. * STA side.
  2153. */
  2154. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2155. A_UINT32
  2156. mec_sa_addr_31_0;
  2157. A_UINT32
  2158. mec_sa_addr_47_32: 16,
  2159. sa_ast_index: 16;
  2160. A_UINT32
  2161. vdev_id: 8,
  2162. reserved0: 24;
  2163. } POSTPACK;
  2164. /* DWORD 4 - mec_sa_addr_31_0 */
  2165. /* DWORD 5 */
  2166. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2167. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2168. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2169. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2170. /* DWORD 6 */
  2171. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2172. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2173. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2174. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2175. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2176. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2177. do { \
  2178. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2179. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2180. } while (0)
  2181. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2182. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2183. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2184. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2185. do { \
  2186. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2187. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2188. } while (0)
  2189. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2190. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2191. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2192. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2193. do { \
  2194. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2195. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2196. } while (0)
  2197. typedef enum {
  2198. TX_FLOW_PRIORITY_BE,
  2199. TX_FLOW_PRIORITY_HIGH,
  2200. TX_FLOW_PRIORITY_LOW,
  2201. } htt_tx_flow_priority_t;
  2202. typedef enum {
  2203. TX_FLOW_LATENCY_SENSITIVE,
  2204. TX_FLOW_LATENCY_INSENSITIVE,
  2205. } htt_tx_flow_latency_t;
  2206. typedef enum {
  2207. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2208. TX_FLOW_INTERACTIVE_TRAFFIC,
  2209. TX_FLOW_PERIODIC_TRAFFIC,
  2210. TX_FLOW_BURSTY_TRAFFIC,
  2211. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2212. } htt_tx_flow_traffic_pattern_t;
  2213. /**
  2214. * @brief HTT TX Flow search metadata format
  2215. * @details
  2216. * Host will set this metadata in flow table's flow search entry along with
  2217. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2218. * firmware and TQM ring if the flow search entry wins.
  2219. * This metadata is available to firmware in that first MSDU's
  2220. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2221. * to one of the available flows for specific tid and returns the tqm flow
  2222. * pointer as part of htt_tx_map_flow_info message.
  2223. */
  2224. PREPACK struct htt_tx_flow_metadata {
  2225. A_UINT32
  2226. rsvd0_1_0: 2,
  2227. tid: 4,
  2228. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2229. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2230. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2231. * Else choose final tid based on latency, priority.
  2232. */
  2233. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2234. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2235. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2236. } POSTPACK;
  2237. /* DWORD 0 */
  2238. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2239. #define HTT_TX_FLOW_METADATA_TID_S 2
  2240. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2241. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2242. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2243. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2244. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2245. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2246. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2247. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2248. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2249. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2250. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2251. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2252. /* DWORD 0 */
  2253. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2254. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2255. HTT_TX_FLOW_METADATA_TID_S)
  2256. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2257. do { \
  2258. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2259. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2260. } while (0)
  2261. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2262. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2263. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2264. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2265. do { \
  2266. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2267. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2268. } while (0)
  2269. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2270. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2271. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2272. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2273. do { \
  2274. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2275. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2276. } while (0)
  2277. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2278. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2279. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2280. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2281. do { \
  2282. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2283. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2284. } while (0)
  2285. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2286. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2287. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2288. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2289. do { \
  2290. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2291. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2292. } while (0)
  2293. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2294. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2295. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2296. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2297. do { \
  2298. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2299. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2300. } while (0)
  2301. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2302. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2303. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2304. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2305. do { \
  2306. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2307. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2308. } while (0)
  2309. /**
  2310. * @brief Used in HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2311. *
  2312. * @details
  2313. * HTT wds entry from source port learning
  2314. * Host will learn wds entries from rx and send this message to firmware
  2315. * to enable firmware to configure/delete AST entries for wds clients.
  2316. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2317. * and when SA's entry is deleted, firmware removes this AST entry
  2318. *
  2319. * The message would appear as follows:
  2320. *
  2321. * |31 30|29 |17 16|15 8|7 0|
  2322. * |----------------+----------------+----------------+----------------|
  2323. * | rsvd0 |PDVID| vdev_id | msg_type |
  2324. * |-------------------------------------------------------------------|
  2325. * | sa_addr_31_0 |
  2326. * |-------------------------------------------------------------------|
  2327. * | | ta_peer_id | sa_addr_47_32 |
  2328. * |-------------------------------------------------------------------|
  2329. * Where PDVID = pdev_id
  2330. *
  2331. * The message is interpreted as follows:
  2332. *
  2333. * dword0 - b'0:7 - msg_type: This will be set to
  2334. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2335. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2336. *
  2337. * dword0 - b'8:15 - vdev_id
  2338. *
  2339. * dword0 - b'16:17 - pdev_id
  2340. *
  2341. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2342. *
  2343. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2344. *
  2345. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2346. *
  2347. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2348. */
  2349. PREPACK struct htt_wds_entry {
  2350. A_UINT32
  2351. msg_type: 8,
  2352. vdev_id: 8,
  2353. pdev_id: 2,
  2354. rsvd0: 14;
  2355. A_UINT32 sa_addr_31_0;
  2356. A_UINT32
  2357. sa_addr_47_32: 16,
  2358. ta_peer_id: 14,
  2359. rsvd2: 2;
  2360. } POSTPACK;
  2361. /* DWORD 0 */
  2362. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2363. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2364. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2365. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2366. /* DWORD 2 */
  2367. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2368. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2369. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2370. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2371. /* DWORD 0 */
  2372. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2373. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2374. HTT_WDS_ENTRY_VDEV_ID_S)
  2375. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2376. do { \
  2377. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2378. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2379. } while (0)
  2380. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2381. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2382. HTT_WDS_ENTRY_PDEV_ID_S)
  2383. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2384. do { \
  2385. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2386. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2387. } while (0)
  2388. /* DWORD 2 */
  2389. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2390. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2391. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2392. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2393. do { \
  2394. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2395. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2396. } while (0)
  2397. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2398. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2399. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2400. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2401. do { \
  2402. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2403. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2404. } while (0)
  2405. /**
  2406. * @brief MAC DMA rx ring setup specification
  2407. * @details
  2408. * To allow for dynamic rx ring reconfiguration and to avoid race
  2409. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2410. * it uses. Instead, it sends this message to the target, indicating how
  2411. * the rx ring used by the host should be set up and maintained.
  2412. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2413. * specifications.
  2414. *
  2415. * |31 16|15 8|7 0|
  2416. * |---------------------------------------------------------------|
  2417. * header: | reserved | num rings | msg type |
  2418. * |---------------------------------------------------------------|
  2419. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2420. #if HTT_PADDR64
  2421. * | FW_IDX shadow register physical address (bits 63:32) |
  2422. #endif
  2423. * |---------------------------------------------------------------|
  2424. * | rx ring base physical address (bits 31:0) |
  2425. #if HTT_PADDR64
  2426. * | rx ring base physical address (bits 63:32) |
  2427. #endif
  2428. * |---------------------------------------------------------------|
  2429. * | rx ring buffer size | rx ring length |
  2430. * |---------------------------------------------------------------|
  2431. * | FW_IDX initial value | enabled flags |
  2432. * |---------------------------------------------------------------|
  2433. * | MSDU payload offset | 802.11 header offset |
  2434. * |---------------------------------------------------------------|
  2435. * | PPDU end offset | PPDU start offset |
  2436. * |---------------------------------------------------------------|
  2437. * | MPDU end offset | MPDU start offset |
  2438. * |---------------------------------------------------------------|
  2439. * | MSDU end offset | MSDU start offset |
  2440. * |---------------------------------------------------------------|
  2441. * | frag info offset | rx attention offset |
  2442. * |---------------------------------------------------------------|
  2443. * payload 2, if present, has the same format as payload 1
  2444. * Header fields:
  2445. * - MSG_TYPE
  2446. * Bits 7:0
  2447. * Purpose: identifies this as an rx ring configuration message
  2448. * Value: 0x2
  2449. * - NUM_RINGS
  2450. * Bits 15:8
  2451. * Purpose: indicates whether the host is setting up one rx ring or two
  2452. * Value: 1 or 2
  2453. * Payload:
  2454. * for systems using 64-bit format for bus addresses:
  2455. * - IDX_SHADOW_REG_PADDR_LO
  2456. * Bits 31:0
  2457. * Value: lower 4 bytes of physical address of the host's
  2458. * FW_IDX shadow register
  2459. * - IDX_SHADOW_REG_PADDR_HI
  2460. * Bits 31:0
  2461. * Value: upper 4 bytes of physical address of the host's
  2462. * FW_IDX shadow register
  2463. * - RING_BASE_PADDR_LO
  2464. * Bits 31:0
  2465. * Value: lower 4 bytes of physical address of the host's rx ring
  2466. * - RING_BASE_PADDR_HI
  2467. * Bits 31:0
  2468. * Value: uppper 4 bytes of physical address of the host's rx ring
  2469. * for systems using 32-bit format for bus addresses:
  2470. * - IDX_SHADOW_REG_PADDR
  2471. * Bits 31:0
  2472. * Value: physical address of the host's FW_IDX shadow register
  2473. * - RING_BASE_PADDR
  2474. * Bits 31:0
  2475. * Value: physical address of the host's rx ring
  2476. * - RING_LEN
  2477. * Bits 15:0
  2478. * Value: number of elements in the rx ring
  2479. * - RING_BUF_SZ
  2480. * Bits 31:16
  2481. * Value: size of the buffers referenced by the rx ring, in byte units
  2482. * - ENABLED_FLAGS
  2483. * Bits 15:0
  2484. * Value: 1-bit flags to show whether different rx fields are enabled
  2485. * bit 0: 802.11 header enabled (1) or disabled (0)
  2486. * bit 1: MSDU payload enabled (1) or disabled (0)
  2487. * bit 2: PPDU start enabled (1) or disabled (0)
  2488. * bit 3: PPDU end enabled (1) or disabled (0)
  2489. * bit 4: MPDU start enabled (1) or disabled (0)
  2490. * bit 5: MPDU end enabled (1) or disabled (0)
  2491. * bit 6: MSDU start enabled (1) or disabled (0)
  2492. * bit 7: MSDU end enabled (1) or disabled (0)
  2493. * bit 8: rx attention enabled (1) or disabled (0)
  2494. * bit 9: frag info enabled (1) or disabled (0)
  2495. * bit 10: unicast rx enabled (1) or disabled (0)
  2496. * bit 11: multicast rx enabled (1) or disabled (0)
  2497. * bit 12: ctrl rx enabled (1) or disabled (0)
  2498. * bit 13: mgmt rx enabled (1) or disabled (0)
  2499. * bit 14: null rx enabled (1) or disabled (0)
  2500. * bit 15: phy data rx enabled (1) or disabled (0)
  2501. * - IDX_INIT_VAL
  2502. * Bits 31:16
  2503. * Purpose: Specify the initial value for the FW_IDX.
  2504. * Value: the number of buffers initially present in the host's rx ring
  2505. * - OFFSET_802_11_HDR
  2506. * Bits 15:0
  2507. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2508. * - OFFSET_MSDU_PAYLOAD
  2509. * Bits 31:16
  2510. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2511. * - OFFSET_PPDU_START
  2512. * Bits 15:0
  2513. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2514. * - OFFSET_PPDU_END
  2515. * Bits 31:16
  2516. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2517. * - OFFSET_MPDU_START
  2518. * Bits 15:0
  2519. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2520. * - OFFSET_MPDU_END
  2521. * Bits 31:16
  2522. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2523. * - OFFSET_MSDU_START
  2524. * Bits 15:0
  2525. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2526. * - OFFSET_MSDU_END
  2527. * Bits 31:16
  2528. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2529. * - OFFSET_RX_ATTN
  2530. * Bits 15:0
  2531. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2532. * - OFFSET_FRAG_INFO
  2533. * Bits 31:16
  2534. * Value: offset in QUAD-bytes of frag info table
  2535. */
  2536. /* header fields */
  2537. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2538. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2539. /* payload fields */
  2540. /* for systems using a 64-bit format for bus addresses */
  2541. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2542. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2543. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2544. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2545. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2546. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2547. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2548. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2549. /* for systems using a 32-bit format for bus addresses */
  2550. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2551. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2552. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2553. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2554. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2555. #define HTT_RX_RING_CFG_LEN_S 0
  2556. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2557. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2558. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2559. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2560. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2561. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2562. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2563. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2564. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2565. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2566. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2567. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2568. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2569. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2570. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2571. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2572. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2573. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2574. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2575. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2576. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2577. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2578. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2579. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2580. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2581. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2582. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2583. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2584. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2585. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2586. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2587. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2588. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2589. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2590. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2591. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2592. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2593. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2594. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2595. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2596. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2597. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2598. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2599. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2600. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2601. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2602. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2603. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2604. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2605. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2606. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2607. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2608. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2609. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2610. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2611. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2612. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2613. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2614. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2615. #if HTT_PADDR64
  2616. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2617. #else
  2618. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2619. #endif
  2620. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2621. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2622. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2623. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2624. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2625. do { \
  2626. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2627. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2628. } while (0)
  2629. /* degenerate case for 32-bit fields */
  2630. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2631. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2632. ((_var) = (_val))
  2633. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2634. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2635. ((_var) = (_val))
  2636. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2637. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2638. ((_var) = (_val))
  2639. /* degenerate case for 32-bit fields */
  2640. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2641. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2642. ((_var) = (_val))
  2643. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2644. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2645. ((_var) = (_val))
  2646. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2647. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2648. ((_var) = (_val))
  2649. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2650. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2651. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2652. do { \
  2653. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2654. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2655. } while (0)
  2656. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2657. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2658. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2659. do { \
  2660. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2661. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2662. } while (0)
  2663. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2664. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2665. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2666. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2667. do { \
  2668. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2669. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2670. } while (0)
  2671. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2672. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2673. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2674. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2675. do { \
  2676. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2677. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2678. } while (0)
  2679. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2680. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2681. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2682. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2683. do { \
  2684. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2685. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2686. } while (0)
  2687. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2688. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2689. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2690. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2691. do { \
  2692. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2693. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2694. } while (0)
  2695. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2696. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2697. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2698. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2699. do { \
  2700. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2701. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2702. } while (0)
  2703. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2704. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2705. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2706. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2707. do { \
  2708. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2709. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2710. } while (0)
  2711. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2712. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2713. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2714. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2715. do { \
  2716. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2717. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2718. } while (0)
  2719. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2720. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2721. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2722. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2723. do { \
  2724. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2725. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2726. } while (0)
  2727. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2728. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2729. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2730. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2731. do { \
  2732. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2733. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2734. } while (0)
  2735. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2736. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2737. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2738. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2739. do { \
  2740. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2741. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2742. } while (0)
  2743. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2744. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2745. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2746. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2747. do { \
  2748. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2749. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2750. } while (0)
  2751. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2752. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2753. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2754. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2755. do { \
  2756. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2757. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2758. } while (0)
  2759. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2760. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2761. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2762. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2763. do { \
  2764. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2765. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2766. } while (0)
  2767. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2768. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2769. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2770. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2771. do { \
  2772. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2773. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2774. } while (0)
  2775. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2776. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2777. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2778. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2779. do { \
  2780. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2781. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2782. } while (0)
  2783. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2784. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2785. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2786. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2787. do { \
  2788. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2789. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2790. } while (0)
  2791. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2792. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2793. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2794. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2795. do { \
  2796. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2797. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2798. } while (0)
  2799. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2800. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2801. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2802. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2803. do { \
  2804. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2805. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2806. } while (0)
  2807. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2808. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2809. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2810. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2811. do { \
  2812. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2813. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2814. } while (0)
  2815. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2816. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2817. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2818. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2819. do { \
  2820. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2821. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2822. } while (0)
  2823. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2824. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2825. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2826. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2827. do { \
  2828. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2829. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2830. } while (0)
  2831. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  2832. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  2833. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  2834. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  2835. do { \
  2836. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  2837. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  2838. } while (0)
  2839. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  2840. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  2841. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  2842. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  2843. do { \
  2844. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  2845. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  2846. } while (0)
  2847. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  2848. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  2849. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  2850. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  2851. do { \
  2852. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  2853. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  2854. } while (0)
  2855. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  2856. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  2857. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  2858. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  2859. do { \
  2860. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  2861. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  2862. } while (0)
  2863. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  2864. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  2865. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  2866. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  2867. do { \
  2868. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  2869. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  2870. } while (0)
  2871. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  2872. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  2873. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  2874. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  2875. do { \
  2876. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  2877. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  2878. } while (0)
  2879. /**
  2880. * @brief host -> target FW statistics retrieve
  2881. *
  2882. * @details
  2883. * The following field definitions describe the format of the HTT host
  2884. * to target FW stats retrieve message. The message specifies the type of
  2885. * stats host wants to retrieve.
  2886. *
  2887. * |31 24|23 16|15 8|7 0|
  2888. * |-----------------------------------------------------------|
  2889. * | stats types request bitmask | msg type |
  2890. * |-----------------------------------------------------------|
  2891. * | stats types reset bitmask | reserved |
  2892. * |-----------------------------------------------------------|
  2893. * | stats type | config value |
  2894. * |-----------------------------------------------------------|
  2895. * | cookie LSBs |
  2896. * |-----------------------------------------------------------|
  2897. * | cookie MSBs |
  2898. * |-----------------------------------------------------------|
  2899. * Header fields:
  2900. * - MSG_TYPE
  2901. * Bits 7:0
  2902. * Purpose: identifies this is a stats upload request message
  2903. * Value: 0x3
  2904. * - UPLOAD_TYPES
  2905. * Bits 31:8
  2906. * Purpose: identifies which types of FW statistics to upload
  2907. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  2908. * - RESET_TYPES
  2909. * Bits 31:8
  2910. * Purpose: identifies which types of FW statistics to reset
  2911. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  2912. * - CFG_VAL
  2913. * Bits 23:0
  2914. * Purpose: give an opaque configuration value to the specified stats type
  2915. * Value: stats-type specific configuration value
  2916. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  2917. * bits 7:0 - how many per-MPDU byte counts to include in a record
  2918. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  2919. * bits 23:16 - how many per-MSDU byte counts to include in a record
  2920. * - CFG_STAT_TYPE
  2921. * Bits 31:24
  2922. * Purpose: specify which stats type (if any) the config value applies to
  2923. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  2924. * a valid configuration specification
  2925. * - COOKIE_LSBS
  2926. * Bits 31:0
  2927. * Purpose: Provide a mechanism to match a target->host stats confirmation
  2928. * message with its preceding host->target stats request message.
  2929. * Value: LSBs of the opaque cookie specified by the host-side requestor
  2930. * - COOKIE_MSBS
  2931. * Bits 31:0
  2932. * Purpose: Provide a mechanism to match a target->host stats confirmation
  2933. * message with its preceding host->target stats request message.
  2934. * Value: MSBs of the opaque cookie specified by the host-side requestor
  2935. */
  2936. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  2937. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  2938. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  2939. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  2940. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  2941. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  2942. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  2943. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  2944. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  2945. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  2946. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  2947. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  2948. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  2949. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  2950. do { \
  2951. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  2952. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  2953. } while (0)
  2954. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  2955. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  2956. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  2957. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  2958. do { \
  2959. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  2960. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  2961. } while (0)
  2962. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  2963. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  2964. HTT_H2T_STATS_REQ_CFG_VAL_S)
  2965. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  2966. do { \
  2967. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  2968. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  2969. } while (0)
  2970. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  2971. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  2972. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  2973. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  2974. do { \
  2975. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  2976. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  2977. } while (0)
  2978. /**
  2979. * @brief host -> target HTT out-of-band sync request
  2980. *
  2981. * @details
  2982. * The HTT SYNC tells the target to suspend processing of subsequent
  2983. * HTT host-to-target messages until some other target agent locally
  2984. * informs the target HTT FW that the current sync counter is equal to
  2985. * or greater than (in a modulo sense) the sync counter specified in
  2986. * the SYNC message.
  2987. * This allows other host-target components to synchronize their operation
  2988. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  2989. * security key has been downloaded to and activated by the target.
  2990. * In the absence of any explicit synchronization counter value
  2991. * specification, the target HTT FW will use zero as the default current
  2992. * sync value.
  2993. *
  2994. * |31 24|23 16|15 8|7 0|
  2995. * |-----------------------------------------------------------|
  2996. * | reserved | sync count | msg type |
  2997. * |-----------------------------------------------------------|
  2998. * Header fields:
  2999. * - MSG_TYPE
  3000. * Bits 7:0
  3001. * Purpose: identifies this as a sync message
  3002. * Value: 0x4
  3003. * - SYNC_COUNT
  3004. * Bits 15:8
  3005. * Purpose: specifies what sync value the HTT FW will wait for from
  3006. * an out-of-band specification to resume its operation
  3007. * Value: in-band sync counter value to compare against the out-of-band
  3008. * counter spec.
  3009. * The HTT target FW will suspend its host->target message processing
  3010. * as long as
  3011. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3012. */
  3013. #define HTT_H2T_SYNC_MSG_SZ 4
  3014. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3015. #define HTT_H2T_SYNC_COUNT_S 8
  3016. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3017. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3018. HTT_H2T_SYNC_COUNT_S)
  3019. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3020. do { \
  3021. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3022. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3023. } while (0)
  3024. /**
  3025. * @brief HTT aggregation configuration
  3026. */
  3027. #define HTT_AGGR_CFG_MSG_SZ 4
  3028. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3029. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3030. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3031. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3032. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3033. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3034. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3035. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3036. do { \
  3037. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3038. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3039. } while (0)
  3040. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3041. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3042. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3043. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3044. do { \
  3045. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3046. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3047. } while (0)
  3048. /**
  3049. * @brief host -> target HTT configure max amsdu info per vdev
  3050. *
  3051. * @details
  3052. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3053. *
  3054. * |31 21|20 16|15 8|7 0|
  3055. * |-----------------------------------------------------------|
  3056. * | reserved | vdev id | max amsdu | msg type |
  3057. * |-----------------------------------------------------------|
  3058. * Header fields:
  3059. * - MSG_TYPE
  3060. * Bits 7:0
  3061. * Purpose: identifies this as a aggr cfg ex message
  3062. * Value: 0xa
  3063. * - MAX_NUM_AMSDU_SUBFRM
  3064. * Bits 15:8
  3065. * Purpose: max MSDUs per A-MSDU
  3066. * - VDEV_ID
  3067. * Bits 20:16
  3068. * Purpose: ID of the vdev to which this limit is applied
  3069. */
  3070. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3071. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3072. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3073. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3074. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3075. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3076. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3077. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3078. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3079. do { \
  3080. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3081. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3082. } while (0)
  3083. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3084. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3085. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3086. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3087. do { \
  3088. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3089. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3090. } while (0)
  3091. /**
  3092. * @brief HTT WDI_IPA Config Message
  3093. *
  3094. * @details
  3095. * The HTT WDI_IPA config message is created/sent by host at driver
  3096. * init time. It contains information about data structures used on
  3097. * WDI_IPA TX and RX path.
  3098. * TX CE ring is used for pushing packet metadata from IPA uC
  3099. * to WLAN FW
  3100. * TX Completion ring is used for generating TX completions from
  3101. * WLAN FW to IPA uC
  3102. * RX Indication ring is used for indicating RX packets from FW
  3103. * to IPA uC
  3104. * RX Ring2 is used as either completion ring or as second
  3105. * indication ring. when Ring2 is used as completion ring, IPA uC
  3106. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3107. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3108. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3109. * indicated in RX Indication ring. Please see WDI_IPA specification
  3110. * for more details.
  3111. * |31 24|23 16|15 8|7 0|
  3112. * |----------------+----------------+----------------+----------------|
  3113. * | tx pkt pool size | Rsvd | msg_type |
  3114. * |-------------------------------------------------------------------|
  3115. * | tx comp ring base (bits 31:0) |
  3116. #if HTT_PADDR64
  3117. * | tx comp ring base (bits 63:32) |
  3118. #endif
  3119. * |-------------------------------------------------------------------|
  3120. * | tx comp ring size |
  3121. * |-------------------------------------------------------------------|
  3122. * | tx comp WR_IDX physical address (bits 31:0) |
  3123. #if HTT_PADDR64
  3124. * | tx comp WR_IDX physical address (bits 63:32) |
  3125. #endif
  3126. * |-------------------------------------------------------------------|
  3127. * | tx CE WR_IDX physical address (bits 31:0) |
  3128. #if HTT_PADDR64
  3129. * | tx CE WR_IDX physical address (bits 63:32) |
  3130. #endif
  3131. * |-------------------------------------------------------------------|
  3132. * | rx indication ring base (bits 31:0) |
  3133. #if HTT_PADDR64
  3134. * | rx indication ring base (bits 63:32) |
  3135. #endif
  3136. * |-------------------------------------------------------------------|
  3137. * | rx indication ring size |
  3138. * |-------------------------------------------------------------------|
  3139. * | rx ind RD_IDX physical address (bits 31:0) |
  3140. #if HTT_PADDR64
  3141. * | rx ind RD_IDX physical address (bits 63:32) |
  3142. #endif
  3143. * |-------------------------------------------------------------------|
  3144. * | rx ind WR_IDX physical address (bits 31:0) |
  3145. #if HTT_PADDR64
  3146. * | rx ind WR_IDX physical address (bits 63:32) |
  3147. #endif
  3148. * |-------------------------------------------------------------------|
  3149. * |-------------------------------------------------------------------|
  3150. * | rx ring2 base (bits 31:0) |
  3151. #if HTT_PADDR64
  3152. * | rx ring2 base (bits 63:32) |
  3153. #endif
  3154. * |-------------------------------------------------------------------|
  3155. * | rx ring2 size |
  3156. * |-------------------------------------------------------------------|
  3157. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3158. #if HTT_PADDR64
  3159. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3160. #endif
  3161. * |-------------------------------------------------------------------|
  3162. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3163. #if HTT_PADDR64
  3164. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3165. #endif
  3166. * |-------------------------------------------------------------------|
  3167. *
  3168. * Header fields:
  3169. * Header fields:
  3170. * - MSG_TYPE
  3171. * Bits 7:0
  3172. * Purpose: Identifies this as WDI_IPA config message
  3173. * value: = 0x8
  3174. * - TX_PKT_POOL_SIZE
  3175. * Bits 15:0
  3176. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3177. * WDI_IPA TX path
  3178. * For systems using 32-bit format for bus addresses:
  3179. * - TX_COMP_RING_BASE_ADDR
  3180. * Bits 31:0
  3181. * Purpose: TX Completion Ring base address in DDR
  3182. * - TX_COMP_RING_SIZE
  3183. * Bits 31:0
  3184. * Purpose: TX Completion Ring size (must be power of 2)
  3185. * - TX_COMP_WR_IDX_ADDR
  3186. * Bits 31:0
  3187. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3188. * updates the Write Index for WDI_IPA TX completion ring
  3189. * - TX_CE_WR_IDX_ADDR
  3190. * Bits 31:0
  3191. * Purpose: DDR address where IPA uC
  3192. * updates the WR Index for TX CE ring
  3193. * (needed for fusion platforms)
  3194. * - RX_IND_RING_BASE_ADDR
  3195. * Bits 31:0
  3196. * Purpose: RX Indication Ring base address in DDR
  3197. * - RX_IND_RING_SIZE
  3198. * Bits 31:0
  3199. * Purpose: RX Indication Ring size
  3200. * - RX_IND_RD_IDX_ADDR
  3201. * Bits 31:0
  3202. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3203. * RX indication ring
  3204. * - RX_IND_WR_IDX_ADDR
  3205. * Bits 31:0
  3206. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3207. * updates the Write Index for WDI_IPA RX indication ring
  3208. * - RX_RING2_BASE_ADDR
  3209. * Bits 31:0
  3210. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3211. * - RX_RING2_SIZE
  3212. * Bits 31:0
  3213. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3214. * - RX_RING2_RD_IDX_ADDR
  3215. * Bits 31:0
  3216. * Purpose: If Second RX ring is Indication ring, DDR address where
  3217. * IPA uC updates the Read Index for Ring2.
  3218. * If Second RX ring is completion ring, this is NOT used
  3219. * - RX_RING2_WR_IDX_ADDR
  3220. * Bits 31:0
  3221. * Purpose: If Second RX ring is Indication ring, DDR address where
  3222. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3223. * If second RX ring is completion ring, DDR address where
  3224. * IPA uC updates the Write Index for Ring 2.
  3225. * For systems using 64-bit format for bus addresses:
  3226. * - TX_COMP_RING_BASE_ADDR_LO
  3227. * Bits 31:0
  3228. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3229. * - TX_COMP_RING_BASE_ADDR_HI
  3230. * Bits 31:0
  3231. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3232. * - TX_COMP_RING_SIZE
  3233. * Bits 31:0
  3234. * Purpose: TX Completion Ring size (must be power of 2)
  3235. * - TX_COMP_WR_IDX_ADDR_LO
  3236. * Bits 31:0
  3237. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3238. * Lower 4 bytes of DDR address where WIFI FW
  3239. * updates the Write Index for WDI_IPA TX completion ring
  3240. * - TX_COMP_WR_IDX_ADDR_HI
  3241. * Bits 31:0
  3242. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3243. * Higher 4 bytes of DDR address where WIFI FW
  3244. * updates the Write Index for WDI_IPA TX completion ring
  3245. * - TX_CE_WR_IDX_ADDR_LO
  3246. * Bits 31:0
  3247. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3248. * updates the WR Index for TX CE ring
  3249. * (needed for fusion platforms)
  3250. * - TX_CE_WR_IDX_ADDR_HI
  3251. * Bits 31:0
  3252. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3253. * updates the WR Index for TX CE ring
  3254. * (needed for fusion platforms)
  3255. * - RX_IND_RING_BASE_ADDR_LO
  3256. * Bits 31:0
  3257. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3258. * - RX_IND_RING_BASE_ADDR_HI
  3259. * Bits 31:0
  3260. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3261. * - RX_IND_RING_SIZE
  3262. * Bits 31:0
  3263. * Purpose: RX Indication Ring size
  3264. * - RX_IND_RD_IDX_ADDR_LO
  3265. * Bits 31:0
  3266. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3267. * for WDI_IPA RX indication ring
  3268. * - RX_IND_RD_IDX_ADDR_HI
  3269. * Bits 31:0
  3270. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3271. * for WDI_IPA RX indication ring
  3272. * - RX_IND_WR_IDX_ADDR_LO
  3273. * Bits 31:0
  3274. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3275. * Lower 4 bytes of DDR address where WIFI FW
  3276. * updates the Write Index for WDI_IPA RX indication ring
  3277. * - RX_IND_WR_IDX_ADDR_HI
  3278. * Bits 31:0
  3279. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3280. * Higher 4 bytes of DDR address where WIFI FW
  3281. * updates the Write Index for WDI_IPA RX indication ring
  3282. * - RX_RING2_BASE_ADDR_LO
  3283. * Bits 31:0
  3284. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3285. * - RX_RING2_BASE_ADDR_HI
  3286. * Bits 31:0
  3287. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3288. * - RX_RING2_SIZE
  3289. * Bits 31:0
  3290. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3291. * - RX_RING2_RD_IDX_ADDR_LO
  3292. * Bits 31:0
  3293. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3294. * DDR address where IPA uC updates the Read Index for Ring2.
  3295. * If Second RX ring is completion ring, this is NOT used
  3296. * - RX_RING2_RD_IDX_ADDR_HI
  3297. * Bits 31:0
  3298. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3299. * DDR address where IPA uC updates the Read Index for Ring2.
  3300. * If Second RX ring is completion ring, this is NOT used
  3301. * - RX_RING2_WR_IDX_ADDR_LO
  3302. * Bits 31:0
  3303. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3304. * DDR address where WIFI FW updates the Write Index
  3305. * for WDI_IPA RX ring2
  3306. * If second RX ring is completion ring, lower 4 bytes of
  3307. * DDR address where IPA uC updates the Write Index for Ring 2.
  3308. * - RX_RING2_WR_IDX_ADDR_HI
  3309. * Bits 31:0
  3310. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3311. * DDR address where WIFI FW updates the Write Index
  3312. * for WDI_IPA RX ring2
  3313. * If second RX ring is completion ring, higher 4 bytes of
  3314. * DDR address where IPA uC updates the Write Index for Ring 2.
  3315. */
  3316. #if HTT_PADDR64
  3317. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3318. #else
  3319. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3320. #endif
  3321. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3322. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3323. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3324. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3325. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3326. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3327. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3328. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3329. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3330. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3331. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3332. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3333. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3334. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3335. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3336. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3337. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3338. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3339. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3340. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3341. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3342. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3343. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3344. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3345. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3346. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3347. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3348. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3349. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3350. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3351. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3352. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3353. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3354. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3355. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3356. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3357. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3358. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3359. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3360. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3361. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3362. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3363. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3364. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3365. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3366. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3367. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3368. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3369. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3370. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3371. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3372. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3373. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3374. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3375. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3376. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3377. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3378. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3379. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3380. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3381. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3382. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3383. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3384. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3385. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3386. do { \
  3387. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3388. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3389. } while (0)
  3390. /* for systems using 32-bit format for bus addr */
  3391. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3392. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3393. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3394. do { \
  3395. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3396. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3397. } while (0)
  3398. /* for systems using 64-bit format for bus addr */
  3399. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3400. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3401. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3402. do { \
  3403. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3404. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3405. } while (0)
  3406. /* for systems using 64-bit format for bus addr */
  3407. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3408. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3409. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3410. do { \
  3411. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3412. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3413. } while (0)
  3414. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3415. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3416. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3417. do { \
  3418. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3419. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3420. } while (0)
  3421. /* for systems using 32-bit format for bus addr */
  3422. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3423. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3424. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3425. do { \
  3426. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3427. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3428. } while (0)
  3429. /* for systems using 64-bit format for bus addr */
  3430. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3431. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3432. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3433. do { \
  3434. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3435. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3436. } while (0)
  3437. /* for systems using 64-bit format for bus addr */
  3438. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3439. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3440. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3441. do { \
  3442. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3443. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3444. } while (0)
  3445. /* for systems using 32-bit format for bus addr */
  3446. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3447. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3448. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3449. do { \
  3450. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3451. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3452. } while (0)
  3453. /* for systems using 64-bit format for bus addr */
  3454. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3455. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3456. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3457. do { \
  3458. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3459. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3460. } while (0)
  3461. /* for systems using 64-bit format for bus addr */
  3462. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3463. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3464. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3465. do { \
  3466. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3467. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3468. } while (0)
  3469. /* for systems using 32-bit format for bus addr */
  3470. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3471. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3472. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3473. do { \
  3474. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3475. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3476. } while (0)
  3477. /* for systems using 64-bit format for bus addr */
  3478. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3479. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3480. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3481. do { \
  3482. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3483. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3484. } while (0)
  3485. /* for systems using 64-bit format for bus addr */
  3486. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3487. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3488. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3489. do { \
  3490. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3491. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3492. } while (0)
  3493. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3494. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3495. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3496. do { \
  3497. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3498. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3499. } while (0)
  3500. /* for systems using 32-bit format for bus addr */
  3501. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3502. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3503. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3504. do { \
  3505. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3506. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3507. } while (0)
  3508. /* for systems using 64-bit format for bus addr */
  3509. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3510. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3511. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3512. do { \
  3513. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3514. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3515. } while (0)
  3516. /* for systems using 64-bit format for bus addr */
  3517. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3518. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3519. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3520. do { \
  3521. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3522. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3523. } while (0)
  3524. /* for systems using 32-bit format for bus addr */
  3525. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3526. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3527. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3528. do { \
  3529. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3530. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3531. } while (0)
  3532. /* for systems using 64-bit format for bus addr */
  3533. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3534. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3535. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3536. do { \
  3537. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3538. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3539. } while (0)
  3540. /* for systems using 64-bit format for bus addr */
  3541. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3542. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3543. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3544. do { \
  3545. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3546. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3547. } while (0)
  3548. /* for systems using 32-bit format for bus addr */
  3549. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3550. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3551. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3552. do { \
  3553. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3554. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3555. } while (0)
  3556. /* for systems using 64-bit format for bus addr */
  3557. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3558. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3559. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3560. do { \
  3561. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3562. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3563. } while (0)
  3564. /* for systems using 64-bit format for bus addr */
  3565. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3566. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3567. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3568. do { \
  3569. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3570. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3571. } while (0)
  3572. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3573. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3574. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3575. do { \
  3576. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3577. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3578. } while (0)
  3579. /* for systems using 32-bit format for bus addr */
  3580. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3581. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3582. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3583. do { \
  3584. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3585. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3586. } while (0)
  3587. /* for systems using 64-bit format for bus addr */
  3588. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3589. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3590. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3591. do { \
  3592. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3593. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3594. } while (0)
  3595. /* for systems using 64-bit format for bus addr */
  3596. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3597. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3598. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3599. do { \
  3600. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3601. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3602. } while (0)
  3603. /* for systems using 32-bit format for bus addr */
  3604. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3605. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3606. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3607. do { \
  3608. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3609. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3610. } while (0)
  3611. /* for systems using 64-bit format for bus addr */
  3612. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3613. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3614. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3615. do { \
  3616. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3617. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3618. } while (0)
  3619. /* for systems using 64-bit format for bus addr */
  3620. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3621. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3622. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3623. do { \
  3624. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3625. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3626. } while (0)
  3627. /*
  3628. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3629. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3630. * addresses are stored in a XXX-bit field.
  3631. * This macro is used to define both htt_wdi_ipa_config32_t and
  3632. * htt_wdi_ipa_config64_t structs.
  3633. */
  3634. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3635. _paddr__tx_comp_ring_base_addr_, \
  3636. _paddr__tx_comp_wr_idx_addr_, \
  3637. _paddr__tx_ce_wr_idx_addr_, \
  3638. _paddr__rx_ind_ring_base_addr_, \
  3639. _paddr__rx_ind_rd_idx_addr_, \
  3640. _paddr__rx_ind_wr_idx_addr_, \
  3641. _paddr__rx_ring2_base_addr_,\
  3642. _paddr__rx_ring2_rd_idx_addr_,\
  3643. _paddr__rx_ring2_wr_idx_addr_) \
  3644. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3645. { \
  3646. /* DWORD 0: flags and meta-data */ \
  3647. A_UINT32 \
  3648. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3649. reserved: 8, \
  3650. tx_pkt_pool_size: 16;\
  3651. /* DWORD 1 */\
  3652. _paddr__tx_comp_ring_base_addr_;\
  3653. /* DWORD 2 (or 3)*/\
  3654. A_UINT32 tx_comp_ring_size;\
  3655. /* DWORD 3 (or 4)*/\
  3656. _paddr__tx_comp_wr_idx_addr_;\
  3657. /* DWORD 4 (or 6)*/\
  3658. _paddr__tx_ce_wr_idx_addr_;\
  3659. /* DWORD 5 (or 8)*/\
  3660. _paddr__rx_ind_ring_base_addr_;\
  3661. /* DWORD 6 (or 10)*/\
  3662. A_UINT32 rx_ind_ring_size;\
  3663. /* DWORD 7 (or 11)*/\
  3664. _paddr__rx_ind_rd_idx_addr_;\
  3665. /* DWORD 8 (or 13)*/\
  3666. _paddr__rx_ind_wr_idx_addr_;\
  3667. /* DWORD 9 (or 15)*/\
  3668. _paddr__rx_ring2_base_addr_;\
  3669. /* DWORD 10 (or 17) */\
  3670. A_UINT32 rx_ring2_size;\
  3671. /* DWORD 11 (or 18) */\
  3672. _paddr__rx_ring2_rd_idx_addr_;\
  3673. /* DWORD 12 (or 20) */\
  3674. _paddr__rx_ring2_wr_idx_addr_;\
  3675. } POSTPACK
  3676. /* define a htt_wdi_ipa_config32_t type */
  3677. 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));
  3678. /* define a htt_wdi_ipa_config64_t type */
  3679. 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));
  3680. #if HTT_PADDR64
  3681. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3682. #else
  3683. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3684. #endif
  3685. enum htt_wdi_ipa_op_code {
  3686. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3687. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3688. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3689. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3690. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3691. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3692. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3693. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3694. /* keep this last */
  3695. HTT_WDI_IPA_OPCODE_MAX
  3696. };
  3697. /**
  3698. * @brief HTT WDI_IPA Operation Request Message
  3699. *
  3700. * @details
  3701. * HTT WDI_IPA Operation Request message is sent by host
  3702. * to either suspend or resume WDI_IPA TX or RX path.
  3703. * |31 24|23 16|15 8|7 0|
  3704. * |----------------+----------------+----------------+----------------|
  3705. * | op_code | Rsvd | msg_type |
  3706. * |-------------------------------------------------------------------|
  3707. *
  3708. * Header fields:
  3709. * - MSG_TYPE
  3710. * Bits 7:0
  3711. * Purpose: Identifies this as WDI_IPA Operation Request message
  3712. * value: = 0x9
  3713. * - OP_CODE
  3714. * Bits 31:16
  3715. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3716. * value: = enum htt_wdi_ipa_op_code
  3717. */
  3718. PREPACK struct htt_wdi_ipa_op_request_t
  3719. {
  3720. /* DWORD 0: flags and meta-data */
  3721. A_UINT32
  3722. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3723. reserved: 8,
  3724. op_code: 16;
  3725. } POSTPACK;
  3726. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3727. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3728. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3729. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3730. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3731. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3732. do { \
  3733. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3734. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3735. } while (0)
  3736. /*
  3737. * @brief host -> target HTT_SRING_SETUP message
  3738. *
  3739. * @details
  3740. * After target is booted up, Host can send SRING setup message for
  3741. * each host facing LMAC SRING. Target setups up HW registers based
  3742. * on setup message and confirms back to Host if response_required is set.
  3743. * Host should wait for confirmation message before sending new SRING
  3744. * setup message
  3745. *
  3746. * The message would appear as follows:
  3747. * |31 24|23 20|19|18 16|15|14 8|7 0|
  3748. * |--------------- +-----------------+----------------+------------------|
  3749. * | ring_type | ring_id | pdev_id | msg_type |
  3750. * |----------------------------------------------------------------------|
  3751. * | ring_base_addr_lo |
  3752. * |----------------------------------------------------------------------|
  3753. * | ring_base_addr_hi |
  3754. * |----------------------------------------------------------------------|
  3755. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3756. * |----------------------------------------------------------------------|
  3757. * | ring_head_offset32_remote_addr_lo |
  3758. * |----------------------------------------------------------------------|
  3759. * | ring_head_offset32_remote_addr_hi |
  3760. * |----------------------------------------------------------------------|
  3761. * | ring_tail_offset32_remote_addr_lo |
  3762. * |----------------------------------------------------------------------|
  3763. * | ring_tail_offset32_remote_addr_hi |
  3764. * |----------------------------------------------------------------------|
  3765. * | ring_msi_addr_lo |
  3766. * |----------------------------------------------------------------------|
  3767. * | ring_msi_addr_hi |
  3768. * |----------------------------------------------------------------------|
  3769. * | ring_msi_data |
  3770. * |----------------------------------------------------------------------|
  3771. * | intr_timer_th |IM| intr_batch_counter_th |
  3772. * |----------------------------------------------------------------------|
  3773. * | reserved |RR|PTCF| intr_low_threshold |
  3774. * |----------------------------------------------------------------------|
  3775. * Where
  3776. * IM = sw_intr_mode
  3777. * RR = response_required
  3778. * PTCF = prefetch_timer_cfg
  3779. *
  3780. * The message is interpreted as follows:
  3781. * dword0 - b'0:7 - msg_type: This will be set to
  3782. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3783. * b'8:15 - pdev_id:
  3784. * 0 (for rings at SOC/UMAC level),
  3785. * 1/2/3 mac id (for rings at LMAC level)
  3786. * b'16:23 - ring_id: identify which ring is to setup,
  3787. * more details can be got from enum htt_srng_ring_id
  3788. * b'24:31 - ring_type: identify type of host rings,
  3789. * more details can be got from enum htt_srng_ring_type
  3790. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3791. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3792. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3793. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3794. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3795. * SW_TO_HW_RING.
  3796. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3797. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3798. * Lower 32 bits of memory address of the remote variable
  3799. * storing the 4-byte word offset that identifies the head
  3800. * element within the ring.
  3801. * (The head offset variable has type A_UINT32.)
  3802. * Valid for HW_TO_SW and SW_TO_SW rings.
  3803. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3804. * Upper 32 bits of memory address of the remote variable
  3805. * storing the 4-byte word offset that identifies the head
  3806. * element within the ring.
  3807. * (The head offset variable has type A_UINT32.)
  3808. * Valid for HW_TO_SW and SW_TO_SW rings.
  3809. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3810. * Lower 32 bits of memory address of the remote variable
  3811. * storing the 4-byte word offset that identifies the tail
  3812. * element within the ring.
  3813. * (The tail offset variable has type A_UINT32.)
  3814. * Valid for HW_TO_SW and SW_TO_SW rings.
  3815. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3816. * Upper 32 bits of memory address of the remote variable
  3817. * storing the 4-byte word offset that identifies the tail
  3818. * element within the ring.
  3819. * (The tail offset variable has type A_UINT32.)
  3820. * Valid for HW_TO_SW and SW_TO_SW rings.
  3821. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  3822. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3823. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  3824. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3825. * dword10 - b'0:31 - ring_msi_data: MSI data
  3826. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  3827. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3828. * dword11 - b'0:14 - intr_batch_counter_th:
  3829. * batch counter threshold is in units of 4-byte words.
  3830. * HW internally maintains and increments batch count.
  3831. * (see SRING spec for detail description).
  3832. * When batch count reaches threshold value, an interrupt
  3833. * is generated by HW.
  3834. * b'15 - sw_intr_mode:
  3835. * This configuration shall be static.
  3836. * Only programmed at power up.
  3837. * 0: generate pulse style sw interrupts
  3838. * 1: generate level style sw interrupts
  3839. * b'16:31 - intr_timer_th:
  3840. * The timer init value when timer is idle or is
  3841. * initialized to start downcounting.
  3842. * In 8us units (to cover a range of 0 to 524 ms)
  3843. * dword12 - b'0:15 - intr_low_threshold:
  3844. * Used only by Consumer ring to generate ring_sw_int_p.
  3845. * Ring entries low threshold water mark, that is used
  3846. * in combination with the interrupt timer as well as
  3847. * the the clearing of the level interrupt.
  3848. * b'16:18 - prefetch_timer_cfg:
  3849. * Used only by Consumer ring to set timer mode to
  3850. * support Application prefetch handling.
  3851. * The external tail offset/pointer will be updated
  3852. * at following intervals:
  3853. * 3'b000: (Prefetch feature disabled; used only for debug)
  3854. * 3'b001: 1 usec
  3855. * 3'b010: 4 usec
  3856. * 3'b011: 8 usec (default)
  3857. * 3'b100: 16 usec
  3858. * Others: Reserverd
  3859. * b'19 - response_required:
  3860. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  3861. * b'20:31 - reserved: reserved for future use
  3862. */
  3863. PREPACK struct htt_sring_setup_t {
  3864. A_UINT32 msg_type: 8,
  3865. pdev_id: 8,
  3866. ring_id: 8,
  3867. ring_type: 8;
  3868. A_UINT32 ring_base_addr_lo;
  3869. A_UINT32 ring_base_addr_hi;
  3870. A_UINT32 ring_size: 16,
  3871. ring_entry_size: 8,
  3872. ring_misc_cfg_flag: 8;
  3873. A_UINT32 ring_head_offset32_remote_addr_lo;
  3874. A_UINT32 ring_head_offset32_remote_addr_hi;
  3875. A_UINT32 ring_tail_offset32_remote_addr_lo;
  3876. A_UINT32 ring_tail_offset32_remote_addr_hi;
  3877. A_UINT32 ring_msi_addr_lo;
  3878. A_UINT32 ring_msi_addr_hi;
  3879. A_UINT32 ring_msi_data;
  3880. A_UINT32 intr_batch_counter_th: 15,
  3881. sw_intr_mode: 1,
  3882. intr_timer_th: 16;
  3883. A_UINT32 intr_low_threshold: 16,
  3884. prefetch_timer_cfg: 3,
  3885. response_required: 1,
  3886. reserved1: 12;
  3887. } POSTPACK;
  3888. enum htt_srng_ring_type {
  3889. HTT_HW_TO_SW_RING = 0,
  3890. HTT_SW_TO_HW_RING,
  3891. HTT_SW_TO_SW_RING,
  3892. /* Insert new ring types above this line */
  3893. };
  3894. enum htt_srng_ring_id {
  3895. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  3896. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  3897. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  3898. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  3899. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  3900. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  3901. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  3902. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  3903. /* Add Other SRING which can't be directly configured by host software above this line */
  3904. };
  3905. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  3906. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  3907. #define HTT_SRING_SETUP_PDEV_ID_S 8
  3908. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  3909. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  3910. HTT_SRING_SETUP_PDEV_ID_S)
  3911. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  3912. do { \
  3913. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  3914. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  3915. } while (0)
  3916. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  3917. #define HTT_SRING_SETUP_RING_ID_S 16
  3918. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  3919. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  3920. HTT_SRING_SETUP_RING_ID_S)
  3921. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  3922. do { \
  3923. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  3924. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  3925. } while (0)
  3926. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  3927. #define HTT_SRING_SETUP_RING_TYPE_S 24
  3928. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  3929. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  3930. HTT_SRING_SETUP_RING_TYPE_S)
  3931. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  3932. do { \
  3933. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  3934. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  3935. } while (0)
  3936. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  3937. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  3938. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  3939. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  3940. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  3941. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3942. do { \
  3943. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  3944. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  3945. } while (0)
  3946. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  3947. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  3948. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  3949. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  3950. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  3951. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3952. do { \
  3953. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  3954. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  3955. } while (0)
  3956. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  3957. #define HTT_SRING_SETUP_RING_SIZE_S 0
  3958. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  3959. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  3960. HTT_SRING_SETUP_RING_SIZE_S)
  3961. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  3962. do { \
  3963. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  3964. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  3965. } while (0)
  3966. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  3967. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  3968. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  3969. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  3970. HTT_SRING_SETUP_ENTRY_SIZE_S)
  3971. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  3972. do { \
  3973. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  3974. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  3975. } while (0)
  3976. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  3977. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  3978. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  3979. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  3980. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  3981. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  3982. do { \
  3983. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  3984. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  3985. } while (0)
  3986. /* This control bit is applicable to only Producer, which updates Ring ID field
  3987. * of each descriptor before pushing into the ring.
  3988. * 0: updates ring_id(default)
  3989. * 1: ring_id updating disabled */
  3990. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  3991. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  3992. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  3993. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  3994. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  3995. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  3996. do { \
  3997. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  3998. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  3999. } while (0)
  4000. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4001. * of each descriptor before pushing into the ring.
  4002. * 0: updates Loopcnt(default)
  4003. * 1: Loopcnt updating disabled */
  4004. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4005. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4006. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4007. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4008. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4009. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4010. do { \
  4011. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4012. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4013. } while (0)
  4014. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4015. * into security_id port of GXI/AXI. */
  4016. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4017. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4018. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4019. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4020. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4021. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4022. do { \
  4023. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4024. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4025. } while (0)
  4026. /* During MSI write operation, SRNG drives value of this register bit into
  4027. * swap bit of GXI/AXI. */
  4028. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4029. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4030. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4031. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4032. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4033. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4034. do { \
  4035. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4036. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4037. } while (0)
  4038. /* During Pointer write operation, SRNG drives value of this register bit into
  4039. * swap bit of GXI/AXI. */
  4040. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4041. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4042. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4043. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4044. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4045. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4046. do { \
  4047. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4048. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4049. } while (0)
  4050. /* During any data or TLV write operation, SRNG drives value of this register
  4051. * bit into swap bit of GXI/AXI. */
  4052. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4053. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4054. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4055. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4056. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4057. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4058. do { \
  4059. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4060. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4061. } while (0)
  4062. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4063. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4064. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4065. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4066. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4067. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4068. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4069. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4070. do { \
  4071. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4072. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4073. } while (0)
  4074. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4075. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4076. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4077. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4078. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4079. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4080. do { \
  4081. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4082. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4083. } while (0)
  4084. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4085. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4086. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4087. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4088. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4089. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4090. do { \
  4091. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4092. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4093. } while (0)
  4094. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4095. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4096. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4097. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4098. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4099. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4100. do { \
  4101. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4102. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4103. } while (0)
  4104. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4105. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4106. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4107. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4108. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4109. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4110. do { \
  4111. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4112. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4113. } while (0)
  4114. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4115. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4116. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4117. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4118. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4119. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4120. do { \
  4121. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4122. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4123. } while (0)
  4124. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4125. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4126. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4127. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4128. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4129. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4130. do { \
  4131. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4132. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4133. } while (0)
  4134. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4135. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4136. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4137. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4138. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4139. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4140. do { \
  4141. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4142. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4143. } while (0)
  4144. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4145. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4146. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4147. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4148. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4149. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4150. do { \
  4151. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4152. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4153. } while (0)
  4154. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4155. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4156. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4157. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4158. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4159. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4160. do { \
  4161. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4162. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4163. } while (0)
  4164. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4165. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4166. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4167. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4168. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4169. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4170. do { \
  4171. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4172. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4173. } while (0)
  4174. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4175. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4176. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4177. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4178. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4179. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4180. do { \
  4181. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4182. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4183. } while (0)
  4184. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4185. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4186. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4187. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4188. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4189. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4190. do { \
  4191. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4192. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4193. } while (0)
  4194. /**
  4195. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4196. *
  4197. * @details
  4198. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4199. * configure RXDMA rings.
  4200. * The configuration is per ring based and includes both packet subtypes
  4201. * and PPDU/MPDU TLVs.
  4202. *
  4203. * The message would appear as follows:
  4204. *
  4205. * |31 26|25|24|23 16|15 8|7 0|
  4206. * |-----------------+----------------+----------------+---------------|
  4207. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  4208. * |-------------------------------------------------------------------|
  4209. * | rsvd2 | ring_buffer_size |
  4210. * |-------------------------------------------------------------------|
  4211. * | packet_type_enable_flags_0 |
  4212. * |-------------------------------------------------------------------|
  4213. * | packet_type_enable_flags_1 |
  4214. * |-------------------------------------------------------------------|
  4215. * | packet_type_enable_flags_2 |
  4216. * |-------------------------------------------------------------------|
  4217. * | packet_type_enable_flags_3 |
  4218. * |-------------------------------------------------------------------|
  4219. * | tlv_filter_in_flags |
  4220. * |-------------------------------------------------------------------|
  4221. * Where:
  4222. * PS = pkt_swap
  4223. * SS = status_swap
  4224. * The message is interpreted as follows:
  4225. * dword0 - b'0:7 - msg_type: This will be set to
  4226. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4227. * b'8:15 - pdev_id:
  4228. * 0 (for rings at SOC/UMAC level),
  4229. * 1/2/3 mac id (for rings at LMAC level)
  4230. * b'16:23 - ring_id : Identify the ring to configure.
  4231. * More details can be got from enum htt_srng_ring_id
  4232. * b'24 - status_swap: 1 is to swap status TLV
  4233. * b'25 - pkt_swap: 1 is to swap packet TLV
  4234. * b'26:31 - rsvd1: reserved for future use
  4235. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4236. * in byte units.
  4237. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4238. * - b'16:31 - rsvd2: Reserved for future use
  4239. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4240. * Enable MGMT packet from 0b0000 to 0b1001
  4241. * bits from low to high: FP, MD, MO - 3 bits
  4242. * FP: Filter_Pass
  4243. * MD: Monitor_Direct
  4244. * MO: Monitor_Other
  4245. * 10 mgmt subtypes * 3 bits -> 30 bits
  4246. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4247. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4248. * Enable MGMT packet from 0b1010 to 0b1111
  4249. * bits from low to high: FP, MD, MO - 3 bits
  4250. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4251. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4252. * Enable CTRL packet from 0b0000 to 0b1001
  4253. * bits from low to high: FP, MD, MO - 3 bits
  4254. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4255. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4256. * Enable CTRL packet from 0b1010 to 0b1111,
  4257. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4258. * bits from low to high: FP, MD, MO - 3 bits
  4259. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4260. * dword6 - b'0:31 - tlv_filter_in_flags:
  4261. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4262. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4263. */
  4264. PREPACK struct htt_rx_ring_selection_cfg_t {
  4265. A_UINT32 msg_type: 8,
  4266. pdev_id: 8,
  4267. ring_id: 8,
  4268. status_swap: 1,
  4269. pkt_swap: 1,
  4270. rsvd1: 6;
  4271. A_UINT32 ring_buffer_size: 16,
  4272. rsvd2: 16;
  4273. A_UINT32 packet_type_enable_flags_0;
  4274. A_UINT32 packet_type_enable_flags_1;
  4275. A_UINT32 packet_type_enable_flags_2;
  4276. A_UINT32 packet_type_enable_flags_3;
  4277. A_UINT32 tlv_filter_in_flags;
  4278. } POSTPACK;
  4279. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4280. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4281. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4282. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4283. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4284. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4285. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4286. do { \
  4287. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4288. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4289. } while (0)
  4290. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4291. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4292. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4293. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4294. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4295. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4296. do { \
  4297. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4298. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4299. } while (0)
  4300. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4301. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4302. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4303. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4304. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4305. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4306. do { \
  4307. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4308. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4309. } while (0)
  4310. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4311. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4312. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4313. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4314. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4315. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4316. do { \
  4317. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4318. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4319. } while (0)
  4320. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4321. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4322. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4323. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4324. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4325. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4326. do { \
  4327. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4328. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4329. } while (0)
  4330. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4331. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4332. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4333. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4334. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4335. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4336. do { \
  4337. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4338. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4339. } while (0)
  4340. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4341. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4342. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4343. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4344. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4345. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4346. do { \
  4347. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4348. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4349. } while (0)
  4350. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4351. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4352. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4353. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4354. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4355. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4356. do { \
  4357. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4358. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4359. } while (0)
  4360. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4361. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4362. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4363. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4364. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4365. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4366. do { \
  4367. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4368. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4369. } while (0)
  4370. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4371. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4372. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4373. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4374. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4375. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4376. do { \
  4377. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4378. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4379. } while (0)
  4380. /*
  4381. * Subtype based MGMT frames enable bits.
  4382. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4383. */
  4384. /* association request */
  4385. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4386. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4387. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4388. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4389. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4390. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4391. /* association response */
  4392. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4393. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4394. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4395. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4396. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4397. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4398. /* Reassociation request */
  4399. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4400. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4401. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4402. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4403. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4404. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4405. /* Reassociation response */
  4406. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4407. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4408. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4409. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4410. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4411. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4412. /* Probe request */
  4413. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4414. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4415. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4416. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4417. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4418. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4419. /* Probe response */
  4420. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4421. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4422. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4423. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4424. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4425. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4426. /* Timing Advertisement */
  4427. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4428. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4429. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4430. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4431. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4432. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4433. /* Reserved */
  4434. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4435. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4436. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4437. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4438. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4439. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4440. /* Beacon */
  4441. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000001
  4442. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4443. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000001
  4444. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4445. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x00000001
  4446. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4447. /* ATIM */
  4448. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x00000001
  4449. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4450. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x00000001
  4451. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4452. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x00000001
  4453. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4454. /* Disassociation */
  4455. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4456. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4457. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4458. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4459. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4460. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4461. /* Authentication */
  4462. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4463. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4464. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4465. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4466. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4467. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4468. /* Deauthentication */
  4469. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4470. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4471. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4472. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4473. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4474. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4475. /* Action */
  4476. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4477. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4478. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4479. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4480. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4481. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4482. /* Action No Ack */
  4483. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4484. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4485. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4486. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4487. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4488. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4489. /* Reserved */
  4490. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4491. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4492. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4493. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4494. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4495. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4496. /*
  4497. * Subtype based CTRL frames enable bits.
  4498. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4499. */
  4500. /* Reserved */
  4501. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4502. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4503. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4504. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4505. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4506. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4507. /* Reserved */
  4508. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4509. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4510. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4511. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4512. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4513. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4514. /* Reserved */
  4515. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4516. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4517. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4518. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4519. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4520. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4521. /* Reserved */
  4522. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4523. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4524. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4525. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4526. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4527. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4528. /* Reserved */
  4529. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4530. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4531. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4532. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4533. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4534. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4535. /* Reserved */
  4536. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4537. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4538. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4539. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4540. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4541. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4542. /* Reserved */
  4543. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4544. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4545. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4546. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4547. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4548. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4549. /* Control Wrapper */
  4550. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4551. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4552. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4553. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4554. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4555. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4556. /* Block Ack Request */
  4557. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000001
  4558. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4559. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000001
  4560. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4561. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x00000001
  4562. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4563. /* Block Ack*/
  4564. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x00000001
  4565. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4566. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x00000001
  4567. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4568. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x00000001
  4569. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4570. /* PS-POLL */
  4571. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4572. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4573. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4574. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4575. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4576. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4577. /* RTS */
  4578. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4579. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4580. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4581. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4582. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4583. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4584. /* CTS */
  4585. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4586. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4587. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4588. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4589. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4590. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4591. /* ACK */
  4592. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4593. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4594. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4595. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4596. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4597. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4598. /* CF-END */
  4599. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4600. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4601. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4602. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4603. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  4604. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4605. /* CF-END + CF-ACK */
  4606. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  4607. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4608. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  4609. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4610. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  4611. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4612. /* Multicast data */
  4613. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  4614. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4615. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  4616. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  4617. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  4618. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  4619. /* Unicast data */
  4620. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  4621. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  4622. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  4623. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  4624. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  4625. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  4626. /* NULL data */
  4627. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  4628. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  4629. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  4630. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  4631. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  4632. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  4633. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  4634. do { \
  4635. HTT_CHECK_SET_VAL(httsym, value); \
  4636. (word) |= (value) << httsym##_S; \
  4637. } while (0)
  4638. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  4639. (((word) & httsym##_M) >> httsym##_S)
  4640. #define htt_rx_ring_pkt_enable_subtype_set( \
  4641. word, flag, mode, type, subtype, val) \
  4642. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  4643. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  4644. #define htt_rx_ring_pkt_enable_subtype_get( \
  4645. word, flag, mode, type, subtype) \
  4646. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  4647. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  4648. /* Definition to filter in TLVs */
  4649. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  4650. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  4651. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  4652. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  4653. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  4654. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  4655. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  4656. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  4657. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  4658. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  4659. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  4660. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  4661. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  4662. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  4663. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  4664. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  4665. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  4666. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  4667. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  4668. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  4669. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  4670. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  4671. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  4672. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  4673. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  4674. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  4675. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  4676. do { \
  4677. HTT_CHECK_SET_VAL(httsym, enable); \
  4678. (word) |= (enable) << httsym##_S; \
  4679. } while (0)
  4680. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  4681. (((word) & httsym##_M) >> httsym##_S)
  4682. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  4683. HTT_RX_RING_TLV_ENABLE_SET( \
  4684. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  4685. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  4686. HTT_RX_RING_TLV_ENABLE_GET( \
  4687. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  4688. /**
  4689. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  4690. * host --> target Receive Flow Steering configuration message definition.
  4691. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4692. * The reason for this is we want RFS to be configured and ready before MAC
  4693. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4694. *
  4695. * |31 24|23 16|15 9|8|7 0|
  4696. * |----------------+----------------+----------------+----------------|
  4697. * | reserved |E| msg type |
  4698. * |-------------------------------------------------------------------|
  4699. * Where E = RFS enable flag
  4700. *
  4701. * The RFS_CONFIG message consists of a single 4-byte word.
  4702. *
  4703. * Header fields:
  4704. * - MSG_TYPE
  4705. * Bits 7:0
  4706. * Purpose: identifies this as a RFS config msg
  4707. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  4708. * - RFS_CONFIG
  4709. * Bit 8
  4710. * Purpose: Tells target whether to enable (1) or disable (0)
  4711. * flow steering feature when sending rx indication messages to host
  4712. */
  4713. #define HTT_H2T_RFS_CONFIG_M 0x100
  4714. #define HTT_H2T_RFS_CONFIG_S 8
  4715. #define HTT_RX_RFS_CONFIG_GET(_var) \
  4716. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  4717. HTT_H2T_RFS_CONFIG_S)
  4718. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  4719. do { \
  4720. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  4721. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  4722. } while (0)
  4723. #define HTT_RFS_CFG_REQ_BYTES 4
  4724. /**
  4725. * @brief host -> target FW extended statistics retrieve
  4726. *
  4727. * @details
  4728. * The following field definitions describe the format of the HTT host
  4729. * to target FW extended stats retrieve message.
  4730. * The message specifies the type of stats the host wants to retrieve.
  4731. *
  4732. * |31 24|23 16|15 8|7 0|
  4733. * |-----------------------------------------------------------|
  4734. * | reserved | stats type | pdev_mask | msg type |
  4735. * |-----------------------------------------------------------|
  4736. * | config param [0] |
  4737. * |-----------------------------------------------------------|
  4738. * | config param [1] |
  4739. * |-----------------------------------------------------------|
  4740. * | config param [2] |
  4741. * |-----------------------------------------------------------|
  4742. * | config param [3] |
  4743. * |-----------------------------------------------------------|
  4744. * | reserved |
  4745. * |-----------------------------------------------------------|
  4746. * | cookie LSBs |
  4747. * |-----------------------------------------------------------|
  4748. * | cookie MSBs |
  4749. * |-----------------------------------------------------------|
  4750. * Header fields:
  4751. * - MSG_TYPE
  4752. * Bits 7:0
  4753. * Purpose: identifies this is a extended stats upload request message
  4754. * Value: 0x10
  4755. * - PDEV_MASK
  4756. * Bits 8:15
  4757. * Purpose: identifies the mask of PDEVs to retrieve stats from
  4758. * Value: This is a overloaded field, refer to usage and interpretation of
  4759. * PDEV in interface document.
  4760. * Bit 8 : Reserved for SOC stats
  4761. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  4762. * Indicates MACID_MASK in DBS
  4763. * - STATS_TYPE
  4764. * Bits 23:16
  4765. * Purpose: identifies which FW statistics to upload
  4766. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  4767. * - Reserved
  4768. * Bits 31:24
  4769. * - CONFIG_PARAM [0]
  4770. * Bits 31:0
  4771. * Purpose: give an opaque configuration value to the specified stats type
  4772. * Value: stats-type specific configuration value
  4773. * Refer to htt_stats.h for interpretation for each stats sub_type
  4774. * - CONFIG_PARAM [1]
  4775. * Bits 31:0
  4776. * Purpose: give an opaque configuration value to the specified stats type
  4777. * Value: stats-type specific configuration value
  4778. * Refer to htt_stats.h for interpretation for each stats sub_type
  4779. * - CONFIG_PARAM [2]
  4780. * Bits 31:0
  4781. * Purpose: give an opaque configuration value to the specified stats type
  4782. * Value: stats-type specific configuration value
  4783. * Refer to htt_stats.h for interpretation for each stats sub_type
  4784. * - CONFIG_PARAM [3]
  4785. * Bits 31:0
  4786. * Purpose: give an opaque configuration value to the specified stats type
  4787. * Value: stats-type specific configuration value
  4788. * Refer to htt_stats.h for interpretation for each stats sub_type
  4789. * - Reserved [31:0] for future use.
  4790. * - COOKIE_LSBS
  4791. * Bits 31:0
  4792. * Purpose: Provide a mechanism to match a target->host stats confirmation
  4793. * message with its preceding host->target stats request message.
  4794. * Value: LSBs of the opaque cookie specified by the host-side requestor
  4795. * - COOKIE_MSBS
  4796. * Bits 31:0
  4797. * Purpose: Provide a mechanism to match a target->host stats confirmation
  4798. * message with its preceding host->target stats request message.
  4799. * Value: MSBs of the opaque cookie specified by the host-side requestor
  4800. */
  4801. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  4802. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  4803. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  4804. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  4805. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  4806. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  4807. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  4808. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  4809. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  4810. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  4811. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  4812. do { \
  4813. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  4814. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  4815. } while (0)
  4816. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  4817. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  4818. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  4819. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  4820. do { \
  4821. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  4822. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  4823. } while (0)
  4824. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  4825. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  4826. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  4827. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  4828. do { \
  4829. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  4830. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  4831. } while (0)
  4832. /**
  4833. * @brief host -> target FW PPDU_STATS request message
  4834. *
  4835. * @details
  4836. * The following field definitions describe the format of the HTT host
  4837. * to target FW for PPDU_STATS_CFG msg.
  4838. * The message allows the host to configure the PPDU_STATS_IND messages
  4839. * produced by the target.
  4840. *
  4841. * |31 24|23 16|15 8|7 0|
  4842. * |-----------------------------------------------------------|
  4843. * | REQ bit mask | pdev_mask | msg type |
  4844. * |-----------------------------------------------------------|
  4845. * Header fields:
  4846. * - MSG_TYPE
  4847. * Bits 7:0
  4848. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  4849. * Value: 0x11
  4850. * - PDEV_MASK
  4851. * Bits 8:15
  4852. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  4853. * Value: This is a overloaded field, refer to usage and interpretation of
  4854. * PDEV in interface document.
  4855. * Bit 8 : Reserved for SOC stats
  4856. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  4857. * Indicates MACID_MASK in DBS
  4858. * - REQ_TLV_BIT_MASK
  4859. * Bits 16:31
  4860. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  4861. * needs to be included in the target's PPDU_STATS_IND messages.
  4862. * Value: refer htt_ppdu_stats_tlv_tag_t
  4863. *
  4864. */
  4865. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  4866. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  4867. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  4868. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  4869. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  4870. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  4871. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  4872. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  4873. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  4874. do { \
  4875. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  4876. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  4877. } while (0)
  4878. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  4879. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  4880. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  4881. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  4882. do { \
  4883. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  4884. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  4885. } while (0)
  4886. /*=== target -> host messages ===============================================*/
  4887. enum htt_t2h_msg_type {
  4888. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  4889. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  4890. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  4891. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  4892. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  4893. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  4894. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  4895. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  4896. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  4897. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  4898. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  4899. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  4900. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  4901. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  4902. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  4903. /* only used for HL, add HTT MSG for HTT CREDIT update */
  4904. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  4905. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  4906. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  4907. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  4908. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  4909. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  4910. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  4911. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  4912. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  4913. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  4914. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  4915. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  4916. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  4917. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  4918. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  4919. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  4920. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  4921. HTT_T2H_MSG_TYPE_TEST,
  4922. /* keep this last */
  4923. HTT_T2H_NUM_MSGS
  4924. };
  4925. /*
  4926. * HTT target to host message type -
  4927. * stored in bits 7:0 of the first word of the message
  4928. */
  4929. #define HTT_T2H_MSG_TYPE_M 0xff
  4930. #define HTT_T2H_MSG_TYPE_S 0
  4931. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  4932. do { \
  4933. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  4934. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  4935. } while (0)
  4936. #define HTT_T2H_MSG_TYPE_GET(word) \
  4937. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  4938. /**
  4939. * @brief target -> host version number confirmation message definition
  4940. *
  4941. * |31 24|23 16|15 8|7 0|
  4942. * |----------------+----------------+----------------+----------------|
  4943. * | reserved | major number | minor number | msg type |
  4944. * |-------------------------------------------------------------------|
  4945. * : option request TLV (optional) |
  4946. * :...................................................................:
  4947. *
  4948. * The VER_CONF message may consist of a single 4-byte word, or may be
  4949. * extended with TLVs that specify HTT options selected by the target.
  4950. * The following option TLVs may be appended to the VER_CONF message:
  4951. * - LL_BUS_ADDR_SIZE
  4952. * - HL_SUPPRESS_TX_COMPL_IND
  4953. * - MAX_TX_QUEUE_GROUPS
  4954. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  4955. * may be appended to the VER_CONF message (but only one TLV of each type).
  4956. *
  4957. * Header fields:
  4958. * - MSG_TYPE
  4959. * Bits 7:0
  4960. * Purpose: identifies this as a version number confirmation message
  4961. * Value: 0x0
  4962. * - VER_MINOR
  4963. * Bits 15:8
  4964. * Purpose: Specify the minor number of the HTT message library version
  4965. * in use by the target firmware.
  4966. * The minor number specifies the specific revision within a range
  4967. * of fundamentally compatible HTT message definition revisions.
  4968. * Compatible revisions involve adding new messages or perhaps
  4969. * adding new fields to existing messages, in a backwards-compatible
  4970. * manner.
  4971. * Incompatible revisions involve changing the message type values,
  4972. * or redefining existing messages.
  4973. * Value: minor number
  4974. * - VER_MAJOR
  4975. * Bits 15:8
  4976. * Purpose: Specify the major number of the HTT message library version
  4977. * in use by the target firmware.
  4978. * The major number specifies the family of minor revisions that are
  4979. * fundamentally compatible with each other, but not with prior or
  4980. * later families.
  4981. * Value: major number
  4982. */
  4983. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  4984. #define HTT_VER_CONF_MINOR_S 8
  4985. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  4986. #define HTT_VER_CONF_MAJOR_S 16
  4987. #define HTT_VER_CONF_MINOR_SET(word, value) \
  4988. do { \
  4989. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  4990. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  4991. } while (0)
  4992. #define HTT_VER_CONF_MINOR_GET(word) \
  4993. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  4994. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  4995. do { \
  4996. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  4997. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  4998. } while (0)
  4999. #define HTT_VER_CONF_MAJOR_GET(word) \
  5000. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  5001. #define HTT_VER_CONF_BYTES 4
  5002. /**
  5003. * @brief - target -> host HTT Rx In order indication message
  5004. *
  5005. * @details
  5006. *
  5007. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  5008. * |----------------+-------------------+---------------------+---------------|
  5009. * | peer ID | P| F| O| ext TID | msg type |
  5010. * |--------------------------------------------------------------------------|
  5011. * | MSDU count | Reserved | vdev id |
  5012. * |--------------------------------------------------------------------------|
  5013. * | MSDU 0 bus address (bits 31:0) |
  5014. #if HTT_PADDR64
  5015. * | MSDU 0 bus address (bits 63:32) |
  5016. #endif
  5017. * |--------------------------------------------------------------------------|
  5018. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  5019. * |--------------------------------------------------------------------------|
  5020. * | MSDU 1 bus address (bits 31:0) |
  5021. #if HTT_PADDR64
  5022. * | MSDU 1 bus address (bits 63:32) |
  5023. #endif
  5024. * |--------------------------------------------------------------------------|
  5025. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  5026. * |--------------------------------------------------------------------------|
  5027. */
  5028. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  5029. *
  5030. * @details
  5031. * bits
  5032. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  5033. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5034. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  5035. * | | frag | | | | fail |chksum fail|
  5036. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5037. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  5038. */
  5039. struct htt_rx_in_ord_paddr_ind_hdr_t
  5040. {
  5041. A_UINT32 /* word 0 */
  5042. msg_type: 8,
  5043. ext_tid: 5,
  5044. offload: 1,
  5045. frag: 1,
  5046. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  5047. peer_id: 16;
  5048. A_UINT32 /* word 1 */
  5049. vap_id: 8,
  5050. reserved_1: 8,
  5051. msdu_cnt: 16;
  5052. };
  5053. struct htt_rx_in_ord_paddr_ind_msdu32_t
  5054. {
  5055. A_UINT32 dma_addr;
  5056. A_UINT32
  5057. length: 16,
  5058. fw_desc: 8,
  5059. msdu_info:8;
  5060. };
  5061. struct htt_rx_in_ord_paddr_ind_msdu64_t
  5062. {
  5063. A_UINT32 dma_addr_lo;
  5064. A_UINT32 dma_addr_hi;
  5065. A_UINT32
  5066. length: 16,
  5067. fw_desc: 8,
  5068. msdu_info:8;
  5069. };
  5070. #if HTT_PADDR64
  5071. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  5072. #else
  5073. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  5074. #endif
  5075. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  5076. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  5077. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  5078. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  5079. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  5080. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  5081. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  5082. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  5083. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  5084. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  5085. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  5086. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  5087. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  5088. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  5089. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  5090. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  5091. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  5092. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  5093. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  5094. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  5095. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  5096. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  5097. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  5098. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  5099. /* for systems using 64-bit format for bus addresses */
  5100. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  5101. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  5102. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  5103. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  5104. /* for systems using 32-bit format for bus addresses */
  5105. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  5106. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  5107. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  5108. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  5109. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  5110. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  5111. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  5112. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  5113. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  5114. do { \
  5115. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  5116. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  5117. } while (0)
  5118. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  5119. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  5120. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  5121. do { \
  5122. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  5123. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  5124. } while (0)
  5125. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  5126. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  5127. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  5128. do { \
  5129. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  5130. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  5131. } while (0)
  5132. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  5133. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  5134. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  5135. do { \
  5136. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  5137. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  5138. } while (0)
  5139. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  5140. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  5141. /* for systems using 64-bit format for bus addresses */
  5142. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  5143. do { \
  5144. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  5145. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  5146. } while (0)
  5147. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  5148. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  5149. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  5150. do { \
  5151. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  5152. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  5153. } while (0)
  5154. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  5155. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  5156. /* for systems using 32-bit format for bus addresses */
  5157. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  5158. do { \
  5159. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  5160. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  5161. } while (0)
  5162. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  5163. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  5164. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  5165. do { \
  5166. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  5167. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  5168. } while (0)
  5169. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  5170. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  5171. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  5172. do { \
  5173. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  5174. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  5175. } while (0)
  5176. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  5177. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  5178. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  5179. do { \
  5180. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  5181. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  5182. } while (0)
  5183. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  5184. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  5185. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  5186. do { \
  5187. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  5188. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  5189. } while (0)
  5190. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  5191. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  5192. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  5193. do { \
  5194. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  5195. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  5196. } while (0)
  5197. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  5198. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  5199. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  5200. do { \
  5201. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  5202. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  5203. } while (0)
  5204. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  5205. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  5206. /* definitions used within target -> host rx indication message */
  5207. PREPACK struct htt_rx_ind_hdr_prefix_t
  5208. {
  5209. A_UINT32 /* word 0 */
  5210. msg_type: 8,
  5211. ext_tid: 5,
  5212. release_valid: 1,
  5213. flush_valid: 1,
  5214. reserved0: 1,
  5215. peer_id: 16;
  5216. A_UINT32 /* word 1 */
  5217. flush_start_seq_num: 6,
  5218. flush_end_seq_num: 6,
  5219. release_start_seq_num: 6,
  5220. release_end_seq_num: 6,
  5221. num_mpdu_ranges: 8;
  5222. } POSTPACK;
  5223. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  5224. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  5225. #define HTT_TGT_RSSI_INVALID 0x80
  5226. PREPACK struct htt_rx_ppdu_desc_t
  5227. {
  5228. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  5229. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  5230. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  5231. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  5232. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  5233. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  5234. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  5235. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  5236. A_UINT32 /* word 0 */
  5237. rssi_cmb: 8,
  5238. timestamp_submicrosec: 8,
  5239. phy_err_code: 8,
  5240. phy_err: 1,
  5241. legacy_rate: 4,
  5242. legacy_rate_sel: 1,
  5243. end_valid: 1,
  5244. start_valid: 1;
  5245. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  5246. union {
  5247. A_UINT32 /* word 1 */
  5248. rssi0_pri20: 8,
  5249. rssi0_ext20: 8,
  5250. rssi0_ext40: 8,
  5251. rssi0_ext80: 8;
  5252. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  5253. } u0;
  5254. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  5255. union {
  5256. A_UINT32 /* word 2 */
  5257. rssi1_pri20: 8,
  5258. rssi1_ext20: 8,
  5259. rssi1_ext40: 8,
  5260. rssi1_ext80: 8;
  5261. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  5262. } u1;
  5263. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  5264. union {
  5265. A_UINT32 /* word 3 */
  5266. rssi2_pri20: 8,
  5267. rssi2_ext20: 8,
  5268. rssi2_ext40: 8,
  5269. rssi2_ext80: 8;
  5270. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  5271. } u2;
  5272. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  5273. union {
  5274. A_UINT32 /* word 4 */
  5275. rssi3_pri20: 8,
  5276. rssi3_ext20: 8,
  5277. rssi3_ext40: 8,
  5278. rssi3_ext80: 8;
  5279. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  5280. } u3;
  5281. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  5282. A_UINT32 tsf32; /* word 5 */
  5283. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  5284. A_UINT32 timestamp_microsec; /* word 6 */
  5285. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  5286. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  5287. A_UINT32 /* word 7 */
  5288. vht_sig_a1: 24,
  5289. preamble_type: 8;
  5290. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  5291. A_UINT32 /* word 8 */
  5292. vht_sig_a2: 24,
  5293. reserved0: 8;
  5294. } POSTPACK;
  5295. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  5296. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  5297. PREPACK struct htt_rx_ind_hdr_suffix_t
  5298. {
  5299. A_UINT32 /* word 0 */
  5300. fw_rx_desc_bytes: 16,
  5301. reserved0: 16;
  5302. } POSTPACK;
  5303. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  5304. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  5305. PREPACK struct htt_rx_ind_hdr_t
  5306. {
  5307. struct htt_rx_ind_hdr_prefix_t prefix;
  5308. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  5309. struct htt_rx_ind_hdr_suffix_t suffix;
  5310. } POSTPACK;
  5311. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  5312. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  5313. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  5314. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  5315. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  5316. /*
  5317. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  5318. * the offset into the HTT rx indication message at which the
  5319. * FW rx PPDU descriptor resides
  5320. */
  5321. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  5322. /*
  5323. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  5324. * the offset into the HTT rx indication message at which the
  5325. * header suffix (FW rx MSDU byte count) resides
  5326. */
  5327. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  5328. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  5329. /*
  5330. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  5331. * the offset into the HTT rx indication message at which the per-MSDU
  5332. * information starts
  5333. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  5334. * per-MSDU information portion of the message. The per-MSDU info itself
  5335. * starts at byte 12.
  5336. */
  5337. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  5338. /**
  5339. * @brief target -> host rx indication message definition
  5340. *
  5341. * @details
  5342. * The following field definitions describe the format of the rx indication
  5343. * message sent from the target to the host.
  5344. * The message consists of three major sections:
  5345. * 1. a fixed-length header
  5346. * 2. a variable-length list of firmware rx MSDU descriptors
  5347. * 3. one or more 4-octet MPDU range information elements
  5348. * The fixed length header itself has two sub-sections
  5349. * 1. the message meta-information, including identification of the
  5350. * sender and type of the received data, and a 4-octet flush/release IE
  5351. * 2. the firmware rx PPDU descriptor
  5352. *
  5353. * The format of the message is depicted below.
  5354. * in this depiction, the following abbreviations are used for information
  5355. * elements within the message:
  5356. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  5357. * elements associated with the PPDU start are valid.
  5358. * Specifically, the following fields are valid only if SV is set:
  5359. * RSSI (all variants), L, legacy rate, preamble type, service,
  5360. * VHT-SIG-A
  5361. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  5362. * elements associated with the PPDU end are valid.
  5363. * Specifically, the following fields are valid only if EV is set:
  5364. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  5365. * - L - Legacy rate selector - if legacy rates are used, this flag
  5366. * indicates whether the rate is from a CCK (L == 1) or OFDM
  5367. * (L == 0) PHY.
  5368. * - P - PHY error flag - boolean indication of whether the rx frame had
  5369. * a PHY error
  5370. *
  5371. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  5372. * |----------------+-------------------+---------------------+---------------|
  5373. * | peer ID | |RV|FV| ext TID | msg type |
  5374. * |--------------------------------------------------------------------------|
  5375. * | num | release | release | flush | flush |
  5376. * | MPDU | end | start | end | start |
  5377. * | ranges | seq num | seq num | seq num | seq num |
  5378. * |==========================================================================|
  5379. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  5380. * |V|V| | rate | | | timestamp | RSSI |
  5381. * |--------------------------------------------------------------------------|
  5382. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  5383. * |--------------------------------------------------------------------------|
  5384. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  5385. * |--------------------------------------------------------------------------|
  5386. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  5387. * |--------------------------------------------------------------------------|
  5388. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  5389. * |--------------------------------------------------------------------------|
  5390. * | TSF LSBs |
  5391. * |--------------------------------------------------------------------------|
  5392. * | microsec timestamp |
  5393. * |--------------------------------------------------------------------------|
  5394. * | preamble type | HT-SIG / VHT-SIG-A1 |
  5395. * |--------------------------------------------------------------------------|
  5396. * | service | HT-SIG / VHT-SIG-A2 |
  5397. * |==========================================================================|
  5398. * | reserved | FW rx desc bytes |
  5399. * |--------------------------------------------------------------------------|
  5400. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  5401. * | desc B3 | desc B2 | desc B1 | desc B0 |
  5402. * |--------------------------------------------------------------------------|
  5403. * : : :
  5404. * |--------------------------------------------------------------------------|
  5405. * | alignment | MSDU Rx |
  5406. * | padding | desc Bn |
  5407. * |--------------------------------------------------------------------------|
  5408. * | reserved | MPDU range status | MPDU count |
  5409. * |--------------------------------------------------------------------------|
  5410. * : reserved : MPDU range status : MPDU count :
  5411. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  5412. *
  5413. * Header fields:
  5414. * - MSG_TYPE
  5415. * Bits 7:0
  5416. * Purpose: identifies this as an rx indication message
  5417. * Value: 0x1
  5418. * - EXT_TID
  5419. * Bits 12:8
  5420. * Purpose: identify the traffic ID of the rx data, including
  5421. * special "extended" TID values for multicast, broadcast, and
  5422. * non-QoS data frames
  5423. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  5424. * - FLUSH_VALID (FV)
  5425. * Bit 13
  5426. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  5427. * is valid
  5428. * Value:
  5429. * 1 -> flush IE is valid and needs to be processed
  5430. * 0 -> flush IE is not valid and should be ignored
  5431. * - REL_VALID (RV)
  5432. * Bit 13
  5433. * Purpose: indicate whether the release IE (start/end sequence numbers)
  5434. * is valid
  5435. * Value:
  5436. * 1 -> release IE is valid and needs to be processed
  5437. * 0 -> release IE is not valid and should be ignored
  5438. * - PEER_ID
  5439. * Bits 31:16
  5440. * Purpose: Identify, by ID, which peer sent the rx data
  5441. * Value: ID of the peer who sent the rx data
  5442. * - FLUSH_SEQ_NUM_START
  5443. * Bits 5:0
  5444. * Purpose: Indicate the start of a series of MPDUs to flush
  5445. * Not all MPDUs within this series are necessarily valid - the host
  5446. * must check each sequence number within this range to see if the
  5447. * corresponding MPDU is actually present.
  5448. * This field is only valid if the FV bit is set.
  5449. * Value:
  5450. * The sequence number for the first MPDUs to check to flush.
  5451. * The sequence number is masked by 0x3f.
  5452. * - FLUSH_SEQ_NUM_END
  5453. * Bits 11:6
  5454. * Purpose: Indicate the end of a series of MPDUs to flush
  5455. * Value:
  5456. * The sequence number one larger than the sequence number of the
  5457. * last MPDU to check to flush.
  5458. * The sequence number is masked by 0x3f.
  5459. * Not all MPDUs within this series are necessarily valid - the host
  5460. * must check each sequence number within this range to see if the
  5461. * corresponding MPDU is actually present.
  5462. * This field is only valid if the FV bit is set.
  5463. * - REL_SEQ_NUM_START
  5464. * Bits 17:12
  5465. * Purpose: Indicate the start of a series of MPDUs to release.
  5466. * All MPDUs within this series are present and valid - the host
  5467. * need not check each sequence number within this range to see if
  5468. * the corresponding MPDU is actually present.
  5469. * This field is only valid if the RV bit is set.
  5470. * Value:
  5471. * The sequence number for the first MPDUs to check to release.
  5472. * The sequence number is masked by 0x3f.
  5473. * - REL_SEQ_NUM_END
  5474. * Bits 23:18
  5475. * Purpose: Indicate the end of a series of MPDUs to release.
  5476. * Value:
  5477. * The sequence number one larger than the sequence number of the
  5478. * last MPDU to check to release.
  5479. * The sequence number is masked by 0x3f.
  5480. * All MPDUs within this series are present and valid - the host
  5481. * need not check each sequence number within this range to see if
  5482. * the corresponding MPDU is actually present.
  5483. * This field is only valid if the RV bit is set.
  5484. * - NUM_MPDU_RANGES
  5485. * Bits 31:24
  5486. * Purpose: Indicate how many ranges of MPDUs are present.
  5487. * Each MPDU range consists of a series of contiguous MPDUs within the
  5488. * rx frame sequence which all have the same MPDU status.
  5489. * Value: 1-63 (typically a small number, like 1-3)
  5490. *
  5491. * Rx PPDU descriptor fields:
  5492. * - RSSI_CMB
  5493. * Bits 7:0
  5494. * Purpose: Combined RSSI from all active rx chains, across the active
  5495. * bandwidth.
  5496. * Value: RSSI dB units w.r.t. noise floor
  5497. * - TIMESTAMP_SUBMICROSEC
  5498. * Bits 15:8
  5499. * Purpose: high-resolution timestamp
  5500. * Value:
  5501. * Sub-microsecond time of PPDU reception.
  5502. * This timestamp ranges from [0,MAC clock MHz).
  5503. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  5504. * to form a high-resolution, large range rx timestamp.
  5505. * - PHY_ERR_CODE
  5506. * Bits 23:16
  5507. * Purpose:
  5508. * If the rx frame processing resulted in a PHY error, indicate what
  5509. * type of rx PHY error occurred.
  5510. * Value:
  5511. * This field is valid if the "P" (PHY_ERR) flag is set.
  5512. * TBD: document/specify the values for this field
  5513. * - PHY_ERR
  5514. * Bit 24
  5515. * Purpose: indicate whether the rx PPDU had a PHY error
  5516. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  5517. * - LEGACY_RATE
  5518. * Bits 28:25
  5519. * Purpose:
  5520. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  5521. * specify which rate was used.
  5522. * Value:
  5523. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  5524. * flag.
  5525. * If LEGACY_RATE_SEL is 0:
  5526. * 0x8: OFDM 48 Mbps
  5527. * 0x9: OFDM 24 Mbps
  5528. * 0xA: OFDM 12 Mbps
  5529. * 0xB: OFDM 6 Mbps
  5530. * 0xC: OFDM 54 Mbps
  5531. * 0xD: OFDM 36 Mbps
  5532. * 0xE: OFDM 18 Mbps
  5533. * 0xF: OFDM 9 Mbps
  5534. * If LEGACY_RATE_SEL is 1:
  5535. * 0x8: CCK 11 Mbps long preamble
  5536. * 0x9: CCK 5.5 Mbps long preamble
  5537. * 0xA: CCK 2 Mbps long preamble
  5538. * 0xB: CCK 1 Mbps long preamble
  5539. * 0xC: CCK 11 Mbps short preamble
  5540. * 0xD: CCK 5.5 Mbps short preamble
  5541. * 0xE: CCK 2 Mbps short preamble
  5542. * - LEGACY_RATE_SEL
  5543. * Bit 29
  5544. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  5545. * Value:
  5546. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  5547. * used a legacy rate.
  5548. * 0 -> OFDM, 1 -> CCK
  5549. * - END_VALID
  5550. * Bit 30
  5551. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5552. * the start of the PPDU are valid. Specifically, the following
  5553. * fields are only valid if END_VALID is set:
  5554. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  5555. * TIMESTAMP_SUBMICROSEC
  5556. * Value:
  5557. * 0 -> rx PPDU desc end fields are not valid
  5558. * 1 -> rx PPDU desc end fields are valid
  5559. * - START_VALID
  5560. * Bit 31
  5561. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5562. * the end of the PPDU are valid. Specifically, the following
  5563. * fields are only valid if START_VALID is set:
  5564. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  5565. * VHT-SIG-A
  5566. * Value:
  5567. * 0 -> rx PPDU desc start fields are not valid
  5568. * 1 -> rx PPDU desc start fields are valid
  5569. * - RSSI0_PRI20
  5570. * Bits 7:0
  5571. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  5572. * Value: RSSI dB units w.r.t. noise floor
  5573. *
  5574. * - RSSI0_EXT20
  5575. * Bits 7:0
  5576. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  5577. * (if the rx bandwidth was >= 40 MHz)
  5578. * Value: RSSI dB units w.r.t. noise floor
  5579. * - RSSI0_EXT40
  5580. * Bits 7:0
  5581. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  5582. * (if the rx bandwidth was >= 80 MHz)
  5583. * Value: RSSI dB units w.r.t. noise floor
  5584. * - RSSI0_EXT80
  5585. * Bits 7:0
  5586. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  5587. * (if the rx bandwidth was >= 160 MHz)
  5588. * Value: RSSI dB units w.r.t. noise floor
  5589. *
  5590. * - RSSI1_PRI20
  5591. * Bits 7:0
  5592. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  5593. * Value: RSSI dB units w.r.t. noise floor
  5594. * - RSSI1_EXT20
  5595. * Bits 7:0
  5596. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  5597. * (if the rx bandwidth was >= 40 MHz)
  5598. * Value: RSSI dB units w.r.t. noise floor
  5599. * - RSSI1_EXT40
  5600. * Bits 7:0
  5601. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  5602. * (if the rx bandwidth was >= 80 MHz)
  5603. * Value: RSSI dB units w.r.t. noise floor
  5604. * - RSSI1_EXT80
  5605. * Bits 7:0
  5606. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  5607. * (if the rx bandwidth was >= 160 MHz)
  5608. * Value: RSSI dB units w.r.t. noise floor
  5609. *
  5610. * - RSSI2_PRI20
  5611. * Bits 7:0
  5612. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  5613. * Value: RSSI dB units w.r.t. noise floor
  5614. * - RSSI2_EXT20
  5615. * Bits 7:0
  5616. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  5617. * (if the rx bandwidth was >= 40 MHz)
  5618. * Value: RSSI dB units w.r.t. noise floor
  5619. * - RSSI2_EXT40
  5620. * Bits 7:0
  5621. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  5622. * (if the rx bandwidth was >= 80 MHz)
  5623. * Value: RSSI dB units w.r.t. noise floor
  5624. * - RSSI2_EXT80
  5625. * Bits 7:0
  5626. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  5627. * (if the rx bandwidth was >= 160 MHz)
  5628. * Value: RSSI dB units w.r.t. noise floor
  5629. *
  5630. * - RSSI3_PRI20
  5631. * Bits 7:0
  5632. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  5633. * Value: RSSI dB units w.r.t. noise floor
  5634. * - RSSI3_EXT20
  5635. * Bits 7:0
  5636. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  5637. * (if the rx bandwidth was >= 40 MHz)
  5638. * Value: RSSI dB units w.r.t. noise floor
  5639. * - RSSI3_EXT40
  5640. * Bits 7:0
  5641. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  5642. * (if the rx bandwidth was >= 80 MHz)
  5643. * Value: RSSI dB units w.r.t. noise floor
  5644. * - RSSI3_EXT80
  5645. * Bits 7:0
  5646. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  5647. * (if the rx bandwidth was >= 160 MHz)
  5648. * Value: RSSI dB units w.r.t. noise floor
  5649. *
  5650. * - TSF32
  5651. * Bits 31:0
  5652. * Purpose: specify the time the rx PPDU was received, in TSF units
  5653. * Value: 32 LSBs of the TSF
  5654. * - TIMESTAMP_MICROSEC
  5655. * Bits 31:0
  5656. * Purpose: specify the time the rx PPDU was received, in microsecond units
  5657. * Value: PPDU rx time, in microseconds
  5658. * - VHT_SIG_A1
  5659. * Bits 23:0
  5660. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  5661. * from the rx PPDU
  5662. * Value:
  5663. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5664. * VHT-SIG-A1 data.
  5665. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5666. * first 24 bits of the HT-SIG data.
  5667. * Otherwise, this field is invalid.
  5668. * Refer to the the 802.11 protocol for the definition of the
  5669. * HT-SIG and VHT-SIG-A1 fields
  5670. * - VHT_SIG_A2
  5671. * Bits 23:0
  5672. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  5673. * from the rx PPDU
  5674. * Value:
  5675. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5676. * VHT-SIG-A2 data.
  5677. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5678. * last 24 bits of the HT-SIG data.
  5679. * Otherwise, this field is invalid.
  5680. * Refer to the the 802.11 protocol for the definition of the
  5681. * HT-SIG and VHT-SIG-A2 fields
  5682. * - PREAMBLE_TYPE
  5683. * Bits 31:24
  5684. * Purpose: indicate the PHY format of the received burst
  5685. * Value:
  5686. * 0x4: Legacy (OFDM/CCK)
  5687. * 0x8: HT
  5688. * 0x9: HT with TxBF
  5689. * 0xC: VHT
  5690. * 0xD: VHT with TxBF
  5691. * - SERVICE
  5692. * Bits 31:24
  5693. * Purpose: TBD
  5694. * Value: TBD
  5695. *
  5696. * Rx MSDU descriptor fields:
  5697. * - FW_RX_DESC_BYTES
  5698. * Bits 15:0
  5699. * Purpose: Indicate how many bytes in the Rx indication are used for
  5700. * FW Rx descriptors
  5701. *
  5702. * Payload fields:
  5703. * - MPDU_COUNT
  5704. * Bits 7:0
  5705. * Purpose: Indicate how many sequential MPDUs share the same status.
  5706. * All MPDUs within the indicated list are from the same RA-TA-TID.
  5707. * - MPDU_STATUS
  5708. * Bits 15:8
  5709. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  5710. * received successfully.
  5711. * Value:
  5712. * 0x1: success
  5713. * 0x2: FCS error
  5714. * 0x3: duplicate error
  5715. * 0x4: replay error
  5716. * 0x5: invalid peer
  5717. */
  5718. /* header fields */
  5719. #define HTT_RX_IND_EXT_TID_M 0x1f00
  5720. #define HTT_RX_IND_EXT_TID_S 8
  5721. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  5722. #define HTT_RX_IND_FLUSH_VALID_S 13
  5723. #define HTT_RX_IND_REL_VALID_M 0x4000
  5724. #define HTT_RX_IND_REL_VALID_S 14
  5725. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  5726. #define HTT_RX_IND_PEER_ID_S 16
  5727. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  5728. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  5729. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  5730. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  5731. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  5732. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  5733. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  5734. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  5735. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  5736. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  5737. /* rx PPDU descriptor fields */
  5738. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  5739. #define HTT_RX_IND_RSSI_CMB_S 0
  5740. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  5741. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  5742. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  5743. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  5744. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  5745. #define HTT_RX_IND_PHY_ERR_S 24
  5746. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  5747. #define HTT_RX_IND_LEGACY_RATE_S 25
  5748. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  5749. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  5750. #define HTT_RX_IND_END_VALID_M 0x40000000
  5751. #define HTT_RX_IND_END_VALID_S 30
  5752. #define HTT_RX_IND_START_VALID_M 0x80000000
  5753. #define HTT_RX_IND_START_VALID_S 31
  5754. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  5755. #define HTT_RX_IND_RSSI_PRI20_S 0
  5756. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  5757. #define HTT_RX_IND_RSSI_EXT20_S 8
  5758. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  5759. #define HTT_RX_IND_RSSI_EXT40_S 16
  5760. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  5761. #define HTT_RX_IND_RSSI_EXT80_S 24
  5762. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  5763. #define HTT_RX_IND_VHT_SIG_A1_S 0
  5764. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  5765. #define HTT_RX_IND_VHT_SIG_A2_S 0
  5766. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  5767. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  5768. #define HTT_RX_IND_SERVICE_M 0xff000000
  5769. #define HTT_RX_IND_SERVICE_S 24
  5770. /* rx MSDU descriptor fields */
  5771. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  5772. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  5773. /* payload fields */
  5774. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  5775. #define HTT_RX_IND_MPDU_COUNT_S 0
  5776. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  5777. #define HTT_RX_IND_MPDU_STATUS_S 8
  5778. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  5779. do { \
  5780. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  5781. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  5782. } while (0)
  5783. #define HTT_RX_IND_EXT_TID_GET(word) \
  5784. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  5785. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  5786. do { \
  5787. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  5788. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  5789. } while (0)
  5790. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  5791. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  5792. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  5793. do { \
  5794. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  5795. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  5796. } while (0)
  5797. #define HTT_RX_IND_REL_VALID_GET(word) \
  5798. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  5799. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  5800. do { \
  5801. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  5802. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  5803. } while (0)
  5804. #define HTT_RX_IND_PEER_ID_GET(word) \
  5805. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  5806. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  5807. do { \
  5808. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  5809. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  5810. } while (0)
  5811. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  5812. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  5813. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  5814. do { \
  5815. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  5816. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  5817. } while (0)
  5818. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  5819. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  5820. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  5821. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  5822. do { \
  5823. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  5824. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  5825. } while (0)
  5826. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  5827. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  5828. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  5829. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  5830. do { \
  5831. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  5832. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  5833. } while (0)
  5834. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  5835. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  5836. HTT_RX_IND_REL_SEQ_NUM_START_S)
  5837. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  5838. do { \
  5839. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  5840. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  5841. } while (0)
  5842. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  5843. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  5844. HTT_RX_IND_REL_SEQ_NUM_END_S)
  5845. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  5846. do { \
  5847. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  5848. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  5849. } while (0)
  5850. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  5851. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  5852. HTT_RX_IND_NUM_MPDU_RANGES_S)
  5853. /* FW rx PPDU descriptor fields */
  5854. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  5855. do { \
  5856. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  5857. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  5858. } while (0)
  5859. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  5860. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  5861. HTT_RX_IND_RSSI_CMB_S)
  5862. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  5863. do { \
  5864. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  5865. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  5866. } while (0)
  5867. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  5868. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  5869. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  5870. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  5871. do { \
  5872. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  5873. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  5874. } while (0)
  5875. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  5876. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  5877. HTT_RX_IND_PHY_ERR_CODE_S)
  5878. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  5879. do { \
  5880. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  5881. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  5882. } while (0)
  5883. #define HTT_RX_IND_PHY_ERR_GET(word) \
  5884. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  5885. HTT_RX_IND_PHY_ERR_S)
  5886. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  5887. do { \
  5888. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  5889. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  5890. } while (0)
  5891. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  5892. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  5893. HTT_RX_IND_LEGACY_RATE_S)
  5894. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  5895. do { \
  5896. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  5897. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  5898. } while (0)
  5899. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  5900. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  5901. HTT_RX_IND_LEGACY_RATE_SEL_S)
  5902. #define HTT_RX_IND_END_VALID_SET(word, value) \
  5903. do { \
  5904. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  5905. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  5906. } while (0)
  5907. #define HTT_RX_IND_END_VALID_GET(word) \
  5908. (((word) & HTT_RX_IND_END_VALID_M) >> \
  5909. HTT_RX_IND_END_VALID_S)
  5910. #define HTT_RX_IND_START_VALID_SET(word, value) \
  5911. do { \
  5912. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  5913. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  5914. } while (0)
  5915. #define HTT_RX_IND_START_VALID_GET(word) \
  5916. (((word) & HTT_RX_IND_START_VALID_M) >> \
  5917. HTT_RX_IND_START_VALID_S)
  5918. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  5919. do { \
  5920. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  5921. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  5922. } while (0)
  5923. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  5924. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  5925. HTT_RX_IND_RSSI_PRI20_S)
  5926. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  5927. do { \
  5928. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  5929. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  5930. } while (0)
  5931. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  5932. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  5933. HTT_RX_IND_RSSI_EXT20_S)
  5934. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  5935. do { \
  5936. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  5937. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  5938. } while (0)
  5939. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  5940. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  5941. HTT_RX_IND_RSSI_EXT40_S)
  5942. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  5943. do { \
  5944. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  5945. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  5946. } while (0)
  5947. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  5948. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  5949. HTT_RX_IND_RSSI_EXT80_S)
  5950. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  5951. do { \
  5952. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  5953. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  5954. } while (0)
  5955. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  5956. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  5957. HTT_RX_IND_VHT_SIG_A1_S)
  5958. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  5959. do { \
  5960. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  5961. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  5962. } while (0)
  5963. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  5964. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  5965. HTT_RX_IND_VHT_SIG_A2_S)
  5966. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  5967. do { \
  5968. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  5969. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  5970. } while (0)
  5971. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  5972. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  5973. HTT_RX_IND_PREAMBLE_TYPE_S)
  5974. #define HTT_RX_IND_SERVICE_SET(word, value) \
  5975. do { \
  5976. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  5977. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  5978. } while (0)
  5979. #define HTT_RX_IND_SERVICE_GET(word) \
  5980. (((word) & HTT_RX_IND_SERVICE_M) >> \
  5981. HTT_RX_IND_SERVICE_S)
  5982. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  5983. do { \
  5984. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  5985. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  5986. } while (0)
  5987. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  5988. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  5989. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  5990. do { \
  5991. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  5992. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  5993. } while (0)
  5994. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  5995. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  5996. #define HTT_RX_IND_HL_BYTES \
  5997. (HTT_RX_IND_HDR_BYTES + \
  5998. 4 /* single FW rx MSDU descriptor, plus padding */ + \
  5999. 4 /* single MPDU range information element */)
  6000. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  6001. /* Could we use one macro entry? */
  6002. #define HTT_WORD_SET(word, field, value) \
  6003. do { \
  6004. HTT_CHECK_SET_VAL(field, value); \
  6005. (word) |= ((value) << field ## _S); \
  6006. } while (0)
  6007. #define HTT_WORD_GET(word, field) \
  6008. (((word) & field ## _M) >> field ## _S)
  6009. PREPACK struct hl_htt_rx_ind_base {
  6010. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  6011. } POSTPACK;
  6012. /*
  6013. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  6014. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  6015. * HL host needed info. The field is just after the msdu fw rx desc.
  6016. */
  6017. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  6018. struct htt_rx_ind_hl_rx_desc_t {
  6019. A_UINT8 ver;
  6020. A_UINT8 len;
  6021. struct {
  6022. A_UINT8
  6023. first_msdu: 1,
  6024. last_msdu: 1,
  6025. c3_failed: 1,
  6026. c4_failed: 1,
  6027. ipv6: 1,
  6028. tcp: 1,
  6029. udp: 1,
  6030. reserved: 1;
  6031. } flags;
  6032. };
  6033. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  6034. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6035. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  6036. #define HTT_RX_IND_HL_RX_DESC_VER 0
  6037. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  6038. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6039. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  6040. #define HTT_RX_IND_HL_FLAG_OFFSET \
  6041. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6042. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  6043. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  6044. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  6045. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  6046. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  6047. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  6048. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  6049. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  6050. /* This structure is used in HL, the basic descriptor information
  6051. * used by host. the structure is translated by FW from HW desc
  6052. * or generated by FW. But in HL monitor mode, the host would use
  6053. * the same structure with LL.
  6054. */
  6055. PREPACK struct hl_htt_rx_desc_base {
  6056. A_UINT32
  6057. seq_num:12,
  6058. encrypted:1,
  6059. chan_info_present:1,
  6060. resv0:2,
  6061. mcast_bcast:1,
  6062. fragment:1,
  6063. key_id_oct:8,
  6064. resv1:6;
  6065. A_UINT32
  6066. pn_31_0;
  6067. union {
  6068. struct {
  6069. A_UINT16 pn_47_32;
  6070. A_UINT16 pn_63_48;
  6071. } pn16;
  6072. A_UINT32 pn_63_32;
  6073. } u0;
  6074. A_UINT32
  6075. pn_95_64;
  6076. A_UINT32
  6077. pn_127_96;
  6078. } POSTPACK;
  6079. /*
  6080. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  6081. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  6082. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  6083. * Please see htt_chan_change_t for description of the fields.
  6084. */
  6085. PREPACK struct htt_chan_info_t
  6086. {
  6087. A_UINT32 primary_chan_center_freq_mhz: 16,
  6088. contig_chan1_center_freq_mhz: 16;
  6089. A_UINT32 contig_chan2_center_freq_mhz: 16,
  6090. phy_mode: 8,
  6091. reserved: 8;
  6092. } POSTPACK;
  6093. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  6094. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  6095. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  6096. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  6097. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  6098. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  6099. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  6100. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  6101. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  6102. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  6103. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  6104. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  6105. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  6106. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  6107. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  6108. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  6109. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  6110. /* Channel information */
  6111. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  6112. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  6113. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  6114. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  6115. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  6116. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  6117. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  6118. #define HTT_CHAN_INFO_PHY_MODE_S 16
  6119. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  6120. do { \
  6121. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  6122. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  6123. } while (0)
  6124. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  6125. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  6126. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  6127. do { \
  6128. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  6129. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  6130. } while (0)
  6131. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  6132. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  6133. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  6134. do { \
  6135. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  6136. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  6137. } while (0)
  6138. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  6139. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  6140. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  6141. do { \
  6142. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  6143. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  6144. } while (0)
  6145. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  6146. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  6147. /*
  6148. * @brief target -> host rx reorder flush message definition
  6149. *
  6150. * @details
  6151. * The following field definitions describe the format of the rx flush
  6152. * message sent from the target to the host.
  6153. * The message consists of a 4-octet header, followed by one or more
  6154. * 4-octet payload information elements.
  6155. *
  6156. * |31 24|23 8|7 0|
  6157. * |--------------------------------------------------------------|
  6158. * | TID | peer ID | msg type |
  6159. * |--------------------------------------------------------------|
  6160. * | seq num end | seq num start | MPDU status | reserved |
  6161. * |--------------------------------------------------------------|
  6162. * First DWORD:
  6163. * - MSG_TYPE
  6164. * Bits 7:0
  6165. * Purpose: identifies this as an rx flush message
  6166. * Value: 0x2
  6167. * - PEER_ID
  6168. * Bits 23:8 (only bits 18:8 actually used)
  6169. * Purpose: identify which peer's rx data is being flushed
  6170. * Value: (rx) peer ID
  6171. * - TID
  6172. * Bits 31:24 (only bits 27:24 actually used)
  6173. * Purpose: Specifies which traffic identifier's rx data is being flushed
  6174. * Value: traffic identifier
  6175. * Second DWORD:
  6176. * - MPDU_STATUS
  6177. * Bits 15:8
  6178. * Purpose:
  6179. * Indicate whether the flushed MPDUs should be discarded or processed.
  6180. * Value:
  6181. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  6182. * stages of rx processing
  6183. * other: discard the MPDUs
  6184. * It is anticipated that flush messages will always have
  6185. * MPDU status == 1, but the status flag is included for
  6186. * flexibility.
  6187. * - SEQ_NUM_START
  6188. * Bits 23:16
  6189. * Purpose:
  6190. * Indicate the start of a series of consecutive MPDUs being flushed.
  6191. * Not all MPDUs within this range are necessarily valid - the host
  6192. * must check each sequence number within this range to see if the
  6193. * corresponding MPDU is actually present.
  6194. * Value:
  6195. * The sequence number for the first MPDU in the sequence.
  6196. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6197. * - SEQ_NUM_END
  6198. * Bits 30:24
  6199. * Purpose:
  6200. * Indicate the end of a series of consecutive MPDUs being flushed.
  6201. * Value:
  6202. * The sequence number one larger than the sequence number of the
  6203. * last MPDU being flushed.
  6204. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6205. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  6206. * are to be released for further rx processing.
  6207. * Not all MPDUs within this range are necessarily valid - the host
  6208. * must check each sequence number within this range to see if the
  6209. * corresponding MPDU is actually present.
  6210. */
  6211. /* first DWORD */
  6212. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  6213. #define HTT_RX_FLUSH_PEER_ID_S 8
  6214. #define HTT_RX_FLUSH_TID_M 0xff000000
  6215. #define HTT_RX_FLUSH_TID_S 24
  6216. /* second DWORD */
  6217. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  6218. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  6219. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  6220. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  6221. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  6222. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  6223. #define HTT_RX_FLUSH_BYTES 8
  6224. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  6225. do { \
  6226. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  6227. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  6228. } while (0)
  6229. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  6230. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  6231. #define HTT_RX_FLUSH_TID_SET(word, value) \
  6232. do { \
  6233. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  6234. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  6235. } while (0)
  6236. #define HTT_RX_FLUSH_TID_GET(word) \
  6237. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  6238. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  6239. do { \
  6240. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  6241. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  6242. } while (0)
  6243. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  6244. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  6245. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  6246. do { \
  6247. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  6248. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  6249. } while (0)
  6250. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  6251. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  6252. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  6253. do { \
  6254. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  6255. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  6256. } while (0)
  6257. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  6258. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  6259. /*
  6260. * @brief target -> host rx pn check indication message
  6261. *
  6262. * @details
  6263. * The following field definitions describe the format of the Rx PN check
  6264. * indication message sent from the target to the host.
  6265. * The message consists of a 4-octet header, followed by the start and
  6266. * end sequence numbers to be released, followed by the PN IEs. Each PN
  6267. * IE is one octet containing the sequence number that failed the PN
  6268. * check.
  6269. *
  6270. * |31 24|23 8|7 0|
  6271. * |--------------------------------------------------------------|
  6272. * | TID | peer ID | msg type |
  6273. * |--------------------------------------------------------------|
  6274. * | Reserved | PN IE count | seq num end | seq num start|
  6275. * |--------------------------------------------------------------|
  6276. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  6277. * |--------------------------------------------------------------|
  6278. * First DWORD:
  6279. * - MSG_TYPE
  6280. * Bits 7:0
  6281. * Purpose: Identifies this as an rx pn check indication message
  6282. * Value: 0x2
  6283. * - PEER_ID
  6284. * Bits 23:8 (only bits 18:8 actually used)
  6285. * Purpose: identify which peer
  6286. * Value: (rx) peer ID
  6287. * - TID
  6288. * Bits 31:24 (only bits 27:24 actually used)
  6289. * Purpose: identify traffic identifier
  6290. * Value: traffic identifier
  6291. * Second DWORD:
  6292. * - SEQ_NUM_START
  6293. * Bits 7:0
  6294. * Purpose:
  6295. * Indicates the starting sequence number of the MPDU in this
  6296. * series of MPDUs that went though PN check.
  6297. * Value:
  6298. * The sequence number for the first MPDU in the sequence.
  6299. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6300. * - SEQ_NUM_END
  6301. * Bits 15:8
  6302. * Purpose:
  6303. * Indicates the ending sequence number of the MPDU in this
  6304. * series of MPDUs that went though PN check.
  6305. * Value:
  6306. * The sequence number one larger then the sequence number of the last
  6307. * MPDU being flushed.
  6308. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6309. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  6310. * for invalid PN numbers and are ready to be released for further processing.
  6311. * Not all MPDUs within this range are necessarily valid - the host
  6312. * must check each sequence number within this range to see if the
  6313. * corresponding MPDU is actually present.
  6314. * - PN_IE_COUNT
  6315. * Bits 23:16
  6316. * Purpose:
  6317. * Used to determine the variable number of PN information elements in this
  6318. * message
  6319. *
  6320. * PN information elements:
  6321. * - PN_IE_x-
  6322. * Purpose:
  6323. * Each PN information element contains the sequence number of the MPDU that
  6324. * has failed the target PN check.
  6325. * Value:
  6326. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  6327. * that failed the PN check.
  6328. */
  6329. /* first DWORD */
  6330. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  6331. #define HTT_RX_PN_IND_PEER_ID_S 8
  6332. #define HTT_RX_PN_IND_TID_M 0xff000000
  6333. #define HTT_RX_PN_IND_TID_S 24
  6334. /* second DWORD */
  6335. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  6336. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  6337. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  6338. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  6339. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  6340. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  6341. #define HTT_RX_PN_IND_BYTES 8
  6342. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  6343. do { \
  6344. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  6345. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  6346. } while (0)
  6347. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  6348. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  6349. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  6350. do { \
  6351. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  6352. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  6353. } while (0)
  6354. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  6355. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  6356. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  6357. do { \
  6358. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  6359. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  6360. } while (0)
  6361. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  6362. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  6363. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  6364. do { \
  6365. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  6366. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  6367. } while (0)
  6368. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  6369. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  6370. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  6371. do { \
  6372. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  6373. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  6374. } while (0)
  6375. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  6376. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  6377. /*
  6378. * @brief target -> host rx offload deliver message for LL system
  6379. *
  6380. * @details
  6381. * In a low latency system this message is sent whenever the offload
  6382. * manager flushes out the packets it has coalesced in its coalescing buffer.
  6383. * The DMA of the actual packets into host memory is done before sending out
  6384. * this message. This message indicates only how many MSDUs to reap. The
  6385. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  6386. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  6387. * DMA'd by the MAC directly into host memory these packets do not contain
  6388. * the MAC descriptors in the header portion of the packet. Instead they contain
  6389. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  6390. * message, the packets are delivered directly to the NW stack without going
  6391. * through the regular reorder buffering and PN checking path since it has
  6392. * already been done in target.
  6393. *
  6394. * |31 24|23 16|15 8|7 0|
  6395. * |-----------------------------------------------------------------------|
  6396. * | Total MSDU count | reserved | msg type |
  6397. * |-----------------------------------------------------------------------|
  6398. *
  6399. * @brief target -> host rx offload deliver message for HL system
  6400. *
  6401. * @details
  6402. * In a high latency system this message is sent whenever the offload manager
  6403. * flushes out the packets it has coalesced in its coalescing buffer. The
  6404. * actual packets are also carried along with this message. When the host
  6405. * receives this message, it is expected to deliver these packets to the NW
  6406. * stack directly instead of routing them through the reorder buffering and
  6407. * PN checking path since it has already been done in target.
  6408. *
  6409. * |31 24|23 16|15 8|7 0|
  6410. * |-----------------------------------------------------------------------|
  6411. * | Total MSDU count | reserved | msg type |
  6412. * |-----------------------------------------------------------------------|
  6413. * | peer ID | MSDU length |
  6414. * |-----------------------------------------------------------------------|
  6415. * | MSDU payload | FW Desc | tid | vdev ID |
  6416. * |-----------------------------------------------------------------------|
  6417. * | MSDU payload contd. |
  6418. * |-----------------------------------------------------------------------|
  6419. * | peer ID | MSDU length |
  6420. * |-----------------------------------------------------------------------|
  6421. * | MSDU payload | FW Desc | tid | vdev ID |
  6422. * |-----------------------------------------------------------------------|
  6423. * | MSDU payload contd. |
  6424. * |-----------------------------------------------------------------------|
  6425. *
  6426. */
  6427. /* first DWORD */
  6428. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  6429. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  6430. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  6431. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  6432. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  6433. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  6434. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  6435. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  6436. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  6437. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  6438. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  6439. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  6440. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  6441. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  6442. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  6443. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  6444. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  6445. do { \
  6446. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  6447. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  6448. } while (0)
  6449. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  6450. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  6451. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  6452. do { \
  6453. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  6454. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  6455. } while (0)
  6456. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  6457. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  6458. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  6459. do { \
  6460. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  6461. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  6462. } while (0)
  6463. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  6464. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  6465. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  6466. do { \
  6467. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  6468. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  6469. } while (0)
  6470. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  6471. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  6472. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  6473. do { \
  6474. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  6475. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  6476. } while (0)
  6477. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  6478. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  6479. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  6480. do { \
  6481. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  6482. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  6483. } while (0)
  6484. /**
  6485. * @brief target -> host rx peer map/unmap message definition
  6486. *
  6487. * @details
  6488. * The following diagram shows the format of the rx peer map message sent
  6489. * from the target to the host. This layout assumes the target operates
  6490. * as little-endian.
  6491. *
  6492. * This message always contains a SW peer ID. The main purpose of the
  6493. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6494. * with, so that the host can use that peer ID to determine which peer
  6495. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6496. * other purposes, such as identifying during tx completions which peer
  6497. * the tx frames in question were transmitted to.
  6498. *
  6499. * In certain generations of chips, the peer map message also contains
  6500. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  6501. * to identify which peer the frame needs to be forwarded to (i.e. the
  6502. * peer assocated with the Destination MAC Address within the packet),
  6503. * and particularly which vdev needs to transmit the frame (for cases
  6504. * of inter-vdev rx --> tx forwarding).
  6505. * This DA-based peer ID that is provided for certain rx frames
  6506. * (the rx frames that need to be re-transmitted as tx frames)
  6507. * is the ID that the HW uses for referring to the peer in question,
  6508. * rather than the peer ID that the SW+FW use to refer to the peer.
  6509. *
  6510. *
  6511. * |31 24|23 16|15 8|7 0|
  6512. * |-----------------------------------------------------------------------|
  6513. * | SW peer ID | VDEV ID | msg type |
  6514. * |-----------------------------------------------------------------------|
  6515. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6516. * |-----------------------------------------------------------------------|
  6517. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6518. * |-----------------------------------------------------------------------|
  6519. *
  6520. *
  6521. * The following diagram shows the format of the rx peer unmap message sent
  6522. * from the target to the host.
  6523. *
  6524. * |31 24|23 16|15 8|7 0|
  6525. * |-----------------------------------------------------------------------|
  6526. * | SW peer ID | VDEV ID | msg type |
  6527. * |-----------------------------------------------------------------------|
  6528. *
  6529. * The following field definitions describe the format of the rx peer map
  6530. * and peer unmap messages sent from the target to the host.
  6531. * - MSG_TYPE
  6532. * Bits 7:0
  6533. * Purpose: identifies this as an rx peer map or peer unmap message
  6534. * Value: peer map -> 0x3, peer unmap -> 0x4
  6535. * - VDEV_ID
  6536. * Bits 15:8
  6537. * Purpose: Indicates which virtual device the peer is associated
  6538. * with.
  6539. * Value: vdev ID (used in the host to look up the vdev object)
  6540. * - PEER_ID (a.k.a. SW_PEER_ID)
  6541. * Bits 31:16
  6542. * Purpose: The peer ID (index) that WAL is allocating (map) or
  6543. * freeing (unmap)
  6544. * Value: (rx) peer ID
  6545. * - MAC_ADDR_L32 (peer map only)
  6546. * Bits 31:0
  6547. * Purpose: Identifies which peer node the peer ID is for.
  6548. * Value: lower 4 bytes of peer node's MAC address
  6549. * - MAC_ADDR_U16 (peer map only)
  6550. * Bits 15:0
  6551. * Purpose: Identifies which peer node the peer ID is for.
  6552. * Value: upper 2 bytes of peer node's MAC address
  6553. * - HW_PEER_ID
  6554. * Bits 31:16
  6555. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6556. * address, so for rx frames marked for rx --> tx forwarding, the
  6557. * host can determine from the HW peer ID provided as meta-data with
  6558. * the rx frame which peer the frame is supposed to be forwarded to.
  6559. * Value: ID used by the MAC HW to identify the peer
  6560. */
  6561. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  6562. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  6563. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  6564. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  6565. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  6566. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  6567. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  6568. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  6569. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  6570. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  6571. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  6572. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  6573. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  6574. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  6575. do { \
  6576. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  6577. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  6578. } while (0)
  6579. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  6580. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  6581. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  6582. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  6583. do { \
  6584. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  6585. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  6586. } while (0)
  6587. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  6588. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  6589. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  6590. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  6591. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  6592. do { \
  6593. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  6594. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  6595. } while (0)
  6596. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  6597. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  6598. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  6599. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  6600. #define HTT_RX_PEER_MAP_BYTES 12
  6601. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  6602. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  6603. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  6604. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  6605. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  6606. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  6607. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  6608. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  6609. #define HTT_RX_PEER_UNMAP_BYTES 4
  6610. /**
  6611. * @brief target -> host rx peer map V2 message definition
  6612. *
  6613. * @details
  6614. * The following diagram shows the format of the rx peer map v2 message sent
  6615. * from the target to the host. This layout assumes the target operates
  6616. * as little-endian.
  6617. *
  6618. * This message always contains a SW peer ID. The main purpose of the
  6619. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6620. * with, so that the host can use that peer ID to determine which peer
  6621. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6622. * other purposes, such as identifying during tx completions which peer
  6623. * the tx frames in question were transmitted to.
  6624. *
  6625. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  6626. * is used during rx --> tx frame forwarding to identify which peer the
  6627. * frame needs to be forwarded to (i.e. the peer assocated with the
  6628. * Destination MAC Address within the packet), and particularly which vdev
  6629. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  6630. * This DA-based peer ID that is provided for certain rx frames
  6631. * (the rx frames that need to be re-transmitted as tx frames)
  6632. * is the ID that the HW uses for referring to the peer in question,
  6633. * rather than the peer ID that the SW+FW use to refer to the peer.
  6634. *
  6635. *
  6636. * |31 24|23 16|15 8|7 0|
  6637. * |-----------------------------------------------------------------------|
  6638. * | SW peer ID | VDEV ID | msg type |
  6639. * |-----------------------------------------------------------------------|
  6640. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6641. * |-----------------------------------------------------------------------|
  6642. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6643. * |-----------------------------------------------------------------------|
  6644. * | Reserved_17_31 | Next Hop | AST Hash Value |
  6645. * |-----------------------------------------------------------------------|
  6646. * | Reserved_0 |
  6647. * |-----------------------------------------------------------------------|
  6648. * | Reserved_1 |
  6649. * |-----------------------------------------------------------------------|
  6650. * | Reserved_2 |
  6651. * |-----------------------------------------------------------------------|
  6652. * | Reserved_3 |
  6653. * |-----------------------------------------------------------------------|
  6654. *
  6655. *
  6656. * The following field definitions describe the format of the rx peer map v2
  6657. * messages sent from the target to the host.
  6658. * - MSG_TYPE
  6659. * Bits 7:0
  6660. * Purpose: identifies this as an rx peer map v2 message
  6661. * Value: peer map v2 -> 0x1e
  6662. * - VDEV_ID
  6663. * Bits 15:8
  6664. * Purpose: Indicates which virtual device the peer is associated with.
  6665. * Value: vdev ID (used in the host to look up the vdev object)
  6666. * - SW_PEER_ID
  6667. * Bits 31:16
  6668. * Purpose: The peer ID (index) that WAL is allocating
  6669. * Value: (rx) peer ID
  6670. * - MAC_ADDR_L32
  6671. * Bits 31:0
  6672. * Purpose: Identifies which peer node the peer ID is for.
  6673. * Value: lower 4 bytes of peer node's MAC address
  6674. * - MAC_ADDR_U16
  6675. * Bits 15:0
  6676. * Purpose: Identifies which peer node the peer ID is for.
  6677. * Value: upper 2 bytes of peer node's MAC address
  6678. * - HW_PEER_ID
  6679. * Bits 31:16
  6680. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6681. * address, so for rx frames marked for rx --> tx forwarding, the
  6682. * host can determine from the HW peer ID provided as meta-data with
  6683. * the rx frame which peer the frame is supposed to be forwarded to.
  6684. * Value: ID used by the MAC HW to identify the peer
  6685. * - AST_HASH_VALUE
  6686. * Bits 15:0
  6687. * Purpose: Indicates AST Hash value is required for the TCL AST index
  6688. * override feature.
  6689. * - NEXT_HOP
  6690. * Bit 16
  6691. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  6692. * (Wireless Distribution System).
  6693. */
  6694. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  6695. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  6696. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  6697. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  6698. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  6699. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  6700. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  6701. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  6702. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  6703. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  6704. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  6705. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  6706. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  6707. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  6708. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  6709. do { \
  6710. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  6711. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  6712. } while (0)
  6713. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  6714. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  6715. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  6716. do { \
  6717. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  6718. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  6719. } while (0)
  6720. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  6721. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  6722. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  6723. do { \
  6724. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  6725. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  6726. } while (0)
  6727. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  6728. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  6729. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  6730. do { \
  6731. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  6732. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  6733. } while (0)
  6734. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  6735. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  6736. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  6737. do { \
  6738. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  6739. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  6740. } while (0)
  6741. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  6742. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  6743. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  6744. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  6745. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  6746. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  6747. #define HTT_RX_PEER_MAP_V2_BYTES 32
  6748. /**
  6749. * @brief target -> host rx peer unmap V2 message definition
  6750. *
  6751. *
  6752. * The following diagram shows the format of the rx peer unmap message sent
  6753. * from the target to the host.
  6754. *
  6755. * |31 24|23 16|15 8|7 0|
  6756. * |-----------------------------------------------------------------------|
  6757. * | SW peer ID | VDEV ID | msg type |
  6758. * |-----------------------------------------------------------------------|
  6759. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6760. * |-----------------------------------------------------------------------|
  6761. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  6762. * |-----------------------------------------------------------------------|
  6763. * | Peer Delete Duration |
  6764. * |-----------------------------------------------------------------------|
  6765. * | Reserved_0 |
  6766. * |-----------------------------------------------------------------------|
  6767. * | Reserved_1 |
  6768. * |-----------------------------------------------------------------------|
  6769. * | Reserved_2 |
  6770. * |-----------------------------------------------------------------------|
  6771. *
  6772. *
  6773. * The following field definitions describe the format of the rx peer unmap
  6774. * messages sent from the target to the host.
  6775. * - MSG_TYPE
  6776. * Bits 7:0
  6777. * Purpose: identifies this as an rx peer unmap v2 message
  6778. * Value: peer unmap v2 -> 0x1f
  6779. * - VDEV_ID
  6780. * Bits 15:8
  6781. * Purpose: Indicates which virtual device the peer is associated
  6782. * with.
  6783. * Value: vdev ID (used in the host to look up the vdev object)
  6784. * - SW_PEER_ID
  6785. * Bits 31:16
  6786. * Purpose: The peer ID (index) that WAL is freeing
  6787. * Value: (rx) peer ID
  6788. * - MAC_ADDR_L32
  6789. * Bits 31:0
  6790. * Purpose: Identifies which peer node the peer ID is for.
  6791. * Value: lower 4 bytes of peer node's MAC address
  6792. * - MAC_ADDR_U16
  6793. * Bits 15:0
  6794. * Purpose: Identifies which peer node the peer ID is for.
  6795. * Value: upper 2 bytes of peer node's MAC address
  6796. * - NEXT_HOP
  6797. * Bits 16
  6798. * Purpose: Bit indicates next_hop AST entry used for WDS
  6799. * (Wireless Distribution System).
  6800. * - PEER_DELETE_DURATION
  6801. * Bits 31:0
  6802. * Purpose: Time taken to delete peer, in msec,
  6803. * Used for monitoring / debugging PEER delete response delay
  6804. */
  6805. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  6806. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  6807. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  6808. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  6809. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  6810. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  6811. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  6812. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  6813. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  6814. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  6815. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  6816. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  6817. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  6818. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  6819. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  6820. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  6821. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  6822. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  6823. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  6824. do { \
  6825. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  6826. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  6827. } while (0)
  6828. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  6829. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  6830. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  6831. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  6832. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  6833. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  6834. /**
  6835. * @brief target -> host message specifying security parameters
  6836. *
  6837. * @details
  6838. * The following diagram shows the format of the security specification
  6839. * message sent from the target to the host.
  6840. * This security specification message tells the host whether a PN check is
  6841. * necessary on rx data frames, and if so, how large the PN counter is.
  6842. * This message also tells the host about the security processing to apply
  6843. * to defragmented rx frames - specifically, whether a Message Integrity
  6844. * Check is required, and the Michael key to use.
  6845. *
  6846. * |31 24|23 16|15|14 8|7 0|
  6847. * |-----------------------------------------------------------------------|
  6848. * | peer ID | U| security type | msg type |
  6849. * |-----------------------------------------------------------------------|
  6850. * | Michael Key K0 |
  6851. * |-----------------------------------------------------------------------|
  6852. * | Michael Key K1 |
  6853. * |-----------------------------------------------------------------------|
  6854. * | WAPI RSC Low0 |
  6855. * |-----------------------------------------------------------------------|
  6856. * | WAPI RSC Low1 |
  6857. * |-----------------------------------------------------------------------|
  6858. * | WAPI RSC Hi0 |
  6859. * |-----------------------------------------------------------------------|
  6860. * | WAPI RSC Hi1 |
  6861. * |-----------------------------------------------------------------------|
  6862. *
  6863. * The following field definitions describe the format of the security
  6864. * indication message sent from the target to the host.
  6865. * - MSG_TYPE
  6866. * Bits 7:0
  6867. * Purpose: identifies this as a security specification message
  6868. * Value: 0xb
  6869. * - SEC_TYPE
  6870. * Bits 14:8
  6871. * Purpose: specifies which type of security applies to the peer
  6872. * Value: htt_sec_type enum value
  6873. * - UNICAST
  6874. * Bit 15
  6875. * Purpose: whether this security is applied to unicast or multicast data
  6876. * Value: 1 -> unicast, 0 -> multicast
  6877. * - PEER_ID
  6878. * Bits 31:16
  6879. * Purpose: The ID number for the peer the security specification is for
  6880. * Value: peer ID
  6881. * - MICHAEL_KEY_K0
  6882. * Bits 31:0
  6883. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  6884. * Value: Michael Key K0 (if security type is TKIP)
  6885. * - MICHAEL_KEY_K1
  6886. * Bits 31:0
  6887. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  6888. * Value: Michael Key K1 (if security type is TKIP)
  6889. * - WAPI_RSC_LOW0
  6890. * Bits 31:0
  6891. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  6892. * Value: WAPI RSC Low0 (if security type is WAPI)
  6893. * - WAPI_RSC_LOW1
  6894. * Bits 31:0
  6895. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  6896. * Value: WAPI RSC Low1 (if security type is WAPI)
  6897. * - WAPI_RSC_HI0
  6898. * Bits 31:0
  6899. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  6900. * Value: WAPI RSC Hi0 (if security type is WAPI)
  6901. * - WAPI_RSC_HI1
  6902. * Bits 31:0
  6903. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  6904. * Value: WAPI RSC Hi1 (if security type is WAPI)
  6905. */
  6906. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  6907. #define HTT_SEC_IND_SEC_TYPE_S 8
  6908. #define HTT_SEC_IND_UNICAST_M 0x00008000
  6909. #define HTT_SEC_IND_UNICAST_S 15
  6910. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  6911. #define HTT_SEC_IND_PEER_ID_S 16
  6912. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  6913. do { \
  6914. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  6915. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  6916. } while (0)
  6917. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  6918. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  6919. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  6920. do { \
  6921. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  6922. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  6923. } while (0)
  6924. #define HTT_SEC_IND_UNICAST_GET(word) \
  6925. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  6926. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  6927. do { \
  6928. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  6929. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  6930. } while (0)
  6931. #define HTT_SEC_IND_PEER_ID_GET(word) \
  6932. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  6933. #define HTT_SEC_IND_BYTES 28
  6934. /**
  6935. * @brief target -> host rx ADDBA / DELBA message definitions
  6936. *
  6937. * @details
  6938. * The following diagram shows the format of the rx ADDBA message sent
  6939. * from the target to the host:
  6940. *
  6941. * |31 20|19 16|15 8|7 0|
  6942. * |---------------------------------------------------------------------|
  6943. * | peer ID | TID | window size | msg type |
  6944. * |---------------------------------------------------------------------|
  6945. *
  6946. * The following diagram shows the format of the rx DELBA message sent
  6947. * from the target to the host:
  6948. *
  6949. * |31 20|19 16|15 8|7 0|
  6950. * |---------------------------------------------------------------------|
  6951. * | peer ID | TID | reserved | msg type |
  6952. * |---------------------------------------------------------------------|
  6953. *
  6954. * The following field definitions describe the format of the rx ADDBA
  6955. * and DELBA messages sent from the target to the host.
  6956. * - MSG_TYPE
  6957. * Bits 7:0
  6958. * Purpose: identifies this as an rx ADDBA or DELBA message
  6959. * Value: ADDBA -> 0x5, DELBA -> 0x6
  6960. * - WIN_SIZE
  6961. * Bits 15:8 (ADDBA only)
  6962. * Purpose: Specifies the length of the block ack window (max = 64).
  6963. * Value:
  6964. * block ack window length specified by the received ADDBA
  6965. * management message.
  6966. * - TID
  6967. * Bits 19:16
  6968. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  6969. * Value:
  6970. * TID specified by the received ADDBA or DELBA management message.
  6971. * - PEER_ID
  6972. * Bits 31:20
  6973. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  6974. * Value:
  6975. * ID (hash value) used by the host for fast, direct lookup of
  6976. * host SW peer info, including rx reorder states.
  6977. */
  6978. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  6979. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  6980. #define HTT_RX_ADDBA_TID_M 0xf0000
  6981. #define HTT_RX_ADDBA_TID_S 16
  6982. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  6983. #define HTT_RX_ADDBA_PEER_ID_S 20
  6984. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  6985. do { \
  6986. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  6987. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  6988. } while (0)
  6989. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  6990. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  6991. #define HTT_RX_ADDBA_TID_SET(word, value) \
  6992. do { \
  6993. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  6994. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  6995. } while (0)
  6996. #define HTT_RX_ADDBA_TID_GET(word) \
  6997. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  6998. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  6999. do { \
  7000. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  7001. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  7002. } while (0)
  7003. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  7004. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  7005. #define HTT_RX_ADDBA_BYTES 4
  7006. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  7007. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  7008. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  7009. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  7010. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  7011. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  7012. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  7013. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  7014. #define HTT_RX_DELBA_BYTES 4
  7015. /**
  7016. * @brief tx queue group information element definition
  7017. *
  7018. * @details
  7019. * The following diagram shows the format of the tx queue group
  7020. * information element, which can be included in target --> host
  7021. * messages to specify the number of tx "credits" (tx descriptors
  7022. * for LL, or tx buffers for HL) available to a particular group
  7023. * of host-side tx queues, and which host-side tx queues belong to
  7024. * the group.
  7025. *
  7026. * |31|30 24|23 16|15|14|13 0|
  7027. * |------------------------------------------------------------------------|
  7028. * | X| reserved | tx queue grp ID | A| S| credit count |
  7029. * |------------------------------------------------------------------------|
  7030. * | vdev ID mask | AC mask |
  7031. * |------------------------------------------------------------------------|
  7032. *
  7033. * The following definitions describe the fields within the tx queue group
  7034. * information element:
  7035. * - credit_count
  7036. * Bits 13:1
  7037. * Purpose: specify how many tx credits are available to the tx queue group
  7038. * Value: An absolute or relative, positive or negative credit value
  7039. * The 'A' bit specifies whether the value is absolute or relative.
  7040. * The 'S' bit specifies whether the value is positive or negative.
  7041. * A negative value can only be relative, not absolute.
  7042. * An absolute value replaces any prior credit value the host has for
  7043. * the tx queue group in question.
  7044. * A relative value is added to the prior credit value the host has for
  7045. * the tx queue group in question.
  7046. * - sign
  7047. * Bit 14
  7048. * Purpose: specify whether the credit count is positive or negative
  7049. * Value: 0 -> positive, 1 -> negative
  7050. * - absolute
  7051. * Bit 15
  7052. * Purpose: specify whether the credit count is absolute or relative
  7053. * Value: 0 -> relative, 1 -> absolute
  7054. * - txq_group_id
  7055. * Bits 23:16
  7056. * Purpose: indicate which tx queue group's credit and/or membership are
  7057. * being specified
  7058. * Value: 0 to max_tx_queue_groups-1
  7059. * - reserved
  7060. * Bits 30:16
  7061. * Value: 0x0
  7062. * - eXtension
  7063. * Bit 31
  7064. * Purpose: specify whether another tx queue group info element follows
  7065. * Value: 0 -> no more tx queue group information elements
  7066. * 1 -> another tx queue group information element immediately follows
  7067. * - ac_mask
  7068. * Bits 15:0
  7069. * Purpose: specify which Access Categories belong to the tx queue group
  7070. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  7071. * the tx queue group.
  7072. * The AC bit-mask values are obtained by left-shifting by the
  7073. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  7074. * - vdev_id_mask
  7075. * Bits 31:16
  7076. * Purpose: specify which vdev's tx queues belong to the tx queue group
  7077. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  7078. * belong to the tx queue group.
  7079. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  7080. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  7081. */
  7082. PREPACK struct htt_txq_group {
  7083. A_UINT32
  7084. credit_count: 14,
  7085. sign: 1,
  7086. absolute: 1,
  7087. tx_queue_group_id: 8,
  7088. reserved0: 7,
  7089. extension: 1;
  7090. A_UINT32
  7091. ac_mask: 16,
  7092. vdev_id_mask: 16;
  7093. } POSTPACK;
  7094. /* first word */
  7095. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  7096. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  7097. #define HTT_TXQ_GROUP_SIGN_S 14
  7098. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  7099. #define HTT_TXQ_GROUP_ABS_S 15
  7100. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  7101. #define HTT_TXQ_GROUP_ID_S 16
  7102. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  7103. #define HTT_TXQ_GROUP_EXT_S 31
  7104. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  7105. /* second word */
  7106. #define HTT_TXQ_GROUP_AC_MASK_S 0
  7107. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  7108. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  7109. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  7110. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  7111. do { \
  7112. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  7113. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  7114. } while (0)
  7115. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  7116. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  7117. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  7118. do { \
  7119. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  7120. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  7121. } while (0)
  7122. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  7123. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  7124. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  7125. do { \
  7126. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  7127. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  7128. } while (0)
  7129. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  7130. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  7131. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  7132. do { \
  7133. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  7134. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  7135. } while (0)
  7136. #define HTT_TXQ_GROUP_ID_GET(_info) \
  7137. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  7138. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  7139. do { \
  7140. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  7141. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  7142. } while (0)
  7143. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  7144. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  7145. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  7146. do { \
  7147. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  7148. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  7149. } while (0)
  7150. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  7151. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  7152. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  7153. do { \
  7154. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  7155. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  7156. } while (0)
  7157. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  7158. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  7159. /**
  7160. * @brief target -> host TX completion indication message definition
  7161. *
  7162. * @details
  7163. * The following diagram shows the format of the TX completion indication sent
  7164. * from the target to the host
  7165. *
  7166. * |31 27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  7167. * |------------------------------------------------------------|
  7168. * header: | rsvd |TP|A1|A0| num | t_i| tid |status| msg_type |
  7169. * |------------------------------------------------------------|
  7170. * payload: | MSDU1 ID | MSDU0 ID |
  7171. * |------------------------------------------------------------|
  7172. * : MSDU3 ID : MSDU2 ID :
  7173. * |------------------------------------------------------------|
  7174. * | struct htt_tx_compl_ind_append_retries |
  7175. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7176. * | struct htt_tx_compl_ind_append_tx_tstamp |
  7177. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7178. * Where:
  7179. * A0 = append (a.k.a. append0)
  7180. * A1 = append1
  7181. * TP = MSDU tx power presence
  7182. *
  7183. * The following field definitions describe the format of the TX completion
  7184. * indication sent from the target to the host
  7185. * Header fields:
  7186. * - msg_type
  7187. * Bits 7:0
  7188. * Purpose: identifies this as HTT TX completion indication
  7189. * Value: 0x7
  7190. * - status
  7191. * Bits 10:8
  7192. * Purpose: the TX completion status of payload fragmentations descriptors
  7193. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  7194. * - tid
  7195. * Bits 14:11
  7196. * Purpose: the tid associated with those fragmentation descriptors. It is
  7197. * valid or not, depending on the tid_invalid bit.
  7198. * Value: 0 to 15
  7199. * - tid_invalid
  7200. * Bits 15:15
  7201. * Purpose: this bit indicates whether the tid field is valid or not
  7202. * Value: 0 indicates valid; 1 indicates invalid
  7203. * - num
  7204. * Bits 23:16
  7205. * Purpose: the number of payload in this indication
  7206. * Value: 1 to 255
  7207. * - append (a.k.a. append0)
  7208. * Bits 24:24
  7209. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  7210. * the number of tx retries for one MSDU at the end of this message
  7211. * Value: 0 indicates no appending; 1 indicates appending
  7212. * - append1
  7213. * Bits 25:25
  7214. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  7215. * contains the timestamp info for each TX msdu id in payload.
  7216. * The order of the timestamps matches the order of the MSDU IDs.
  7217. * Note that a big-endian host needs to account for the reordering
  7218. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7219. * conversion) when determining which tx timestamp corresponds to
  7220. * which MSDU ID.
  7221. * Value: 0 indicates no appending; 1 indicates appending
  7222. * - msdu_tx_power_presence
  7223. * Bits 26:26
  7224. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  7225. * for each MSDU referenced by the TX_COMPL_IND message.
  7226. * The tx power is reported in 0.5 dBm units.
  7227. * The order of the per-MSDU tx power reports matches the order
  7228. * of the MSDU IDs.
  7229. * Note that a big-endian host needs to account for the reordering
  7230. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7231. * conversion) when determining which Tx Power corresponds to
  7232. * which MSDU ID.
  7233. * Value: 0 indicates MSDU tx power reports are not appended,
  7234. * 1 indicates MSDU tx power reports are appended
  7235. * Payload fields:
  7236. * - hmsdu_id
  7237. * Bits 15:0
  7238. * Purpose: this ID is used to track the Tx buffer in host
  7239. * Value: 0 to "size of host MSDU descriptor pool - 1"
  7240. */
  7241. #define HTT_TX_COMPL_IND_STATUS_S 8
  7242. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  7243. #define HTT_TX_COMPL_IND_TID_S 11
  7244. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  7245. #define HTT_TX_COMPL_IND_TID_INV_S 15
  7246. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  7247. #define HTT_TX_COMPL_IND_NUM_S 16
  7248. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  7249. #define HTT_TX_COMPL_IND_APPEND_S 24
  7250. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  7251. #define HTT_TX_COMPL_IND_APPEND1_S 25
  7252. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  7253. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  7254. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  7255. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  7256. do { \
  7257. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  7258. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  7259. } while (0)
  7260. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  7261. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  7262. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  7263. do { \
  7264. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  7265. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  7266. } while (0)
  7267. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  7268. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  7269. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  7270. do { \
  7271. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  7272. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  7273. } while (0)
  7274. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  7275. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  7276. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  7277. do { \
  7278. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  7279. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  7280. } while (0)
  7281. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  7282. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  7283. HTT_TX_COMPL_IND_TID_INV_S)
  7284. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  7285. do { \
  7286. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  7287. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  7288. } while (0)
  7289. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  7290. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  7291. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  7292. do { \
  7293. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  7294. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  7295. } while (0)
  7296. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  7297. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  7298. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  7299. do { \
  7300. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  7301. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  7302. } while (0)
  7303. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  7304. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  7305. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  7306. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  7307. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  7308. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  7309. #define HTT_TX_COMPL_IND_STAT_OK 0
  7310. /* DISCARD:
  7311. * current meaning:
  7312. * MSDUs were queued for transmission but filtered by HW or SW
  7313. * without any over the air attempts
  7314. * legacy meaning (HL Rome):
  7315. * MSDUs were discarded by the target FW without any over the air
  7316. * attempts due to lack of space
  7317. */
  7318. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  7319. /* NO_ACK:
  7320. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  7321. */
  7322. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  7323. /* POSTPONE:
  7324. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  7325. * be downloaded again later (in the appropriate order), when they are
  7326. * deliverable.
  7327. */
  7328. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  7329. /*
  7330. * The PEER_DEL tx completion status is used for HL cases
  7331. * where the peer the frame is for has been deleted.
  7332. * The host has already discarded its copy of the frame, but
  7333. * it still needs the tx completion to restore its credit.
  7334. */
  7335. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  7336. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  7337. #define HTT_TX_COMPL_IND_STAT_DROP 5
  7338. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  7339. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  7340. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  7341. PREPACK struct htt_tx_compl_ind_base {
  7342. A_UINT32 hdr;
  7343. A_UINT16 payload[1/*or more*/];
  7344. } POSTPACK;
  7345. PREPACK struct htt_tx_compl_ind_append_retries {
  7346. A_UINT16 msdu_id;
  7347. A_UINT8 tx_retries;
  7348. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  7349. 0: this is the last append_retries struct */
  7350. } POSTPACK;
  7351. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  7352. A_UINT32 timestamp[1/*or more*/];
  7353. } POSTPACK;
  7354. /**
  7355. * @brief target -> host rate-control update indication message
  7356. *
  7357. * @details
  7358. * The following diagram shows the format of the RC Update message
  7359. * sent from the target to the host, while processing the tx-completion
  7360. * of a transmitted PPDU.
  7361. *
  7362. * |31 24|23 16|15 8|7 0|
  7363. * |-------------------------------------------------------------|
  7364. * | peer ID | vdev ID | msg_type |
  7365. * |-------------------------------------------------------------|
  7366. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7367. * |-------------------------------------------------------------|
  7368. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  7369. * |-------------------------------------------------------------|
  7370. * | : |
  7371. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7372. * | : |
  7373. * |-------------------------------------------------------------|
  7374. * | : |
  7375. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7376. * | : |
  7377. * |-------------------------------------------------------------|
  7378. * : :
  7379. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7380. *
  7381. */
  7382. typedef struct {
  7383. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  7384. A_UINT32 rate_code_flags;
  7385. A_UINT32 flags; /* Encodes information such as excessive
  7386. retransmission, aggregate, some info
  7387. from .11 frame control,
  7388. STBC, LDPC, (SGI and Tx Chain Mask
  7389. are encoded in ptx_rc->flags field),
  7390. AMPDU truncation (BT/time based etc.),
  7391. RTS/CTS attempt */
  7392. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  7393. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  7394. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  7395. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  7396. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  7397. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  7398. } HTT_RC_TX_DONE_PARAMS;
  7399. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  7400. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  7401. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  7402. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  7403. #define HTT_RC_UPDATE_VDEVID_S 8
  7404. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  7405. #define HTT_RC_UPDATE_PEERID_S 16
  7406. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  7407. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  7408. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  7409. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  7410. do { \
  7411. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  7412. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  7413. } while (0)
  7414. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  7415. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  7416. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  7417. do { \
  7418. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  7419. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  7420. } while (0)
  7421. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  7422. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  7423. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  7424. do { \
  7425. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  7426. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  7427. } while (0)
  7428. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  7429. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  7430. /**
  7431. * @brief target -> host rx fragment indication message definition
  7432. *
  7433. * @details
  7434. * The following field definitions describe the format of the rx fragment
  7435. * indication message sent from the target to the host.
  7436. * The rx fragment indication message shares the format of the
  7437. * rx indication message, but not all fields from the rx indication message
  7438. * are relevant to the rx fragment indication message.
  7439. *
  7440. *
  7441. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  7442. * |-----------+-------------------+---------------------+-------------|
  7443. * | peer ID | |FV| ext TID | msg type |
  7444. * |-------------------------------------------------------------------|
  7445. * | | flush | flush |
  7446. * | | end | start |
  7447. * | | seq num | seq num |
  7448. * |-------------------------------------------------------------------|
  7449. * | reserved | FW rx desc bytes |
  7450. * |-------------------------------------------------------------------|
  7451. * | | FW MSDU Rx |
  7452. * | | desc B0 |
  7453. * |-------------------------------------------------------------------|
  7454. * Header fields:
  7455. * - MSG_TYPE
  7456. * Bits 7:0
  7457. * Purpose: identifies this as an rx fragment indication message
  7458. * Value: 0xa
  7459. * - EXT_TID
  7460. * Bits 12:8
  7461. * Purpose: identify the traffic ID of the rx data, including
  7462. * special "extended" TID values for multicast, broadcast, and
  7463. * non-QoS data frames
  7464. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  7465. * - FLUSH_VALID (FV)
  7466. * Bit 13
  7467. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  7468. * is valid
  7469. * Value:
  7470. * 1 -> flush IE is valid and needs to be processed
  7471. * 0 -> flush IE is not valid and should be ignored
  7472. * - PEER_ID
  7473. * Bits 31:16
  7474. * Purpose: Identify, by ID, which peer sent the rx data
  7475. * Value: ID of the peer who sent the rx data
  7476. * - FLUSH_SEQ_NUM_START
  7477. * Bits 5:0
  7478. * Purpose: Indicate the start of a series of MPDUs to flush
  7479. * Not all MPDUs within this series are necessarily valid - the host
  7480. * must check each sequence number within this range to see if the
  7481. * corresponding MPDU is actually present.
  7482. * This field is only valid if the FV bit is set.
  7483. * Value:
  7484. * The sequence number for the first MPDUs to check to flush.
  7485. * The sequence number is masked by 0x3f.
  7486. * - FLUSH_SEQ_NUM_END
  7487. * Bits 11:6
  7488. * Purpose: Indicate the end of a series of MPDUs to flush
  7489. * Value:
  7490. * The sequence number one larger than the sequence number of the
  7491. * last MPDU to check to flush.
  7492. * The sequence number is masked by 0x3f.
  7493. * Not all MPDUs within this series are necessarily valid - the host
  7494. * must check each sequence number within this range to see if the
  7495. * corresponding MPDU is actually present.
  7496. * This field is only valid if the FV bit is set.
  7497. * Rx descriptor fields:
  7498. * - FW_RX_DESC_BYTES
  7499. * Bits 15:0
  7500. * Purpose: Indicate how many bytes in the Rx indication are used for
  7501. * FW Rx descriptors
  7502. * Value: 1
  7503. */
  7504. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  7505. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  7506. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  7507. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  7508. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  7509. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  7510. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  7511. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  7512. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  7513. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  7514. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  7515. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  7516. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  7517. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  7518. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  7519. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  7520. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  7521. #define HTT_RX_FRAG_IND_BYTES \
  7522. (4 /* msg hdr */ + \
  7523. 4 /* flush spec */ + \
  7524. 4 /* (unused) FW rx desc bytes spec */ + \
  7525. 4 /* FW rx desc */)
  7526. /**
  7527. * @brief target -> host test message definition
  7528. *
  7529. * @details
  7530. * The following field definitions describe the format of the test
  7531. * message sent from the target to the host.
  7532. * The message consists of a 4-octet header, followed by a variable
  7533. * number of 32-bit integer values, followed by a variable number
  7534. * of 8-bit character values.
  7535. *
  7536. * |31 16|15 8|7 0|
  7537. * |-----------------------------------------------------------|
  7538. * | num chars | num ints | msg type |
  7539. * |-----------------------------------------------------------|
  7540. * | int 0 |
  7541. * |-----------------------------------------------------------|
  7542. * | int 1 |
  7543. * |-----------------------------------------------------------|
  7544. * | ... |
  7545. * |-----------------------------------------------------------|
  7546. * | char 3 | char 2 | char 1 | char 0 |
  7547. * |-----------------------------------------------------------|
  7548. * | | | ... | char 4 |
  7549. * |-----------------------------------------------------------|
  7550. * - MSG_TYPE
  7551. * Bits 7:0
  7552. * Purpose: identifies this as a test message
  7553. * Value: HTT_MSG_TYPE_TEST
  7554. * - NUM_INTS
  7555. * Bits 15:8
  7556. * Purpose: indicate how many 32-bit integers follow the message header
  7557. * - NUM_CHARS
  7558. * Bits 31:16
  7559. * Purpose: indicate how many 8-bit charaters follow the series of integers
  7560. */
  7561. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  7562. #define HTT_RX_TEST_NUM_INTS_S 8
  7563. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  7564. #define HTT_RX_TEST_NUM_CHARS_S 16
  7565. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  7566. do { \
  7567. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  7568. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  7569. } while (0)
  7570. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  7571. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  7572. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  7573. do { \
  7574. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  7575. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  7576. } while (0)
  7577. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  7578. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  7579. /**
  7580. * @brief target -> host packet log message
  7581. *
  7582. * @details
  7583. * The following field definitions describe the format of the packet log
  7584. * message sent from the target to the host.
  7585. * The message consists of a 4-octet header,followed by a variable number
  7586. * of 32-bit character values.
  7587. *
  7588. * |31 16|15 12|11 10|9 8|7 0|
  7589. * |------------------------------------------------------------------|
  7590. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  7591. * |------------------------------------------------------------------|
  7592. * | payload |
  7593. * |------------------------------------------------------------------|
  7594. * - MSG_TYPE
  7595. * Bits 7:0
  7596. * Purpose: identifies this as a pktlog message
  7597. * Value: HTT_T2H_MSG_TYPE_PKTLOG
  7598. * - mac_id
  7599. * Bits 9:8
  7600. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  7601. * Value: 0-3
  7602. * - pdev_id
  7603. * Bits 11:10
  7604. * Purpose: pdev_id
  7605. * Value: 0-3
  7606. * 0 (for rings at SOC level),
  7607. * 1/2/3 PDEV -> 0/1/2
  7608. * - payload_size
  7609. * Bits 31:16
  7610. * Purpose: explicitly specify the payload size
  7611. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  7612. */
  7613. PREPACK struct htt_pktlog_msg {
  7614. A_UINT32 header;
  7615. A_UINT32 payload[1/* or more */];
  7616. } POSTPACK;
  7617. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  7618. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  7619. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  7620. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  7621. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  7622. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  7623. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  7624. do { \
  7625. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  7626. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  7627. } while (0)
  7628. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  7629. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  7630. HTT_T2H_PKTLOG_MAC_ID_S)
  7631. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  7632. do { \
  7633. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  7634. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  7635. } while (0)
  7636. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  7637. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  7638. HTT_T2H_PKTLOG_PDEV_ID_S)
  7639. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  7640. do { \
  7641. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  7642. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  7643. } while (0)
  7644. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  7645. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  7646. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  7647. /*
  7648. * Rx reorder statistics
  7649. * NB: all the fields must be defined in 4 octets size.
  7650. */
  7651. struct rx_reorder_stats {
  7652. /* Non QoS MPDUs received */
  7653. A_UINT32 deliver_non_qos;
  7654. /* MPDUs received in-order */
  7655. A_UINT32 deliver_in_order;
  7656. /* Flush due to reorder timer expired */
  7657. A_UINT32 deliver_flush_timeout;
  7658. /* Flush due to move out of window */
  7659. A_UINT32 deliver_flush_oow;
  7660. /* Flush due to DELBA */
  7661. A_UINT32 deliver_flush_delba;
  7662. /* MPDUs dropped due to FCS error */
  7663. A_UINT32 fcs_error;
  7664. /* MPDUs dropped due to monitor mode non-data packet */
  7665. A_UINT32 mgmt_ctrl;
  7666. /* Unicast-data MPDUs dropped due to invalid peer */
  7667. A_UINT32 invalid_peer;
  7668. /* MPDUs dropped due to duplication (non aggregation) */
  7669. A_UINT32 dup_non_aggr;
  7670. /* MPDUs dropped due to processed before */
  7671. A_UINT32 dup_past;
  7672. /* MPDUs dropped due to duplicate in reorder queue */
  7673. A_UINT32 dup_in_reorder;
  7674. /* Reorder timeout happened */
  7675. A_UINT32 reorder_timeout;
  7676. /* invalid bar ssn */
  7677. A_UINT32 invalid_bar_ssn;
  7678. /* reorder reset due to bar ssn */
  7679. A_UINT32 ssn_reset;
  7680. /* Flush due to delete peer */
  7681. A_UINT32 deliver_flush_delpeer;
  7682. /* Flush due to offload*/
  7683. A_UINT32 deliver_flush_offload;
  7684. /* Flush due to out of buffer*/
  7685. A_UINT32 deliver_flush_oob;
  7686. /* MPDUs dropped due to PN check fail */
  7687. A_UINT32 pn_fail;
  7688. /* MPDUs dropped due to unable to allocate memory */
  7689. A_UINT32 store_fail;
  7690. /* Number of times the tid pool alloc succeeded */
  7691. A_UINT32 tid_pool_alloc_succ;
  7692. /* Number of times the MPDU pool alloc succeeded */
  7693. A_UINT32 mpdu_pool_alloc_succ;
  7694. /* Number of times the MSDU pool alloc succeeded */
  7695. A_UINT32 msdu_pool_alloc_succ;
  7696. /* Number of times the tid pool alloc failed */
  7697. A_UINT32 tid_pool_alloc_fail;
  7698. /* Number of times the MPDU pool alloc failed */
  7699. A_UINT32 mpdu_pool_alloc_fail;
  7700. /* Number of times the MSDU pool alloc failed */
  7701. A_UINT32 msdu_pool_alloc_fail;
  7702. /* Number of times the tid pool freed */
  7703. A_UINT32 tid_pool_free;
  7704. /* Number of times the MPDU pool freed */
  7705. A_UINT32 mpdu_pool_free;
  7706. /* Number of times the MSDU pool freed */
  7707. A_UINT32 msdu_pool_free;
  7708. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  7709. A_UINT32 msdu_queued;
  7710. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  7711. A_UINT32 msdu_recycled;
  7712. /* Number of MPDUs with invalid peer but A2 found in AST */
  7713. A_UINT32 invalid_peer_a2_in_ast;
  7714. /* Number of MPDUs with invalid peer but A3 found in AST */
  7715. A_UINT32 invalid_peer_a3_in_ast;
  7716. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  7717. A_UINT32 invalid_peer_bmc_mpdus;
  7718. /* Number of MSDUs with err attention word */
  7719. A_UINT32 rxdesc_err_att;
  7720. /* Number of MSDUs with flag of peer_idx_invalid */
  7721. A_UINT32 rxdesc_err_peer_idx_inv;
  7722. /* Number of MSDUs with flag of peer_idx_timeout */
  7723. A_UINT32 rxdesc_err_peer_idx_to;
  7724. /* Number of MSDUs with flag of overflow */
  7725. A_UINT32 rxdesc_err_ov;
  7726. /* Number of MSDUs with flag of msdu_length_err */
  7727. A_UINT32 rxdesc_err_msdu_len;
  7728. /* Number of MSDUs with flag of mpdu_length_err */
  7729. A_UINT32 rxdesc_err_mpdu_len;
  7730. /* Number of MSDUs with flag of tkip_mic_err */
  7731. A_UINT32 rxdesc_err_tkip_mic;
  7732. /* Number of MSDUs with flag of decrypt_err */
  7733. A_UINT32 rxdesc_err_decrypt;
  7734. /* Number of MSDUs with flag of fcs_err */
  7735. A_UINT32 rxdesc_err_fcs;
  7736. /* Number of Unicast (bc_mc bit is not set in attention word)
  7737. * frames with invalid peer handler
  7738. */
  7739. A_UINT32 rxdesc_uc_msdus_inv_peer;
  7740. /* Number of unicast frame directly (direct bit is set in attention word)
  7741. * to DUT with invalid peer handler
  7742. */
  7743. A_UINT32 rxdesc_direct_msdus_inv_peer;
  7744. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  7745. * frames with invalid peer handler
  7746. */
  7747. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  7748. /* Number of MSDUs dropped due to no first MSDU flag */
  7749. A_UINT32 rxdesc_no_1st_msdu;
  7750. /* Number of MSDUs droped due to ring overflow */
  7751. A_UINT32 msdu_drop_ring_ov;
  7752. /* Number of MSDUs dropped due to FC mismatch */
  7753. A_UINT32 msdu_drop_fc_mismatch;
  7754. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  7755. A_UINT32 msdu_drop_mgmt_remote_ring;
  7756. /* Number of MSDUs dropped due to errors not reported in attention word */
  7757. A_UINT32 msdu_drop_misc;
  7758. /* Number of MSDUs go to offload before reorder */
  7759. A_UINT32 offload_msdu_wal;
  7760. /* Number of data frame dropped by offload after reorder */
  7761. A_UINT32 offload_msdu_reorder;
  7762. /* Number of MPDUs with sequence number in the past and within the BA window */
  7763. A_UINT32 dup_past_within_window;
  7764. /* Number of MPDUs with sequence number in the past and outside the BA window */
  7765. A_UINT32 dup_past_outside_window;
  7766. /* Number of MSDUs with decrypt/MIC error */
  7767. A_UINT32 rxdesc_err_decrypt_mic;
  7768. /* Number of data MSDUs received on both local and remote rings */
  7769. A_UINT32 data_msdus_on_both_rings;
  7770. /* MPDUs never filled */
  7771. A_UINT32 holes_not_filled;
  7772. };
  7773. /*
  7774. * Rx Remote buffer statistics
  7775. * NB: all the fields must be defined in 4 octets size.
  7776. */
  7777. struct rx_remote_buffer_mgmt_stats {
  7778. /* Total number of MSDUs reaped for Rx processing */
  7779. A_UINT32 remote_reaped;
  7780. /* MSDUs recycled within firmware */
  7781. A_UINT32 remote_recycled;
  7782. /* MSDUs stored by Data Rx */
  7783. A_UINT32 data_rx_msdus_stored;
  7784. /* Number of HTT indications from WAL Rx MSDU */
  7785. A_UINT32 wal_rx_ind;
  7786. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  7787. A_UINT32 wal_rx_ind_unconsumed;
  7788. /* Number of HTT indications from Data Rx MSDU */
  7789. A_UINT32 data_rx_ind;
  7790. /* Number of unconsumed HTT indications from Data Rx MSDU */
  7791. A_UINT32 data_rx_ind_unconsumed;
  7792. /* Number of HTT indications from ATHBUF */
  7793. A_UINT32 athbuf_rx_ind;
  7794. /* Number of remote buffers requested for refill */
  7795. A_UINT32 refill_buf_req;
  7796. /* Number of remote buffers filled by the host */
  7797. A_UINT32 refill_buf_rsp;
  7798. /* Number of times MAC hw_index = f/w write_index */
  7799. A_INT32 mac_no_bufs;
  7800. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  7801. A_INT32 fw_indices_equal;
  7802. /* Number of times f/w finds no buffers to post */
  7803. A_INT32 host_no_bufs;
  7804. };
  7805. /*
  7806. * TXBF MU/SU packets and NDPA statistics
  7807. * NB: all the fields must be defined in 4 octets size.
  7808. */
  7809. struct rx_txbf_musu_ndpa_pkts_stats {
  7810. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  7811. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  7812. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  7813. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  7814. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  7815. A_UINT32 reserved[3]; /* must be set to 0x0 */
  7816. };
  7817. /*
  7818. * htt_dbg_stats_status -
  7819. * present - The requested stats have been delivered in full.
  7820. * This indicates that either the stats information was contained
  7821. * in its entirety within this message, or else this message
  7822. * completes the delivery of the requested stats info that was
  7823. * partially delivered through earlier STATS_CONF messages.
  7824. * partial - The requested stats have been delivered in part.
  7825. * One or more subsequent STATS_CONF messages with the same
  7826. * cookie value will be sent to deliver the remainder of the
  7827. * information.
  7828. * error - The requested stats could not be delivered, for example due
  7829. * to a shortage of memory to construct a message holding the
  7830. * requested stats.
  7831. * invalid - The requested stat type is either not recognized, or the
  7832. * target is configured to not gather the stats type in question.
  7833. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7834. * series_done - This special value indicates that no further stats info
  7835. * elements are present within a series of stats info elems
  7836. * (within a stats upload confirmation message).
  7837. */
  7838. enum htt_dbg_stats_status {
  7839. HTT_DBG_STATS_STATUS_PRESENT = 0,
  7840. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  7841. HTT_DBG_STATS_STATUS_ERROR = 2,
  7842. HTT_DBG_STATS_STATUS_INVALID = 3,
  7843. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  7844. };
  7845. /**
  7846. * @brief target -> host statistics upload
  7847. *
  7848. * @details
  7849. * The following field definitions describe the format of the HTT target
  7850. * to host stats upload confirmation message.
  7851. * The message contains a cookie echoed from the HTT host->target stats
  7852. * upload request, which identifies which request the confirmation is
  7853. * for, and a series of tag-length-value stats information elements.
  7854. * The tag-length header for each stats info element also includes a
  7855. * status field, to indicate whether the request for the stat type in
  7856. * question was fully met, partially met, unable to be met, or invalid
  7857. * (if the stat type in question is disabled in the target).
  7858. * A special value of all 1's in this status field is used to indicate
  7859. * the end of the series of stats info elements.
  7860. *
  7861. *
  7862. * |31 16|15 8|7 5|4 0|
  7863. * |------------------------------------------------------------|
  7864. * | reserved | msg type |
  7865. * |------------------------------------------------------------|
  7866. * | cookie LSBs |
  7867. * |------------------------------------------------------------|
  7868. * | cookie MSBs |
  7869. * |------------------------------------------------------------|
  7870. * | stats entry length | reserved | S |stat type|
  7871. * |------------------------------------------------------------|
  7872. * | |
  7873. * | type-specific stats info |
  7874. * | |
  7875. * |------------------------------------------------------------|
  7876. * | stats entry length | reserved | S |stat type|
  7877. * |------------------------------------------------------------|
  7878. * | |
  7879. * | type-specific stats info |
  7880. * | |
  7881. * |------------------------------------------------------------|
  7882. * | n/a | reserved | 111 | n/a |
  7883. * |------------------------------------------------------------|
  7884. * Header fields:
  7885. * - MSG_TYPE
  7886. * Bits 7:0
  7887. * Purpose: identifies this is a statistics upload confirmation message
  7888. * Value: 0x9
  7889. * - COOKIE_LSBS
  7890. * Bits 31:0
  7891. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7892. * message with its preceding host->target stats request message.
  7893. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7894. * - COOKIE_MSBS
  7895. * Bits 31:0
  7896. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7897. * message with its preceding host->target stats request message.
  7898. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7899. *
  7900. * Stats Information Element tag-length header fields:
  7901. * - STAT_TYPE
  7902. * Bits 4:0
  7903. * Purpose: identifies the type of statistics info held in the
  7904. * following information element
  7905. * Value: htt_dbg_stats_type
  7906. * - STATUS
  7907. * Bits 7:5
  7908. * Purpose: indicate whether the requested stats are present
  7909. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  7910. * the completion of the stats entry series
  7911. * - LENGTH
  7912. * Bits 31:16
  7913. * Purpose: indicate the stats information size
  7914. * Value: This field specifies the number of bytes of stats information
  7915. * that follows the element tag-length header.
  7916. * It is expected but not required that this length is a multiple of
  7917. * 4 bytes. Even if the length is not an integer multiple of 4, the
  7918. * subsequent stats entry header will begin on a 4-byte aligned
  7919. * boundary.
  7920. */
  7921. #define HTT_T2H_STATS_COOKIE_SIZE 8
  7922. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  7923. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  7924. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  7925. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  7926. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  7927. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  7928. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  7929. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  7930. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  7931. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  7932. do { \
  7933. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  7934. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  7935. } while (0)
  7936. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  7937. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  7938. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  7939. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  7940. do { \
  7941. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  7942. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  7943. } while (0)
  7944. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  7945. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  7946. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  7947. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  7948. do { \
  7949. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  7950. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  7951. } while (0)
  7952. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  7953. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  7954. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  7955. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  7956. #define HTT_MAX_AGGR 64
  7957. #define HTT_HL_MAX_AGGR 18
  7958. /**
  7959. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  7960. *
  7961. * @details
  7962. * The following field definitions describe the format of the HTT host
  7963. * to target frag_desc/msdu_ext bank configuration message.
  7964. * The message contains the based address and the min and max id of the
  7965. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  7966. * MSDU_EXT/FRAG_DESC.
  7967. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  7968. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  7969. * the hardware does the mapping/translation.
  7970. *
  7971. * Total banks that can be configured is configured to 16.
  7972. *
  7973. * This should be called before any TX has be initiated by the HTT
  7974. *
  7975. * |31 16|15 8|7 5|4 0|
  7976. * |------------------------------------------------------------|
  7977. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  7978. * |------------------------------------------------------------|
  7979. * | BANK0_BASE_ADDRESS (bits 31:0) |
  7980. #if HTT_PADDR64
  7981. * | BANK0_BASE_ADDRESS (bits 63:32) |
  7982. #endif
  7983. * |------------------------------------------------------------|
  7984. * | ... |
  7985. * |------------------------------------------------------------|
  7986. * | BANK15_BASE_ADDRESS (bits 31:0) |
  7987. #if HTT_PADDR64
  7988. * | BANK15_BASE_ADDRESS (bits 63:32) |
  7989. #endif
  7990. * |------------------------------------------------------------|
  7991. * | BANK0_MAX_ID | BANK0_MIN_ID |
  7992. * |------------------------------------------------------------|
  7993. * | ... |
  7994. * |------------------------------------------------------------|
  7995. * | BANK15_MAX_ID | BANK15_MIN_ID |
  7996. * |------------------------------------------------------------|
  7997. * Header fields:
  7998. * - MSG_TYPE
  7999. * Bits 7:0
  8000. * Value: 0x6
  8001. * for systems with 64-bit format for bus addresses:
  8002. * - BANKx_BASE_ADDRESS_LO
  8003. * Bits 31:0
  8004. * Purpose: Provide a mechanism to specify the base address of the
  8005. * MSDU_EXT bank physical/bus address.
  8006. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  8007. * - BANKx_BASE_ADDRESS_HI
  8008. * Bits 31:0
  8009. * Purpose: Provide a mechanism to specify the base address of the
  8010. * MSDU_EXT bank physical/bus address.
  8011. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  8012. * for systems with 32-bit format for bus addresses:
  8013. * - BANKx_BASE_ADDRESS
  8014. * Bits 31:0
  8015. * Purpose: Provide a mechanism to specify the base address of the
  8016. * MSDU_EXT bank physical/bus address.
  8017. * Value: MSDU_EXT bank physical / bus address
  8018. * - BANKx_MIN_ID
  8019. * Bits 15:0
  8020. * Purpose: Provide a mechanism to specify the min index that needs to
  8021. * mapped.
  8022. * - BANKx_MAX_ID
  8023. * Bits 31:16
  8024. * Purpose: Provide a mechanism to specify the max index that needs to
  8025. * mapped.
  8026. *
  8027. */
  8028. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  8029. * safe value.
  8030. * @note MAX supported banks is 16.
  8031. */
  8032. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  8033. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  8034. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  8035. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  8036. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  8037. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  8038. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  8039. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  8040. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  8041. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  8042. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  8043. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  8044. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  8045. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  8046. do { \
  8047. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  8048. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  8049. } while (0)
  8050. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  8051. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  8052. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  8053. do { \
  8054. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  8055. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  8056. } while (0)
  8057. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  8058. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  8059. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  8060. do { \
  8061. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  8062. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  8063. } while (0)
  8064. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  8065. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  8066. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  8067. do { \
  8068. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  8069. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  8070. } while (0)
  8071. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  8072. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  8073. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  8074. do { \
  8075. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  8076. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  8077. } while (0)
  8078. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  8079. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  8080. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  8081. do { \
  8082. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  8083. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  8084. } while (0)
  8085. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  8086. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  8087. /*
  8088. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  8089. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  8090. * addresses are stored in a XXX-bit field.
  8091. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  8092. * htt_tx_frag_desc64_bank_cfg_t structs.
  8093. */
  8094. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  8095. _paddr_bits_, \
  8096. _paddr__bank_base_address_) \
  8097. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  8098. /** word 0 \
  8099. * msg_type: 8, \
  8100. * pdev_id: 2, \
  8101. * swap: 1, \
  8102. * reserved0: 5, \
  8103. * num_banks: 8, \
  8104. * desc_size: 8; \
  8105. */ \
  8106. A_UINT32 word0; \
  8107. /* \
  8108. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  8109. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  8110. * the second A_UINT32). \
  8111. */ \
  8112. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8113. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8114. } POSTPACK
  8115. /* define htt_tx_frag_desc32_bank_cfg_t */
  8116. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  8117. /* define htt_tx_frag_desc64_bank_cfg_t */
  8118. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  8119. /*
  8120. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  8121. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  8122. */
  8123. #if HTT_PADDR64
  8124. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  8125. #else
  8126. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  8127. #endif
  8128. /**
  8129. * @brief target -> host HTT TX Credit total count update message definition
  8130. *
  8131. *|31 16|15|14 9| 8 |7 0 |
  8132. *|---------------------+--+----------+-------+----------|
  8133. *|cur htt credit delta | Q| reserved | sign | msg type |
  8134. *|------------------------------------------------------|
  8135. *
  8136. * Header fields:
  8137. * - MSG_TYPE
  8138. * Bits 7:0
  8139. * Purpose: identifies this as a htt tx credit delta update message
  8140. * Value: 0xe
  8141. * - SIGN
  8142. * Bits 8
  8143. * identifies whether credit delta is positive or negative
  8144. * Value:
  8145. * - 0x0: credit delta is positive, rebalance in some buffers
  8146. * - 0x1: credit delta is negative, rebalance out some buffers
  8147. * - reserved
  8148. * Bits 14:9
  8149. * Value: 0x0
  8150. * - TXQ_GRP
  8151. * Bit 15
  8152. * Purpose: indicates whether any tx queue group information elements
  8153. * are appended to the tx credit update message
  8154. * Value: 0 -> no tx queue group information element is present
  8155. * 1 -> a tx queue group information element immediately follows
  8156. * - DELTA_COUNT
  8157. * Bits 31:16
  8158. * Purpose: Specify current htt credit delta absolute count
  8159. */
  8160. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  8161. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  8162. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  8163. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  8164. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  8165. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  8166. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  8167. do { \
  8168. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  8169. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  8170. } while (0)
  8171. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  8172. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  8173. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  8174. do { \
  8175. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  8176. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  8177. } while (0)
  8178. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  8179. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  8180. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  8181. do { \
  8182. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  8183. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  8184. } while (0)
  8185. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  8186. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  8187. #define HTT_TX_CREDIT_MSG_BYTES 4
  8188. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  8189. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  8190. /**
  8191. * @brief HTT WDI_IPA Operation Response Message
  8192. *
  8193. * @details
  8194. * HTT WDI_IPA Operation Response message is sent by target
  8195. * to host confirming suspend or resume operation.
  8196. * |31 24|23 16|15 8|7 0|
  8197. * |----------------+----------------+----------------+----------------|
  8198. * | op_code | Rsvd | msg_type |
  8199. * |-------------------------------------------------------------------|
  8200. * | Rsvd | Response len |
  8201. * |-------------------------------------------------------------------|
  8202. * | |
  8203. * | Response-type specific info |
  8204. * | |
  8205. * | |
  8206. * |-------------------------------------------------------------------|
  8207. * Header fields:
  8208. * - MSG_TYPE
  8209. * Bits 7:0
  8210. * Purpose: Identifies this as WDI_IPA Operation Response message
  8211. * value: = 0x13
  8212. * - OP_CODE
  8213. * Bits 31:16
  8214. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  8215. * value: = enum htt_wdi_ipa_op_code
  8216. * - RSP_LEN
  8217. * Bits 16:0
  8218. * Purpose: length for the response-type specific info
  8219. * value: = length in bytes for response-type specific info
  8220. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  8221. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  8222. */
  8223. PREPACK struct htt_wdi_ipa_op_response_t
  8224. {
  8225. /* DWORD 0: flags and meta-data */
  8226. A_UINT32
  8227. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8228. reserved1: 8,
  8229. op_code: 16;
  8230. A_UINT32
  8231. rsp_len: 16,
  8232. reserved2: 16;
  8233. } POSTPACK;
  8234. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  8235. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  8236. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  8237. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  8238. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  8239. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  8240. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  8241. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  8242. do { \
  8243. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  8244. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  8245. } while (0)
  8246. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  8247. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  8248. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  8249. do { \
  8250. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  8251. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  8252. } while (0)
  8253. enum htt_phy_mode {
  8254. htt_phy_mode_11a = 0,
  8255. htt_phy_mode_11g = 1,
  8256. htt_phy_mode_11b = 2,
  8257. htt_phy_mode_11g_only = 3,
  8258. htt_phy_mode_11na_ht20 = 4,
  8259. htt_phy_mode_11ng_ht20 = 5,
  8260. htt_phy_mode_11na_ht40 = 6,
  8261. htt_phy_mode_11ng_ht40 = 7,
  8262. htt_phy_mode_11ac_vht20 = 8,
  8263. htt_phy_mode_11ac_vht40 = 9,
  8264. htt_phy_mode_11ac_vht80 = 10,
  8265. htt_phy_mode_11ac_vht20_2g = 11,
  8266. htt_phy_mode_11ac_vht40_2g = 12,
  8267. htt_phy_mode_11ac_vht80_2g = 13,
  8268. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  8269. htt_phy_mode_11ac_vht160 = 15,
  8270. htt_phy_mode_max,
  8271. };
  8272. /**
  8273. * @brief target -> host HTT channel change indication
  8274. * @details
  8275. * Specify when a channel change occurs.
  8276. * This allows the host to precisely determine which rx frames arrived
  8277. * on the old channel and which rx frames arrived on the new channel.
  8278. *
  8279. *|31 |7 0 |
  8280. *|-------------------------------------------+----------|
  8281. *| reserved | msg type |
  8282. *|------------------------------------------------------|
  8283. *| primary_chan_center_freq_mhz |
  8284. *|------------------------------------------------------|
  8285. *| contiguous_chan1_center_freq_mhz |
  8286. *|------------------------------------------------------|
  8287. *| contiguous_chan2_center_freq_mhz |
  8288. *|------------------------------------------------------|
  8289. *| phy_mode |
  8290. *|------------------------------------------------------|
  8291. *
  8292. * Header fields:
  8293. * - MSG_TYPE
  8294. * Bits 7:0
  8295. * Purpose: identifies this as a htt channel change indication message
  8296. * Value: 0x15
  8297. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  8298. * Bits 31:0
  8299. * Purpose: identify the (center of the) new 20 MHz primary channel
  8300. * Value: center frequency of the 20 MHz primary channel, in MHz units
  8301. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  8302. * Bits 31:0
  8303. * Purpose: identify the (center of the) contiguous frequency range
  8304. * comprising the new channel.
  8305. * For example, if the new channel is a 80 MHz channel extending
  8306. * 60 MHz beyond the primary channel, this field would be 30 larger
  8307. * than the primary channel center frequency field.
  8308. * Value: center frequency of the contiguous frequency range comprising
  8309. * the full channel in MHz units
  8310. * (80+80 channels also use the CONTIG_CHAN2 field)
  8311. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  8312. * Bits 31:0
  8313. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  8314. * within a VHT 80+80 channel.
  8315. * This field is only relevant for VHT 80+80 channels.
  8316. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  8317. * channel (arbitrary value for cases besides VHT 80+80)
  8318. * - PHY_MODE
  8319. * Bits 31:0
  8320. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  8321. * and band
  8322. * Value: htt_phy_mode enum value
  8323. */
  8324. PREPACK struct htt_chan_change_t
  8325. {
  8326. /* DWORD 0: flags and meta-data */
  8327. A_UINT32
  8328. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8329. reserved1: 24;
  8330. A_UINT32 primary_chan_center_freq_mhz;
  8331. A_UINT32 contig_chan1_center_freq_mhz;
  8332. A_UINT32 contig_chan2_center_freq_mhz;
  8333. A_UINT32 phy_mode;
  8334. } POSTPACK;
  8335. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  8336. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  8337. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  8338. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  8339. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  8340. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  8341. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  8342. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  8343. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  8344. do { \
  8345. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  8346. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  8347. } while (0)
  8348. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  8349. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  8350. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  8351. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  8352. do { \
  8353. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  8354. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  8355. } while (0)
  8356. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  8357. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  8358. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  8359. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  8360. do { \
  8361. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  8362. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  8363. } while (0)
  8364. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  8365. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  8366. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  8367. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  8368. do { \
  8369. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  8370. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  8371. } while (0)
  8372. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  8373. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  8374. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  8375. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  8376. /**
  8377. * @brief rx offload packet error message
  8378. *
  8379. * @details
  8380. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  8381. * of target payload like mic err.
  8382. *
  8383. * |31 24|23 16|15 8|7 0|
  8384. * |----------------+----------------+----------------+----------------|
  8385. * | tid | vdev_id | msg_sub_type | msg_type |
  8386. * |-------------------------------------------------------------------|
  8387. * : (sub-type dependent content) :
  8388. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8389. * Header fields:
  8390. * - msg_type
  8391. * Bits 7:0
  8392. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  8393. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  8394. * - msg_sub_type
  8395. * Bits 15:8
  8396. * Purpose: Identifies which type of rx error is reported by this message
  8397. * value: htt_rx_ofld_pkt_err_type
  8398. * - vdev_id
  8399. * Bits 23:16
  8400. * Purpose: Identifies which vdev received the erroneous rx frame
  8401. * value:
  8402. * - tid
  8403. * Bits 31:24
  8404. * Purpose: Identifies the traffic type of the rx frame
  8405. * value:
  8406. *
  8407. * - The payload fields used if the sub-type == MIC error are shown below.
  8408. * Note - MIC err is per MSDU, while PN is per MPDU.
  8409. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  8410. * with MIC err in A-MSDU case, so FW will send only one HTT message
  8411. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  8412. * instead of sending separate HTT messages for each wrong MSDU within
  8413. * the MPDU.
  8414. *
  8415. * |31 24|23 16|15 8|7 0|
  8416. * |----------------+----------------+----------------+----------------|
  8417. * | Rsvd | key_id | peer_id |
  8418. * |-------------------------------------------------------------------|
  8419. * | receiver MAC addr 31:0 |
  8420. * |-------------------------------------------------------------------|
  8421. * | Rsvd | receiver MAC addr 47:32 |
  8422. * |-------------------------------------------------------------------|
  8423. * | transmitter MAC addr 31:0 |
  8424. * |-------------------------------------------------------------------|
  8425. * | Rsvd | transmitter MAC addr 47:32 |
  8426. * |-------------------------------------------------------------------|
  8427. * | PN 31:0 |
  8428. * |-------------------------------------------------------------------|
  8429. * | Rsvd | PN 47:32 |
  8430. * |-------------------------------------------------------------------|
  8431. * - peer_id
  8432. * Bits 15:0
  8433. * Purpose: identifies which peer is frame is from
  8434. * value:
  8435. * - key_id
  8436. * Bits 23:16
  8437. * Purpose: identifies key_id of rx frame
  8438. * value:
  8439. * - RA_31_0 (receiver MAC addr 31:0)
  8440. * Bits 31:0
  8441. * Purpose: identifies by MAC address which vdev received the frame
  8442. * value: MAC address lower 4 bytes
  8443. * - RA_47_32 (receiver MAC addr 47:32)
  8444. * Bits 15:0
  8445. * Purpose: identifies by MAC address which vdev received the frame
  8446. * value: MAC address upper 2 bytes
  8447. * - TA_31_0 (transmitter MAC addr 31:0)
  8448. * Bits 31:0
  8449. * Purpose: identifies by MAC address which peer transmitted the frame
  8450. * value: MAC address lower 4 bytes
  8451. * - TA_47_32 (transmitter MAC addr 47:32)
  8452. * Bits 15:0
  8453. * Purpose: identifies by MAC address which peer transmitted the frame
  8454. * value: MAC address upper 2 bytes
  8455. * - PN_31_0
  8456. * Bits 31:0
  8457. * Purpose: Identifies pn of rx frame
  8458. * value: PN lower 4 bytes
  8459. * - PN_47_32
  8460. * Bits 15:0
  8461. * Purpose: Identifies pn of rx frame
  8462. * value:
  8463. * TKIP or CCMP: PN upper 2 bytes
  8464. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  8465. */
  8466. enum htt_rx_ofld_pkt_err_type {
  8467. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  8468. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  8469. };
  8470. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  8471. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  8472. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  8473. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  8474. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  8475. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  8476. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  8477. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  8478. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  8479. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  8480. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  8481. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  8482. do { \
  8483. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  8484. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  8485. } while (0)
  8486. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  8487. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  8488. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  8489. do { \
  8490. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  8491. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  8492. } while (0)
  8493. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  8494. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  8495. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  8496. do { \
  8497. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  8498. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  8499. } while (0)
  8500. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  8501. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  8502. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  8503. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  8504. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  8505. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  8506. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  8507. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  8508. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  8509. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  8510. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  8511. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  8512. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  8513. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  8514. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  8515. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  8516. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  8517. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  8518. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  8519. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  8520. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  8521. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  8522. do { \
  8523. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  8524. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  8525. } while (0)
  8526. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  8527. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  8528. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  8529. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  8530. do { \
  8531. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  8532. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  8533. } while (0)
  8534. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  8535. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  8536. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  8537. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  8538. do { \
  8539. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  8540. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  8541. } while (0)
  8542. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  8543. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  8544. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  8545. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  8546. do { \
  8547. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  8548. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  8549. } while (0)
  8550. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  8551. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  8552. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  8553. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  8554. do { \
  8555. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  8556. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  8557. } while (0)
  8558. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  8559. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  8560. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  8561. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  8562. do { \
  8563. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  8564. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  8565. } while (0)
  8566. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  8567. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  8568. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  8569. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  8570. do { \
  8571. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  8572. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  8573. } while (0)
  8574. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  8575. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  8576. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  8577. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  8578. do { \
  8579. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  8580. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  8581. } while (0)
  8582. /**
  8583. * @brief peer rate report message
  8584. *
  8585. * @details
  8586. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  8587. * justified rate of all the peers.
  8588. *
  8589. * |31 24|23 16|15 8|7 0|
  8590. * |----------------+----------------+----------------+----------------|
  8591. * | peer_count | | msg_type |
  8592. * |-------------------------------------------------------------------|
  8593. * : Payload (variant number of peer rate report) :
  8594. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8595. * Header fields:
  8596. * - msg_type
  8597. * Bits 7:0
  8598. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  8599. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  8600. * - reserved
  8601. * Bits 15:8
  8602. * Purpose:
  8603. * value:
  8604. * - peer_count
  8605. * Bits 31:16
  8606. * Purpose: Specify how many peer rate report elements are present in the payload.
  8607. * value:
  8608. *
  8609. * Payload:
  8610. * There are variant number of peer rate report follow the first 32 bits.
  8611. * The peer rate report is defined as follows.
  8612. *
  8613. * |31 20|19 16|15 0|
  8614. * |-----------------------+---------+---------------------------------|-
  8615. * | reserved | phy | peer_id | \
  8616. * |-------------------------------------------------------------------| -> report #0
  8617. * | rate | /
  8618. * |-----------------------+---------+---------------------------------|-
  8619. * | reserved | phy | peer_id | \
  8620. * |-------------------------------------------------------------------| -> report #1
  8621. * | rate | /
  8622. * |-----------------------+---------+---------------------------------|-
  8623. * | reserved | phy | peer_id | \
  8624. * |-------------------------------------------------------------------| -> report #2
  8625. * | rate | /
  8626. * |-------------------------------------------------------------------|-
  8627. * : :
  8628. * : :
  8629. * : :
  8630. * :-------------------------------------------------------------------:
  8631. *
  8632. * - peer_id
  8633. * Bits 15:0
  8634. * Purpose: identify the peer
  8635. * value:
  8636. * - phy
  8637. * Bits 19:16
  8638. * Purpose: identify which phy is in use
  8639. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  8640. * Please see enum htt_peer_report_phy_type for detail.
  8641. * - reserved
  8642. * Bits 31:20
  8643. * Purpose:
  8644. * value:
  8645. * - rate
  8646. * Bits 31:0
  8647. * Purpose: represent the justified rate of the peer specified by peer_id
  8648. * value:
  8649. */
  8650. enum htt_peer_rate_report_phy_type {
  8651. HTT_PEER_RATE_REPORT_11B = 0,
  8652. HTT_PEER_RATE_REPORT_11A_G,
  8653. HTT_PEER_RATE_REPORT_11N,
  8654. HTT_PEER_RATE_REPORT_11AC,
  8655. };
  8656. #define HTT_PEER_RATE_REPORT_SIZE 8
  8657. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  8658. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  8659. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  8660. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  8661. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  8662. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  8663. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  8664. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  8665. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  8666. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  8667. do { \
  8668. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  8669. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  8670. } while (0)
  8671. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  8672. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  8673. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  8674. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  8675. do { \
  8676. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  8677. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  8678. } while (0)
  8679. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  8680. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  8681. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  8682. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  8683. do { \
  8684. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  8685. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  8686. } while (0)
  8687. /**
  8688. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  8689. *
  8690. * @details
  8691. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  8692. * a flow of descriptors.
  8693. *
  8694. * This message is in TLV format and indicates the parameters to be setup a
  8695. * flow in the host. Each entry indicates that a particular flow ID is ready to
  8696. * receive descriptors from a specified pool.
  8697. *
  8698. * The message would appear as follows:
  8699. *
  8700. * |31 24|23 16|15 8|7 0|
  8701. * |----------------+----------------+----------------+----------------|
  8702. * header | reserved | num_flows | msg_type |
  8703. * |-------------------------------------------------------------------|
  8704. * | |
  8705. * : payload :
  8706. * | |
  8707. * |-------------------------------------------------------------------|
  8708. *
  8709. * The header field is one DWORD long and is interpreted as follows:
  8710. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  8711. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  8712. * this message
  8713. * b'16-31 - reserved: These bits are reserved for future use
  8714. *
  8715. * Payload:
  8716. * The payload would contain multiple objects of the following structure. Each
  8717. * object represents a flow.
  8718. *
  8719. * |31 24|23 16|15 8|7 0|
  8720. * |----------------+----------------+----------------+----------------|
  8721. * header | reserved | num_flows | msg_type |
  8722. * |-------------------------------------------------------------------|
  8723. * payload0| flow_type |
  8724. * |-------------------------------------------------------------------|
  8725. * | flow_id |
  8726. * |-------------------------------------------------------------------|
  8727. * | reserved0 | flow_pool_id |
  8728. * |-------------------------------------------------------------------|
  8729. * | reserved1 | flow_pool_size |
  8730. * |-------------------------------------------------------------------|
  8731. * | reserved2 |
  8732. * |-------------------------------------------------------------------|
  8733. * payload1| flow_type |
  8734. * |-------------------------------------------------------------------|
  8735. * | flow_id |
  8736. * |-------------------------------------------------------------------|
  8737. * | reserved0 | flow_pool_id |
  8738. * |-------------------------------------------------------------------|
  8739. * | reserved1 | flow_pool_size |
  8740. * |-------------------------------------------------------------------|
  8741. * | reserved2 |
  8742. * |-------------------------------------------------------------------|
  8743. * | . |
  8744. * | . |
  8745. * | . |
  8746. * |-------------------------------------------------------------------|
  8747. *
  8748. * Each payload is 5 DWORDS long and is interpreted as follows:
  8749. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  8750. * this flow is associated. It can be VDEV, peer,
  8751. * or tid (AC). Based on enum htt_flow_type.
  8752. *
  8753. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  8754. * object. For flow_type vdev it is set to the
  8755. * vdevid, for peer it is peerid and for tid, it is
  8756. * tid_num.
  8757. *
  8758. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  8759. * in the host for this flow
  8760. * b'16:31 - reserved0: This field in reserved for the future. In case
  8761. * we have a hierarchical implementation (HCM) of
  8762. * pools, it can be used to indicate the ID of the
  8763. * parent-pool.
  8764. *
  8765. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  8766. * Descriptors for this flow will be
  8767. * allocated from this pool in the host.
  8768. * b'16:31 - reserved1: This field in reserved for the future. In case
  8769. * we have a hierarchical implementation of pools,
  8770. * it can be used to indicate the max number of
  8771. * descriptors in the pool. The b'0:15 can be used
  8772. * to indicate min number of descriptors in the
  8773. * HCM scheme.
  8774. *
  8775. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  8776. * we have a hierarchical implementation of pools,
  8777. * b'0:15 can be used to indicate the
  8778. * priority-based borrowing (PBB) threshold of
  8779. * the flow's pool. The b'16:31 are still left
  8780. * reserved.
  8781. */
  8782. enum htt_flow_type {
  8783. FLOW_TYPE_VDEV = 0,
  8784. /* Insert new flow types above this line */
  8785. };
  8786. PREPACK struct htt_flow_pool_map_payload_t {
  8787. A_UINT32 flow_type;
  8788. A_UINT32 flow_id;
  8789. A_UINT32 flow_pool_id:16,
  8790. reserved0:16;
  8791. A_UINT32 flow_pool_size:16,
  8792. reserved1:16;
  8793. A_UINT32 reserved2;
  8794. } POSTPACK;
  8795. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  8796. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  8797. (sizeof(struct htt_flow_pool_map_payload_t))
  8798. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  8799. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  8800. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  8801. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  8802. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  8803. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  8804. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  8805. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  8806. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  8807. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  8808. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  8809. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  8810. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  8811. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  8812. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  8813. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  8814. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  8815. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  8816. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  8817. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  8818. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  8819. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  8820. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  8821. do { \
  8822. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  8823. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  8824. } while (0)
  8825. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  8826. do { \
  8827. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  8828. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  8829. } while (0)
  8830. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  8831. do { \
  8832. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  8833. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  8834. } while (0)
  8835. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  8836. do { \
  8837. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  8838. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  8839. } while (0)
  8840. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  8841. do { \
  8842. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  8843. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  8844. } while (0)
  8845. /**
  8846. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  8847. *
  8848. * @details
  8849. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  8850. * down a flow of descriptors.
  8851. * This message indicates that for the flow (whose ID is provided) is wanting
  8852. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  8853. * pool of descriptors from where descriptors are being allocated for this
  8854. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  8855. * be unmapped by the host.
  8856. *
  8857. * The message would appear as follows:
  8858. *
  8859. * |31 24|23 16|15 8|7 0|
  8860. * |----------------+----------------+----------------+----------------|
  8861. * | reserved0 | msg_type |
  8862. * |-------------------------------------------------------------------|
  8863. * | flow_type |
  8864. * |-------------------------------------------------------------------|
  8865. * | flow_id |
  8866. * |-------------------------------------------------------------------|
  8867. * | reserved1 | flow_pool_id |
  8868. * |-------------------------------------------------------------------|
  8869. *
  8870. * The message is interpreted as follows:
  8871. * dword0 - b'0:7 - msg_type: This will be set to
  8872. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  8873. * b'8:31 - reserved0: Reserved for future use
  8874. *
  8875. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  8876. * this flow is associated. It can be VDEV, peer,
  8877. * or tid (AC). Based on enum htt_flow_type.
  8878. *
  8879. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  8880. * object. For flow_type vdev it is set to the
  8881. * vdevid, for peer it is peerid and for tid, it is
  8882. * tid_num.
  8883. *
  8884. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  8885. * used in the host for this flow
  8886. * b'16:31 - reserved0: This field in reserved for the future.
  8887. *
  8888. */
  8889. PREPACK struct htt_flow_pool_unmap_t {
  8890. A_UINT32 msg_type:8,
  8891. reserved0:24;
  8892. A_UINT32 flow_type;
  8893. A_UINT32 flow_id;
  8894. A_UINT32 flow_pool_id:16,
  8895. reserved1:16;
  8896. } POSTPACK;
  8897. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  8898. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  8899. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  8900. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  8901. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  8902. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  8903. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  8904. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  8905. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  8906. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  8907. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  8908. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  8909. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  8910. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  8911. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  8912. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  8913. do { \
  8914. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  8915. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  8916. } while (0)
  8917. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  8918. do { \
  8919. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  8920. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  8921. } while (0)
  8922. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  8923. do { \
  8924. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  8925. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  8926. } while (0)
  8927. /**
  8928. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  8929. *
  8930. * @details
  8931. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  8932. * SRNG ring setup is done
  8933. *
  8934. * This message indicates whether the last setup operation is successful.
  8935. * It will be sent to host when host set respose_required bit in
  8936. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  8937. * The message would appear as follows:
  8938. *
  8939. * |31 24|23 16|15 8|7 0|
  8940. * |--------------- +----------------+----------------+----------------|
  8941. * | setup_status | ring_id | pdev_id | msg_type |
  8942. * |-------------------------------------------------------------------|
  8943. *
  8944. * The message is interpreted as follows:
  8945. * dword0 - b'0:7 - msg_type: This will be set to
  8946. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  8947. * b'8:15 - pdev_id:
  8948. * 0 (for rings at SOC/UMAC level),
  8949. * 1/2/3 mac id (for rings at LMAC level)
  8950. * b'16:23 - ring_id: Identify the ring which is set up
  8951. * More details can be got from enum htt_srng_ring_id
  8952. * b'24:31 - setup_status: Indicate status of setup operation
  8953. * Refer to htt_ring_setup_status
  8954. */
  8955. PREPACK struct htt_sring_setup_done_t {
  8956. A_UINT32 msg_type: 8,
  8957. pdev_id: 8,
  8958. ring_id: 8,
  8959. setup_status: 8;
  8960. } POSTPACK;
  8961. enum htt_ring_setup_status {
  8962. htt_ring_setup_status_ok = 0,
  8963. htt_ring_setup_status_error,
  8964. };
  8965. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  8966. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  8967. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  8968. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  8969. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  8970. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  8971. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  8972. do { \
  8973. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  8974. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  8975. } while (0)
  8976. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  8977. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  8978. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  8979. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  8980. HTT_SRING_SETUP_DONE_RING_ID_S)
  8981. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  8982. do { \
  8983. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  8984. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  8985. } while (0)
  8986. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  8987. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  8988. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  8989. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  8990. HTT_SRING_SETUP_DONE_STATUS_S)
  8991. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  8992. do { \
  8993. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  8994. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  8995. } while (0)
  8996. /**
  8997. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  8998. *
  8999. * @details
  9000. * HTT TX map flow entry with tqm flow pointer
  9001. * Sent from firmware to host to add tqm flow pointer in corresponding
  9002. * flow search entry. Flow metadata is replayed back to host as part of this
  9003. * struct to enable host to find the specific flow search entry
  9004. *
  9005. * The message would appear as follows:
  9006. *
  9007. * |31 28|27 18|17 14|13 8|7 0|
  9008. * |-------+------------------------------------------+----------------|
  9009. * | rsvd0 | fse_hsh_idx | msg_type |
  9010. * |-------------------------------------------------------------------|
  9011. * | rsvd1 | tid | peer_id |
  9012. * |-------------------------------------------------------------------|
  9013. * | tqm_flow_pntr_lo |
  9014. * |-------------------------------------------------------------------|
  9015. * | tqm_flow_pntr_hi |
  9016. * |-------------------------------------------------------------------|
  9017. * | fse_meta_data |
  9018. * |-------------------------------------------------------------------|
  9019. *
  9020. * The message is interpreted as follows:
  9021. *
  9022. * dword0 - b'0:7 - msg_type: This will be set to
  9023. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  9024. *
  9025. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  9026. * for this flow entry
  9027. *
  9028. * dword0 - b'28:31 - rsvd0: Reserved for future use
  9029. *
  9030. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  9031. *
  9032. * dword1 - b'14:17 - tid
  9033. *
  9034. * dword1 - b'18:31 - rsvd1: Reserved for future use
  9035. *
  9036. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  9037. *
  9038. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  9039. *
  9040. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  9041. * given by host
  9042. */
  9043. PREPACK struct htt_tx_map_flow_info {
  9044. A_UINT32
  9045. msg_type: 8,
  9046. fse_hsh_idx: 20,
  9047. rsvd0: 4;
  9048. A_UINT32
  9049. peer_id: 14,
  9050. tid: 4,
  9051. rsvd1: 14;
  9052. A_UINT32 tqm_flow_pntr_lo;
  9053. A_UINT32 tqm_flow_pntr_hi;
  9054. struct htt_tx_flow_metadata fse_meta_data;
  9055. } POSTPACK;
  9056. /* DWORD 0 */
  9057. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  9058. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  9059. /* DWORD 1 */
  9060. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  9061. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  9062. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  9063. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  9064. /* DWORD 0 */
  9065. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  9066. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  9067. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  9068. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  9069. do { \
  9070. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  9071. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  9072. } while (0)
  9073. /* DWORD 1 */
  9074. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  9075. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  9076. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  9077. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  9078. do { \
  9079. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  9080. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  9081. } while (0)
  9082. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  9083. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  9084. HTT_TX_MAP_FLOW_INFO_TID_S)
  9085. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  9086. do { \
  9087. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  9088. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  9089. } while (0)
  9090. /*
  9091. * htt_dbg_ext_stats_status -
  9092. * present - The requested stats have been delivered in full.
  9093. * This indicates that either the stats information was contained
  9094. * in its entirety within this message, or else this message
  9095. * completes the delivery of the requested stats info that was
  9096. * partially delivered through earlier STATS_CONF messages.
  9097. * partial - The requested stats have been delivered in part.
  9098. * One or more subsequent STATS_CONF messages with the same
  9099. * cookie value will be sent to deliver the remainder of the
  9100. * information.
  9101. * error - The requested stats could not be delivered, for example due
  9102. * to a shortage of memory to construct a message holding the
  9103. * requested stats.
  9104. * invalid - The requested stat type is either not recognized, or the
  9105. * target is configured to not gather the stats type in question.
  9106. */
  9107. enum htt_dbg_ext_stats_status {
  9108. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  9109. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  9110. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  9111. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  9112. };
  9113. /**
  9114. * @brief target -> host ppdu stats upload
  9115. *
  9116. * @details
  9117. * The following field definitions describe the format of the HTT target
  9118. * to host ppdu stats indication message.
  9119. *
  9120. *
  9121. * |31 16|15 12|11 10|9 8|7 0 |
  9122. * |----------------------------------------------------------------------|
  9123. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  9124. * |----------------------------------------------------------------------|
  9125. * | ppdu_id |
  9126. * |----------------------------------------------------------------------|
  9127. * | Timestamp in us |
  9128. * |----------------------------------------------------------------------|
  9129. * | reserved |
  9130. * |----------------------------------------------------------------------|
  9131. * | type-specific stats info |
  9132. * | (see htt_ppdu_stats.h) |
  9133. * |----------------------------------------------------------------------|
  9134. * Header fields:
  9135. * - MSG_TYPE
  9136. * Bits 7:0
  9137. * Purpose: Identifies this is a PPDU STATS indication
  9138. * message.
  9139. * Value: 0x1d
  9140. * - mac_id
  9141. * Bits 9:8
  9142. * Purpose: mac_id of this ppdu_id
  9143. * Value: 0-3
  9144. * - pdev_id
  9145. * Bits 11:10
  9146. * Purpose: pdev_id of this ppdu_id
  9147. * Value: 0-3
  9148. * 0 (for rings at SOC level),
  9149. * 1/2/3 PDEV -> 0/1/2
  9150. * - payload_size
  9151. * Bits 31:16
  9152. * Purpose: total tlv size
  9153. * Value: payload_size in bytes
  9154. */
  9155. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  9156. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  9157. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  9158. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  9159. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  9160. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  9161. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  9162. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  9163. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  9164. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  9165. do { \
  9166. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  9167. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  9168. } while (0)
  9169. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  9170. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  9171. HTT_T2H_PPDU_STATS_MAC_ID_S)
  9172. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  9173. do { \
  9174. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  9175. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  9176. } while (0)
  9177. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  9178. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  9179. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  9180. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  9181. do { \
  9182. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  9183. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  9184. } while (0)
  9185. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  9186. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  9187. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  9188. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  9189. do { \
  9190. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  9191. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  9192. } while (0)
  9193. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  9194. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  9195. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  9196. /**
  9197. * @brief target -> host extended statistics upload
  9198. *
  9199. * @details
  9200. * The following field definitions describe the format of the HTT target
  9201. * to host stats upload confirmation message.
  9202. * The message contains a cookie echoed from the HTT host->target stats
  9203. * upload request, which identifies which request the confirmation is
  9204. * for, and a single stats can span over multiple HTT stats indication
  9205. * due to the HTT message size limitation so every HTT ext stats indication
  9206. * will have tag-length-value stats information elements.
  9207. * The tag-length header for each HTT stats IND message also includes a
  9208. * status field, to indicate whether the request for the stat type in
  9209. * question was fully met, partially met, unable to be met, or invalid
  9210. * (if the stat type in question is disabled in the target).
  9211. * A Done bit 1's indicate the end of the of stats info elements.
  9212. *
  9213. *
  9214. * |31 16|15 12|11|10 8|7 5|4 0|
  9215. * |--------------------------------------------------------------|
  9216. * | reserved | msg type |
  9217. * |--------------------------------------------------------------|
  9218. * | cookie LSBs |
  9219. * |--------------------------------------------------------------|
  9220. * | cookie MSBs |
  9221. * |--------------------------------------------------------------|
  9222. * | stats entry length | rsvd | D| S | stat type |
  9223. * |--------------------------------------------------------------|
  9224. * | type-specific stats info |
  9225. * | (see htt_stats.h) |
  9226. * |--------------------------------------------------------------|
  9227. * Header fields:
  9228. * - MSG_TYPE
  9229. * Bits 7:0
  9230. * Purpose: Identifies this is a extended statistics upload confirmation
  9231. * message.
  9232. * Value: 0x1c
  9233. * - COOKIE_LSBS
  9234. * Bits 31:0
  9235. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9236. * message with its preceding host->target stats request message.
  9237. * Value: LSBs of the opaque cookie specified by the host-side requestor
  9238. * - COOKIE_MSBS
  9239. * Bits 31:0
  9240. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9241. * message with its preceding host->target stats request message.
  9242. * Value: MSBs of the opaque cookie specified by the host-side requestor
  9243. *
  9244. * Stats Information Element tag-length header fields:
  9245. * - STAT_TYPE
  9246. * Bits 7:0
  9247. * Purpose: identifies the type of statistics info held in the
  9248. * following information element
  9249. * Value: htt_dbg_ext_stats_type
  9250. * - STATUS
  9251. * Bits 10:8
  9252. * Purpose: indicate whether the requested stats are present
  9253. * Value: htt_dbg_ext_stats_status
  9254. * - DONE
  9255. * Bits 11
  9256. * Purpose:
  9257. * Indicates the completion of the stats entry, this will be the last
  9258. * stats conf HTT segment for the requested stats type.
  9259. * Value:
  9260. * 0 -> the stats retrieval is ongoing
  9261. * 1 -> the stats retrieval is complete
  9262. * - LENGTH
  9263. * Bits 31:16
  9264. * Purpose: indicate the stats information size
  9265. * Value: This field specifies the number of bytes of stats information
  9266. * that follows the element tag-length header.
  9267. * It is expected but not required that this length is a multiple of
  9268. * 4 bytes.
  9269. */
  9270. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  9271. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  9272. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  9273. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  9274. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  9275. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  9276. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  9277. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  9278. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  9279. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  9280. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  9281. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  9282. do { \
  9283. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  9284. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  9285. } while (0)
  9286. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  9287. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  9288. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  9289. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  9290. do { \
  9291. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  9292. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  9293. } while (0)
  9294. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  9295. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  9296. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  9297. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  9298. do { \
  9299. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  9300. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  9301. } while (0)
  9302. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  9303. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  9304. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  9305. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  9306. do { \
  9307. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  9308. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  9309. } while (0)
  9310. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  9311. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  9312. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  9313. typedef enum {
  9314. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  9315. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  9316. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  9317. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  9318. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  9319. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  9320. /* Reserved from 128 - 255 for target internal use.*/
  9321. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  9322. } HTT_PEER_TYPE;
  9323. /** 2 word representation of MAC addr */
  9324. typedef struct {
  9325. /** upper 4 bytes of MAC address */
  9326. A_UINT32 mac_addr31to0;
  9327. /** lower 2 bytes of MAC address */
  9328. A_UINT32 mac_addr47to32;
  9329. } htt_mac_addr;
  9330. /** macro to convert MAC address from char array to HTT word format */
  9331. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  9332. (phtt_mac_addr)->mac_addr31to0 = \
  9333. (((c_macaddr)[0] << 0) | \
  9334. ((c_macaddr)[1] << 8) | \
  9335. ((c_macaddr)[2] << 16) | \
  9336. ((c_macaddr)[3] << 24)); \
  9337. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  9338. } while (0)
  9339. #endif