htt.h 517 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422
  1. /*
  2. * Copyright (c) 2011-2019 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /**
  27. * @file htt.h
  28. *
  29. * @details the public header file of HTT layer
  30. */
  31. #ifndef _HTT_H_
  32. #define _HTT_H_
  33. #include <htt_deps.h>
  34. #include <htt_common.h>
  35. /*
  36. * Unless explicitly specified to use 64 bits to represent physical addresses
  37. * (or more precisely, bus addresses), default to 32 bits.
  38. */
  39. #ifndef HTT_PADDR64
  40. #define HTT_PADDR64 0
  41. #endif
  42. #ifndef offsetof
  43. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  44. #endif
  45. /*
  46. * HTT version history:
  47. * 1.0 initial numbered version
  48. * 1.1 modifications to STATS messages.
  49. * These modifications are not backwards compatible, but since the
  50. * STATS messages themselves are non-essential (they are for debugging),
  51. * the 1.1 version of the HTT message library as a whole is compatible
  52. * with the 1.0 version.
  53. * 1.2 reset mask IE added to STATS_REQ message
  54. * 1.3 stat config IE added to STATS_REQ message
  55. *----
  56. * 2.0 FW rx PPDU desc added to RX_IND message
  57. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  58. *----
  59. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  60. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  61. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  62. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  63. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  64. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  65. * 3.5 Added flush and fail stats in rx_reorder stats structure
  66. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  67. * 3.7 Made changes to support EOS Mac_core 3.0
  68. * 3.8 Added txq_group information element definition;
  69. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  70. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  71. * Allow buffer addresses in bus-address format to be stored as
  72. * either 32 bits or 64 bits.
  73. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  74. * messages to specify which HTT options to use.
  75. * Initial TLV options cover:
  76. * - whether to use 32 or 64 bits to represent LL bus addresses
  77. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  78. * - how many tx queue groups to use
  79. * 3.11 Expand rx debug stats:
  80. * - Expand the rx_reorder_stats struct with stats about successful and
  81. * failed rx buffer allcoations.
  82. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  83. * the supply, allocation, use, and recycling of rx buffers for the
  84. * "remote ring" of rx buffers in host member in LL systems.
  85. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  86. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  87. * 3.13 Add constants + macros to support 64-bit address format for the
  88. * tx fragments descriptor, the rx ring buffer, and the rx ring
  89. * index shadow register.
  90. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  91. * - Add htt_tx_msdu_desc_ext_t struct def.
  92. * - Add TLV to specify whether the target supports the HTT tx MSDU
  93. * extension descriptor.
  94. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  95. * "extension" bit, to specify whether a HTT tx MSDU extension
  96. * descriptor is present.
  97. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  98. * (This allows the host to obtain key information about the MSDU
  99. * from a memory location already in the cache, rather than taking a
  100. * cache miss for each MSDU by reading the HW rx descs.)
  101. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  102. * whether a copy-engine classification result is appended to TX_FRM.
  103. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  104. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  105. * tx frames in the target after the peer has already been deleted.
  106. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  107. * 3.20 Expand rx_reorder_stats.
  108. * 3.21 Add optional rx channel spec to HL RX_IND.
  109. * 3.22 Expand rx_reorder_stats
  110. * (distinguish duplicates within vs. outside block ack window)
  111. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  112. * The justified rate is calculated by two steps. The first is to multiply
  113. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  114. * by a low pass filter.
  115. * This change allows HL download scheduling to consider the WLAN rate
  116. * that will be used for transmitting the downloaded frames.
  117. * 3.24 Expand rx_reorder_stats
  118. * (add counter for decrypt / MIC errors)
  119. * 3.25 Expand rx_reorder_stats
  120. * (add counter of frames received into both local + remote rings)
  121. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  122. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  123. * 3.27 Add a new interface for flow-control. The following t2h messages have
  124. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  125. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  126. * 3.28 Add a new interface for ring interface change. The following two h2t
  127. * and one t2h messages have been included:
  128. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  129. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  130. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  131. * information elements passed from the host to a Lithium target,
  132. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  133. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  134. * targets).
  135. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  136. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  137. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  138. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  139. * sharing stats
  140. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  141. * 3.34 Add HW_PEER_ID field to PEER_MAP
  142. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  143. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  144. * not yet in use)
  145. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  146. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  147. * 3.38 Add holes_no_filled field to rx_reorder_stats
  148. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  149. * 3.40 Add optional timestamps in the HTT tx completion
  150. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  151. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  152. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  153. * 3.44 Add htt_tx_wbm_completion_v2
  154. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  155. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  156. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  157. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  158. * HTT_T2H_MSG_TYPE_PKTLOG
  159. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  160. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  161. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  162. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  163. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  165. * 3.55 Add initiator / responder flags to RX_DELBA indication
  166. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  167. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  168. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  169. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  170. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  171. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  172. * 3.62 Add antenna mask to reserved space in htt_rx_ind_hl_rx_desc_t
  173. */
  174. #define HTT_CURRENT_VERSION_MAJOR 3
  175. #define HTT_CURRENT_VERSION_MINOR 62
  176. #define HTT_NUM_TX_FRAG_DESC 1024
  177. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  178. #define HTT_CHECK_SET_VAL(field, val) \
  179. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  180. /* macros to assist in sign-extending fields from HTT messages */
  181. #define HTT_SIGN_BIT_MASK(field) \
  182. ((field ## _M + (1 << field ## _S)) >> 1)
  183. #define HTT_SIGN_BIT(_val, field) \
  184. (_val & HTT_SIGN_BIT_MASK(field))
  185. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  186. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  187. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  188. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  189. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  190. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  191. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  192. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  193. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  194. /*
  195. * TEMPORARY:
  196. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  197. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  198. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  199. * updated.
  200. */
  201. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  202. /*
  203. * TEMPORARY:
  204. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  205. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  206. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  207. * updated.
  208. */
  209. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  210. /* HTT Access Category values */
  211. enum HTT_AC_WMM {
  212. /* WMM Access Categories */
  213. HTT_AC_WMM_BE = 0x0,
  214. HTT_AC_WMM_BK = 0x1,
  215. HTT_AC_WMM_VI = 0x2,
  216. HTT_AC_WMM_VO = 0x3,
  217. /* extension Access Categories */
  218. HTT_AC_EXT_NON_QOS = 0x4,
  219. HTT_AC_EXT_UCAST_MGMT = 0x5,
  220. HTT_AC_EXT_MCAST_DATA = 0x6,
  221. HTT_AC_EXT_MCAST_MGMT = 0x7,
  222. };
  223. enum HTT_AC_WMM_MASK {
  224. /* WMM Access Categories */
  225. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  226. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  227. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  228. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  229. /* extension Access Categories */
  230. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  231. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  232. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  233. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  234. };
  235. #define HTT_AC_MASK_WMM \
  236. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  237. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  238. #define HTT_AC_MASK_EXT \
  239. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  240. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  241. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  242. /*
  243. * htt_dbg_stats_type -
  244. * bit positions for each stats type within a stats type bitmask
  245. * The bitmask contains 24 bits.
  246. */
  247. enum htt_dbg_stats_type {
  248. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  249. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  250. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  251. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  252. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  253. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  254. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  255. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  256. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  257. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  258. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  259. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  260. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  261. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  262. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  263. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  264. /* bits 16-23 currently reserved */
  265. /* keep this last */
  266. HTT_DBG_NUM_STATS
  267. };
  268. /*=== HTT option selection TLVs ===
  269. * Certain HTT messages have alternatives or options.
  270. * For such cases, the host and target need to agree on which option to use.
  271. * Option specification TLVs can be appended to the VERSION_REQ and
  272. * VERSION_CONF messages to select options other than the default.
  273. * These TLVs are entirely optional - if they are not provided, there is a
  274. * well-defined default for each option. If they are provided, they can be
  275. * provided in any order. Each TLV can be present or absent independent of
  276. * the presence / absence of other TLVs.
  277. *
  278. * The HTT option selection TLVs use the following format:
  279. * |31 16|15 8|7 0|
  280. * |---------------------------------+----------------+----------------|
  281. * | value (payload) | length | tag |
  282. * |-------------------------------------------------------------------|
  283. * The value portion need not be only 2 bytes; it can be extended by any
  284. * integer number of 4-byte units. The total length of the TLV, including
  285. * the tag and length fields, must be a multiple of 4 bytes. The length
  286. * field specifies the total TLV size in 4-byte units. Thus, the typical
  287. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  288. * field, would store 0x1 in its length field, to show that the TLV occupies
  289. * a single 4-byte unit.
  290. */
  291. /*--- TLV header format - applies to all HTT option TLVs ---*/
  292. enum HTT_OPTION_TLV_TAGS {
  293. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  294. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  295. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  296. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  297. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  298. };
  299. PREPACK struct htt_option_tlv_header_t {
  300. A_UINT8 tag;
  301. A_UINT8 length;
  302. } POSTPACK;
  303. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  304. #define HTT_OPTION_TLV_TAG_S 0
  305. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  306. #define HTT_OPTION_TLV_LENGTH_S 8
  307. /*
  308. * value0 - 16 bit value field stored in word0
  309. * The TLV's value field may be longer than 2 bytes, in which case
  310. * the remainder of the value is stored in word1, word2, etc.
  311. */
  312. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  313. #define HTT_OPTION_TLV_VALUE0_S 16
  314. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  315. do { \
  316. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  317. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  318. } while (0)
  319. #define HTT_OPTION_TLV_TAG_GET(word) \
  320. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  321. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  322. do { \
  323. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  324. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  325. } while (0)
  326. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  327. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  328. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  329. do { \
  330. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  331. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  332. } while (0)
  333. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  334. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  335. /*--- format of specific HTT option TLVs ---*/
  336. /*
  337. * HTT option TLV for specifying LL bus address size
  338. * Some chips require bus addresses used by the target to access buffers
  339. * within the host's memory to be 32 bits; others require bus addresses
  340. * used by the target to access buffers within the host's memory to be
  341. * 64 bits.
  342. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  343. * a suffix to the VERSION_CONF message to specify which bus address format
  344. * the target requires.
  345. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  346. * default to providing bus addresses to the target in 32-bit format.
  347. */
  348. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  349. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  350. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  351. };
  352. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  353. struct htt_option_tlv_header_t hdr;
  354. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  355. } POSTPACK;
  356. /*
  357. * HTT option TLV for specifying whether HL systems should indicate
  358. * over-the-air tx completion for individual frames, or should instead
  359. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  360. * requests an OTA tx completion for a particular tx frame.
  361. * This option does not apply to LL systems, where the TX_COMPL_IND
  362. * is mandatory.
  363. * This option is primarily intended for HL systems in which the tx frame
  364. * downloads over the host --> target bus are as slow as or slower than
  365. * the transmissions over the WLAN PHY. For cases where the bus is faster
  366. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  367. * and consquently will send one TX_COMPL_IND message that covers several
  368. * tx frames. For cases where the WLAN PHY is faster than the bus,
  369. * the target will end up transmitting very short A-MPDUs, and consequently
  370. * sending many TX_COMPL_IND messages, which each cover a very small number
  371. * of tx frames.
  372. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  373. * a suffix to the VERSION_REQ message to request whether the host desires to
  374. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  375. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  376. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  377. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  378. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  379. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  380. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  381. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  382. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  383. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  384. * TLV.
  385. */
  386. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  387. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  388. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  389. };
  390. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  391. struct htt_option_tlv_header_t hdr;
  392. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  393. } POSTPACK;
  394. /*
  395. * HTT option TLV for specifying how many tx queue groups the target
  396. * may establish.
  397. * This TLV specifies the maximum value the target may send in the
  398. * txq_group_id field of any TXQ_GROUP information elements sent by
  399. * the target to the host. This allows the host to pre-allocate an
  400. * appropriate number of tx queue group structs.
  401. *
  402. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  403. * a suffix to the VERSION_REQ message to specify whether the host supports
  404. * tx queue groups at all, and if so if there is any limit on the number of
  405. * tx queue groups that the host supports.
  406. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  407. * a suffix to the VERSION_CONF message. If the host has specified in the
  408. * VER_REQ message a limit on the number of tx queue groups the host can
  409. * supprt, the target shall limit its specification of the maximum tx groups
  410. * to be no larger than this host-specified limit.
  411. *
  412. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  413. * shall preallocate 4 tx queue group structs, and the target shall not
  414. * specify a txq_group_id larger than 3.
  415. */
  416. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  417. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  418. /*
  419. * values 1 through N specify the max number of tx queue groups
  420. * the sender supports
  421. */
  422. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  423. };
  424. /* TEMPORARY backwards-compatibility alias for a typo fix -
  425. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  426. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  427. * to support the old name (with the typo) until all references to the
  428. * old name are replaced with the new name.
  429. */
  430. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  431. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  432. struct htt_option_tlv_header_t hdr;
  433. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  434. } POSTPACK;
  435. /*
  436. * HTT option TLV for specifying whether the target supports an extended
  437. * version of the HTT tx descriptor. If the target provides this TLV
  438. * and specifies in the TLV that the target supports an extended version
  439. * of the HTT tx descriptor, the target must check the "extension" bit in
  440. * the HTT tx descriptor, and if the extension bit is set, to expect a
  441. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  442. * descriptor. Furthermore, the target must provide room for the HTT
  443. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  444. * This option is intended for systems where the host needs to explicitly
  445. * control the transmission parameters such as tx power for individual
  446. * tx frames.
  447. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  448. * as a suffix to the VERSION_CONF message to explicitly specify whether
  449. * the target supports the HTT tx MSDU extension descriptor.
  450. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  451. * by the host as lack of target support for the HTT tx MSDU extension
  452. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  453. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  454. * the HTT tx MSDU extension descriptor.
  455. * The host is not required to provide the HTT tx MSDU extension descriptor
  456. * just because the target supports it; the target must check the
  457. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  458. * extension descriptor is present.
  459. */
  460. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  461. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  462. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  463. };
  464. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  465. struct htt_option_tlv_header_t hdr;
  466. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  467. } POSTPACK;
  468. /*=== host -> target messages ===============================================*/
  469. enum htt_h2t_msg_type {
  470. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  471. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  472. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  473. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  474. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  475. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  476. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  477. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  478. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  479. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  480. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  481. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  482. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  483. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  484. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  485. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  486. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  487. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  488. /* keep this last */
  489. HTT_H2T_NUM_MSGS
  490. };
  491. /*
  492. * HTT host to target message type -
  493. * stored in bits 7:0 of the first word of the message
  494. */
  495. #define HTT_H2T_MSG_TYPE_M 0xff
  496. #define HTT_H2T_MSG_TYPE_S 0
  497. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  498. do { \
  499. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  500. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  501. } while (0)
  502. #define HTT_H2T_MSG_TYPE_GET(word) \
  503. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  504. /**
  505. * @brief host -> target version number request message definition
  506. *
  507. * |31 24|23 16|15 8|7 0|
  508. * |----------------+----------------+----------------+----------------|
  509. * | reserved | msg type |
  510. * |-------------------------------------------------------------------|
  511. * : option request TLV (optional) |
  512. * :...................................................................:
  513. *
  514. * The VER_REQ message may consist of a single 4-byte word, or may be
  515. * extended with TLVs that specify which HTT options the host is requesting
  516. * from the target.
  517. * The following option TLVs may be appended to the VER_REQ message:
  518. * - HL_SUPPRESS_TX_COMPL_IND
  519. * - HL_MAX_TX_QUEUE_GROUPS
  520. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  521. * may be appended to the VER_REQ message (but only one TLV of each type).
  522. *
  523. * Header fields:
  524. * - MSG_TYPE
  525. * Bits 7:0
  526. * Purpose: identifies this as a version number request message
  527. * Value: 0x0
  528. */
  529. #define HTT_VER_REQ_BYTES 4
  530. /* TBDXXX: figure out a reasonable number */
  531. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  532. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  533. /**
  534. * @brief HTT tx MSDU descriptor
  535. *
  536. * @details
  537. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  538. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  539. * the target firmware needs for the FW's tx processing, particularly
  540. * for creating the HW msdu descriptor.
  541. * The same HTT tx descriptor is used for HL and LL systems, though
  542. * a few fields within the tx descriptor are used only by LL or
  543. * only by HL.
  544. * The HTT tx descriptor is defined in two manners: by a struct with
  545. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  546. * definitions.
  547. * The target should use the struct def, for simplicitly and clarity,
  548. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  549. * neutral. Specifically, the host shall use the get/set macros built
  550. * around the mask + shift defs.
  551. */
  552. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  553. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  554. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  555. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  556. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  557. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  558. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  559. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  560. #define HTT_TX_VDEV_ID_WORD 0
  561. #define HTT_TX_VDEV_ID_MASK 0x3f
  562. #define HTT_TX_VDEV_ID_SHIFT 16
  563. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  564. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  565. #define HTT_TX_MSDU_LEN_DWORD 1
  566. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  567. /*
  568. * HTT_VAR_PADDR macros
  569. * Allow physical / bus addresses to be either a single 32-bit value,
  570. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  571. */
  572. #define HTT_VAR_PADDR32(var_name) \
  573. A_UINT32 var_name
  574. #define HTT_VAR_PADDR64_LE(var_name) \
  575. struct { \
  576. /* little-endian: lo precedes hi */ \
  577. A_UINT32 lo; \
  578. A_UINT32 hi; \
  579. } var_name
  580. /*
  581. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  582. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  583. * addresses are stored in a XXX-bit field.
  584. * This macro is used to define both htt_tx_msdu_desc32_t and
  585. * htt_tx_msdu_desc64_t structs.
  586. */
  587. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  588. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  589. { \
  590. /* DWORD 0: flags and meta-data */ \
  591. A_UINT32 \
  592. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  593. \
  594. /* pkt_subtype - \
  595. * Detailed specification of the tx frame contents, extending the \
  596. * general specification provided by pkt_type. \
  597. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  598. * pkt_type | pkt_subtype \
  599. * ============================================================== \
  600. * 802.3 | bit 0:3 - Reserved \
  601. * | bit 4: 0x0 - Copy-Engine Classification Results \
  602. * | not appended to the HTT message \
  603. * | 0x1 - Copy-Engine Classification Results \
  604. * | appended to the HTT message in the \
  605. * | format: \
  606. * | [HTT tx desc, frame header, \
  607. * | CE classification results] \
  608. * | The CE classification results begin \
  609. * | at the next 4-byte boundary after \
  610. * | the frame header. \
  611. * ------------+------------------------------------------------- \
  612. * Eth2 | bit 0:3 - Reserved \
  613. * | bit 4: 0x0 - Copy-Engine Classification Results \
  614. * | not appended to the HTT message \
  615. * | 0x1 - Copy-Engine Classification Results \
  616. * | appended to the HTT message. \
  617. * | See the above specification of the \
  618. * | CE classification results location. \
  619. * ------------+------------------------------------------------- \
  620. * native WiFi | bit 0:3 - Reserved \
  621. * | bit 4: 0x0 - Copy-Engine Classification Results \
  622. * | not appended to the HTT message \
  623. * | 0x1 - Copy-Engine Classification Results \
  624. * | appended to the HTT message. \
  625. * | See the above specification of the \
  626. * | CE classification results location. \
  627. * ------------+------------------------------------------------- \
  628. * mgmt | 0x0 - 802.11 MAC header absent \
  629. * | 0x1 - 802.11 MAC header present \
  630. * ------------+------------------------------------------------- \
  631. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  632. * | 0x1 - 802.11 MAC header present \
  633. * | bit 1: 0x0 - allow aggregation \
  634. * | 0x1 - don't allow aggregation \
  635. * | bit 2: 0x0 - perform encryption \
  636. * | 0x1 - don't perform encryption \
  637. * | bit 3: 0x0 - perform tx classification / queuing \
  638. * | 0x1 - don't perform tx classification; \
  639. * | insert the frame into the "misc" \
  640. * | tx queue \
  641. * | bit 4: 0x0 - Copy-Engine Classification Results \
  642. * | not appended to the HTT message \
  643. * | 0x1 - Copy-Engine Classification Results \
  644. * | appended to the HTT message. \
  645. * | See the above specification of the \
  646. * | CE classification results location. \
  647. */ \
  648. pkt_subtype: 5, \
  649. \
  650. /* pkt_type - \
  651. * General specification of the tx frame contents. \
  652. * The htt_pkt_type enum should be used to specify and check the \
  653. * value of this field. \
  654. */ \
  655. pkt_type: 3, \
  656. \
  657. /* vdev_id - \
  658. * ID for the vdev that is sending this tx frame. \
  659. * For certain non-standard packet types, e.g. pkt_type == raw \
  660. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  661. * This field is used primarily for determining where to queue \
  662. * broadcast and multicast frames. \
  663. */ \
  664. vdev_id: 6, \
  665. /* ext_tid - \
  666. * The extended traffic ID. \
  667. * If the TID is unknown, the extended TID is set to \
  668. * HTT_TX_EXT_TID_INVALID. \
  669. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  670. * value of the QoS TID. \
  671. * If the tx frame is non-QoS data, then the extended TID is set to \
  672. * HTT_TX_EXT_TID_NON_QOS. \
  673. * If the tx frame is multicast or broadcast, then the extended TID \
  674. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  675. */ \
  676. ext_tid: 5, \
  677. \
  678. /* postponed - \
  679. * This flag indicates whether the tx frame has been downloaded to \
  680. * the target before but discarded by the target, and now is being \
  681. * downloaded again; or if this is a new frame that is being \
  682. * downloaded for the first time. \
  683. * This flag allows the target to determine the correct order for \
  684. * transmitting new vs. old frames. \
  685. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  686. * This flag only applies to HL systems, since in LL systems, \
  687. * the tx flow control is handled entirely within the target. \
  688. */ \
  689. postponed: 1, \
  690. \
  691. /* extension - \
  692. * This flag indicates whether a HTT tx MSDU extension descriptor \
  693. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  694. * \
  695. * 0x0 - no extension MSDU descriptor is present \
  696. * 0x1 - an extension MSDU descriptor immediately follows the \
  697. * regular MSDU descriptor \
  698. */ \
  699. extension: 1, \
  700. \
  701. /* cksum_offload - \
  702. * This flag indicates whether checksum offload is enabled or not \
  703. * for this frame. Target FW use this flag to turn on HW checksumming \
  704. * 0x0 - No checksum offload \
  705. * 0x1 - L3 header checksum only \
  706. * 0x2 - L4 checksum only \
  707. * 0x3 - L3 header checksum + L4 checksum \
  708. */ \
  709. cksum_offload: 2, \
  710. \
  711. /* tx_comp_req - \
  712. * This flag indicates whether Tx Completion \
  713. * from fw is required or not. \
  714. * This flag is only relevant if tx completion is not \
  715. * universally enabled. \
  716. * For all LL systems, tx completion is mandatory, \
  717. * so this flag will be irrelevant. \
  718. * For HL systems tx completion is optional, but HL systems in which \
  719. * the bus throughput exceeds the WLAN throughput will \
  720. * probably want to always use tx completion, and thus \
  721. * would not check this flag. \
  722. * This flag is required when tx completions are not used universally, \
  723. * but are still required for certain tx frames for which \
  724. * an OTA delivery acknowledgment is needed by the host. \
  725. * In practice, this would be for HL systems in which the \
  726. * bus throughput is less than the WLAN throughput. \
  727. * \
  728. * 0x0 - Tx Completion Indication from Fw not required \
  729. * 0x1 - Tx Completion Indication from Fw is required \
  730. */ \
  731. tx_compl_req: 1; \
  732. \
  733. \
  734. /* DWORD 1: MSDU length and ID */ \
  735. A_UINT32 \
  736. len: 16, /* MSDU length, in bytes */ \
  737. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  738. * and this id is used to calculate fragmentation \
  739. * descriptor pointer inside the target based on \
  740. * the base address, configured inside the target. \
  741. */ \
  742. \
  743. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  744. /* frags_desc_ptr - \
  745. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  746. * where the tx frame's fragments reside in memory. \
  747. * This field only applies to LL systems, since in HL systems the \
  748. * (degenerate single-fragment) fragmentation descriptor is created \
  749. * within the target. \
  750. */ \
  751. _paddr__frags_desc_ptr_; \
  752. \
  753. /* DWORD 3 (or 4): peerid, chanfreq */ \
  754. /* \
  755. * Peer ID : Target can use this value to know which peer-id packet \
  756. * destined to. \
  757. * It's intended to be specified by host in case of NAWDS. \
  758. */ \
  759. A_UINT16 peerid; \
  760. \
  761. /* \
  762. * Channel frequency: This identifies the desired channel \
  763. * frequency (in mhz) for tx frames. This is used by FW to help \
  764. * determine when it is safe to transmit or drop frames for \
  765. * off-channel operation. \
  766. * The default value of zero indicates to FW that the corresponding \
  767. * VDEV's home channel (if there is one) is the desired channel \
  768. * frequency. \
  769. */ \
  770. A_UINT16 chanfreq; \
  771. \
  772. /* Reason reserved is commented is increasing the htt structure size \
  773. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  774. * A_UINT32 reserved_dword3_bits0_31; \
  775. */ \
  776. } POSTPACK
  777. /* define a htt_tx_msdu_desc32_t type */
  778. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  779. /* define a htt_tx_msdu_desc64_t type */
  780. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  781. /*
  782. * Make htt_tx_msdu_desc_t be an alias for either
  783. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  784. */
  785. #if HTT_PADDR64
  786. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  787. #else
  788. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  789. #endif
  790. /* decriptor information for Management frame*/
  791. /*
  792. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  793. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  794. */
  795. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  796. extern A_UINT32 mgmt_hdr_len;
  797. PREPACK struct htt_mgmt_tx_desc_t {
  798. A_UINT32 msg_type;
  799. #if HTT_PADDR64
  800. A_UINT64 frag_paddr; /* DMAble address of the data */
  801. #else
  802. A_UINT32 frag_paddr; /* DMAble address of the data */
  803. #endif
  804. A_UINT32 desc_id; /* returned to host during completion
  805. * to free the meory*/
  806. A_UINT32 len; /* Fragment length */
  807. A_UINT32 vdev_id; /* virtual device ID*/
  808. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  809. } POSTPACK;
  810. PREPACK struct htt_mgmt_tx_compl_ind {
  811. A_UINT32 desc_id;
  812. A_UINT32 status;
  813. } POSTPACK;
  814. /*
  815. * This SDU header size comes from the summation of the following:
  816. * 1. Max of:
  817. * a. Native WiFi header, for native WiFi frames: 24 bytes
  818. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  819. * b. 802.11 header, for raw frames: 36 bytes
  820. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  821. * QoS header, HT header)
  822. * c. 802.3 header, for ethernet frames: 14 bytes
  823. * (destination address, source address, ethertype / length)
  824. * 2. Max of:
  825. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  826. * b. IPv6 header, up through the Traffic Class: 2 bytes
  827. * 3. 802.1Q VLAN header: 4 bytes
  828. * 4. LLC/SNAP header: 8 bytes
  829. */
  830. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  831. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  832. #define HTT_TX_HDR_SIZE_ETHERNET 14
  833. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  834. A_COMPILE_TIME_ASSERT(
  835. htt_encap_hdr_size_max_check_nwifi,
  836. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  837. A_COMPILE_TIME_ASSERT(
  838. htt_encap_hdr_size_max_check_enet,
  839. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  840. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  841. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  842. #define HTT_TX_HDR_SIZE_802_1Q 4
  843. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  844. #define HTT_COMMON_TX_FRM_HDR_LEN \
  845. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  846. HTT_TX_HDR_SIZE_802_1Q + \
  847. HTT_TX_HDR_SIZE_LLC_SNAP)
  848. #define HTT_HL_TX_FRM_HDR_LEN \
  849. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  850. #define HTT_LL_TX_FRM_HDR_LEN \
  851. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  852. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  853. /* dword 0 */
  854. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  855. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  856. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  857. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  858. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  859. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  860. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  861. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  862. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  863. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  864. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  865. #define HTT_TX_DESC_PKT_TYPE_S 13
  866. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  867. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  868. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  869. #define HTT_TX_DESC_VDEV_ID_S 16
  870. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  871. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  872. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  873. #define HTT_TX_DESC_EXT_TID_S 22
  874. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  875. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  876. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  877. #define HTT_TX_DESC_POSTPONED_S 27
  878. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  879. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  880. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  881. #define HTT_TX_DESC_EXTENSION_S 28
  882. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  883. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  884. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  885. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  886. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  887. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  888. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  889. #define HTT_TX_DESC_TX_COMP_S 31
  890. /* dword 1 */
  891. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  892. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  893. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  894. #define HTT_TX_DESC_FRM_LEN_S 0
  895. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  896. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  897. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  898. #define HTT_TX_DESC_FRM_ID_S 16
  899. /* dword 2 */
  900. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  901. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  902. /* for systems using 64-bit format for bus addresses */
  903. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  904. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  905. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  906. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  907. /* for systems using 32-bit format for bus addresses */
  908. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  909. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  910. /* dword 3 */
  911. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  912. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  913. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  914. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  915. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  916. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  917. #if HTT_PADDR64
  918. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  919. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  920. #else
  921. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  922. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  923. #endif
  924. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  925. #define HTT_TX_DESC_PEER_ID_S 0
  926. /*
  927. * TEMPORARY:
  928. * The original definitions for the PEER_ID fields contained typos
  929. * (with _DESC_PADDR appended to this PEER_ID field name).
  930. * Retain deprecated original names for PEER_ID fields until all code that
  931. * refers to them has been updated.
  932. */
  933. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  934. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  935. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  936. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  937. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  938. HTT_TX_DESC_PEER_ID_M
  939. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  940. HTT_TX_DESC_PEER_ID_S
  941. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  942. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  943. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  944. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  945. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  946. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  947. #if HTT_PADDR64
  948. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  949. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  950. #else
  951. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  952. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  953. #endif
  954. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  955. #define HTT_TX_DESC_CHAN_FREQ_S 16
  956. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  957. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  958. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  959. do { \
  960. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  961. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  962. } while (0)
  963. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  964. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  965. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  966. do { \
  967. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  968. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  969. } while (0)
  970. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  971. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  972. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  973. do { \
  974. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  975. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  976. } while (0)
  977. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  978. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  979. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  980. do { \
  981. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  982. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  983. } while (0)
  984. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  985. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  986. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  987. do { \
  988. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  989. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  990. } while (0)
  991. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  992. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  993. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  994. do { \
  995. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  996. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  997. } while (0)
  998. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  999. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1000. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1001. do { \
  1002. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1003. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1004. } while (0)
  1005. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1006. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1007. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1008. do { \
  1009. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1010. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1011. } while (0)
  1012. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1013. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1014. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1015. do { \
  1016. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1017. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1018. } while (0)
  1019. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1020. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1021. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1022. do { \
  1023. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1024. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1025. } while (0)
  1026. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1027. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1028. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1029. do { \
  1030. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1031. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1032. } while (0)
  1033. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1034. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1035. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1036. do { \
  1037. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1038. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1039. } while (0)
  1040. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1041. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1042. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1043. do { \
  1044. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1045. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1046. } while (0)
  1047. /* enums used in the HTT tx MSDU extension descriptor */
  1048. enum {
  1049. htt_tx_guard_interval_regular = 0,
  1050. htt_tx_guard_interval_short = 1,
  1051. };
  1052. enum {
  1053. htt_tx_preamble_type_ofdm = 0,
  1054. htt_tx_preamble_type_cck = 1,
  1055. htt_tx_preamble_type_ht = 2,
  1056. htt_tx_preamble_type_vht = 3,
  1057. };
  1058. enum {
  1059. htt_tx_bandwidth_5MHz = 0,
  1060. htt_tx_bandwidth_10MHz = 1,
  1061. htt_tx_bandwidth_20MHz = 2,
  1062. htt_tx_bandwidth_40MHz = 3,
  1063. htt_tx_bandwidth_80MHz = 4,
  1064. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1065. };
  1066. /**
  1067. * @brief HTT tx MSDU extension descriptor
  1068. * @details
  1069. * If the target supports HTT tx MSDU extension descriptors, the host has
  1070. * the option of appending the following struct following the regular
  1071. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1072. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1073. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1074. * tx specs for each frame.
  1075. */
  1076. PREPACK struct htt_tx_msdu_desc_ext_t {
  1077. /* DWORD 0: flags */
  1078. A_UINT32
  1079. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1080. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1081. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1082. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1083. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1084. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1085. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1086. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1087. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1088. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1089. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1090. /* DWORD 1: tx power, tx rate, tx BW */
  1091. A_UINT32
  1092. /* pwr -
  1093. * Specify what power the tx frame needs to be transmitted at.
  1094. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1095. * The value needs to be appropriately sign-extended when extracting
  1096. * the value from the message and storing it in a variable that is
  1097. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1098. * automatically handles this sign-extension.)
  1099. * If the transmission uses multiple tx chains, this power spec is
  1100. * the total transmit power, assuming incoherent combination of
  1101. * per-chain power to produce the total power.
  1102. */
  1103. pwr: 8,
  1104. /* mcs_mask -
  1105. * Specify the allowable values for MCS index (modulation and coding)
  1106. * to use for transmitting the frame.
  1107. *
  1108. * For HT / VHT preamble types, this mask directly corresponds to
  1109. * the HT or VHT MCS indices that are allowed. For each bit N set
  1110. * within the mask, MCS index N is allowed for transmitting the frame.
  1111. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1112. * rates versus OFDM rates, so the host has the option of specifying
  1113. * that the target must transmit the frame with CCK or OFDM rates
  1114. * (not HT or VHT), but leaving the decision to the target whether
  1115. * to use CCK or OFDM.
  1116. *
  1117. * For CCK and OFDM, the bits within this mask are interpreted as
  1118. * follows:
  1119. * bit 0 -> CCK 1 Mbps rate is allowed
  1120. * bit 1 -> CCK 2 Mbps rate is allowed
  1121. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1122. * bit 3 -> CCK 11 Mbps rate is allowed
  1123. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1124. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1125. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1126. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1127. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1128. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1129. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1130. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1131. *
  1132. * The MCS index specification needs to be compatible with the
  1133. * bandwidth mask specification. For example, a MCS index == 9
  1134. * specification is inconsistent with a preamble type == VHT,
  1135. * Nss == 1, and channel bandwidth == 20 MHz.
  1136. *
  1137. * Furthermore, the host has only a limited ability to specify to
  1138. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1139. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1140. */
  1141. mcs_mask: 12,
  1142. /* nss_mask -
  1143. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1144. * Each bit in this mask corresponds to a Nss value:
  1145. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1146. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1147. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1148. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1149. * The values in the Nss mask must be suitable for the recipient, e.g.
  1150. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1151. * recipient which only supports 2x2 MIMO.
  1152. */
  1153. nss_mask: 4,
  1154. /* guard_interval -
  1155. * Specify a htt_tx_guard_interval enum value to indicate whether
  1156. * the transmission should use a regular guard interval or a
  1157. * short guard interval.
  1158. */
  1159. guard_interval: 1,
  1160. /* preamble_type_mask -
  1161. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1162. * may choose from for transmitting this frame.
  1163. * The bits in this mask correspond to the values in the
  1164. * htt_tx_preamble_type enum. For example, to allow the target
  1165. * to transmit the frame as either CCK or OFDM, this field would
  1166. * be set to
  1167. * (1 << htt_tx_preamble_type_ofdm) |
  1168. * (1 << htt_tx_preamble_type_cck)
  1169. */
  1170. preamble_type_mask: 4,
  1171. reserved1_31_29: 3; /* unused, set to 0x0 */
  1172. /* DWORD 2: tx chain mask, tx retries */
  1173. A_UINT32
  1174. /* chain_mask - specify which chains to transmit from */
  1175. chain_mask: 4,
  1176. /* retry_limit -
  1177. * Specify the maximum number of transmissions, including the
  1178. * initial transmission, to attempt before giving up if no ack
  1179. * is received.
  1180. * If the tx rate is specified, then all retries shall use the
  1181. * same rate as the initial transmission.
  1182. * If no tx rate is specified, the target can choose whether to
  1183. * retain the original rate during the retransmissions, or to
  1184. * fall back to a more robust rate.
  1185. */
  1186. retry_limit: 4,
  1187. /* bandwidth_mask -
  1188. * Specify what channel widths may be used for the transmission.
  1189. * A value of zero indicates "don't care" - the target may choose
  1190. * the transmission bandwidth.
  1191. * The bits within this mask correspond to the htt_tx_bandwidth
  1192. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1193. * The bandwidth_mask must be consistent with the preamble_type_mask
  1194. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1195. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1196. */
  1197. bandwidth_mask: 6,
  1198. reserved2_31_14: 18; /* unused, set to 0x0 */
  1199. /* DWORD 3: tx expiry time (TSF) LSBs */
  1200. A_UINT32 expire_tsf_lo;
  1201. /* DWORD 4: tx expiry time (TSF) MSBs */
  1202. A_UINT32 expire_tsf_hi;
  1203. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1204. } POSTPACK;
  1205. /* DWORD 0 */
  1206. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1207. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1208. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1209. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1210. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1211. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1212. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1213. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1214. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1215. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1216. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1217. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1218. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1219. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1220. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1221. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1222. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1223. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1224. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1225. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1226. /* DWORD 1 */
  1227. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1228. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1229. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1230. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1231. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1232. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1233. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1234. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1235. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1236. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1237. /* DWORD 2 */
  1238. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1239. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1240. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1241. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1242. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1243. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1244. /* DWORD 0 */
  1245. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1246. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1247. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1248. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1249. do { \
  1250. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1251. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1252. } while (0)
  1253. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1254. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1255. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1256. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1257. do { \
  1258. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1259. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1260. } while (0)
  1261. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1262. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1263. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1264. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1265. do { \
  1266. HTT_CHECK_SET_VAL( \
  1267. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1268. ((_var) |= ((_val) \
  1269. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1270. } while (0)
  1271. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1272. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1273. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1274. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1275. do { \
  1276. HTT_CHECK_SET_VAL( \
  1277. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1278. ((_var) |= ((_val) \
  1279. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1280. } while (0)
  1281. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1282. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1283. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1284. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1285. do { \
  1286. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1287. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1288. } while (0)
  1289. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1290. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1291. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1292. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1293. do { \
  1294. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1295. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1296. } while (0)
  1297. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1298. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1299. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1300. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1301. do { \
  1302. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1303. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1304. } while (0)
  1305. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1306. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1307. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1308. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1309. do { \
  1310. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1311. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1312. } while (0)
  1313. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1314. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1315. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1316. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1317. do { \
  1318. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1319. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1320. } while (0)
  1321. /* DWORD 1 */
  1322. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1323. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1324. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1325. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1326. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1327. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1328. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1329. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1330. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1331. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1332. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1333. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1334. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1335. do { \
  1336. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1337. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1338. } while (0)
  1339. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1340. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1341. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1342. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1343. do { \
  1344. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1345. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1346. } while (0)
  1347. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1348. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1349. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1350. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1351. do { \
  1352. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1353. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1354. } while (0)
  1355. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1356. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1357. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1358. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1359. do { \
  1360. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1361. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1362. } while (0)
  1363. /* DWORD 2 */
  1364. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1365. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1366. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1367. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1368. do { \
  1369. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1370. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1371. } while (0)
  1372. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1373. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1374. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1375. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1376. do { \
  1377. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1378. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1379. } while (0)
  1380. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1381. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1382. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1383. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1384. do { \
  1385. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1386. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1387. } while (0)
  1388. typedef enum {
  1389. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1390. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1391. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1392. } htt_11ax_ltf_subtype_t;
  1393. typedef enum {
  1394. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1395. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1396. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1397. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1398. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1399. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1400. } htt_tx_ext2_preamble_type_t;
  1401. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1402. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1403. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1404. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1405. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1406. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1407. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1408. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1409. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1410. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1411. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1412. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1413. /**
  1414. * @brief HTT tx MSDU extension descriptor v2
  1415. * @details
  1416. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1417. * is received as tcl_exit_base->host_meta_info in firmware.
  1418. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1419. * are already part of tcl_exit_base.
  1420. */
  1421. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1422. /* DWORD 0: flags */
  1423. A_UINT32
  1424. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1425. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1426. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1427. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1428. valid_retries : 1, /* if set, tx retries spec is valid */
  1429. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1430. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1431. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1432. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1433. valid_key_flags : 1, /* if set, key flags is valid */
  1434. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1435. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1436. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1437. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1438. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1439. 1 = ENCRYPT,
  1440. 2 ~ 3 - Reserved */
  1441. /* retry_limit -
  1442. * Specify the maximum number of transmissions, including the
  1443. * initial transmission, to attempt before giving up if no ack
  1444. * is received.
  1445. * If the tx rate is specified, then all retries shall use the
  1446. * same rate as the initial transmission.
  1447. * If no tx rate is specified, the target can choose whether to
  1448. * retain the original rate during the retransmissions, or to
  1449. * fall back to a more robust rate.
  1450. */
  1451. retry_limit : 4,
  1452. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1453. * Valid only for 11ax preamble types HE_SU
  1454. * and HE_EXT_SU
  1455. */
  1456. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1457. * Valid only for 11ax preamble types HE_SU
  1458. * and HE_EXT_SU
  1459. */
  1460. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1461. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1462. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1463. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1464. */
  1465. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1466. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1467. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1468. * Use cases:
  1469. * Any time firmware uses TQM-BYPASS for Data
  1470. * TID, firmware expect host to set this bit.
  1471. */
  1472. /* DWORD 1: tx power, tx rate */
  1473. A_UINT32
  1474. power : 8, /* unit of the power field is 0.5 dbm
  1475. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1476. * signed value ranging from -64dbm to 63.5 dbm
  1477. */
  1478. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1479. * Setting more than one MCS isn't currently
  1480. * supported by the target (but is supported
  1481. * in the interface in case in the future
  1482. * the target supports specifications of
  1483. * a limited set of MCS values.
  1484. */
  1485. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1486. * Setting more than one Nss isn't currently
  1487. * supported by the target (but is supported
  1488. * in the interface in case in the future
  1489. * the target supports specifications of
  1490. * a limited set of Nss values.
  1491. */
  1492. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1493. update_peer_cache : 1; /* When set these custom values will be
  1494. * used for all packets, until the next
  1495. * update via this ext header.
  1496. * This is to make sure not all packets
  1497. * need to include this header.
  1498. */
  1499. /* DWORD 2: tx chain mask, tx retries */
  1500. A_UINT32
  1501. /* chain_mask - specify which chains to transmit from */
  1502. chain_mask : 8,
  1503. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1504. * TODO: Update Enum values for key_flags
  1505. */
  1506. /*
  1507. * Channel frequency: This identifies the desired channel
  1508. * frequency (in MHz) for tx frames. This is used by FW to help
  1509. * determine when it is safe to transmit or drop frames for
  1510. * off-channel operation.
  1511. * The default value of zero indicates to FW that the corresponding
  1512. * VDEV's home channel (if there is one) is the desired channel
  1513. * frequency.
  1514. */
  1515. chanfreq : 16;
  1516. /* DWORD 3: tx expiry time (TSF) LSBs */
  1517. A_UINT32 expire_tsf_lo;
  1518. /* DWORD 4: tx expiry time (TSF) MSBs */
  1519. A_UINT32 expire_tsf_hi;
  1520. /* DWORD 5: reserved
  1521. * This structure can be expanded further up to 60 bytes
  1522. * by adding further DWORDs as needed.
  1523. */
  1524. A_UINT32
  1525. /* learning_frame
  1526. * When this flag is set, this frame will be dropped by FW
  1527. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1528. */
  1529. learning_frame : 1,
  1530. rsvd0 : 31;
  1531. } POSTPACK;
  1532. /* DWORD 0 */
  1533. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1534. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1535. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1536. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1537. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1538. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1539. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1540. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1541. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1542. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1543. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1544. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1545. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1546. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1547. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1548. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1549. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1550. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1551. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1552. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1553. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1554. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1555. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1556. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1557. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1558. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1559. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1560. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1561. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1562. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1563. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1564. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1565. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1566. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1567. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1568. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1569. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1570. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1571. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1572. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1573. /* DWORD 1 */
  1574. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1575. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1576. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1577. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1578. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1579. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1580. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1581. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1582. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1583. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1584. /* DWORD 2 */
  1585. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1586. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1587. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1588. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1589. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1590. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1591. /* DWORD 5 */
  1592. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1593. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1594. /* DWORD 0 */
  1595. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1596. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1597. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1598. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1599. do { \
  1600. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1601. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1602. } while (0)
  1603. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1604. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1605. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1606. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1607. do { \
  1608. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1609. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1610. } while (0)
  1611. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1612. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1613. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1614. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1615. do { \
  1616. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1617. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1618. } while (0)
  1619. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1620. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1621. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1622. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1623. do { \
  1624. HTT_CHECK_SET_VAL( \
  1625. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1626. ((_var) |= ((_val) \
  1627. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1628. } while (0)
  1629. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1630. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1631. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1632. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1633. do { \
  1634. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1635. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1636. } while (0)
  1637. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1638. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1639. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1640. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1641. do { \
  1642. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1643. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1644. } while (0)
  1645. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1646. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1647. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1648. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1649. do { \
  1650. HTT_CHECK_SET_VAL( \
  1651. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1652. ((_var) |= ((_val) \
  1653. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1654. } while (0)
  1655. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1656. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1657. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1658. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1659. do { \
  1660. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1661. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1662. } while (0)
  1663. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1664. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1665. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1666. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1667. do { \
  1668. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1669. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1670. } while (0)
  1671. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1672. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1673. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1674. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1675. do { \
  1676. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1677. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1678. } while (0)
  1679. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1680. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1681. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1682. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1683. do { \
  1684. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1685. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1686. } while (0)
  1687. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1688. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1689. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1690. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1691. do { \
  1692. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1693. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1694. } while (0)
  1695. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1696. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1697. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1698. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1699. do { \
  1700. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1701. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1702. } while (0)
  1703. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1704. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1705. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1706. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1707. do { \
  1708. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1709. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1710. } while (0)
  1711. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1712. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1713. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1714. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1715. do { \
  1716. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1717. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1718. } while (0)
  1719. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1720. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1721. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1722. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1723. do { \
  1724. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1725. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1726. } while (0)
  1727. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1728. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1729. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1730. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1731. do { \
  1732. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1733. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1734. } while (0)
  1735. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1736. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1737. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1738. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1739. do { \
  1740. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1741. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1742. } while (0)
  1743. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1744. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1745. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1746. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1747. do { \
  1748. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1749. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1750. } while (0)
  1751. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1752. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1753. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1754. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1755. do { \
  1756. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1757. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1758. } while (0)
  1759. /* DWORD 1 */
  1760. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1761. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1762. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1763. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1764. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1765. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1766. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1767. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1768. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1769. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1770. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1771. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1772. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1773. do { \
  1774. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1775. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1776. } while (0)
  1777. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1778. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1779. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1780. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1781. do { \
  1782. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1783. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1784. } while (0)
  1785. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1786. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1787. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1788. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1789. do { \
  1790. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1791. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1792. } while (0)
  1793. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1794. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1795. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1796. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1797. do { \
  1798. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1799. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1800. } while (0)
  1801. /* DWORD 2 */
  1802. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1803. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1804. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1805. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1806. do { \
  1807. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1808. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1809. } while (0)
  1810. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1811. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1812. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1813. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1814. do { \
  1815. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1816. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1817. } while (0)
  1818. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1819. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1820. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1821. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1822. do { \
  1823. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1824. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1825. } while (0)
  1826. /* DWORD 5 */
  1827. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  1828. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  1829. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  1830. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  1831. do { \
  1832. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  1833. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  1834. } while (0)
  1835. typedef enum {
  1836. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1837. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1838. } htt_tcl_metadata_type;
  1839. /**
  1840. * @brief HTT TCL command number format
  1841. * @details
  1842. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1843. * available to firmware as tcl_exit_base->tcl_status_number.
  1844. * For regular / multicast packets host will send vdev and mac id and for
  1845. * NAWDS packets, host will send peer id.
  1846. * A_UINT32 is used to avoid endianness conversion problems.
  1847. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1848. */
  1849. typedef struct {
  1850. A_UINT32
  1851. type: 1, /* vdev_id based or peer_id based */
  1852. rsvd: 31;
  1853. } htt_tx_tcl_vdev_or_peer_t;
  1854. typedef struct {
  1855. A_UINT32
  1856. type: 1, /* vdev_id based or peer_id based */
  1857. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1858. vdev_id: 8,
  1859. pdev_id: 2,
  1860. host_inspected:1,
  1861. rsvd: 19;
  1862. } htt_tx_tcl_vdev_metadata;
  1863. typedef struct {
  1864. A_UINT32
  1865. type: 1, /* vdev_id based or peer_id based */
  1866. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1867. peer_id: 14,
  1868. rsvd: 16;
  1869. } htt_tx_tcl_peer_metadata;
  1870. PREPACK struct htt_tx_tcl_metadata {
  1871. union {
  1872. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1873. htt_tx_tcl_vdev_metadata vdev_meta;
  1874. htt_tx_tcl_peer_metadata peer_meta;
  1875. };
  1876. } POSTPACK;
  1877. /* DWORD 0 */
  1878. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1879. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1880. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1881. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1882. /* VDEV metadata */
  1883. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1884. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1885. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1886. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1887. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1888. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1889. /* PEER metadata */
  1890. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1891. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1892. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1893. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1894. HTT_TX_TCL_METADATA_TYPE_S)
  1895. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1896. do { \
  1897. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1898. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1899. } while (0)
  1900. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1901. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1902. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1903. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1904. do { \
  1905. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1906. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1907. } while (0)
  1908. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1909. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1910. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1911. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1912. do { \
  1913. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1914. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1915. } while (0)
  1916. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1917. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1918. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1919. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1920. do { \
  1921. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1922. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1923. } while (0)
  1924. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1925. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1926. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  1927. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  1928. do { \
  1929. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  1930. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  1931. } while (0)
  1932. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1933. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  1934. HTT_TX_TCL_METADATA_PEER_ID_S)
  1935. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  1936. do { \
  1937. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  1938. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  1939. } while (0)
  1940. typedef enum {
  1941. HTT_TX_FW2WBM_TX_STATUS_OK,
  1942. HTT_TX_FW2WBM_TX_STATUS_DROP,
  1943. HTT_TX_FW2WBM_TX_STATUS_TTL,
  1944. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  1945. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  1946. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  1947. HTT_TX_FW2WBM_TX_STATUS_MAX
  1948. } htt_tx_fw2wbm_tx_status_t;
  1949. typedef enum {
  1950. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  1951. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  1952. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  1953. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  1954. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  1955. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  1956. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  1957. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  1958. } htt_tx_fw2wbm_reinject_reason_t;
  1959. /**
  1960. * @brief HTT TX WBM Completion from firmware to host
  1961. * @details
  1962. * This structure is passed from firmware to host overlayed on wbm_release_ring
  1963. * DWORD 3 and 4 for software based completions (Exception frames and
  1964. * TQM bypass frames)
  1965. * For software based completions, wbm_release_ring->release_source_module will
  1966. * be set to release_source_fw
  1967. */
  1968. PREPACK struct htt_tx_wbm_completion {
  1969. A_UINT32
  1970. sch_cmd_id: 24,
  1971. exception_frame: 1, /* If set, this packet was queued via exception path */
  1972. rsvd0_31_25: 7;
  1973. A_UINT32
  1974. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  1975. * reception of an ACK or BA, this field indicates
  1976. * the RSSI of the received ACK or BA frame.
  1977. * When the frame is removed as result of a direct
  1978. * remove command from the SW, this field is set
  1979. * to 0x0 (which is never a valid value when real
  1980. * RSSI is available).
  1981. * Units: dB w.r.t noise floor
  1982. */
  1983. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  1984. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  1985. rsvd1_31_16: 16;
  1986. } POSTPACK;
  1987. /* DWORD 0 */
  1988. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  1989. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  1990. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  1991. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  1992. /* DWORD 1 */
  1993. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  1994. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  1995. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  1996. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  1997. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  1998. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  1999. /* DWORD 0 */
  2000. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2001. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2002. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2003. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2004. do { \
  2005. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2006. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2007. } while (0)
  2008. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2009. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2010. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2011. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2012. do { \
  2013. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2014. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2015. } while (0)
  2016. /* DWORD 1 */
  2017. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2018. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2019. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2020. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2021. do { \
  2022. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2023. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2024. } while (0)
  2025. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2026. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2027. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2028. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2029. do { \
  2030. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2031. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2032. } while (0)
  2033. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2034. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2035. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2036. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2037. do { \
  2038. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2039. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2040. } while (0)
  2041. /**
  2042. * @brief HTT TX WBM Completion from firmware to host
  2043. * @details
  2044. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2045. * (WBM) offload HW.
  2046. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2047. * For software based completions, release_source_module will
  2048. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2049. * struct wbm_release_ring and then switch to this after looking at
  2050. * release_source_module.
  2051. */
  2052. PREPACK struct htt_tx_wbm_completion_v2 {
  2053. A_UINT32
  2054. used_by_hw0; /* Refer to struct wbm_release_ring */
  2055. A_UINT32
  2056. used_by_hw1; /* Refer to struct wbm_release_ring */
  2057. A_UINT32
  2058. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2059. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2060. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2061. exception_frame: 1,
  2062. rsvd0: 12, /* For future use */
  2063. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2064. rsvd1: 1; /* For future use */
  2065. A_UINT32
  2066. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2067. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2068. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2069. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2070. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2071. */
  2072. A_UINT32
  2073. data1: 32;
  2074. A_UINT32
  2075. data2: 32;
  2076. A_UINT32
  2077. used_by_hw3; /* Refer to struct wbm_release_ring */
  2078. } POSTPACK;
  2079. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2080. /* DWORD 3 */
  2081. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2082. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2083. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2084. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2085. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2086. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2087. /* DWORD 3 */
  2088. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2089. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2090. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2091. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2092. do { \
  2093. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2094. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2095. } while (0)
  2096. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2097. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2098. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2099. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2100. do { \
  2101. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2102. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2103. } while (0)
  2104. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2105. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2106. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2107. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2108. do { \
  2109. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2110. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2111. } while (0)
  2112. /**
  2113. * @brief HTT TX WBM transmit status from firmware to host
  2114. * @details
  2115. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2116. * (WBM) offload HW.
  2117. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2118. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2119. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2120. */
  2121. PREPACK struct htt_tx_wbm_transmit_status {
  2122. A_UINT32
  2123. sch_cmd_id: 24,
  2124. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2125. * reception of an ACK or BA, this field indicates
  2126. * the RSSI of the received ACK or BA frame.
  2127. * When the frame is removed as result of a direct
  2128. * remove command from the SW, this field is set
  2129. * to 0x0 (which is never a valid value when real
  2130. * RSSI is available).
  2131. * Units: dB w.r.t noise floor
  2132. */
  2133. A_UINT32
  2134. sw_peer_id: 16,
  2135. tid_num: 5,
  2136. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2137. * and tid_num fields contain valid data.
  2138. * If this "valid" flag is not set, the
  2139. * sw_peer_id and tid_num fields must be ignored.
  2140. */
  2141. mcast: 1,
  2142. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2143. * contains valid data.
  2144. */
  2145. reserved0: 8;
  2146. A_UINT32
  2147. reserved1: 32;
  2148. } POSTPACK;
  2149. /* DWORD 4 */
  2150. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2151. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2152. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2153. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2154. /* DWORD 5 */
  2155. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2156. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2157. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2158. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2159. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2160. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2161. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2162. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2163. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2164. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2165. /* DWORD 4 */
  2166. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2167. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2168. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2169. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2170. do { \
  2171. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2172. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2173. } while (0)
  2174. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2175. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2176. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2177. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2178. do { \
  2179. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2180. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2181. } while (0)
  2182. /* DWORD 5 */
  2183. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2184. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2185. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2186. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2187. do { \
  2188. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2189. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2190. } while (0)
  2191. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2192. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2193. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2194. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2195. do { \
  2196. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2197. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2198. } while (0)
  2199. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2200. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2201. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2202. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2203. do { \
  2204. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2205. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2206. } while (0)
  2207. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2208. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2209. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2210. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2211. do { \
  2212. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2213. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2214. } while (0)
  2215. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2216. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2217. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2218. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2219. do { \
  2220. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2221. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2222. } while (0)
  2223. /**
  2224. * @brief HTT TX WBM reinject status from firmware to host
  2225. * @details
  2226. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2227. * (WBM) offload HW.
  2228. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2229. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2230. */
  2231. PREPACK struct htt_tx_wbm_reinject_status {
  2232. A_UINT32
  2233. reserved0: 32;
  2234. A_UINT32
  2235. reserved1: 32;
  2236. A_UINT32
  2237. reserved2: 32;
  2238. } POSTPACK;
  2239. /**
  2240. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2241. * @details
  2242. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2243. * (WBM) offload HW.
  2244. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2245. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2246. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2247. * STA side.
  2248. */
  2249. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2250. A_UINT32
  2251. mec_sa_addr_31_0;
  2252. A_UINT32
  2253. mec_sa_addr_47_32: 16,
  2254. sa_ast_index: 16;
  2255. A_UINT32
  2256. vdev_id: 8,
  2257. reserved0: 24;
  2258. } POSTPACK;
  2259. /* DWORD 4 - mec_sa_addr_31_0 */
  2260. /* DWORD 5 */
  2261. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2262. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2263. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2264. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2265. /* DWORD 6 */
  2266. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2267. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2268. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2269. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2270. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2271. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2272. do { \
  2273. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2274. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2275. } while (0)
  2276. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2277. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2278. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2279. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2280. do { \
  2281. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2282. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2283. } while (0)
  2284. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2285. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2286. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2287. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2288. do { \
  2289. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2290. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2291. } while (0)
  2292. typedef enum {
  2293. TX_FLOW_PRIORITY_BE,
  2294. TX_FLOW_PRIORITY_HIGH,
  2295. TX_FLOW_PRIORITY_LOW,
  2296. } htt_tx_flow_priority_t;
  2297. typedef enum {
  2298. TX_FLOW_LATENCY_SENSITIVE,
  2299. TX_FLOW_LATENCY_INSENSITIVE,
  2300. } htt_tx_flow_latency_t;
  2301. typedef enum {
  2302. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2303. TX_FLOW_INTERACTIVE_TRAFFIC,
  2304. TX_FLOW_PERIODIC_TRAFFIC,
  2305. TX_FLOW_BURSTY_TRAFFIC,
  2306. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2307. } htt_tx_flow_traffic_pattern_t;
  2308. /**
  2309. * @brief HTT TX Flow search metadata format
  2310. * @details
  2311. * Host will set this metadata in flow table's flow search entry along with
  2312. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2313. * firmware and TQM ring if the flow search entry wins.
  2314. * This metadata is available to firmware in that first MSDU's
  2315. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2316. * to one of the available flows for specific tid and returns the tqm flow
  2317. * pointer as part of htt_tx_map_flow_info message.
  2318. */
  2319. PREPACK struct htt_tx_flow_metadata {
  2320. A_UINT32
  2321. rsvd0_1_0: 2,
  2322. tid: 4,
  2323. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2324. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2325. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2326. * Else choose final tid based on latency, priority.
  2327. */
  2328. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2329. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2330. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2331. } POSTPACK;
  2332. /* DWORD 0 */
  2333. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2334. #define HTT_TX_FLOW_METADATA_TID_S 2
  2335. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2336. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2337. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2338. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2339. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2340. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2341. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2342. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2343. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2344. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2345. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2346. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2347. /* DWORD 0 */
  2348. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2349. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2350. HTT_TX_FLOW_METADATA_TID_S)
  2351. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2352. do { \
  2353. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2354. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2355. } while (0)
  2356. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2357. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2358. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2359. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2360. do { \
  2361. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2362. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2363. } while (0)
  2364. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2365. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2366. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2367. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2368. do { \
  2369. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2370. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2371. } while (0)
  2372. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2373. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2374. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2375. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2376. do { \
  2377. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2378. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2379. } while (0)
  2380. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2381. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2382. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2383. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2384. do { \
  2385. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2386. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2387. } while (0)
  2388. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2389. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2390. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2391. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2392. do { \
  2393. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2394. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2395. } while (0)
  2396. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2397. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2398. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2399. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2400. do { \
  2401. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2402. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2403. } while (0)
  2404. /**
  2405. * @brief Used in HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2406. *
  2407. * @details
  2408. * HTT wds entry from source port learning
  2409. * Host will learn wds entries from rx and send this message to firmware
  2410. * to enable firmware to configure/delete AST entries for wds clients.
  2411. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2412. * and when SA's entry is deleted, firmware removes this AST entry
  2413. *
  2414. * The message would appear as follows:
  2415. *
  2416. * |31 30|29 |17 16|15 8|7 0|
  2417. * |----------------+----------------+----------------+----------------|
  2418. * | rsvd0 |PDVID| vdev_id | msg_type |
  2419. * |-------------------------------------------------------------------|
  2420. * | sa_addr_31_0 |
  2421. * |-------------------------------------------------------------------|
  2422. * | | ta_peer_id | sa_addr_47_32 |
  2423. * |-------------------------------------------------------------------|
  2424. * Where PDVID = pdev_id
  2425. *
  2426. * The message is interpreted as follows:
  2427. *
  2428. * dword0 - b'0:7 - msg_type: This will be set to
  2429. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2430. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2431. *
  2432. * dword0 - b'8:15 - vdev_id
  2433. *
  2434. * dword0 - b'16:17 - pdev_id
  2435. *
  2436. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2437. *
  2438. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2439. *
  2440. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2441. *
  2442. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2443. */
  2444. PREPACK struct htt_wds_entry {
  2445. A_UINT32
  2446. msg_type: 8,
  2447. vdev_id: 8,
  2448. pdev_id: 2,
  2449. rsvd0: 14;
  2450. A_UINT32 sa_addr_31_0;
  2451. A_UINT32
  2452. sa_addr_47_32: 16,
  2453. ta_peer_id: 14,
  2454. rsvd2: 2;
  2455. } POSTPACK;
  2456. /* DWORD 0 */
  2457. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2458. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2459. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2460. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2461. /* DWORD 2 */
  2462. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2463. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2464. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2465. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2466. /* DWORD 0 */
  2467. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2468. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2469. HTT_WDS_ENTRY_VDEV_ID_S)
  2470. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2471. do { \
  2472. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2473. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2474. } while (0)
  2475. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2476. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2477. HTT_WDS_ENTRY_PDEV_ID_S)
  2478. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2479. do { \
  2480. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2481. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2482. } while (0)
  2483. /* DWORD 2 */
  2484. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2485. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2486. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2487. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2488. do { \
  2489. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2490. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2491. } while (0)
  2492. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2493. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2494. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2495. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2496. do { \
  2497. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2498. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2499. } while (0)
  2500. /**
  2501. * @brief MAC DMA rx ring setup specification
  2502. * @details
  2503. * To allow for dynamic rx ring reconfiguration and to avoid race
  2504. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2505. * it uses. Instead, it sends this message to the target, indicating how
  2506. * the rx ring used by the host should be set up and maintained.
  2507. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2508. * specifications.
  2509. *
  2510. * |31 16|15 8|7 0|
  2511. * |---------------------------------------------------------------|
  2512. * header: | reserved | num rings | msg type |
  2513. * |---------------------------------------------------------------|
  2514. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2515. #if HTT_PADDR64
  2516. * | FW_IDX shadow register physical address (bits 63:32) |
  2517. #endif
  2518. * |---------------------------------------------------------------|
  2519. * | rx ring base physical address (bits 31:0) |
  2520. #if HTT_PADDR64
  2521. * | rx ring base physical address (bits 63:32) |
  2522. #endif
  2523. * |---------------------------------------------------------------|
  2524. * | rx ring buffer size | rx ring length |
  2525. * |---------------------------------------------------------------|
  2526. * | FW_IDX initial value | enabled flags |
  2527. * |---------------------------------------------------------------|
  2528. * | MSDU payload offset | 802.11 header offset |
  2529. * |---------------------------------------------------------------|
  2530. * | PPDU end offset | PPDU start offset |
  2531. * |---------------------------------------------------------------|
  2532. * | MPDU end offset | MPDU start offset |
  2533. * |---------------------------------------------------------------|
  2534. * | MSDU end offset | MSDU start offset |
  2535. * |---------------------------------------------------------------|
  2536. * | frag info offset | rx attention offset |
  2537. * |---------------------------------------------------------------|
  2538. * payload 2, if present, has the same format as payload 1
  2539. * Header fields:
  2540. * - MSG_TYPE
  2541. * Bits 7:0
  2542. * Purpose: identifies this as an rx ring configuration message
  2543. * Value: 0x2
  2544. * - NUM_RINGS
  2545. * Bits 15:8
  2546. * Purpose: indicates whether the host is setting up one rx ring or two
  2547. * Value: 1 or 2
  2548. * Payload:
  2549. * for systems using 64-bit format for bus addresses:
  2550. * - IDX_SHADOW_REG_PADDR_LO
  2551. * Bits 31:0
  2552. * Value: lower 4 bytes of physical address of the host's
  2553. * FW_IDX shadow register
  2554. * - IDX_SHADOW_REG_PADDR_HI
  2555. * Bits 31:0
  2556. * Value: upper 4 bytes of physical address of the host's
  2557. * FW_IDX shadow register
  2558. * - RING_BASE_PADDR_LO
  2559. * Bits 31:0
  2560. * Value: lower 4 bytes of physical address of the host's rx ring
  2561. * - RING_BASE_PADDR_HI
  2562. * Bits 31:0
  2563. * Value: uppper 4 bytes of physical address of the host's rx ring
  2564. * for systems using 32-bit format for bus addresses:
  2565. * - IDX_SHADOW_REG_PADDR
  2566. * Bits 31:0
  2567. * Value: physical address of the host's FW_IDX shadow register
  2568. * - RING_BASE_PADDR
  2569. * Bits 31:0
  2570. * Value: physical address of the host's rx ring
  2571. * - RING_LEN
  2572. * Bits 15:0
  2573. * Value: number of elements in the rx ring
  2574. * - RING_BUF_SZ
  2575. * Bits 31:16
  2576. * Value: size of the buffers referenced by the rx ring, in byte units
  2577. * - ENABLED_FLAGS
  2578. * Bits 15:0
  2579. * Value: 1-bit flags to show whether different rx fields are enabled
  2580. * bit 0: 802.11 header enabled (1) or disabled (0)
  2581. * bit 1: MSDU payload enabled (1) or disabled (0)
  2582. * bit 2: PPDU start enabled (1) or disabled (0)
  2583. * bit 3: PPDU end enabled (1) or disabled (0)
  2584. * bit 4: MPDU start enabled (1) or disabled (0)
  2585. * bit 5: MPDU end enabled (1) or disabled (0)
  2586. * bit 6: MSDU start enabled (1) or disabled (0)
  2587. * bit 7: MSDU end enabled (1) or disabled (0)
  2588. * bit 8: rx attention enabled (1) or disabled (0)
  2589. * bit 9: frag info enabled (1) or disabled (0)
  2590. * bit 10: unicast rx enabled (1) or disabled (0)
  2591. * bit 11: multicast rx enabled (1) or disabled (0)
  2592. * bit 12: ctrl rx enabled (1) or disabled (0)
  2593. * bit 13: mgmt rx enabled (1) or disabled (0)
  2594. * bit 14: null rx enabled (1) or disabled (0)
  2595. * bit 15: phy data rx enabled (1) or disabled (0)
  2596. * - IDX_INIT_VAL
  2597. * Bits 31:16
  2598. * Purpose: Specify the initial value for the FW_IDX.
  2599. * Value: the number of buffers initially present in the host's rx ring
  2600. * - OFFSET_802_11_HDR
  2601. * Bits 15:0
  2602. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2603. * - OFFSET_MSDU_PAYLOAD
  2604. * Bits 31:16
  2605. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2606. * - OFFSET_PPDU_START
  2607. * Bits 15:0
  2608. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2609. * - OFFSET_PPDU_END
  2610. * Bits 31:16
  2611. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2612. * - OFFSET_MPDU_START
  2613. * Bits 15:0
  2614. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2615. * - OFFSET_MPDU_END
  2616. * Bits 31:16
  2617. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2618. * - OFFSET_MSDU_START
  2619. * Bits 15:0
  2620. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2621. * - OFFSET_MSDU_END
  2622. * Bits 31:16
  2623. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2624. * - OFFSET_RX_ATTN
  2625. * Bits 15:0
  2626. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2627. * - OFFSET_FRAG_INFO
  2628. * Bits 31:16
  2629. * Value: offset in QUAD-bytes of frag info table
  2630. */
  2631. /* header fields */
  2632. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2633. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2634. /* payload fields */
  2635. /* for systems using a 64-bit format for bus addresses */
  2636. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2637. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2638. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2639. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2640. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2641. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2642. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2643. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2644. /* for systems using a 32-bit format for bus addresses */
  2645. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2646. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2647. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2648. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2649. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2650. #define HTT_RX_RING_CFG_LEN_S 0
  2651. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2652. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2653. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2654. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2655. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2656. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2657. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2658. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2659. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2660. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2661. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2662. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2663. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2664. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2665. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2666. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2667. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2668. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2669. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2670. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2671. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2672. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2673. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2674. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2675. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2676. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2677. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2678. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2679. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2680. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2681. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2682. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2683. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2684. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2685. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2686. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2687. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2688. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2689. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2690. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2691. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2692. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2693. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2694. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2695. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2696. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2697. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2698. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2699. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2700. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2701. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2702. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2703. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2704. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2705. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2706. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2707. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2708. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2709. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2710. #if HTT_PADDR64
  2711. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2712. #else
  2713. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2714. #endif
  2715. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2716. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2717. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2718. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2719. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2720. do { \
  2721. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2722. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2723. } while (0)
  2724. /* degenerate case for 32-bit fields */
  2725. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2726. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2727. ((_var) = (_val))
  2728. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2729. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2730. ((_var) = (_val))
  2731. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2732. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2733. ((_var) = (_val))
  2734. /* degenerate case for 32-bit fields */
  2735. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2736. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2737. ((_var) = (_val))
  2738. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2739. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2740. ((_var) = (_val))
  2741. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2742. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2743. ((_var) = (_val))
  2744. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2745. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2746. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2747. do { \
  2748. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2749. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2750. } while (0)
  2751. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2752. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2753. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2754. do { \
  2755. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2756. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2757. } while (0)
  2758. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2759. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2760. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2761. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2762. do { \
  2763. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2764. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2765. } while (0)
  2766. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2767. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2768. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2769. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2770. do { \
  2771. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2772. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2773. } while (0)
  2774. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2775. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2776. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2777. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2778. do { \
  2779. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2780. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2781. } while (0)
  2782. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2783. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2784. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2785. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2786. do { \
  2787. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2788. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2789. } while (0)
  2790. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2791. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2792. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2793. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2794. do { \
  2795. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2796. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2797. } while (0)
  2798. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2799. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2800. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2801. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2802. do { \
  2803. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2804. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2805. } while (0)
  2806. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2807. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2808. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2809. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2810. do { \
  2811. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2812. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2813. } while (0)
  2814. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2815. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2816. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2817. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2818. do { \
  2819. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2820. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2821. } while (0)
  2822. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2823. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2824. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2825. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2826. do { \
  2827. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2828. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2829. } while (0)
  2830. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2831. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2832. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2833. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2834. do { \
  2835. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2836. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2837. } while (0)
  2838. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2839. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2840. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2841. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2842. do { \
  2843. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2844. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2845. } while (0)
  2846. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2847. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2848. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2849. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2850. do { \
  2851. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2852. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2853. } while (0)
  2854. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2855. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2856. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2857. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2858. do { \
  2859. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2860. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2861. } while (0)
  2862. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2863. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2864. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2865. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2866. do { \
  2867. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2868. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2869. } while (0)
  2870. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2871. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2872. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2873. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2874. do { \
  2875. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2876. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2877. } while (0)
  2878. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2879. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2880. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2881. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2882. do { \
  2883. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2884. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2885. } while (0)
  2886. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2887. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2888. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2889. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2890. do { \
  2891. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2892. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2893. } while (0)
  2894. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2895. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2896. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2897. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2898. do { \
  2899. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2900. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2901. } while (0)
  2902. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2903. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2904. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2905. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2906. do { \
  2907. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2908. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2909. } while (0)
  2910. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2911. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2912. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2913. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2914. do { \
  2915. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2916. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2917. } while (0)
  2918. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2919. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2920. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2921. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2922. do { \
  2923. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2924. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2925. } while (0)
  2926. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  2927. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  2928. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  2929. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  2930. do { \
  2931. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  2932. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  2933. } while (0)
  2934. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  2935. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  2936. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  2937. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  2938. do { \
  2939. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  2940. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  2941. } while (0)
  2942. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  2943. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  2944. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  2945. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  2946. do { \
  2947. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  2948. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  2949. } while (0)
  2950. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  2951. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  2952. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  2953. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  2954. do { \
  2955. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  2956. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  2957. } while (0)
  2958. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  2959. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  2960. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  2961. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  2962. do { \
  2963. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  2964. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  2965. } while (0)
  2966. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  2967. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  2968. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  2969. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  2970. do { \
  2971. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  2972. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  2973. } while (0)
  2974. /**
  2975. * @brief host -> target FW statistics retrieve
  2976. *
  2977. * @details
  2978. * The following field definitions describe the format of the HTT host
  2979. * to target FW stats retrieve message. The message specifies the type of
  2980. * stats host wants to retrieve.
  2981. *
  2982. * |31 24|23 16|15 8|7 0|
  2983. * |-----------------------------------------------------------|
  2984. * | stats types request bitmask | msg type |
  2985. * |-----------------------------------------------------------|
  2986. * | stats types reset bitmask | reserved |
  2987. * |-----------------------------------------------------------|
  2988. * | stats type | config value |
  2989. * |-----------------------------------------------------------|
  2990. * | cookie LSBs |
  2991. * |-----------------------------------------------------------|
  2992. * | cookie MSBs |
  2993. * |-----------------------------------------------------------|
  2994. * Header fields:
  2995. * - MSG_TYPE
  2996. * Bits 7:0
  2997. * Purpose: identifies this is a stats upload request message
  2998. * Value: 0x3
  2999. * - UPLOAD_TYPES
  3000. * Bits 31:8
  3001. * Purpose: identifies which types of FW statistics to upload
  3002. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3003. * - RESET_TYPES
  3004. * Bits 31:8
  3005. * Purpose: identifies which types of FW statistics to reset
  3006. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3007. * - CFG_VAL
  3008. * Bits 23:0
  3009. * Purpose: give an opaque configuration value to the specified stats type
  3010. * Value: stats-type specific configuration value
  3011. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3012. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3013. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3014. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3015. * - CFG_STAT_TYPE
  3016. * Bits 31:24
  3017. * Purpose: specify which stats type (if any) the config value applies to
  3018. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3019. * a valid configuration specification
  3020. * - COOKIE_LSBS
  3021. * Bits 31:0
  3022. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3023. * message with its preceding host->target stats request message.
  3024. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3025. * - COOKIE_MSBS
  3026. * Bits 31:0
  3027. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3028. * message with its preceding host->target stats request message.
  3029. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3030. */
  3031. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3032. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3033. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3034. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3035. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3036. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3037. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3038. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3039. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3040. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3041. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3042. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3043. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3044. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3045. do { \
  3046. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3047. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3048. } while (0)
  3049. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3050. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3051. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3052. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3053. do { \
  3054. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3055. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3056. } while (0)
  3057. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3058. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3059. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3060. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3061. do { \
  3062. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3063. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3064. } while (0)
  3065. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3066. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3067. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3068. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3069. do { \
  3070. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3071. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3072. } while (0)
  3073. /**
  3074. * @brief host -> target HTT out-of-band sync request
  3075. *
  3076. * @details
  3077. * The HTT SYNC tells the target to suspend processing of subsequent
  3078. * HTT host-to-target messages until some other target agent locally
  3079. * informs the target HTT FW that the current sync counter is equal to
  3080. * or greater than (in a modulo sense) the sync counter specified in
  3081. * the SYNC message.
  3082. * This allows other host-target components to synchronize their operation
  3083. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3084. * security key has been downloaded to and activated by the target.
  3085. * In the absence of any explicit synchronization counter value
  3086. * specification, the target HTT FW will use zero as the default current
  3087. * sync value.
  3088. *
  3089. * |31 24|23 16|15 8|7 0|
  3090. * |-----------------------------------------------------------|
  3091. * | reserved | sync count | msg type |
  3092. * |-----------------------------------------------------------|
  3093. * Header fields:
  3094. * - MSG_TYPE
  3095. * Bits 7:0
  3096. * Purpose: identifies this as a sync message
  3097. * Value: 0x4
  3098. * - SYNC_COUNT
  3099. * Bits 15:8
  3100. * Purpose: specifies what sync value the HTT FW will wait for from
  3101. * an out-of-band specification to resume its operation
  3102. * Value: in-band sync counter value to compare against the out-of-band
  3103. * counter spec.
  3104. * The HTT target FW will suspend its host->target message processing
  3105. * as long as
  3106. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3107. */
  3108. #define HTT_H2T_SYNC_MSG_SZ 4
  3109. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3110. #define HTT_H2T_SYNC_COUNT_S 8
  3111. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3112. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3113. HTT_H2T_SYNC_COUNT_S)
  3114. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3115. do { \
  3116. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3117. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3118. } while (0)
  3119. /**
  3120. * @brief HTT aggregation configuration
  3121. */
  3122. #define HTT_AGGR_CFG_MSG_SZ 4
  3123. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3124. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3125. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3126. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3127. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3128. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3129. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3130. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3131. do { \
  3132. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3133. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3134. } while (0)
  3135. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3136. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3137. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3138. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3139. do { \
  3140. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3141. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3142. } while (0)
  3143. /**
  3144. * @brief host -> target HTT configure max amsdu info per vdev
  3145. *
  3146. * @details
  3147. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3148. *
  3149. * |31 21|20 16|15 8|7 0|
  3150. * |-----------------------------------------------------------|
  3151. * | reserved | vdev id | max amsdu | msg type |
  3152. * |-----------------------------------------------------------|
  3153. * Header fields:
  3154. * - MSG_TYPE
  3155. * Bits 7:0
  3156. * Purpose: identifies this as a aggr cfg ex message
  3157. * Value: 0xa
  3158. * - MAX_NUM_AMSDU_SUBFRM
  3159. * Bits 15:8
  3160. * Purpose: max MSDUs per A-MSDU
  3161. * - VDEV_ID
  3162. * Bits 20:16
  3163. * Purpose: ID of the vdev to which this limit is applied
  3164. */
  3165. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3166. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3167. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3168. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3169. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3170. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3171. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3172. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3173. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3174. do { \
  3175. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3176. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3177. } while (0)
  3178. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3179. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3180. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3181. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3182. do { \
  3183. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3184. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3185. } while (0)
  3186. /**
  3187. * @brief HTT WDI_IPA Config Message
  3188. *
  3189. * @details
  3190. * The HTT WDI_IPA config message is created/sent by host at driver
  3191. * init time. It contains information about data structures used on
  3192. * WDI_IPA TX and RX path.
  3193. * TX CE ring is used for pushing packet metadata from IPA uC
  3194. * to WLAN FW
  3195. * TX Completion ring is used for generating TX completions from
  3196. * WLAN FW to IPA uC
  3197. * RX Indication ring is used for indicating RX packets from FW
  3198. * to IPA uC
  3199. * RX Ring2 is used as either completion ring or as second
  3200. * indication ring. when Ring2 is used as completion ring, IPA uC
  3201. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3202. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3203. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3204. * indicated in RX Indication ring. Please see WDI_IPA specification
  3205. * for more details.
  3206. * |31 24|23 16|15 8|7 0|
  3207. * |----------------+----------------+----------------+----------------|
  3208. * | tx pkt pool size | Rsvd | msg_type |
  3209. * |-------------------------------------------------------------------|
  3210. * | tx comp ring base (bits 31:0) |
  3211. #if HTT_PADDR64
  3212. * | tx comp ring base (bits 63:32) |
  3213. #endif
  3214. * |-------------------------------------------------------------------|
  3215. * | tx comp ring size |
  3216. * |-------------------------------------------------------------------|
  3217. * | tx comp WR_IDX physical address (bits 31:0) |
  3218. #if HTT_PADDR64
  3219. * | tx comp WR_IDX physical address (bits 63:32) |
  3220. #endif
  3221. * |-------------------------------------------------------------------|
  3222. * | tx CE WR_IDX physical address (bits 31:0) |
  3223. #if HTT_PADDR64
  3224. * | tx CE WR_IDX physical address (bits 63:32) |
  3225. #endif
  3226. * |-------------------------------------------------------------------|
  3227. * | rx indication ring base (bits 31:0) |
  3228. #if HTT_PADDR64
  3229. * | rx indication ring base (bits 63:32) |
  3230. #endif
  3231. * |-------------------------------------------------------------------|
  3232. * | rx indication ring size |
  3233. * |-------------------------------------------------------------------|
  3234. * | rx ind RD_IDX physical address (bits 31:0) |
  3235. #if HTT_PADDR64
  3236. * | rx ind RD_IDX physical address (bits 63:32) |
  3237. #endif
  3238. * |-------------------------------------------------------------------|
  3239. * | rx ind WR_IDX physical address (bits 31:0) |
  3240. #if HTT_PADDR64
  3241. * | rx ind WR_IDX physical address (bits 63:32) |
  3242. #endif
  3243. * |-------------------------------------------------------------------|
  3244. * |-------------------------------------------------------------------|
  3245. * | rx ring2 base (bits 31:0) |
  3246. #if HTT_PADDR64
  3247. * | rx ring2 base (bits 63:32) |
  3248. #endif
  3249. * |-------------------------------------------------------------------|
  3250. * | rx ring2 size |
  3251. * |-------------------------------------------------------------------|
  3252. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3253. #if HTT_PADDR64
  3254. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3255. #endif
  3256. * |-------------------------------------------------------------------|
  3257. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3258. #if HTT_PADDR64
  3259. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3260. #endif
  3261. * |-------------------------------------------------------------------|
  3262. *
  3263. * Header fields:
  3264. * Header fields:
  3265. * - MSG_TYPE
  3266. * Bits 7:0
  3267. * Purpose: Identifies this as WDI_IPA config message
  3268. * value: = 0x8
  3269. * - TX_PKT_POOL_SIZE
  3270. * Bits 15:0
  3271. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3272. * WDI_IPA TX path
  3273. * For systems using 32-bit format for bus addresses:
  3274. * - TX_COMP_RING_BASE_ADDR
  3275. * Bits 31:0
  3276. * Purpose: TX Completion Ring base address in DDR
  3277. * - TX_COMP_RING_SIZE
  3278. * Bits 31:0
  3279. * Purpose: TX Completion Ring size (must be power of 2)
  3280. * - TX_COMP_WR_IDX_ADDR
  3281. * Bits 31:0
  3282. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3283. * updates the Write Index for WDI_IPA TX completion ring
  3284. * - TX_CE_WR_IDX_ADDR
  3285. * Bits 31:0
  3286. * Purpose: DDR address where IPA uC
  3287. * updates the WR Index for TX CE ring
  3288. * (needed for fusion platforms)
  3289. * - RX_IND_RING_BASE_ADDR
  3290. * Bits 31:0
  3291. * Purpose: RX Indication Ring base address in DDR
  3292. * - RX_IND_RING_SIZE
  3293. * Bits 31:0
  3294. * Purpose: RX Indication Ring size
  3295. * - RX_IND_RD_IDX_ADDR
  3296. * Bits 31:0
  3297. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3298. * RX indication ring
  3299. * - RX_IND_WR_IDX_ADDR
  3300. * Bits 31:0
  3301. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3302. * updates the Write Index for WDI_IPA RX indication ring
  3303. * - RX_RING2_BASE_ADDR
  3304. * Bits 31:0
  3305. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3306. * - RX_RING2_SIZE
  3307. * Bits 31:0
  3308. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3309. * - RX_RING2_RD_IDX_ADDR
  3310. * Bits 31:0
  3311. * Purpose: If Second RX ring is Indication ring, DDR address where
  3312. * IPA uC updates the Read Index for Ring2.
  3313. * If Second RX ring is completion ring, this is NOT used
  3314. * - RX_RING2_WR_IDX_ADDR
  3315. * Bits 31:0
  3316. * Purpose: If Second RX ring is Indication ring, DDR address where
  3317. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3318. * If second RX ring is completion ring, DDR address where
  3319. * IPA uC updates the Write Index for Ring 2.
  3320. * For systems using 64-bit format for bus addresses:
  3321. * - TX_COMP_RING_BASE_ADDR_LO
  3322. * Bits 31:0
  3323. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3324. * - TX_COMP_RING_BASE_ADDR_HI
  3325. * Bits 31:0
  3326. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3327. * - TX_COMP_RING_SIZE
  3328. * Bits 31:0
  3329. * Purpose: TX Completion Ring size (must be power of 2)
  3330. * - TX_COMP_WR_IDX_ADDR_LO
  3331. * Bits 31:0
  3332. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3333. * Lower 4 bytes of DDR address where WIFI FW
  3334. * updates the Write Index for WDI_IPA TX completion ring
  3335. * - TX_COMP_WR_IDX_ADDR_HI
  3336. * Bits 31:0
  3337. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3338. * Higher 4 bytes of DDR address where WIFI FW
  3339. * updates the Write Index for WDI_IPA TX completion ring
  3340. * - TX_CE_WR_IDX_ADDR_LO
  3341. * Bits 31:0
  3342. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3343. * updates the WR Index for TX CE ring
  3344. * (needed for fusion platforms)
  3345. * - TX_CE_WR_IDX_ADDR_HI
  3346. * Bits 31:0
  3347. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3348. * updates the WR Index for TX CE ring
  3349. * (needed for fusion platforms)
  3350. * - RX_IND_RING_BASE_ADDR_LO
  3351. * Bits 31:0
  3352. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3353. * - RX_IND_RING_BASE_ADDR_HI
  3354. * Bits 31:0
  3355. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3356. * - RX_IND_RING_SIZE
  3357. * Bits 31:0
  3358. * Purpose: RX Indication Ring size
  3359. * - RX_IND_RD_IDX_ADDR_LO
  3360. * Bits 31:0
  3361. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3362. * for WDI_IPA RX indication ring
  3363. * - RX_IND_RD_IDX_ADDR_HI
  3364. * Bits 31:0
  3365. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3366. * for WDI_IPA RX indication ring
  3367. * - RX_IND_WR_IDX_ADDR_LO
  3368. * Bits 31:0
  3369. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3370. * Lower 4 bytes of DDR address where WIFI FW
  3371. * updates the Write Index for WDI_IPA RX indication ring
  3372. * - RX_IND_WR_IDX_ADDR_HI
  3373. * Bits 31:0
  3374. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3375. * Higher 4 bytes of DDR address where WIFI FW
  3376. * updates the Write Index for WDI_IPA RX indication ring
  3377. * - RX_RING2_BASE_ADDR_LO
  3378. * Bits 31:0
  3379. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3380. * - RX_RING2_BASE_ADDR_HI
  3381. * Bits 31:0
  3382. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3383. * - RX_RING2_SIZE
  3384. * Bits 31:0
  3385. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3386. * - RX_RING2_RD_IDX_ADDR_LO
  3387. * Bits 31:0
  3388. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3389. * DDR address where IPA uC updates the Read Index for Ring2.
  3390. * If Second RX ring is completion ring, this is NOT used
  3391. * - RX_RING2_RD_IDX_ADDR_HI
  3392. * Bits 31:0
  3393. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3394. * DDR address where IPA uC updates the Read Index for Ring2.
  3395. * If Second RX ring is completion ring, this is NOT used
  3396. * - RX_RING2_WR_IDX_ADDR_LO
  3397. * Bits 31:0
  3398. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3399. * DDR address where WIFI FW updates the Write Index
  3400. * for WDI_IPA RX ring2
  3401. * If second RX ring is completion ring, lower 4 bytes of
  3402. * DDR address where IPA uC updates the Write Index for Ring 2.
  3403. * - RX_RING2_WR_IDX_ADDR_HI
  3404. * Bits 31:0
  3405. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3406. * DDR address where WIFI FW updates the Write Index
  3407. * for WDI_IPA RX ring2
  3408. * If second RX ring is completion ring, higher 4 bytes of
  3409. * DDR address where IPA uC updates the Write Index for Ring 2.
  3410. */
  3411. #if HTT_PADDR64
  3412. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3413. #else
  3414. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3415. #endif
  3416. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3417. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3418. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3419. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3420. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3421. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3422. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3423. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3424. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3425. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3426. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3427. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3428. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3429. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3430. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3431. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3432. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3433. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3434. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3435. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3436. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3437. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3438. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3439. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3440. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3441. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3442. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3443. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3444. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3445. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3446. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3447. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3448. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3449. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3450. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3451. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3452. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3453. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3454. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3455. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3456. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3457. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3458. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3459. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3460. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3461. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3462. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3463. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3464. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3465. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3466. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3467. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3468. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3469. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3470. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3471. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3472. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3473. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3474. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3475. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3476. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3477. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3478. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3479. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3480. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3481. do { \
  3482. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3483. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3484. } while (0)
  3485. /* for systems using 32-bit format for bus addr */
  3486. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3487. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3488. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3489. do { \
  3490. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3491. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3492. } while (0)
  3493. /* for systems using 64-bit format for bus addr */
  3494. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3495. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3496. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3497. do { \
  3498. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3499. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3500. } while (0)
  3501. /* for systems using 64-bit format for bus addr */
  3502. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3503. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3504. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3505. do { \
  3506. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3507. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3508. } while (0)
  3509. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3510. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3511. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3512. do { \
  3513. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3514. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3515. } while (0)
  3516. /* for systems using 32-bit format for bus addr */
  3517. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3518. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3519. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3520. do { \
  3521. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3522. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3523. } while (0)
  3524. /* for systems using 64-bit format for bus addr */
  3525. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3526. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3527. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3528. do { \
  3529. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3530. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3531. } while (0)
  3532. /* for systems using 64-bit format for bus addr */
  3533. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3534. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3535. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3536. do { \
  3537. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3538. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3539. } while (0)
  3540. /* for systems using 32-bit format for bus addr */
  3541. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3542. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3543. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3544. do { \
  3545. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3546. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3547. } while (0)
  3548. /* for systems using 64-bit format for bus addr */
  3549. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3550. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3551. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3552. do { \
  3553. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3554. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3555. } while (0)
  3556. /* for systems using 64-bit format for bus addr */
  3557. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3558. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3559. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3560. do { \
  3561. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3562. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3563. } while (0)
  3564. /* for systems using 32-bit format for bus addr */
  3565. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3566. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3567. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3568. do { \
  3569. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3570. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3571. } while (0)
  3572. /* for systems using 64-bit format for bus addr */
  3573. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3574. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3575. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3576. do { \
  3577. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3578. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3579. } while (0)
  3580. /* for systems using 64-bit format for bus addr */
  3581. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3582. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3583. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3584. do { \
  3585. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3586. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3587. } while (0)
  3588. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3589. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3590. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3591. do { \
  3592. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3593. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3594. } while (0)
  3595. /* for systems using 32-bit format for bus addr */
  3596. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3597. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3598. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3599. do { \
  3600. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3601. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3602. } while (0)
  3603. /* for systems using 64-bit format for bus addr */
  3604. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3605. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3606. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3607. do { \
  3608. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3609. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3610. } while (0)
  3611. /* for systems using 64-bit format for bus addr */
  3612. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3613. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3614. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3615. do { \
  3616. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3617. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3618. } while (0)
  3619. /* for systems using 32-bit format for bus addr */
  3620. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3621. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3622. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3623. do { \
  3624. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3625. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3626. } while (0)
  3627. /* for systems using 64-bit format for bus addr */
  3628. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3629. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3630. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3631. do { \
  3632. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3633. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3634. } while (0)
  3635. /* for systems using 64-bit format for bus addr */
  3636. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3637. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3638. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3639. do { \
  3640. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3641. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3642. } while (0)
  3643. /* for systems using 32-bit format for bus addr */
  3644. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3645. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3646. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3647. do { \
  3648. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3649. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3650. } while (0)
  3651. /* for systems using 64-bit format for bus addr */
  3652. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3653. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3654. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3655. do { \
  3656. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3657. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3658. } while (0)
  3659. /* for systems using 64-bit format for bus addr */
  3660. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3661. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3662. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3663. do { \
  3664. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3665. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3666. } while (0)
  3667. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3668. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3669. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3670. do { \
  3671. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3672. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3673. } while (0)
  3674. /* for systems using 32-bit format for bus addr */
  3675. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3676. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3677. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3678. do { \
  3679. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3680. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3681. } while (0)
  3682. /* for systems using 64-bit format for bus addr */
  3683. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3684. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3685. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3686. do { \
  3687. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3688. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3689. } while (0)
  3690. /* for systems using 64-bit format for bus addr */
  3691. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3692. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3693. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3694. do { \
  3695. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3696. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3697. } while (0)
  3698. /* for systems using 32-bit format for bus addr */
  3699. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3700. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3701. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3702. do { \
  3703. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3704. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3705. } while (0)
  3706. /* for systems using 64-bit format for bus addr */
  3707. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3708. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3709. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3710. do { \
  3711. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3712. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3713. } while (0)
  3714. /* for systems using 64-bit format for bus addr */
  3715. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3716. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3717. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3718. do { \
  3719. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3720. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3721. } while (0)
  3722. /*
  3723. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3724. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3725. * addresses are stored in a XXX-bit field.
  3726. * This macro is used to define both htt_wdi_ipa_config32_t and
  3727. * htt_wdi_ipa_config64_t structs.
  3728. */
  3729. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3730. _paddr__tx_comp_ring_base_addr_, \
  3731. _paddr__tx_comp_wr_idx_addr_, \
  3732. _paddr__tx_ce_wr_idx_addr_, \
  3733. _paddr__rx_ind_ring_base_addr_, \
  3734. _paddr__rx_ind_rd_idx_addr_, \
  3735. _paddr__rx_ind_wr_idx_addr_, \
  3736. _paddr__rx_ring2_base_addr_,\
  3737. _paddr__rx_ring2_rd_idx_addr_,\
  3738. _paddr__rx_ring2_wr_idx_addr_) \
  3739. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3740. { \
  3741. /* DWORD 0: flags and meta-data */ \
  3742. A_UINT32 \
  3743. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3744. reserved: 8, \
  3745. tx_pkt_pool_size: 16;\
  3746. /* DWORD 1 */\
  3747. _paddr__tx_comp_ring_base_addr_;\
  3748. /* DWORD 2 (or 3)*/\
  3749. A_UINT32 tx_comp_ring_size;\
  3750. /* DWORD 3 (or 4)*/\
  3751. _paddr__tx_comp_wr_idx_addr_;\
  3752. /* DWORD 4 (or 6)*/\
  3753. _paddr__tx_ce_wr_idx_addr_;\
  3754. /* DWORD 5 (or 8)*/\
  3755. _paddr__rx_ind_ring_base_addr_;\
  3756. /* DWORD 6 (or 10)*/\
  3757. A_UINT32 rx_ind_ring_size;\
  3758. /* DWORD 7 (or 11)*/\
  3759. _paddr__rx_ind_rd_idx_addr_;\
  3760. /* DWORD 8 (or 13)*/\
  3761. _paddr__rx_ind_wr_idx_addr_;\
  3762. /* DWORD 9 (or 15)*/\
  3763. _paddr__rx_ring2_base_addr_;\
  3764. /* DWORD 10 (or 17) */\
  3765. A_UINT32 rx_ring2_size;\
  3766. /* DWORD 11 (or 18) */\
  3767. _paddr__rx_ring2_rd_idx_addr_;\
  3768. /* DWORD 12 (or 20) */\
  3769. _paddr__rx_ring2_wr_idx_addr_;\
  3770. } POSTPACK
  3771. /* define a htt_wdi_ipa_config32_t type */
  3772. 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));
  3773. /* define a htt_wdi_ipa_config64_t type */
  3774. 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));
  3775. #if HTT_PADDR64
  3776. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3777. #else
  3778. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3779. #endif
  3780. enum htt_wdi_ipa_op_code {
  3781. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3782. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3783. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3784. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3785. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3786. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3787. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3788. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3789. /* keep this last */
  3790. HTT_WDI_IPA_OPCODE_MAX
  3791. };
  3792. /**
  3793. * @brief HTT WDI_IPA Operation Request Message
  3794. *
  3795. * @details
  3796. * HTT WDI_IPA Operation Request message is sent by host
  3797. * to either suspend or resume WDI_IPA TX or RX path.
  3798. * |31 24|23 16|15 8|7 0|
  3799. * |----------------+----------------+----------------+----------------|
  3800. * | op_code | Rsvd | msg_type |
  3801. * |-------------------------------------------------------------------|
  3802. *
  3803. * Header fields:
  3804. * - MSG_TYPE
  3805. * Bits 7:0
  3806. * Purpose: Identifies this as WDI_IPA Operation Request message
  3807. * value: = 0x9
  3808. * - OP_CODE
  3809. * Bits 31:16
  3810. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3811. * value: = enum htt_wdi_ipa_op_code
  3812. */
  3813. PREPACK struct htt_wdi_ipa_op_request_t
  3814. {
  3815. /* DWORD 0: flags and meta-data */
  3816. A_UINT32
  3817. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3818. reserved: 8,
  3819. op_code: 16;
  3820. } POSTPACK;
  3821. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3822. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3823. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3824. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3825. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3826. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3827. do { \
  3828. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3829. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3830. } while (0)
  3831. /*
  3832. * @brief host -> target HTT_SRING_SETUP message
  3833. *
  3834. * @details
  3835. * After target is booted up, Host can send SRING setup message for
  3836. * each host facing LMAC SRING. Target setups up HW registers based
  3837. * on setup message and confirms back to Host if response_required is set.
  3838. * Host should wait for confirmation message before sending new SRING
  3839. * setup message
  3840. *
  3841. * The message would appear as follows:
  3842. * |31 24|23 20|19|18 16|15|14 8|7 0|
  3843. * |--------------- +-----------------+----------------+------------------|
  3844. * | ring_type | ring_id | pdev_id | msg_type |
  3845. * |----------------------------------------------------------------------|
  3846. * | ring_base_addr_lo |
  3847. * |----------------------------------------------------------------------|
  3848. * | ring_base_addr_hi |
  3849. * |----------------------------------------------------------------------|
  3850. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3851. * |----------------------------------------------------------------------|
  3852. * | ring_head_offset32_remote_addr_lo |
  3853. * |----------------------------------------------------------------------|
  3854. * | ring_head_offset32_remote_addr_hi |
  3855. * |----------------------------------------------------------------------|
  3856. * | ring_tail_offset32_remote_addr_lo |
  3857. * |----------------------------------------------------------------------|
  3858. * | ring_tail_offset32_remote_addr_hi |
  3859. * |----------------------------------------------------------------------|
  3860. * | ring_msi_addr_lo |
  3861. * |----------------------------------------------------------------------|
  3862. * | ring_msi_addr_hi |
  3863. * |----------------------------------------------------------------------|
  3864. * | ring_msi_data |
  3865. * |----------------------------------------------------------------------|
  3866. * | intr_timer_th |IM| intr_batch_counter_th |
  3867. * |----------------------------------------------------------------------|
  3868. * | reserved |RR|PTCF| intr_low_threshold |
  3869. * |----------------------------------------------------------------------|
  3870. * Where
  3871. * IM = sw_intr_mode
  3872. * RR = response_required
  3873. * PTCF = prefetch_timer_cfg
  3874. *
  3875. * The message is interpreted as follows:
  3876. * dword0 - b'0:7 - msg_type: This will be set to
  3877. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3878. * b'8:15 - pdev_id:
  3879. * 0 (for rings at SOC/UMAC level),
  3880. * 1/2/3 mac id (for rings at LMAC level)
  3881. * b'16:23 - ring_id: identify which ring is to setup,
  3882. * more details can be got from enum htt_srng_ring_id
  3883. * b'24:31 - ring_type: identify type of host rings,
  3884. * more details can be got from enum htt_srng_ring_type
  3885. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3886. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3887. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3888. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3889. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3890. * SW_TO_HW_RING.
  3891. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3892. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3893. * Lower 32 bits of memory address of the remote variable
  3894. * storing the 4-byte word offset that identifies the head
  3895. * element within the ring.
  3896. * (The head offset variable has type A_UINT32.)
  3897. * Valid for HW_TO_SW and SW_TO_SW rings.
  3898. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3899. * Upper 32 bits of memory address of the remote variable
  3900. * storing the 4-byte word offset that identifies the head
  3901. * element within the ring.
  3902. * (The head offset variable has type A_UINT32.)
  3903. * Valid for HW_TO_SW and SW_TO_SW rings.
  3904. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3905. * Lower 32 bits of memory address of the remote variable
  3906. * storing the 4-byte word offset that identifies the tail
  3907. * element within the ring.
  3908. * (The tail offset variable has type A_UINT32.)
  3909. * Valid for HW_TO_SW and SW_TO_SW rings.
  3910. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3911. * Upper 32 bits of memory address of the remote variable
  3912. * storing the 4-byte word offset that identifies the tail
  3913. * element within the ring.
  3914. * (The tail offset variable has type A_UINT32.)
  3915. * Valid for HW_TO_SW and SW_TO_SW rings.
  3916. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  3917. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3918. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  3919. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3920. * dword10 - b'0:31 - ring_msi_data: MSI data
  3921. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  3922. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3923. * dword11 - b'0:14 - intr_batch_counter_th:
  3924. * batch counter threshold is in units of 4-byte words.
  3925. * HW internally maintains and increments batch count.
  3926. * (see SRING spec for detail description).
  3927. * When batch count reaches threshold value, an interrupt
  3928. * is generated by HW.
  3929. * b'15 - sw_intr_mode:
  3930. * This configuration shall be static.
  3931. * Only programmed at power up.
  3932. * 0: generate pulse style sw interrupts
  3933. * 1: generate level style sw interrupts
  3934. * b'16:31 - intr_timer_th:
  3935. * The timer init value when timer is idle or is
  3936. * initialized to start downcounting.
  3937. * In 8us units (to cover a range of 0 to 524 ms)
  3938. * dword12 - b'0:15 - intr_low_threshold:
  3939. * Used only by Consumer ring to generate ring_sw_int_p.
  3940. * Ring entries low threshold water mark, that is used
  3941. * in combination with the interrupt timer as well as
  3942. * the the clearing of the level interrupt.
  3943. * b'16:18 - prefetch_timer_cfg:
  3944. * Used only by Consumer ring to set timer mode to
  3945. * support Application prefetch handling.
  3946. * The external tail offset/pointer will be updated
  3947. * at following intervals:
  3948. * 3'b000: (Prefetch feature disabled; used only for debug)
  3949. * 3'b001: 1 usec
  3950. * 3'b010: 4 usec
  3951. * 3'b011: 8 usec (default)
  3952. * 3'b100: 16 usec
  3953. * Others: Reserverd
  3954. * b'19 - response_required:
  3955. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  3956. * b'20:31 - reserved: reserved for future use
  3957. */
  3958. PREPACK struct htt_sring_setup_t {
  3959. A_UINT32 msg_type: 8,
  3960. pdev_id: 8,
  3961. ring_id: 8,
  3962. ring_type: 8;
  3963. A_UINT32 ring_base_addr_lo;
  3964. A_UINT32 ring_base_addr_hi;
  3965. A_UINT32 ring_size: 16,
  3966. ring_entry_size: 8,
  3967. ring_misc_cfg_flag: 8;
  3968. A_UINT32 ring_head_offset32_remote_addr_lo;
  3969. A_UINT32 ring_head_offset32_remote_addr_hi;
  3970. A_UINT32 ring_tail_offset32_remote_addr_lo;
  3971. A_UINT32 ring_tail_offset32_remote_addr_hi;
  3972. A_UINT32 ring_msi_addr_lo;
  3973. A_UINT32 ring_msi_addr_hi;
  3974. A_UINT32 ring_msi_data;
  3975. A_UINT32 intr_batch_counter_th: 15,
  3976. sw_intr_mode: 1,
  3977. intr_timer_th: 16;
  3978. A_UINT32 intr_low_threshold: 16,
  3979. prefetch_timer_cfg: 3,
  3980. response_required: 1,
  3981. reserved1: 12;
  3982. } POSTPACK;
  3983. enum htt_srng_ring_type {
  3984. HTT_HW_TO_SW_RING = 0,
  3985. HTT_SW_TO_HW_RING,
  3986. HTT_SW_TO_SW_RING,
  3987. /* Insert new ring types above this line */
  3988. };
  3989. enum htt_srng_ring_id {
  3990. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  3991. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  3992. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  3993. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  3994. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  3995. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  3996. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  3997. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  3998. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  3999. /* Add Other SRING which can't be directly configured by host software above this line */
  4000. };
  4001. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4002. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4003. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4004. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4005. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4006. HTT_SRING_SETUP_PDEV_ID_S)
  4007. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4008. do { \
  4009. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4010. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4011. } while (0)
  4012. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4013. #define HTT_SRING_SETUP_RING_ID_S 16
  4014. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4015. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4016. HTT_SRING_SETUP_RING_ID_S)
  4017. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4018. do { \
  4019. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4020. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4021. } while (0)
  4022. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4023. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4024. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4025. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4026. HTT_SRING_SETUP_RING_TYPE_S)
  4027. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4028. do { \
  4029. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4030. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4031. } while (0)
  4032. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4033. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4034. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4035. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4036. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4037. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4038. do { \
  4039. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4040. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4041. } while (0)
  4042. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4043. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4044. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4045. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4046. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4047. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4048. do { \
  4049. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4050. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4051. } while (0)
  4052. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4053. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4054. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4055. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4056. HTT_SRING_SETUP_RING_SIZE_S)
  4057. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4058. do { \
  4059. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4060. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4061. } while (0)
  4062. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4063. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4064. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4065. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4066. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4067. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4068. do { \
  4069. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4070. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4071. } while (0)
  4072. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4073. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4074. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4075. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4076. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4077. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4078. do { \
  4079. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4080. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4081. } while (0)
  4082. /* This control bit is applicable to only Producer, which updates Ring ID field
  4083. * of each descriptor before pushing into the ring.
  4084. * 0: updates ring_id(default)
  4085. * 1: ring_id updating disabled */
  4086. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4087. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4088. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4089. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4090. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4091. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4092. do { \
  4093. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4094. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4095. } while (0)
  4096. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4097. * of each descriptor before pushing into the ring.
  4098. * 0: updates Loopcnt(default)
  4099. * 1: Loopcnt updating disabled */
  4100. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4101. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4102. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4103. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4104. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4105. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4106. do { \
  4107. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4108. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4109. } while (0)
  4110. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4111. * into security_id port of GXI/AXI. */
  4112. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4113. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4114. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4115. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4116. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4117. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4118. do { \
  4119. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4120. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4121. } while (0)
  4122. /* During MSI write operation, SRNG drives value of this register bit into
  4123. * swap bit of GXI/AXI. */
  4124. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4125. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4126. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4127. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4128. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4129. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4130. do { \
  4131. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4132. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4133. } while (0)
  4134. /* During Pointer write operation, SRNG drives value of this register bit into
  4135. * swap bit of GXI/AXI. */
  4136. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4137. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4138. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4139. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4140. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4141. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4142. do { \
  4143. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4144. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4145. } while (0)
  4146. /* During any data or TLV write operation, SRNG drives value of this register
  4147. * bit into swap bit of GXI/AXI. */
  4148. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4149. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4150. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4151. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4152. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4153. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4154. do { \
  4155. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4156. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4157. } while (0)
  4158. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4159. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4160. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4161. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4162. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4163. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4164. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4165. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4166. do { \
  4167. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4168. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4169. } while (0)
  4170. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4171. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4172. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4173. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4174. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4175. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4176. do { \
  4177. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4178. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4179. } while (0)
  4180. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4181. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4182. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4183. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4184. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4185. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4186. do { \
  4187. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4188. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4189. } while (0)
  4190. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4191. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4192. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4193. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4194. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4195. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4196. do { \
  4197. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4198. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4199. } while (0)
  4200. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4201. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4202. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4203. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4204. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4205. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4206. do { \
  4207. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4208. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4209. } while (0)
  4210. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4211. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4212. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4213. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4214. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4215. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4216. do { \
  4217. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4218. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4219. } while (0)
  4220. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4221. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4222. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4223. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4224. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4225. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4226. do { \
  4227. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4228. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4229. } while (0)
  4230. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4231. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4232. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4233. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4234. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4235. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4236. do { \
  4237. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4238. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4239. } while (0)
  4240. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4241. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4242. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4243. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4244. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4245. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4246. do { \
  4247. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4248. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4249. } while (0)
  4250. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4251. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4252. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4253. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4254. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4255. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4256. do { \
  4257. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4258. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4259. } while (0)
  4260. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4261. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4262. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4263. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4264. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4265. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4266. do { \
  4267. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4268. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4269. } while (0)
  4270. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4271. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4272. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4273. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4274. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4275. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4276. do { \
  4277. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4278. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4279. } while (0)
  4280. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4281. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4282. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4283. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4284. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4285. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4286. do { \
  4287. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4288. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4289. } while (0)
  4290. /**
  4291. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4292. *
  4293. * @details
  4294. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4295. * configure RXDMA rings.
  4296. * The configuration is per ring based and includes both packet subtypes
  4297. * and PPDU/MPDU TLVs.
  4298. *
  4299. * The message would appear as follows:
  4300. *
  4301. * |31 27|26|25|24|23 16|15 8|7 0|
  4302. * |-----------------+----------------+----------------+---------------|
  4303. * | rsvd1 |OV|PS|SS| ring_id | pdev_id | msg_type |
  4304. * |-------------------------------------------------------------------|
  4305. * | rsvd2 | ring_buffer_size |
  4306. * |-------------------------------------------------------------------|
  4307. * | packet_type_enable_flags_0 |
  4308. * |-------------------------------------------------------------------|
  4309. * | packet_type_enable_flags_1 |
  4310. * |-------------------------------------------------------------------|
  4311. * | packet_type_enable_flags_2 |
  4312. * |-------------------------------------------------------------------|
  4313. * | packet_type_enable_flags_3 |
  4314. * |-------------------------------------------------------------------|
  4315. * | tlv_filter_in_flags |
  4316. * |-------------------------------------------------------------------|
  4317. * | rx_header_offset | rx_packet_offset |
  4318. * |-------------------------------------------------------------------|
  4319. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4320. * |-------------------------------------------------------------------|
  4321. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4322. * |-------------------------------------------------------------------|
  4323. * | rsvd3 | rx_attention_offset |
  4324. * |-------------------------------------------------------------------|
  4325. * Where:
  4326. * PS = pkt_swap
  4327. * SS = status_swap
  4328. * OV = rx_offsets_valid
  4329. * The message is interpreted as follows:
  4330. * dword0 - b'0:7 - msg_type: This will be set to
  4331. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4332. * b'8:15 - pdev_id:
  4333. * 0 (for rings at SOC/UMAC level),
  4334. * 1/2/3 mac id (for rings at LMAC level)
  4335. * b'16:23 - ring_id : Identify the ring to configure.
  4336. * More details can be got from enum htt_srng_ring_id
  4337. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4338. * BUF_RING_CFG_0 defs within HW .h files,
  4339. * e.g. wmac_top_reg_seq_hwioreg.h
  4340. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4341. * BUF_RING_CFG_0 defs within HW .h files,
  4342. * e.g. wmac_top_reg_seq_hwioreg.h
  4343. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4344. * configuration fields are valid
  4345. * b'27:31 - rsvd1: reserved for future use
  4346. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4347. * in byte units.
  4348. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4349. * - b'16:31 - rsvd2: Reserved for future use
  4350. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4351. * Enable MGMT packet from 0b0000 to 0b1001
  4352. * bits from low to high: FP, MD, MO - 3 bits
  4353. * FP: Filter_Pass
  4354. * MD: Monitor_Direct
  4355. * MO: Monitor_Other
  4356. * 10 mgmt subtypes * 3 bits -> 30 bits
  4357. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4358. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4359. * Enable MGMT packet from 0b1010 to 0b1111
  4360. * bits from low to high: FP, MD, MO - 3 bits
  4361. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4362. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4363. * Enable CTRL packet from 0b0000 to 0b1001
  4364. * bits from low to high: FP, MD, MO - 3 bits
  4365. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4366. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4367. * Enable CTRL packet from 0b1010 to 0b1111,
  4368. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4369. * bits from low to high: FP, MD, MO - 3 bits
  4370. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4371. * dword6 - b'0:31 - tlv_filter_in_flags:
  4372. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4373. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4374. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  4375. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4376. * A value of 0 will be considered as ignore this config.
  4377. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4378. * e.g. wmac_top_reg_seq_hwioreg.h
  4379. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  4380. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4381. * A value of 0 will be considered as ignore this config.
  4382. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4383. * e.g. wmac_top_reg_seq_hwioreg.h
  4384. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  4385. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4386. * A value of 0 will be considered as ignore this config.
  4387. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4388. * e.g. wmac_top_reg_seq_hwioreg.h
  4389. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  4390. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4391. * A value of 0 will be considered as ignore this config.
  4392. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4393. * e.g. wmac_top_reg_seq_hwioreg.h
  4394. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  4395. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4396. * A value of 0 will be considered as ignore this config.
  4397. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4398. * e.g. wmac_top_reg_seq_hwioreg.h
  4399. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  4400. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4401. * A value of 0 will be considered as ignore this config.
  4402. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4403. * e.g. wmac_top_reg_seq_hwioreg.h
  4404. * dword10 - b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4405. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4406. * A value of 0 will be considered as ignore this config.
  4407. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4408. * e.g. wmac_top_reg_seq_hwioreg.h
  4409. * - b'16-31 - rsvd3 for future use
  4410. */
  4411. PREPACK struct htt_rx_ring_selection_cfg_t {
  4412. A_UINT32 msg_type: 8,
  4413. pdev_id: 8,
  4414. ring_id: 8,
  4415. status_swap: 1,
  4416. pkt_swap: 1,
  4417. rx_offsets_valid: 1,
  4418. rsvd1: 5;
  4419. A_UINT32 ring_buffer_size: 16,
  4420. rsvd2: 16;
  4421. A_UINT32 packet_type_enable_flags_0;
  4422. A_UINT32 packet_type_enable_flags_1;
  4423. A_UINT32 packet_type_enable_flags_2;
  4424. A_UINT32 packet_type_enable_flags_3;
  4425. A_UINT32 tlv_filter_in_flags;
  4426. A_UINT32 rx_packet_offset: 16,
  4427. rx_header_offset: 16;
  4428. A_UINT32 rx_mpdu_end_offset: 16,
  4429. rx_mpdu_start_offset: 16;
  4430. A_UINT32 rx_msdu_end_offset: 16,
  4431. rx_msdu_start_offset: 16;
  4432. A_UINT32 rx_attn_offset: 16,
  4433. rsvd3: 16;
  4434. } POSTPACK;
  4435. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4436. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4437. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4438. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4439. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4440. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4441. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4442. do { \
  4443. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4444. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4445. } while (0)
  4446. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4447. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4448. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4449. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4450. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4451. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4452. do { \
  4453. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4454. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4455. } while (0)
  4456. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4457. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4458. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4459. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4460. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4461. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4462. do { \
  4463. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4464. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4465. } while (0)
  4466. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4467. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4468. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4469. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4470. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4471. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4472. do { \
  4473. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4474. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4475. } while (0)
  4476. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  4477. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  4478. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  4479. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  4480. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  4481. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  4482. do { \
  4483. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  4484. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  4485. } while (0)
  4486. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4487. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4488. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4489. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4490. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4491. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4492. do { \
  4493. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4494. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4495. } while (0)
  4496. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4497. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4498. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4499. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4500. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4501. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4502. do { \
  4503. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4504. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4505. } while (0)
  4506. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4507. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4508. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4509. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4510. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4511. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4512. do { \
  4513. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4514. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4515. } while (0)
  4516. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4517. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4518. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4519. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4520. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4521. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4522. do { \
  4523. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4524. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4525. } while (0)
  4526. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4527. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4528. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4529. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4530. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4531. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4532. do { \
  4533. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4534. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4535. } while (0)
  4536. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4537. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4538. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4539. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4540. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4541. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4542. do { \
  4543. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4544. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4545. } while (0)
  4546. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  4547. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  4548. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  4549. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  4550. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  4551. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  4552. do { \
  4553. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  4554. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  4555. } while (0)
  4556. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  4557. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  4558. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  4559. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  4560. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  4561. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  4562. do { \
  4563. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  4564. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  4565. } while (0)
  4566. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  4567. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  4568. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  4569. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  4570. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  4571. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  4572. do { \
  4573. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  4574. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  4575. } while (0)
  4576. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  4577. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  4578. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  4579. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  4580. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  4581. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  4582. do { \
  4583. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  4584. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  4585. } while (0)
  4586. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  4587. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  4588. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  4589. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  4590. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  4591. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  4592. do { \
  4593. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  4594. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  4595. } while (0)
  4596. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  4597. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  4598. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  4599. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  4600. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  4601. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  4602. do { \
  4603. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  4604. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  4605. } while (0)
  4606. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  4607. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  4608. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  4609. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  4610. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  4611. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  4612. do { \
  4613. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  4614. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  4615. } while (0)
  4616. /*
  4617. * Subtype based MGMT frames enable bits.
  4618. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4619. */
  4620. /* association request */
  4621. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4622. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4623. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4624. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4625. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4626. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4627. /* association response */
  4628. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4629. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4630. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4631. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4632. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4633. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4634. /* Reassociation request */
  4635. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4636. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4637. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4638. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4639. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4640. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4641. /* Reassociation response */
  4642. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4643. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4644. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4645. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4646. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4647. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4648. /* Probe request */
  4649. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4650. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4651. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4652. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4653. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4654. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4655. /* Probe response */
  4656. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4657. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4658. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4659. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4660. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4661. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4662. /* Timing Advertisement */
  4663. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4664. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4665. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4666. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4667. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4668. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4669. /* Reserved */
  4670. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4671. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4672. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4673. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4674. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4675. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4676. /* Beacon */
  4677. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  4678. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4679. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  4680. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4681. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  4682. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4683. /* ATIM */
  4684. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  4685. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4686. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  4687. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4688. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  4689. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4690. /* Disassociation */
  4691. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4692. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4693. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4694. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4695. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4696. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4697. /* Authentication */
  4698. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4699. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4700. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4701. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4702. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4703. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4704. /* Deauthentication */
  4705. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4706. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4707. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4708. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4709. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4710. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4711. /* Action */
  4712. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4713. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4714. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4715. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4716. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4717. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4718. /* Action No Ack */
  4719. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4720. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4721. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4722. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4723. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4724. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4725. /* Reserved */
  4726. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4727. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4728. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4729. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4730. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4731. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4732. /*
  4733. * Subtype based CTRL frames enable bits.
  4734. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4735. */
  4736. /* Reserved */
  4737. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4738. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4739. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4740. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4741. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4742. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4743. /* Reserved */
  4744. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4745. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4746. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4747. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4748. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4749. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4750. /* Reserved */
  4751. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4752. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4753. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4754. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4755. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4756. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4757. /* Reserved */
  4758. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4759. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4760. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4761. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4762. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4763. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4764. /* Reserved */
  4765. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4766. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4767. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4768. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4769. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4770. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4771. /* Reserved */
  4772. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4773. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4774. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4775. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4776. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4777. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4778. /* Reserved */
  4779. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4782. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4784. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4785. /* Control Wrapper */
  4786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4787. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4788. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4789. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4791. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4792. /* Block Ack Request */
  4793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  4794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  4796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  4798. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4799. /* Block Ack*/
  4800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  4801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  4803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  4805. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4806. /* PS-POLL */
  4807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4812. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4813. /* RTS */
  4814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4819. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4820. /* CTS */
  4821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4826. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4827. /* ACK */
  4828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4834. /* CF-END */
  4835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  4840. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4841. /* CF-END + CF-ACK */
  4842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  4843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  4845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  4847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4848. /* Multicast data */
  4849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  4850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4851. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  4852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  4853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  4854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  4855. /* Unicast data */
  4856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  4857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  4858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  4859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  4860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  4861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  4862. /* NULL data */
  4863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  4864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  4865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  4866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  4867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  4868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  4869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  4870. do { \
  4871. HTT_CHECK_SET_VAL(httsym, value); \
  4872. (word) |= (value) << httsym##_S; \
  4873. } while (0)
  4874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  4875. (((word) & httsym##_M) >> httsym##_S)
  4876. #define htt_rx_ring_pkt_enable_subtype_set( \
  4877. word, flag, mode, type, subtype, val) \
  4878. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  4879. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  4880. #define htt_rx_ring_pkt_enable_subtype_get( \
  4881. word, flag, mode, type, subtype) \
  4882. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  4883. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  4884. /* Definition to filter in TLVs */
  4885. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  4886. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  4887. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  4888. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  4889. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  4890. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  4891. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  4892. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  4893. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  4894. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  4895. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  4896. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  4897. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  4898. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  4899. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  4900. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  4901. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  4902. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  4903. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  4904. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  4905. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  4906. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  4907. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  4908. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  4909. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  4910. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  4911. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  4912. do { \
  4913. HTT_CHECK_SET_VAL(httsym, enable); \
  4914. (word) |= (enable) << httsym##_S; \
  4915. } while (0)
  4916. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  4917. (((word) & httsym##_M) >> httsym##_S)
  4918. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  4919. HTT_RX_RING_TLV_ENABLE_SET( \
  4920. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  4921. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  4922. HTT_RX_RING_TLV_ENABLE_GET( \
  4923. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  4924. /**
  4925. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  4926. * host --> target Receive Flow Steering configuration message definition.
  4927. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4928. * The reason for this is we want RFS to be configured and ready before MAC
  4929. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4930. *
  4931. * |31 24|23 16|15 9|8|7 0|
  4932. * |----------------+----------------+----------------+----------------|
  4933. * | reserved |E| msg type |
  4934. * |-------------------------------------------------------------------|
  4935. * Where E = RFS enable flag
  4936. *
  4937. * The RFS_CONFIG message consists of a single 4-byte word.
  4938. *
  4939. * Header fields:
  4940. * - MSG_TYPE
  4941. * Bits 7:0
  4942. * Purpose: identifies this as a RFS config msg
  4943. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  4944. * - RFS_CONFIG
  4945. * Bit 8
  4946. * Purpose: Tells target whether to enable (1) or disable (0)
  4947. * flow steering feature when sending rx indication messages to host
  4948. */
  4949. #define HTT_H2T_RFS_CONFIG_M 0x100
  4950. #define HTT_H2T_RFS_CONFIG_S 8
  4951. #define HTT_RX_RFS_CONFIG_GET(_var) \
  4952. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  4953. HTT_H2T_RFS_CONFIG_S)
  4954. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  4955. do { \
  4956. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  4957. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  4958. } while (0)
  4959. #define HTT_RFS_CFG_REQ_BYTES 4
  4960. /**
  4961. * @brief host -> target FW extended statistics retrieve
  4962. *
  4963. * @details
  4964. * The following field definitions describe the format of the HTT host
  4965. * to target FW extended stats retrieve message.
  4966. * The message specifies the type of stats the host wants to retrieve.
  4967. *
  4968. * |31 24|23 16|15 8|7 0|
  4969. * |-----------------------------------------------------------|
  4970. * | reserved | stats type | pdev_mask | msg type |
  4971. * |-----------------------------------------------------------|
  4972. * | config param [0] |
  4973. * |-----------------------------------------------------------|
  4974. * | config param [1] |
  4975. * |-----------------------------------------------------------|
  4976. * | config param [2] |
  4977. * |-----------------------------------------------------------|
  4978. * | config param [3] |
  4979. * |-----------------------------------------------------------|
  4980. * | reserved |
  4981. * |-----------------------------------------------------------|
  4982. * | cookie LSBs |
  4983. * |-----------------------------------------------------------|
  4984. * | cookie MSBs |
  4985. * |-----------------------------------------------------------|
  4986. * Header fields:
  4987. * - MSG_TYPE
  4988. * Bits 7:0
  4989. * Purpose: identifies this is a extended stats upload request message
  4990. * Value: 0x10
  4991. * - PDEV_MASK
  4992. * Bits 8:15
  4993. * Purpose: identifies the mask of PDEVs to retrieve stats from
  4994. * Value: This is a overloaded field, refer to usage and interpretation of
  4995. * PDEV in interface document.
  4996. * Bit 8 : Reserved for SOC stats
  4997. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  4998. * Indicates MACID_MASK in DBS
  4999. * - STATS_TYPE
  5000. * Bits 23:16
  5001. * Purpose: identifies which FW statistics to upload
  5002. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  5003. * - Reserved
  5004. * Bits 31:24
  5005. * - CONFIG_PARAM [0]
  5006. * Bits 31:0
  5007. * Purpose: give an opaque configuration value to the specified stats type
  5008. * Value: stats-type specific configuration value
  5009. * Refer to htt_stats.h for interpretation for each stats sub_type
  5010. * - CONFIG_PARAM [1]
  5011. * Bits 31:0
  5012. * Purpose: give an opaque configuration value to the specified stats type
  5013. * Value: stats-type specific configuration value
  5014. * Refer to htt_stats.h for interpretation for each stats sub_type
  5015. * - CONFIG_PARAM [2]
  5016. * Bits 31:0
  5017. * Purpose: give an opaque configuration value to the specified stats type
  5018. * Value: stats-type specific configuration value
  5019. * Refer to htt_stats.h for interpretation for each stats sub_type
  5020. * - CONFIG_PARAM [3]
  5021. * Bits 31:0
  5022. * Purpose: give an opaque configuration value to the specified stats type
  5023. * Value: stats-type specific configuration value
  5024. * Refer to htt_stats.h for interpretation for each stats sub_type
  5025. * - Reserved [31:0] for future use.
  5026. * - COOKIE_LSBS
  5027. * Bits 31:0
  5028. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5029. * message with its preceding host->target stats request message.
  5030. * Value: LSBs of the opaque cookie specified by the host-side requestor
  5031. * - COOKIE_MSBS
  5032. * Bits 31:0
  5033. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5034. * message with its preceding host->target stats request message.
  5035. * Value: MSBs of the opaque cookie specified by the host-side requestor
  5036. */
  5037. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  5038. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  5039. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  5040. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  5041. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  5042. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  5043. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  5044. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  5045. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  5046. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  5047. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  5048. do { \
  5049. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  5050. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  5051. } while (0)
  5052. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  5053. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  5054. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  5055. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  5056. do { \
  5057. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  5058. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  5059. } while (0)
  5060. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  5061. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  5062. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  5063. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  5064. do { \
  5065. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  5066. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  5067. } while (0)
  5068. /**
  5069. * @brief host -> target FW PPDU_STATS request message
  5070. *
  5071. * @details
  5072. * The following field definitions describe the format of the HTT host
  5073. * to target FW for PPDU_STATS_CFG msg.
  5074. * The message allows the host to configure the PPDU_STATS_IND messages
  5075. * produced by the target.
  5076. *
  5077. * |31 24|23 16|15 8|7 0|
  5078. * |-----------------------------------------------------------|
  5079. * | REQ bit mask | pdev_mask | msg type |
  5080. * |-----------------------------------------------------------|
  5081. * Header fields:
  5082. * - MSG_TYPE
  5083. * Bits 7:0
  5084. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  5085. * Value: 0x11
  5086. * - PDEV_MASK
  5087. * Bits 8:15
  5088. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  5089. * Value: This is a overloaded field, refer to usage and interpretation of
  5090. * PDEV in interface document.
  5091. * Bit 8 : Reserved for SOC stats
  5092. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5093. * Indicates MACID_MASK in DBS
  5094. * - REQ_TLV_BIT_MASK
  5095. * Bits 16:31
  5096. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  5097. * needs to be included in the target's PPDU_STATS_IND messages.
  5098. * Value: refer htt_ppdu_stats_tlv_tag_t
  5099. *
  5100. */
  5101. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  5102. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  5103. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  5104. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  5105. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  5106. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  5107. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  5108. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  5109. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  5110. do { \
  5111. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  5112. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  5113. } while (0)
  5114. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  5115. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  5116. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  5117. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  5118. do { \
  5119. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  5120. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  5121. } while (0)
  5122. /*=== target -> host messages ===============================================*/
  5123. enum htt_t2h_msg_type {
  5124. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  5125. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  5126. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  5127. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  5128. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  5129. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  5130. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  5131. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  5132. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  5133. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  5134. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  5135. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  5136. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  5137. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  5138. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  5139. /* only used for HL, add HTT MSG for HTT CREDIT update */
  5140. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  5141. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  5142. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  5143. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  5144. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  5145. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  5146. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  5147. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  5148. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  5149. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  5150. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  5151. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  5152. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  5153. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  5154. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  5155. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  5156. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  5157. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  5158. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  5159. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  5160. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  5161. HTT_T2H_MSG_TYPE_TEST,
  5162. /* keep this last */
  5163. HTT_T2H_NUM_MSGS
  5164. };
  5165. /*
  5166. * HTT target to host message type -
  5167. * stored in bits 7:0 of the first word of the message
  5168. */
  5169. #define HTT_T2H_MSG_TYPE_M 0xff
  5170. #define HTT_T2H_MSG_TYPE_S 0
  5171. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  5172. do { \
  5173. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  5174. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  5175. } while (0)
  5176. #define HTT_T2H_MSG_TYPE_GET(word) \
  5177. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  5178. /**
  5179. * @brief target -> host version number confirmation message definition
  5180. *
  5181. * |31 24|23 16|15 8|7 0|
  5182. * |----------------+----------------+----------------+----------------|
  5183. * | reserved | major number | minor number | msg type |
  5184. * |-------------------------------------------------------------------|
  5185. * : option request TLV (optional) |
  5186. * :...................................................................:
  5187. *
  5188. * The VER_CONF message may consist of a single 4-byte word, or may be
  5189. * extended with TLVs that specify HTT options selected by the target.
  5190. * The following option TLVs may be appended to the VER_CONF message:
  5191. * - LL_BUS_ADDR_SIZE
  5192. * - HL_SUPPRESS_TX_COMPL_IND
  5193. * - MAX_TX_QUEUE_GROUPS
  5194. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  5195. * may be appended to the VER_CONF message (but only one TLV of each type).
  5196. *
  5197. * Header fields:
  5198. * - MSG_TYPE
  5199. * Bits 7:0
  5200. * Purpose: identifies this as a version number confirmation message
  5201. * Value: 0x0
  5202. * - VER_MINOR
  5203. * Bits 15:8
  5204. * Purpose: Specify the minor number of the HTT message library version
  5205. * in use by the target firmware.
  5206. * The minor number specifies the specific revision within a range
  5207. * of fundamentally compatible HTT message definition revisions.
  5208. * Compatible revisions involve adding new messages or perhaps
  5209. * adding new fields to existing messages, in a backwards-compatible
  5210. * manner.
  5211. * Incompatible revisions involve changing the message type values,
  5212. * or redefining existing messages.
  5213. * Value: minor number
  5214. * - VER_MAJOR
  5215. * Bits 15:8
  5216. * Purpose: Specify the major number of the HTT message library version
  5217. * in use by the target firmware.
  5218. * The major number specifies the family of minor revisions that are
  5219. * fundamentally compatible with each other, but not with prior or
  5220. * later families.
  5221. * Value: major number
  5222. */
  5223. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  5224. #define HTT_VER_CONF_MINOR_S 8
  5225. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  5226. #define HTT_VER_CONF_MAJOR_S 16
  5227. #define HTT_VER_CONF_MINOR_SET(word, value) \
  5228. do { \
  5229. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  5230. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  5231. } while (0)
  5232. #define HTT_VER_CONF_MINOR_GET(word) \
  5233. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  5234. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  5235. do { \
  5236. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  5237. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  5238. } while (0)
  5239. #define HTT_VER_CONF_MAJOR_GET(word) \
  5240. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  5241. #define HTT_VER_CONF_BYTES 4
  5242. /**
  5243. * @brief - target -> host HTT Rx In order indication message
  5244. *
  5245. * @details
  5246. *
  5247. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  5248. * |----------------+-------------------+---------------------+---------------|
  5249. * | peer ID | P| F| O| ext TID | msg type |
  5250. * |--------------------------------------------------------------------------|
  5251. * | MSDU count | Reserved | vdev id |
  5252. * |--------------------------------------------------------------------------|
  5253. * | MSDU 0 bus address (bits 31:0) |
  5254. #if HTT_PADDR64
  5255. * | MSDU 0 bus address (bits 63:32) |
  5256. #endif
  5257. * |--------------------------------------------------------------------------|
  5258. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  5259. * |--------------------------------------------------------------------------|
  5260. * | MSDU 1 bus address (bits 31:0) |
  5261. #if HTT_PADDR64
  5262. * | MSDU 1 bus address (bits 63:32) |
  5263. #endif
  5264. * |--------------------------------------------------------------------------|
  5265. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  5266. * |--------------------------------------------------------------------------|
  5267. */
  5268. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  5269. *
  5270. * @details
  5271. * bits
  5272. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  5273. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5274. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  5275. * | | frag | | | | fail |chksum fail|
  5276. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5277. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  5278. */
  5279. struct htt_rx_in_ord_paddr_ind_hdr_t
  5280. {
  5281. A_UINT32 /* word 0 */
  5282. msg_type: 8,
  5283. ext_tid: 5,
  5284. offload: 1,
  5285. frag: 1,
  5286. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  5287. peer_id: 16;
  5288. A_UINT32 /* word 1 */
  5289. vap_id: 8,
  5290. reserved_1: 8,
  5291. msdu_cnt: 16;
  5292. };
  5293. struct htt_rx_in_ord_paddr_ind_msdu32_t
  5294. {
  5295. A_UINT32 dma_addr;
  5296. A_UINT32
  5297. length: 16,
  5298. fw_desc: 8,
  5299. msdu_info:8;
  5300. };
  5301. struct htt_rx_in_ord_paddr_ind_msdu64_t
  5302. {
  5303. A_UINT32 dma_addr_lo;
  5304. A_UINT32 dma_addr_hi;
  5305. A_UINT32
  5306. length: 16,
  5307. fw_desc: 8,
  5308. msdu_info:8;
  5309. };
  5310. #if HTT_PADDR64
  5311. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  5312. #else
  5313. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  5314. #endif
  5315. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  5316. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  5317. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  5318. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  5319. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  5320. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  5321. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  5322. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  5323. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  5324. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  5325. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  5326. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  5327. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  5328. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  5329. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  5330. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  5331. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  5332. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  5333. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  5334. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  5335. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  5336. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  5337. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  5338. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  5339. /* for systems using 64-bit format for bus addresses */
  5340. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  5341. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  5342. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  5343. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  5344. /* for systems using 32-bit format for bus addresses */
  5345. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  5346. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  5347. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  5348. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  5349. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  5350. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  5351. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  5352. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  5353. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  5354. do { \
  5355. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  5356. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  5357. } while (0)
  5358. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  5359. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  5360. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  5361. do { \
  5362. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  5363. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  5364. } while (0)
  5365. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  5366. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  5367. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  5368. do { \
  5369. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  5370. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  5371. } while (0)
  5372. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  5373. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  5374. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  5375. do { \
  5376. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  5377. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  5378. } while (0)
  5379. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  5380. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  5381. /* for systems using 64-bit format for bus addresses */
  5382. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  5383. do { \
  5384. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  5385. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  5386. } while (0)
  5387. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  5388. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  5389. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  5390. do { \
  5391. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  5392. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  5393. } while (0)
  5394. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  5395. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  5396. /* for systems using 32-bit format for bus addresses */
  5397. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  5398. do { \
  5399. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  5400. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  5401. } while (0)
  5402. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  5403. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  5404. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  5405. do { \
  5406. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  5407. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  5408. } while (0)
  5409. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  5410. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  5411. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  5412. do { \
  5413. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  5414. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  5415. } while (0)
  5416. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  5417. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  5418. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  5419. do { \
  5420. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  5421. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  5422. } while (0)
  5423. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  5424. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  5425. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  5426. do { \
  5427. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  5428. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  5429. } while (0)
  5430. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  5431. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  5432. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  5433. do { \
  5434. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  5435. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  5436. } while (0)
  5437. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  5438. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  5439. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  5440. do { \
  5441. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  5442. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  5443. } while (0)
  5444. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  5445. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  5446. /* definitions used within target -> host rx indication message */
  5447. PREPACK struct htt_rx_ind_hdr_prefix_t
  5448. {
  5449. A_UINT32 /* word 0 */
  5450. msg_type: 8,
  5451. ext_tid: 5,
  5452. release_valid: 1,
  5453. flush_valid: 1,
  5454. reserved0: 1,
  5455. peer_id: 16;
  5456. A_UINT32 /* word 1 */
  5457. flush_start_seq_num: 6,
  5458. flush_end_seq_num: 6,
  5459. release_start_seq_num: 6,
  5460. release_end_seq_num: 6,
  5461. num_mpdu_ranges: 8;
  5462. } POSTPACK;
  5463. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  5464. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  5465. #define HTT_TGT_RSSI_INVALID 0x80
  5466. PREPACK struct htt_rx_ppdu_desc_t
  5467. {
  5468. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  5469. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  5470. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  5471. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  5472. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  5473. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  5474. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  5475. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  5476. A_UINT32 /* word 0 */
  5477. rssi_cmb: 8,
  5478. timestamp_submicrosec: 8,
  5479. phy_err_code: 8,
  5480. phy_err: 1,
  5481. legacy_rate: 4,
  5482. legacy_rate_sel: 1,
  5483. end_valid: 1,
  5484. start_valid: 1;
  5485. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  5486. union {
  5487. A_UINT32 /* word 1 */
  5488. rssi0_pri20: 8,
  5489. rssi0_ext20: 8,
  5490. rssi0_ext40: 8,
  5491. rssi0_ext80: 8;
  5492. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  5493. } u0;
  5494. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  5495. union {
  5496. A_UINT32 /* word 2 */
  5497. rssi1_pri20: 8,
  5498. rssi1_ext20: 8,
  5499. rssi1_ext40: 8,
  5500. rssi1_ext80: 8;
  5501. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  5502. } u1;
  5503. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  5504. union {
  5505. A_UINT32 /* word 3 */
  5506. rssi2_pri20: 8,
  5507. rssi2_ext20: 8,
  5508. rssi2_ext40: 8,
  5509. rssi2_ext80: 8;
  5510. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  5511. } u2;
  5512. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  5513. union {
  5514. A_UINT32 /* word 4 */
  5515. rssi3_pri20: 8,
  5516. rssi3_ext20: 8,
  5517. rssi3_ext40: 8,
  5518. rssi3_ext80: 8;
  5519. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  5520. } u3;
  5521. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  5522. A_UINT32 tsf32; /* word 5 */
  5523. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  5524. A_UINT32 timestamp_microsec; /* word 6 */
  5525. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  5526. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  5527. A_UINT32 /* word 7 */
  5528. vht_sig_a1: 24,
  5529. preamble_type: 8;
  5530. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  5531. A_UINT32 /* word 8 */
  5532. vht_sig_a2: 24,
  5533. reserved0: 8;
  5534. } POSTPACK;
  5535. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  5536. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  5537. PREPACK struct htt_rx_ind_hdr_suffix_t
  5538. {
  5539. A_UINT32 /* word 0 */
  5540. fw_rx_desc_bytes: 16,
  5541. reserved0: 16;
  5542. } POSTPACK;
  5543. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  5544. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  5545. PREPACK struct htt_rx_ind_hdr_t
  5546. {
  5547. struct htt_rx_ind_hdr_prefix_t prefix;
  5548. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  5549. struct htt_rx_ind_hdr_suffix_t suffix;
  5550. } POSTPACK;
  5551. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  5552. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  5553. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  5554. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  5555. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  5556. /*
  5557. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  5558. * the offset into the HTT rx indication message at which the
  5559. * FW rx PPDU descriptor resides
  5560. */
  5561. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  5562. /*
  5563. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  5564. * the offset into the HTT rx indication message at which the
  5565. * header suffix (FW rx MSDU byte count) resides
  5566. */
  5567. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  5568. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  5569. /*
  5570. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  5571. * the offset into the HTT rx indication message at which the per-MSDU
  5572. * information starts
  5573. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  5574. * per-MSDU information portion of the message. The per-MSDU info itself
  5575. * starts at byte 12.
  5576. */
  5577. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  5578. /**
  5579. * @brief target -> host rx indication message definition
  5580. *
  5581. * @details
  5582. * The following field definitions describe the format of the rx indication
  5583. * message sent from the target to the host.
  5584. * The message consists of three major sections:
  5585. * 1. a fixed-length header
  5586. * 2. a variable-length list of firmware rx MSDU descriptors
  5587. * 3. one or more 4-octet MPDU range information elements
  5588. * The fixed length header itself has two sub-sections
  5589. * 1. the message meta-information, including identification of the
  5590. * sender and type of the received data, and a 4-octet flush/release IE
  5591. * 2. the firmware rx PPDU descriptor
  5592. *
  5593. * The format of the message is depicted below.
  5594. * in this depiction, the following abbreviations are used for information
  5595. * elements within the message:
  5596. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  5597. * elements associated with the PPDU start are valid.
  5598. * Specifically, the following fields are valid only if SV is set:
  5599. * RSSI (all variants), L, legacy rate, preamble type, service,
  5600. * VHT-SIG-A
  5601. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  5602. * elements associated with the PPDU end are valid.
  5603. * Specifically, the following fields are valid only if EV is set:
  5604. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  5605. * - L - Legacy rate selector - if legacy rates are used, this flag
  5606. * indicates whether the rate is from a CCK (L == 1) or OFDM
  5607. * (L == 0) PHY.
  5608. * - P - PHY error flag - boolean indication of whether the rx frame had
  5609. * a PHY error
  5610. *
  5611. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  5612. * |----------------+-------------------+---------------------+---------------|
  5613. * | peer ID | |RV|FV| ext TID | msg type |
  5614. * |--------------------------------------------------------------------------|
  5615. * | num | release | release | flush | flush |
  5616. * | MPDU | end | start | end | start |
  5617. * | ranges | seq num | seq num | seq num | seq num |
  5618. * |==========================================================================|
  5619. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  5620. * |V|V| | rate | | | timestamp | RSSI |
  5621. * |--------------------------------------------------------------------------|
  5622. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  5623. * |--------------------------------------------------------------------------|
  5624. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  5625. * |--------------------------------------------------------------------------|
  5626. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  5627. * |--------------------------------------------------------------------------|
  5628. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  5629. * |--------------------------------------------------------------------------|
  5630. * | TSF LSBs |
  5631. * |--------------------------------------------------------------------------|
  5632. * | microsec timestamp |
  5633. * |--------------------------------------------------------------------------|
  5634. * | preamble type | HT-SIG / VHT-SIG-A1 |
  5635. * |--------------------------------------------------------------------------|
  5636. * | service | HT-SIG / VHT-SIG-A2 |
  5637. * |==========================================================================|
  5638. * | reserved | FW rx desc bytes |
  5639. * |--------------------------------------------------------------------------|
  5640. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  5641. * | desc B3 | desc B2 | desc B1 | desc B0 |
  5642. * |--------------------------------------------------------------------------|
  5643. * : : :
  5644. * |--------------------------------------------------------------------------|
  5645. * | alignment | MSDU Rx |
  5646. * | padding | desc Bn |
  5647. * |--------------------------------------------------------------------------|
  5648. * | reserved | MPDU range status | MPDU count |
  5649. * |--------------------------------------------------------------------------|
  5650. * : reserved : MPDU range status : MPDU count :
  5651. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  5652. *
  5653. * Header fields:
  5654. * - MSG_TYPE
  5655. * Bits 7:0
  5656. * Purpose: identifies this as an rx indication message
  5657. * Value: 0x1
  5658. * - EXT_TID
  5659. * Bits 12:8
  5660. * Purpose: identify the traffic ID of the rx data, including
  5661. * special "extended" TID values for multicast, broadcast, and
  5662. * non-QoS data frames
  5663. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  5664. * - FLUSH_VALID (FV)
  5665. * Bit 13
  5666. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  5667. * is valid
  5668. * Value:
  5669. * 1 -> flush IE is valid and needs to be processed
  5670. * 0 -> flush IE is not valid and should be ignored
  5671. * - REL_VALID (RV)
  5672. * Bit 13
  5673. * Purpose: indicate whether the release IE (start/end sequence numbers)
  5674. * is valid
  5675. * Value:
  5676. * 1 -> release IE is valid and needs to be processed
  5677. * 0 -> release IE is not valid and should be ignored
  5678. * - PEER_ID
  5679. * Bits 31:16
  5680. * Purpose: Identify, by ID, which peer sent the rx data
  5681. * Value: ID of the peer who sent the rx data
  5682. * - FLUSH_SEQ_NUM_START
  5683. * Bits 5:0
  5684. * Purpose: Indicate the start of a series of MPDUs to flush
  5685. * Not all MPDUs within this series are necessarily valid - the host
  5686. * must check each sequence number within this range to see if the
  5687. * corresponding MPDU is actually present.
  5688. * This field is only valid if the FV bit is set.
  5689. * Value:
  5690. * The sequence number for the first MPDUs to check to flush.
  5691. * The sequence number is masked by 0x3f.
  5692. * - FLUSH_SEQ_NUM_END
  5693. * Bits 11:6
  5694. * Purpose: Indicate the end of a series of MPDUs to flush
  5695. * Value:
  5696. * The sequence number one larger than the sequence number of the
  5697. * last MPDU to check to flush.
  5698. * The sequence number is masked by 0x3f.
  5699. * Not all MPDUs within this series are necessarily valid - the host
  5700. * must check each sequence number within this range to see if the
  5701. * corresponding MPDU is actually present.
  5702. * This field is only valid if the FV bit is set.
  5703. * - REL_SEQ_NUM_START
  5704. * Bits 17:12
  5705. * Purpose: Indicate the start of a series of MPDUs to release.
  5706. * All MPDUs within this series are present and valid - the host
  5707. * need not check each sequence number within this range to see if
  5708. * the corresponding MPDU is actually present.
  5709. * This field is only valid if the RV bit is set.
  5710. * Value:
  5711. * The sequence number for the first MPDUs to check to release.
  5712. * The sequence number is masked by 0x3f.
  5713. * - REL_SEQ_NUM_END
  5714. * Bits 23:18
  5715. * Purpose: Indicate the end of a series of MPDUs to release.
  5716. * Value:
  5717. * The sequence number one larger than the sequence number of the
  5718. * last MPDU to check to release.
  5719. * The sequence number is masked by 0x3f.
  5720. * All MPDUs within this series are present and valid - the host
  5721. * need not check each sequence number within this range to see if
  5722. * the corresponding MPDU is actually present.
  5723. * This field is only valid if the RV bit is set.
  5724. * - NUM_MPDU_RANGES
  5725. * Bits 31:24
  5726. * Purpose: Indicate how many ranges of MPDUs are present.
  5727. * Each MPDU range consists of a series of contiguous MPDUs within the
  5728. * rx frame sequence which all have the same MPDU status.
  5729. * Value: 1-63 (typically a small number, like 1-3)
  5730. *
  5731. * Rx PPDU descriptor fields:
  5732. * - RSSI_CMB
  5733. * Bits 7:0
  5734. * Purpose: Combined RSSI from all active rx chains, across the active
  5735. * bandwidth.
  5736. * Value: RSSI dB units w.r.t. noise floor
  5737. * - TIMESTAMP_SUBMICROSEC
  5738. * Bits 15:8
  5739. * Purpose: high-resolution timestamp
  5740. * Value:
  5741. * Sub-microsecond time of PPDU reception.
  5742. * This timestamp ranges from [0,MAC clock MHz).
  5743. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  5744. * to form a high-resolution, large range rx timestamp.
  5745. * - PHY_ERR_CODE
  5746. * Bits 23:16
  5747. * Purpose:
  5748. * If the rx frame processing resulted in a PHY error, indicate what
  5749. * type of rx PHY error occurred.
  5750. * Value:
  5751. * This field is valid if the "P" (PHY_ERR) flag is set.
  5752. * TBD: document/specify the values for this field
  5753. * - PHY_ERR
  5754. * Bit 24
  5755. * Purpose: indicate whether the rx PPDU had a PHY error
  5756. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  5757. * - LEGACY_RATE
  5758. * Bits 28:25
  5759. * Purpose:
  5760. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  5761. * specify which rate was used.
  5762. * Value:
  5763. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  5764. * flag.
  5765. * If LEGACY_RATE_SEL is 0:
  5766. * 0x8: OFDM 48 Mbps
  5767. * 0x9: OFDM 24 Mbps
  5768. * 0xA: OFDM 12 Mbps
  5769. * 0xB: OFDM 6 Mbps
  5770. * 0xC: OFDM 54 Mbps
  5771. * 0xD: OFDM 36 Mbps
  5772. * 0xE: OFDM 18 Mbps
  5773. * 0xF: OFDM 9 Mbps
  5774. * If LEGACY_RATE_SEL is 1:
  5775. * 0x8: CCK 11 Mbps long preamble
  5776. * 0x9: CCK 5.5 Mbps long preamble
  5777. * 0xA: CCK 2 Mbps long preamble
  5778. * 0xB: CCK 1 Mbps long preamble
  5779. * 0xC: CCK 11 Mbps short preamble
  5780. * 0xD: CCK 5.5 Mbps short preamble
  5781. * 0xE: CCK 2 Mbps short preamble
  5782. * - LEGACY_RATE_SEL
  5783. * Bit 29
  5784. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  5785. * Value:
  5786. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  5787. * used a legacy rate.
  5788. * 0 -> OFDM, 1 -> CCK
  5789. * - END_VALID
  5790. * Bit 30
  5791. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5792. * the start of the PPDU are valid. Specifically, the following
  5793. * fields are only valid if END_VALID is set:
  5794. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  5795. * TIMESTAMP_SUBMICROSEC
  5796. * Value:
  5797. * 0 -> rx PPDU desc end fields are not valid
  5798. * 1 -> rx PPDU desc end fields are valid
  5799. * - START_VALID
  5800. * Bit 31
  5801. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5802. * the end of the PPDU are valid. Specifically, the following
  5803. * fields are only valid if START_VALID is set:
  5804. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  5805. * VHT-SIG-A
  5806. * Value:
  5807. * 0 -> rx PPDU desc start fields are not valid
  5808. * 1 -> rx PPDU desc start fields are valid
  5809. * - RSSI0_PRI20
  5810. * Bits 7:0
  5811. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  5812. * Value: RSSI dB units w.r.t. noise floor
  5813. *
  5814. * - RSSI0_EXT20
  5815. * Bits 7:0
  5816. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  5817. * (if the rx bandwidth was >= 40 MHz)
  5818. * Value: RSSI dB units w.r.t. noise floor
  5819. * - RSSI0_EXT40
  5820. * Bits 7:0
  5821. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  5822. * (if the rx bandwidth was >= 80 MHz)
  5823. * Value: RSSI dB units w.r.t. noise floor
  5824. * - RSSI0_EXT80
  5825. * Bits 7:0
  5826. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  5827. * (if the rx bandwidth was >= 160 MHz)
  5828. * Value: RSSI dB units w.r.t. noise floor
  5829. *
  5830. * - RSSI1_PRI20
  5831. * Bits 7:0
  5832. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  5833. * Value: RSSI dB units w.r.t. noise floor
  5834. * - RSSI1_EXT20
  5835. * Bits 7:0
  5836. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  5837. * (if the rx bandwidth was >= 40 MHz)
  5838. * Value: RSSI dB units w.r.t. noise floor
  5839. * - RSSI1_EXT40
  5840. * Bits 7:0
  5841. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  5842. * (if the rx bandwidth was >= 80 MHz)
  5843. * Value: RSSI dB units w.r.t. noise floor
  5844. * - RSSI1_EXT80
  5845. * Bits 7:0
  5846. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  5847. * (if the rx bandwidth was >= 160 MHz)
  5848. * Value: RSSI dB units w.r.t. noise floor
  5849. *
  5850. * - RSSI2_PRI20
  5851. * Bits 7:0
  5852. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  5853. * Value: RSSI dB units w.r.t. noise floor
  5854. * - RSSI2_EXT20
  5855. * Bits 7:0
  5856. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  5857. * (if the rx bandwidth was >= 40 MHz)
  5858. * Value: RSSI dB units w.r.t. noise floor
  5859. * - RSSI2_EXT40
  5860. * Bits 7:0
  5861. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  5862. * (if the rx bandwidth was >= 80 MHz)
  5863. * Value: RSSI dB units w.r.t. noise floor
  5864. * - RSSI2_EXT80
  5865. * Bits 7:0
  5866. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  5867. * (if the rx bandwidth was >= 160 MHz)
  5868. * Value: RSSI dB units w.r.t. noise floor
  5869. *
  5870. * - RSSI3_PRI20
  5871. * Bits 7:0
  5872. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  5873. * Value: RSSI dB units w.r.t. noise floor
  5874. * - RSSI3_EXT20
  5875. * Bits 7:0
  5876. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  5877. * (if the rx bandwidth was >= 40 MHz)
  5878. * Value: RSSI dB units w.r.t. noise floor
  5879. * - RSSI3_EXT40
  5880. * Bits 7:0
  5881. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  5882. * (if the rx bandwidth was >= 80 MHz)
  5883. * Value: RSSI dB units w.r.t. noise floor
  5884. * - RSSI3_EXT80
  5885. * Bits 7:0
  5886. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  5887. * (if the rx bandwidth was >= 160 MHz)
  5888. * Value: RSSI dB units w.r.t. noise floor
  5889. *
  5890. * - TSF32
  5891. * Bits 31:0
  5892. * Purpose: specify the time the rx PPDU was received, in TSF units
  5893. * Value: 32 LSBs of the TSF
  5894. * - TIMESTAMP_MICROSEC
  5895. * Bits 31:0
  5896. * Purpose: specify the time the rx PPDU was received, in microsecond units
  5897. * Value: PPDU rx time, in microseconds
  5898. * - VHT_SIG_A1
  5899. * Bits 23:0
  5900. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  5901. * from the rx PPDU
  5902. * Value:
  5903. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5904. * VHT-SIG-A1 data.
  5905. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5906. * first 24 bits of the HT-SIG data.
  5907. * Otherwise, this field is invalid.
  5908. * Refer to the the 802.11 protocol for the definition of the
  5909. * HT-SIG and VHT-SIG-A1 fields
  5910. * - VHT_SIG_A2
  5911. * Bits 23:0
  5912. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  5913. * from the rx PPDU
  5914. * Value:
  5915. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5916. * VHT-SIG-A2 data.
  5917. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5918. * last 24 bits of the HT-SIG data.
  5919. * Otherwise, this field is invalid.
  5920. * Refer to the the 802.11 protocol for the definition of the
  5921. * HT-SIG and VHT-SIG-A2 fields
  5922. * - PREAMBLE_TYPE
  5923. * Bits 31:24
  5924. * Purpose: indicate the PHY format of the received burst
  5925. * Value:
  5926. * 0x4: Legacy (OFDM/CCK)
  5927. * 0x8: HT
  5928. * 0x9: HT with TxBF
  5929. * 0xC: VHT
  5930. * 0xD: VHT with TxBF
  5931. * - SERVICE
  5932. * Bits 31:24
  5933. * Purpose: TBD
  5934. * Value: TBD
  5935. *
  5936. * Rx MSDU descriptor fields:
  5937. * - FW_RX_DESC_BYTES
  5938. * Bits 15:0
  5939. * Purpose: Indicate how many bytes in the Rx indication are used for
  5940. * FW Rx descriptors
  5941. *
  5942. * Payload fields:
  5943. * - MPDU_COUNT
  5944. * Bits 7:0
  5945. * Purpose: Indicate how many sequential MPDUs share the same status.
  5946. * All MPDUs within the indicated list are from the same RA-TA-TID.
  5947. * - MPDU_STATUS
  5948. * Bits 15:8
  5949. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  5950. * received successfully.
  5951. * Value:
  5952. * 0x1: success
  5953. * 0x2: FCS error
  5954. * 0x3: duplicate error
  5955. * 0x4: replay error
  5956. * 0x5: invalid peer
  5957. */
  5958. /* header fields */
  5959. #define HTT_RX_IND_EXT_TID_M 0x1f00
  5960. #define HTT_RX_IND_EXT_TID_S 8
  5961. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  5962. #define HTT_RX_IND_FLUSH_VALID_S 13
  5963. #define HTT_RX_IND_REL_VALID_M 0x4000
  5964. #define HTT_RX_IND_REL_VALID_S 14
  5965. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  5966. #define HTT_RX_IND_PEER_ID_S 16
  5967. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  5968. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  5969. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  5970. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  5971. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  5972. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  5973. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  5974. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  5975. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  5976. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  5977. /* rx PPDU descriptor fields */
  5978. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  5979. #define HTT_RX_IND_RSSI_CMB_S 0
  5980. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  5981. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  5982. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  5983. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  5984. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  5985. #define HTT_RX_IND_PHY_ERR_S 24
  5986. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  5987. #define HTT_RX_IND_LEGACY_RATE_S 25
  5988. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  5989. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  5990. #define HTT_RX_IND_END_VALID_M 0x40000000
  5991. #define HTT_RX_IND_END_VALID_S 30
  5992. #define HTT_RX_IND_START_VALID_M 0x80000000
  5993. #define HTT_RX_IND_START_VALID_S 31
  5994. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  5995. #define HTT_RX_IND_RSSI_PRI20_S 0
  5996. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  5997. #define HTT_RX_IND_RSSI_EXT20_S 8
  5998. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  5999. #define HTT_RX_IND_RSSI_EXT40_S 16
  6000. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  6001. #define HTT_RX_IND_RSSI_EXT80_S 24
  6002. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  6003. #define HTT_RX_IND_VHT_SIG_A1_S 0
  6004. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  6005. #define HTT_RX_IND_VHT_SIG_A2_S 0
  6006. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  6007. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  6008. #define HTT_RX_IND_SERVICE_M 0xff000000
  6009. #define HTT_RX_IND_SERVICE_S 24
  6010. /* rx MSDU descriptor fields */
  6011. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  6012. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  6013. /* payload fields */
  6014. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  6015. #define HTT_RX_IND_MPDU_COUNT_S 0
  6016. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  6017. #define HTT_RX_IND_MPDU_STATUS_S 8
  6018. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  6019. do { \
  6020. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  6021. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  6022. } while (0)
  6023. #define HTT_RX_IND_EXT_TID_GET(word) \
  6024. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  6025. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  6026. do { \
  6027. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  6028. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  6029. } while (0)
  6030. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  6031. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  6032. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  6033. do { \
  6034. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  6035. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  6036. } while (0)
  6037. #define HTT_RX_IND_REL_VALID_GET(word) \
  6038. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  6039. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  6040. do { \
  6041. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  6042. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  6043. } while (0)
  6044. #define HTT_RX_IND_PEER_ID_GET(word) \
  6045. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  6046. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  6047. do { \
  6048. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  6049. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  6050. } while (0)
  6051. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  6052. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  6053. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  6054. do { \
  6055. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  6056. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  6057. } while (0)
  6058. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  6059. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  6060. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  6061. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  6062. do { \
  6063. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  6064. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  6065. } while (0)
  6066. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  6067. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  6068. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  6069. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  6070. do { \
  6071. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  6072. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  6073. } while (0)
  6074. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  6075. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  6076. HTT_RX_IND_REL_SEQ_NUM_START_S)
  6077. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  6078. do { \
  6079. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  6080. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  6081. } while (0)
  6082. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  6083. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  6084. HTT_RX_IND_REL_SEQ_NUM_END_S)
  6085. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  6086. do { \
  6087. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  6088. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  6089. } while (0)
  6090. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  6091. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  6092. HTT_RX_IND_NUM_MPDU_RANGES_S)
  6093. /* FW rx PPDU descriptor fields */
  6094. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  6095. do { \
  6096. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  6097. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  6098. } while (0)
  6099. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  6100. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  6101. HTT_RX_IND_RSSI_CMB_S)
  6102. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  6103. do { \
  6104. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  6105. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  6106. } while (0)
  6107. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  6108. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  6109. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  6110. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  6111. do { \
  6112. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  6113. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  6114. } while (0)
  6115. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  6116. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  6117. HTT_RX_IND_PHY_ERR_CODE_S)
  6118. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  6119. do { \
  6120. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  6121. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  6122. } while (0)
  6123. #define HTT_RX_IND_PHY_ERR_GET(word) \
  6124. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  6125. HTT_RX_IND_PHY_ERR_S)
  6126. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  6127. do { \
  6128. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  6129. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  6130. } while (0)
  6131. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  6132. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  6133. HTT_RX_IND_LEGACY_RATE_S)
  6134. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  6135. do { \
  6136. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  6137. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  6138. } while (0)
  6139. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  6140. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  6141. HTT_RX_IND_LEGACY_RATE_SEL_S)
  6142. #define HTT_RX_IND_END_VALID_SET(word, value) \
  6143. do { \
  6144. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  6145. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  6146. } while (0)
  6147. #define HTT_RX_IND_END_VALID_GET(word) \
  6148. (((word) & HTT_RX_IND_END_VALID_M) >> \
  6149. HTT_RX_IND_END_VALID_S)
  6150. #define HTT_RX_IND_START_VALID_SET(word, value) \
  6151. do { \
  6152. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  6153. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  6154. } while (0)
  6155. #define HTT_RX_IND_START_VALID_GET(word) \
  6156. (((word) & HTT_RX_IND_START_VALID_M) >> \
  6157. HTT_RX_IND_START_VALID_S)
  6158. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  6159. do { \
  6160. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  6161. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  6162. } while (0)
  6163. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  6164. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  6165. HTT_RX_IND_RSSI_PRI20_S)
  6166. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  6167. do { \
  6168. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  6169. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  6170. } while (0)
  6171. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  6172. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  6173. HTT_RX_IND_RSSI_EXT20_S)
  6174. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  6175. do { \
  6176. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  6177. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  6178. } while (0)
  6179. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  6180. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  6181. HTT_RX_IND_RSSI_EXT40_S)
  6182. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  6183. do { \
  6184. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  6185. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  6186. } while (0)
  6187. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  6188. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  6189. HTT_RX_IND_RSSI_EXT80_S)
  6190. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  6191. do { \
  6192. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  6193. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  6194. } while (0)
  6195. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  6196. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  6197. HTT_RX_IND_VHT_SIG_A1_S)
  6198. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  6199. do { \
  6200. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  6201. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  6202. } while (0)
  6203. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  6204. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  6205. HTT_RX_IND_VHT_SIG_A2_S)
  6206. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  6207. do { \
  6208. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  6209. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  6210. } while (0)
  6211. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  6212. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  6213. HTT_RX_IND_PREAMBLE_TYPE_S)
  6214. #define HTT_RX_IND_SERVICE_SET(word, value) \
  6215. do { \
  6216. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  6217. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  6218. } while (0)
  6219. #define HTT_RX_IND_SERVICE_GET(word) \
  6220. (((word) & HTT_RX_IND_SERVICE_M) >> \
  6221. HTT_RX_IND_SERVICE_S)
  6222. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  6223. do { \
  6224. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  6225. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  6226. } while (0)
  6227. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  6228. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  6229. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  6230. do { \
  6231. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  6232. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  6233. } while (0)
  6234. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  6235. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  6236. #define HTT_RX_IND_HL_BYTES \
  6237. (HTT_RX_IND_HDR_BYTES + \
  6238. 4 /* single FW rx MSDU descriptor */ + \
  6239. 4 /* single MPDU range information element */)
  6240. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  6241. /* Could we use one macro entry? */
  6242. #define HTT_WORD_SET(word, field, value) \
  6243. do { \
  6244. HTT_CHECK_SET_VAL(field, value); \
  6245. (word) |= ((value) << field ## _S); \
  6246. } while (0)
  6247. #define HTT_WORD_GET(word, field) \
  6248. (((word) & field ## _M) >> field ## _S)
  6249. PREPACK struct hl_htt_rx_ind_base {
  6250. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  6251. } POSTPACK;
  6252. /*
  6253. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  6254. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  6255. * HL host needed info. The field is just after the msdu fw rx desc.
  6256. */
  6257. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  6258. struct htt_rx_ind_hl_rx_desc_t {
  6259. A_UINT8 ver;
  6260. A_UINT8 len;
  6261. struct {
  6262. A_UINT8
  6263. first_msdu: 1,
  6264. last_msdu: 1,
  6265. c3_failed: 1,
  6266. c4_failed: 1,
  6267. ipv6: 1,
  6268. tcp: 1,
  6269. udp: 1,
  6270. reserved: 1;
  6271. } flags;
  6272. /* sa_ant_matrix
  6273. * For cases where a single rx chain has options to be connected to
  6274. * different rx antennas, show which rx antennas were in use during
  6275. * receipt of a given PPDU.
  6276. * This sa_ant_matrix provides a bitmask of the antennas used while
  6277. * receiving this frame.
  6278. */
  6279. A_UINT8 sa_ant_matrix;
  6280. };
  6281. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  6282. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6283. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  6284. #define HTT_RX_IND_HL_RX_DESC_VER 0
  6285. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  6286. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6287. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  6288. #define HTT_RX_IND_HL_FLAG_OFFSET \
  6289. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6290. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  6291. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  6292. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  6293. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  6294. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  6295. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  6296. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  6297. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  6298. /* This structure is used in HL, the basic descriptor information
  6299. * used by host. the structure is translated by FW from HW desc
  6300. * or generated by FW. But in HL monitor mode, the host would use
  6301. * the same structure with LL.
  6302. */
  6303. PREPACK struct hl_htt_rx_desc_base {
  6304. A_UINT32
  6305. seq_num:12,
  6306. encrypted:1,
  6307. chan_info_present:1,
  6308. resv0:2,
  6309. mcast_bcast:1,
  6310. fragment:1,
  6311. key_id_oct:8,
  6312. resv1:6;
  6313. A_UINT32
  6314. pn_31_0;
  6315. union {
  6316. struct {
  6317. A_UINT16 pn_47_32;
  6318. A_UINT16 pn_63_48;
  6319. } pn16;
  6320. A_UINT32 pn_63_32;
  6321. } u0;
  6322. A_UINT32
  6323. pn_95_64;
  6324. A_UINT32
  6325. pn_127_96;
  6326. } POSTPACK;
  6327. /*
  6328. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  6329. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  6330. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  6331. * Please see htt_chan_change_t for description of the fields.
  6332. */
  6333. PREPACK struct htt_chan_info_t
  6334. {
  6335. A_UINT32 primary_chan_center_freq_mhz: 16,
  6336. contig_chan1_center_freq_mhz: 16;
  6337. A_UINT32 contig_chan2_center_freq_mhz: 16,
  6338. phy_mode: 8,
  6339. reserved: 8;
  6340. } POSTPACK;
  6341. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  6342. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  6343. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  6344. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  6345. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  6346. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  6347. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  6348. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  6349. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  6350. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  6351. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  6352. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  6353. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  6354. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  6355. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  6356. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  6357. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  6358. /* Channel information */
  6359. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  6360. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  6361. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  6362. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  6363. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  6364. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  6365. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  6366. #define HTT_CHAN_INFO_PHY_MODE_S 16
  6367. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  6368. do { \
  6369. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  6370. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  6371. } while (0)
  6372. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  6373. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  6374. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  6375. do { \
  6376. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  6377. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  6378. } while (0)
  6379. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  6380. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  6381. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  6382. do { \
  6383. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  6384. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  6385. } while (0)
  6386. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  6387. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  6388. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  6389. do { \
  6390. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  6391. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  6392. } while (0)
  6393. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  6394. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  6395. /*
  6396. * @brief target -> host rx reorder flush message definition
  6397. *
  6398. * @details
  6399. * The following field definitions describe the format of the rx flush
  6400. * message sent from the target to the host.
  6401. * The message consists of a 4-octet header, followed by one or more
  6402. * 4-octet payload information elements.
  6403. *
  6404. * |31 24|23 8|7 0|
  6405. * |--------------------------------------------------------------|
  6406. * | TID | peer ID | msg type |
  6407. * |--------------------------------------------------------------|
  6408. * | seq num end | seq num start | MPDU status | reserved |
  6409. * |--------------------------------------------------------------|
  6410. * First DWORD:
  6411. * - MSG_TYPE
  6412. * Bits 7:0
  6413. * Purpose: identifies this as an rx flush message
  6414. * Value: 0x2
  6415. * - PEER_ID
  6416. * Bits 23:8 (only bits 18:8 actually used)
  6417. * Purpose: identify which peer's rx data is being flushed
  6418. * Value: (rx) peer ID
  6419. * - TID
  6420. * Bits 31:24 (only bits 27:24 actually used)
  6421. * Purpose: Specifies which traffic identifier's rx data is being flushed
  6422. * Value: traffic identifier
  6423. * Second DWORD:
  6424. * - MPDU_STATUS
  6425. * Bits 15:8
  6426. * Purpose:
  6427. * Indicate whether the flushed MPDUs should be discarded or processed.
  6428. * Value:
  6429. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  6430. * stages of rx processing
  6431. * other: discard the MPDUs
  6432. * It is anticipated that flush messages will always have
  6433. * MPDU status == 1, but the status flag is included for
  6434. * flexibility.
  6435. * - SEQ_NUM_START
  6436. * Bits 23:16
  6437. * Purpose:
  6438. * Indicate the start of a series of consecutive MPDUs being flushed.
  6439. * Not all MPDUs within this range are necessarily valid - the host
  6440. * must check each sequence number within this range to see if the
  6441. * corresponding MPDU is actually present.
  6442. * Value:
  6443. * The sequence number for the first MPDU in the sequence.
  6444. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6445. * - SEQ_NUM_END
  6446. * Bits 30:24
  6447. * Purpose:
  6448. * Indicate the end of a series of consecutive MPDUs being flushed.
  6449. * Value:
  6450. * The sequence number one larger than the sequence number of the
  6451. * last MPDU being flushed.
  6452. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6453. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  6454. * are to be released for further rx processing.
  6455. * Not all MPDUs within this range are necessarily valid - the host
  6456. * must check each sequence number within this range to see if the
  6457. * corresponding MPDU is actually present.
  6458. */
  6459. /* first DWORD */
  6460. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  6461. #define HTT_RX_FLUSH_PEER_ID_S 8
  6462. #define HTT_RX_FLUSH_TID_M 0xff000000
  6463. #define HTT_RX_FLUSH_TID_S 24
  6464. /* second DWORD */
  6465. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  6466. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  6467. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  6468. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  6469. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  6470. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  6471. #define HTT_RX_FLUSH_BYTES 8
  6472. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  6473. do { \
  6474. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  6475. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  6476. } while (0)
  6477. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  6478. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  6479. #define HTT_RX_FLUSH_TID_SET(word, value) \
  6480. do { \
  6481. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  6482. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  6483. } while (0)
  6484. #define HTT_RX_FLUSH_TID_GET(word) \
  6485. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  6486. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  6487. do { \
  6488. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  6489. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  6490. } while (0)
  6491. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  6492. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  6493. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  6494. do { \
  6495. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  6496. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  6497. } while (0)
  6498. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  6499. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  6500. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  6501. do { \
  6502. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  6503. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  6504. } while (0)
  6505. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  6506. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  6507. /*
  6508. * @brief target -> host rx pn check indication message
  6509. *
  6510. * @details
  6511. * The following field definitions describe the format of the Rx PN check
  6512. * indication message sent from the target to the host.
  6513. * The message consists of a 4-octet header, followed by the start and
  6514. * end sequence numbers to be released, followed by the PN IEs. Each PN
  6515. * IE is one octet containing the sequence number that failed the PN
  6516. * check.
  6517. *
  6518. * |31 24|23 8|7 0|
  6519. * |--------------------------------------------------------------|
  6520. * | TID | peer ID | msg type |
  6521. * |--------------------------------------------------------------|
  6522. * | Reserved | PN IE count | seq num end | seq num start|
  6523. * |--------------------------------------------------------------|
  6524. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  6525. * |--------------------------------------------------------------|
  6526. * First DWORD:
  6527. * - MSG_TYPE
  6528. * Bits 7:0
  6529. * Purpose: Identifies this as an rx pn check indication message
  6530. * Value: 0x2
  6531. * - PEER_ID
  6532. * Bits 23:8 (only bits 18:8 actually used)
  6533. * Purpose: identify which peer
  6534. * Value: (rx) peer ID
  6535. * - TID
  6536. * Bits 31:24 (only bits 27:24 actually used)
  6537. * Purpose: identify traffic identifier
  6538. * Value: traffic identifier
  6539. * Second DWORD:
  6540. * - SEQ_NUM_START
  6541. * Bits 7:0
  6542. * Purpose:
  6543. * Indicates the starting sequence number of the MPDU in this
  6544. * series of MPDUs that went though PN check.
  6545. * Value:
  6546. * The sequence number for the first MPDU in the sequence.
  6547. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6548. * - SEQ_NUM_END
  6549. * Bits 15:8
  6550. * Purpose:
  6551. * Indicates the ending sequence number of the MPDU in this
  6552. * series of MPDUs that went though PN check.
  6553. * Value:
  6554. * The sequence number one larger then the sequence number of the last
  6555. * MPDU being flushed.
  6556. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6557. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  6558. * for invalid PN numbers and are ready to be released for further processing.
  6559. * Not all MPDUs within this range are necessarily valid - the host
  6560. * must check each sequence number within this range to see if the
  6561. * corresponding MPDU is actually present.
  6562. * - PN_IE_COUNT
  6563. * Bits 23:16
  6564. * Purpose:
  6565. * Used to determine the variable number of PN information elements in this
  6566. * message
  6567. *
  6568. * PN information elements:
  6569. * - PN_IE_x-
  6570. * Purpose:
  6571. * Each PN information element contains the sequence number of the MPDU that
  6572. * has failed the target PN check.
  6573. * Value:
  6574. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  6575. * that failed the PN check.
  6576. */
  6577. /* first DWORD */
  6578. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  6579. #define HTT_RX_PN_IND_PEER_ID_S 8
  6580. #define HTT_RX_PN_IND_TID_M 0xff000000
  6581. #define HTT_RX_PN_IND_TID_S 24
  6582. /* second DWORD */
  6583. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  6584. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  6585. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  6586. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  6587. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  6588. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  6589. #define HTT_RX_PN_IND_BYTES 8
  6590. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  6591. do { \
  6592. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  6593. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  6594. } while (0)
  6595. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  6596. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  6597. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  6598. do { \
  6599. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  6600. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  6601. } while (0)
  6602. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  6603. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  6604. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  6605. do { \
  6606. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  6607. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  6608. } while (0)
  6609. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  6610. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  6611. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  6612. do { \
  6613. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  6614. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  6615. } while (0)
  6616. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  6617. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  6618. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  6619. do { \
  6620. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  6621. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  6622. } while (0)
  6623. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  6624. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  6625. /*
  6626. * @brief target -> host rx offload deliver message for LL system
  6627. *
  6628. * @details
  6629. * In a low latency system this message is sent whenever the offload
  6630. * manager flushes out the packets it has coalesced in its coalescing buffer.
  6631. * The DMA of the actual packets into host memory is done before sending out
  6632. * this message. This message indicates only how many MSDUs to reap. The
  6633. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  6634. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  6635. * DMA'd by the MAC directly into host memory these packets do not contain
  6636. * the MAC descriptors in the header portion of the packet. Instead they contain
  6637. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  6638. * message, the packets are delivered directly to the NW stack without going
  6639. * through the regular reorder buffering and PN checking path since it has
  6640. * already been done in target.
  6641. *
  6642. * |31 24|23 16|15 8|7 0|
  6643. * |-----------------------------------------------------------------------|
  6644. * | Total MSDU count | reserved | msg type |
  6645. * |-----------------------------------------------------------------------|
  6646. *
  6647. * @brief target -> host rx offload deliver message for HL system
  6648. *
  6649. * @details
  6650. * In a high latency system this message is sent whenever the offload manager
  6651. * flushes out the packets it has coalesced in its coalescing buffer. The
  6652. * actual packets are also carried along with this message. When the host
  6653. * receives this message, it is expected to deliver these packets to the NW
  6654. * stack directly instead of routing them through the reorder buffering and
  6655. * PN checking path since it has already been done in target.
  6656. *
  6657. * |31 24|23 16|15 8|7 0|
  6658. * |-----------------------------------------------------------------------|
  6659. * | Total MSDU count | reserved | msg type |
  6660. * |-----------------------------------------------------------------------|
  6661. * | peer ID | MSDU length |
  6662. * |-----------------------------------------------------------------------|
  6663. * | MSDU payload | FW Desc | tid | vdev ID |
  6664. * |-----------------------------------------------------------------------|
  6665. * | MSDU payload contd. |
  6666. * |-----------------------------------------------------------------------|
  6667. * | peer ID | MSDU length |
  6668. * |-----------------------------------------------------------------------|
  6669. * | MSDU payload | FW Desc | tid | vdev ID |
  6670. * |-----------------------------------------------------------------------|
  6671. * | MSDU payload contd. |
  6672. * |-----------------------------------------------------------------------|
  6673. *
  6674. */
  6675. /* first DWORD */
  6676. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  6677. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  6678. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  6679. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  6680. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  6681. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  6682. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  6683. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  6684. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  6685. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  6686. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  6687. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  6688. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  6689. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  6690. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  6691. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  6692. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  6693. do { \
  6694. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  6695. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  6696. } while (0)
  6697. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  6698. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  6699. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  6700. do { \
  6701. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  6702. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  6703. } while (0)
  6704. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  6705. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  6706. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  6707. do { \
  6708. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  6709. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  6710. } while (0)
  6711. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  6712. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  6713. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  6714. do { \
  6715. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  6716. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  6717. } while (0)
  6718. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  6719. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  6720. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  6721. do { \
  6722. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  6723. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  6724. } while (0)
  6725. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  6726. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  6727. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  6728. do { \
  6729. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  6730. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  6731. } while (0)
  6732. /**
  6733. * @brief target -> host rx peer map/unmap message definition
  6734. *
  6735. * @details
  6736. * The following diagram shows the format of the rx peer map message sent
  6737. * from the target to the host. This layout assumes the target operates
  6738. * as little-endian.
  6739. *
  6740. * This message always contains a SW peer ID. The main purpose of the
  6741. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6742. * with, so that the host can use that peer ID to determine which peer
  6743. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6744. * other purposes, such as identifying during tx completions which peer
  6745. * the tx frames in question were transmitted to.
  6746. *
  6747. * In certain generations of chips, the peer map message also contains
  6748. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  6749. * to identify which peer the frame needs to be forwarded to (i.e. the
  6750. * peer assocated with the Destination MAC Address within the packet),
  6751. * and particularly which vdev needs to transmit the frame (for cases
  6752. * of inter-vdev rx --> tx forwarding).
  6753. * This DA-based peer ID that is provided for certain rx frames
  6754. * (the rx frames that need to be re-transmitted as tx frames)
  6755. * is the ID that the HW uses for referring to the peer in question,
  6756. * rather than the peer ID that the SW+FW use to refer to the peer.
  6757. *
  6758. *
  6759. * |31 24|23 16|15 8|7 0|
  6760. * |-----------------------------------------------------------------------|
  6761. * | SW peer ID | VDEV ID | msg type |
  6762. * |-----------------------------------------------------------------------|
  6763. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6764. * |-----------------------------------------------------------------------|
  6765. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6766. * |-----------------------------------------------------------------------|
  6767. *
  6768. *
  6769. * The following diagram shows the format of the rx peer unmap message sent
  6770. * from the target to the host.
  6771. *
  6772. * |31 24|23 16|15 8|7 0|
  6773. * |-----------------------------------------------------------------------|
  6774. * | SW peer ID | VDEV ID | msg type |
  6775. * |-----------------------------------------------------------------------|
  6776. *
  6777. * The following field definitions describe the format of the rx peer map
  6778. * and peer unmap messages sent from the target to the host.
  6779. * - MSG_TYPE
  6780. * Bits 7:0
  6781. * Purpose: identifies this as an rx peer map or peer unmap message
  6782. * Value: peer map -> 0x3, peer unmap -> 0x4
  6783. * - VDEV_ID
  6784. * Bits 15:8
  6785. * Purpose: Indicates which virtual device the peer is associated
  6786. * with.
  6787. * Value: vdev ID (used in the host to look up the vdev object)
  6788. * - PEER_ID (a.k.a. SW_PEER_ID)
  6789. * Bits 31:16
  6790. * Purpose: The peer ID (index) that WAL is allocating (map) or
  6791. * freeing (unmap)
  6792. * Value: (rx) peer ID
  6793. * - MAC_ADDR_L32 (peer map only)
  6794. * Bits 31:0
  6795. * Purpose: Identifies which peer node the peer ID is for.
  6796. * Value: lower 4 bytes of peer node's MAC address
  6797. * - MAC_ADDR_U16 (peer map only)
  6798. * Bits 15:0
  6799. * Purpose: Identifies which peer node the peer ID is for.
  6800. * Value: upper 2 bytes of peer node's MAC address
  6801. * - HW_PEER_ID
  6802. * Bits 31:16
  6803. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6804. * address, so for rx frames marked for rx --> tx forwarding, the
  6805. * host can determine from the HW peer ID provided as meta-data with
  6806. * the rx frame which peer the frame is supposed to be forwarded to.
  6807. * Value: ID used by the MAC HW to identify the peer
  6808. */
  6809. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  6810. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  6811. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  6812. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  6813. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  6814. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  6815. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  6816. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  6817. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  6818. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  6819. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  6820. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  6821. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  6822. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  6823. do { \
  6824. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  6825. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  6826. } while (0)
  6827. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  6828. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  6829. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  6830. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  6831. do { \
  6832. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  6833. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  6834. } while (0)
  6835. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  6836. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  6837. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  6838. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  6839. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  6840. do { \
  6841. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  6842. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  6843. } while (0)
  6844. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  6845. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  6846. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  6847. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  6848. #define HTT_RX_PEER_MAP_BYTES 12
  6849. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  6850. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  6851. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  6852. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  6853. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  6854. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  6855. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  6856. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  6857. #define HTT_RX_PEER_UNMAP_BYTES 4
  6858. /**
  6859. * @brief target -> host rx peer map V2 message definition
  6860. *
  6861. * @details
  6862. * The following diagram shows the format of the rx peer map v2 message sent
  6863. * from the target to the host. This layout assumes the target operates
  6864. * as little-endian.
  6865. *
  6866. * This message always contains a SW peer ID. The main purpose of the
  6867. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6868. * with, so that the host can use that peer ID to determine which peer
  6869. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6870. * other purposes, such as identifying during tx completions which peer
  6871. * the tx frames in question were transmitted to.
  6872. *
  6873. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  6874. * is used during rx --> tx frame forwarding to identify which peer the
  6875. * frame needs to be forwarded to (i.e. the peer assocated with the
  6876. * Destination MAC Address within the packet), and particularly which vdev
  6877. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  6878. * This DA-based peer ID that is provided for certain rx frames
  6879. * (the rx frames that need to be re-transmitted as tx frames)
  6880. * is the ID that the HW uses for referring to the peer in question,
  6881. * rather than the peer ID that the SW+FW use to refer to the peer.
  6882. *
  6883. *
  6884. * |31 24|23 16|15 8|7 0|
  6885. * |-----------------------------------------------------------------------|
  6886. * | SW peer ID | VDEV ID | msg type |
  6887. * |-----------------------------------------------------------------------|
  6888. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6889. * |-----------------------------------------------------------------------|
  6890. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6891. * |-----------------------------------------------------------------------|
  6892. * | Reserved_17_31 | Next Hop | AST Hash Value |
  6893. * |-----------------------------------------------------------------------|
  6894. * | Reserved_0 |
  6895. * |-----------------------------------------------------------------------|
  6896. * | Reserved_1 |
  6897. * |-----------------------------------------------------------------------|
  6898. * | Reserved_2 |
  6899. * |-----------------------------------------------------------------------|
  6900. * | Reserved_3 |
  6901. * |-----------------------------------------------------------------------|
  6902. *
  6903. *
  6904. * The following field definitions describe the format of the rx peer map v2
  6905. * messages sent from the target to the host.
  6906. * - MSG_TYPE
  6907. * Bits 7:0
  6908. * Purpose: identifies this as an rx peer map v2 message
  6909. * Value: peer map v2 -> 0x1e
  6910. * - VDEV_ID
  6911. * Bits 15:8
  6912. * Purpose: Indicates which virtual device the peer is associated with.
  6913. * Value: vdev ID (used in the host to look up the vdev object)
  6914. * - SW_PEER_ID
  6915. * Bits 31:16
  6916. * Purpose: The peer ID (index) that WAL is allocating
  6917. * Value: (rx) peer ID
  6918. * - MAC_ADDR_L32
  6919. * Bits 31:0
  6920. * Purpose: Identifies which peer node the peer ID is for.
  6921. * Value: lower 4 bytes of peer node's MAC address
  6922. * - MAC_ADDR_U16
  6923. * Bits 15:0
  6924. * Purpose: Identifies which peer node the peer ID is for.
  6925. * Value: upper 2 bytes of peer node's MAC address
  6926. * - HW_PEER_ID
  6927. * Bits 31:16
  6928. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6929. * address, so for rx frames marked for rx --> tx forwarding, the
  6930. * host can determine from the HW peer ID provided as meta-data with
  6931. * the rx frame which peer the frame is supposed to be forwarded to.
  6932. * Value: ID used by the MAC HW to identify the peer
  6933. * - AST_HASH_VALUE
  6934. * Bits 15:0
  6935. * Purpose: Indicates AST Hash value is required for the TCL AST index
  6936. * override feature.
  6937. * - NEXT_HOP
  6938. * Bit 16
  6939. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  6940. * (Wireless Distribution System).
  6941. */
  6942. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  6943. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  6944. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  6945. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  6946. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  6947. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  6948. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  6949. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  6950. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  6951. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  6952. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  6953. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  6954. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  6955. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  6956. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  6957. do { \
  6958. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  6959. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  6960. } while (0)
  6961. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  6962. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  6963. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  6964. do { \
  6965. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  6966. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  6967. } while (0)
  6968. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  6969. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  6970. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  6971. do { \
  6972. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  6973. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  6974. } while (0)
  6975. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  6976. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  6977. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  6978. do { \
  6979. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  6980. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  6981. } while (0)
  6982. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  6983. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  6984. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  6985. do { \
  6986. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  6987. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  6988. } while (0)
  6989. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  6990. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  6991. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  6992. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  6993. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  6994. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  6995. #define HTT_RX_PEER_MAP_V2_BYTES 32
  6996. /**
  6997. * @brief target -> host rx peer unmap V2 message definition
  6998. *
  6999. *
  7000. * The following diagram shows the format of the rx peer unmap message sent
  7001. * from the target to the host.
  7002. *
  7003. * |31 24|23 16|15 8|7 0|
  7004. * |-----------------------------------------------------------------------|
  7005. * | SW peer ID | VDEV ID | msg type |
  7006. * |-----------------------------------------------------------------------|
  7007. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7008. * |-----------------------------------------------------------------------|
  7009. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  7010. * |-----------------------------------------------------------------------|
  7011. * | Peer Delete Duration |
  7012. * |-----------------------------------------------------------------------|
  7013. * | Reserved_0 |
  7014. * |-----------------------------------------------------------------------|
  7015. * | Reserved_1 |
  7016. * |-----------------------------------------------------------------------|
  7017. * | Reserved_2 |
  7018. * |-----------------------------------------------------------------------|
  7019. *
  7020. *
  7021. * The following field definitions describe the format of the rx peer unmap
  7022. * messages sent from the target to the host.
  7023. * - MSG_TYPE
  7024. * Bits 7:0
  7025. * Purpose: identifies this as an rx peer unmap v2 message
  7026. * Value: peer unmap v2 -> 0x1f
  7027. * - VDEV_ID
  7028. * Bits 15:8
  7029. * Purpose: Indicates which virtual device the peer is associated
  7030. * with.
  7031. * Value: vdev ID (used in the host to look up the vdev object)
  7032. * - SW_PEER_ID
  7033. * Bits 31:16
  7034. * Purpose: The peer ID (index) that WAL is freeing
  7035. * Value: (rx) peer ID
  7036. * - MAC_ADDR_L32
  7037. * Bits 31:0
  7038. * Purpose: Identifies which peer node the peer ID is for.
  7039. * Value: lower 4 bytes of peer node's MAC address
  7040. * - MAC_ADDR_U16
  7041. * Bits 15:0
  7042. * Purpose: Identifies which peer node the peer ID is for.
  7043. * Value: upper 2 bytes of peer node's MAC address
  7044. * - NEXT_HOP
  7045. * Bits 16
  7046. * Purpose: Bit indicates next_hop AST entry used for WDS
  7047. * (Wireless Distribution System).
  7048. * - PEER_DELETE_DURATION
  7049. * Bits 31:0
  7050. * Purpose: Time taken to delete peer, in msec,
  7051. * Used for monitoring / debugging PEER delete response delay
  7052. */
  7053. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  7054. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  7055. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  7056. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  7057. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  7058. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  7059. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  7060. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  7061. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  7062. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  7063. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  7064. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  7065. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  7066. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  7067. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  7068. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  7069. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  7070. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  7071. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  7072. do { \
  7073. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  7074. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  7075. } while (0)
  7076. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  7077. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  7078. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  7079. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  7080. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  7081. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  7082. /**
  7083. * @brief target -> host message specifying security parameters
  7084. *
  7085. * @details
  7086. * The following diagram shows the format of the security specification
  7087. * message sent from the target to the host.
  7088. * This security specification message tells the host whether a PN check is
  7089. * necessary on rx data frames, and if so, how large the PN counter is.
  7090. * This message also tells the host about the security processing to apply
  7091. * to defragmented rx frames - specifically, whether a Message Integrity
  7092. * Check is required, and the Michael key to use.
  7093. *
  7094. * |31 24|23 16|15|14 8|7 0|
  7095. * |-----------------------------------------------------------------------|
  7096. * | peer ID | U| security type | msg type |
  7097. * |-----------------------------------------------------------------------|
  7098. * | Michael Key K0 |
  7099. * |-----------------------------------------------------------------------|
  7100. * | Michael Key K1 |
  7101. * |-----------------------------------------------------------------------|
  7102. * | WAPI RSC Low0 |
  7103. * |-----------------------------------------------------------------------|
  7104. * | WAPI RSC Low1 |
  7105. * |-----------------------------------------------------------------------|
  7106. * | WAPI RSC Hi0 |
  7107. * |-----------------------------------------------------------------------|
  7108. * | WAPI RSC Hi1 |
  7109. * |-----------------------------------------------------------------------|
  7110. *
  7111. * The following field definitions describe the format of the security
  7112. * indication message sent from the target to the host.
  7113. * - MSG_TYPE
  7114. * Bits 7:0
  7115. * Purpose: identifies this as a security specification message
  7116. * Value: 0xb
  7117. * - SEC_TYPE
  7118. * Bits 14:8
  7119. * Purpose: specifies which type of security applies to the peer
  7120. * Value: htt_sec_type enum value
  7121. * - UNICAST
  7122. * Bit 15
  7123. * Purpose: whether this security is applied to unicast or multicast data
  7124. * Value: 1 -> unicast, 0 -> multicast
  7125. * - PEER_ID
  7126. * Bits 31:16
  7127. * Purpose: The ID number for the peer the security specification is for
  7128. * Value: peer ID
  7129. * - MICHAEL_KEY_K0
  7130. * Bits 31:0
  7131. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  7132. * Value: Michael Key K0 (if security type is TKIP)
  7133. * - MICHAEL_KEY_K1
  7134. * Bits 31:0
  7135. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  7136. * Value: Michael Key K1 (if security type is TKIP)
  7137. * - WAPI_RSC_LOW0
  7138. * Bits 31:0
  7139. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  7140. * Value: WAPI RSC Low0 (if security type is WAPI)
  7141. * - WAPI_RSC_LOW1
  7142. * Bits 31:0
  7143. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  7144. * Value: WAPI RSC Low1 (if security type is WAPI)
  7145. * - WAPI_RSC_HI0
  7146. * Bits 31:0
  7147. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  7148. * Value: WAPI RSC Hi0 (if security type is WAPI)
  7149. * - WAPI_RSC_HI1
  7150. * Bits 31:0
  7151. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  7152. * Value: WAPI RSC Hi1 (if security type is WAPI)
  7153. */
  7154. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  7155. #define HTT_SEC_IND_SEC_TYPE_S 8
  7156. #define HTT_SEC_IND_UNICAST_M 0x00008000
  7157. #define HTT_SEC_IND_UNICAST_S 15
  7158. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  7159. #define HTT_SEC_IND_PEER_ID_S 16
  7160. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  7161. do { \
  7162. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  7163. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  7164. } while (0)
  7165. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  7166. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  7167. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  7168. do { \
  7169. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  7170. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  7171. } while (0)
  7172. #define HTT_SEC_IND_UNICAST_GET(word) \
  7173. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  7174. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  7175. do { \
  7176. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  7177. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  7178. } while (0)
  7179. #define HTT_SEC_IND_PEER_ID_GET(word) \
  7180. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  7181. #define HTT_SEC_IND_BYTES 28
  7182. /**
  7183. * @brief target -> host rx ADDBA / DELBA message definitions
  7184. *
  7185. * @details
  7186. * The following diagram shows the format of the rx ADDBA message sent
  7187. * from the target to the host:
  7188. *
  7189. * |31 20|19 16|15 8|7 0|
  7190. * |---------------------------------------------------------------------|
  7191. * | peer ID | TID | window size | msg type |
  7192. * |---------------------------------------------------------------------|
  7193. *
  7194. * The following diagram shows the format of the rx DELBA message sent
  7195. * from the target to the host:
  7196. *
  7197. * |31 20|19 16|15 10|9 8|7 0|
  7198. * |---------------------------------------------------------------------|
  7199. * | peer ID | TID | reserved | IR| msg type |
  7200. * |---------------------------------------------------------------------|
  7201. *
  7202. * The following field definitions describe the format of the rx ADDBA
  7203. * and DELBA messages sent from the target to the host.
  7204. * - MSG_TYPE
  7205. * Bits 7:0
  7206. * Purpose: identifies this as an rx ADDBA or DELBA message
  7207. * Value: ADDBA -> 0x5, DELBA -> 0x6
  7208. * - IR (initiator / recipient)
  7209. * Bits 9:8 (DELBA only)
  7210. * Purpose: specify whether the DELBA handshake was initiated by the
  7211. * local STA/AP, or by the peer STA/AP
  7212. * Value:
  7213. * 0 - unspecified
  7214. * 1 - initiator (a.k.a. originator)
  7215. * 2 - recipient (a.k.a. responder)
  7216. * 3 - unused / reserved
  7217. * - WIN_SIZE
  7218. * Bits 15:8 (ADDBA only)
  7219. * Purpose: Specifies the length of the block ack window (max = 64).
  7220. * Value:
  7221. * block ack window length specified by the received ADDBA
  7222. * management message.
  7223. * - TID
  7224. * Bits 19:16
  7225. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  7226. * Value:
  7227. * TID specified by the received ADDBA or DELBA management message.
  7228. * - PEER_ID
  7229. * Bits 31:20
  7230. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  7231. * Value:
  7232. * ID (hash value) used by the host for fast, direct lookup of
  7233. * host SW peer info, including rx reorder states.
  7234. */
  7235. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  7236. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  7237. #define HTT_RX_ADDBA_TID_M 0xf0000
  7238. #define HTT_RX_ADDBA_TID_S 16
  7239. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  7240. #define HTT_RX_ADDBA_PEER_ID_S 20
  7241. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  7242. do { \
  7243. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  7244. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  7245. } while (0)
  7246. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  7247. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  7248. #define HTT_RX_ADDBA_TID_SET(word, value) \
  7249. do { \
  7250. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  7251. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  7252. } while (0)
  7253. #define HTT_RX_ADDBA_TID_GET(word) \
  7254. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  7255. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  7256. do { \
  7257. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  7258. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  7259. } while (0)
  7260. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  7261. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  7262. #define HTT_RX_ADDBA_BYTES 4
  7263. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  7264. #define HTT_RX_DELBA_INITIATOR_S 8
  7265. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  7266. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  7267. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  7268. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  7269. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  7270. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  7271. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  7272. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  7273. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  7274. do { \
  7275. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  7276. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  7277. } while (0)
  7278. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  7279. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  7280. #define HTT_RX_DELBA_BYTES 4
  7281. /**
  7282. * @brief tx queue group information element definition
  7283. *
  7284. * @details
  7285. * The following diagram shows the format of the tx queue group
  7286. * information element, which can be included in target --> host
  7287. * messages to specify the number of tx "credits" (tx descriptors
  7288. * for LL, or tx buffers for HL) available to a particular group
  7289. * of host-side tx queues, and which host-side tx queues belong to
  7290. * the group.
  7291. *
  7292. * |31|30 24|23 16|15|14|13 0|
  7293. * |------------------------------------------------------------------------|
  7294. * | X| reserved | tx queue grp ID | A| S| credit count |
  7295. * |------------------------------------------------------------------------|
  7296. * | vdev ID mask | AC mask |
  7297. * |------------------------------------------------------------------------|
  7298. *
  7299. * The following definitions describe the fields within the tx queue group
  7300. * information element:
  7301. * - credit_count
  7302. * Bits 13:1
  7303. * Purpose: specify how many tx credits are available to the tx queue group
  7304. * Value: An absolute or relative, positive or negative credit value
  7305. * The 'A' bit specifies whether the value is absolute or relative.
  7306. * The 'S' bit specifies whether the value is positive or negative.
  7307. * A negative value can only be relative, not absolute.
  7308. * An absolute value replaces any prior credit value the host has for
  7309. * the tx queue group in question.
  7310. * A relative value is added to the prior credit value the host has for
  7311. * the tx queue group in question.
  7312. * - sign
  7313. * Bit 14
  7314. * Purpose: specify whether the credit count is positive or negative
  7315. * Value: 0 -> positive, 1 -> negative
  7316. * - absolute
  7317. * Bit 15
  7318. * Purpose: specify whether the credit count is absolute or relative
  7319. * Value: 0 -> relative, 1 -> absolute
  7320. * - txq_group_id
  7321. * Bits 23:16
  7322. * Purpose: indicate which tx queue group's credit and/or membership are
  7323. * being specified
  7324. * Value: 0 to max_tx_queue_groups-1
  7325. * - reserved
  7326. * Bits 30:16
  7327. * Value: 0x0
  7328. * - eXtension
  7329. * Bit 31
  7330. * Purpose: specify whether another tx queue group info element follows
  7331. * Value: 0 -> no more tx queue group information elements
  7332. * 1 -> another tx queue group information element immediately follows
  7333. * - ac_mask
  7334. * Bits 15:0
  7335. * Purpose: specify which Access Categories belong to the tx queue group
  7336. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  7337. * the tx queue group.
  7338. * The AC bit-mask values are obtained by left-shifting by the
  7339. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  7340. * - vdev_id_mask
  7341. * Bits 31:16
  7342. * Purpose: specify which vdev's tx queues belong to the tx queue group
  7343. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  7344. * belong to the tx queue group.
  7345. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  7346. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  7347. */
  7348. PREPACK struct htt_txq_group {
  7349. A_UINT32
  7350. credit_count: 14,
  7351. sign: 1,
  7352. absolute: 1,
  7353. tx_queue_group_id: 8,
  7354. reserved0: 7,
  7355. extension: 1;
  7356. A_UINT32
  7357. ac_mask: 16,
  7358. vdev_id_mask: 16;
  7359. } POSTPACK;
  7360. /* first word */
  7361. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  7362. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  7363. #define HTT_TXQ_GROUP_SIGN_S 14
  7364. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  7365. #define HTT_TXQ_GROUP_ABS_S 15
  7366. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  7367. #define HTT_TXQ_GROUP_ID_S 16
  7368. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  7369. #define HTT_TXQ_GROUP_EXT_S 31
  7370. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  7371. /* second word */
  7372. #define HTT_TXQ_GROUP_AC_MASK_S 0
  7373. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  7374. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  7375. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  7376. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  7377. do { \
  7378. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  7379. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  7380. } while (0)
  7381. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  7382. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  7383. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  7384. do { \
  7385. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  7386. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  7387. } while (0)
  7388. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  7389. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  7390. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  7391. do { \
  7392. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  7393. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  7394. } while (0)
  7395. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  7396. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  7397. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  7398. do { \
  7399. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  7400. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  7401. } while (0)
  7402. #define HTT_TXQ_GROUP_ID_GET(_info) \
  7403. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  7404. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  7405. do { \
  7406. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  7407. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  7408. } while (0)
  7409. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  7410. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  7411. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  7412. do { \
  7413. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  7414. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  7415. } while (0)
  7416. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  7417. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  7418. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  7419. do { \
  7420. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  7421. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  7422. } while (0)
  7423. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  7424. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  7425. /**
  7426. * @brief target -> host TX completion indication message definition
  7427. *
  7428. * @details
  7429. * The following diagram shows the format of the TX completion indication sent
  7430. * from the target to the host
  7431. *
  7432. * |31 28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  7433. * |-------------------------------------------------------------|
  7434. * header: |rsvd |A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  7435. * |-------------------------------------------------------------|
  7436. * payload: | MSDU1 ID | MSDU0 ID |
  7437. * |-------------------------------------------------------------|
  7438. * : MSDU3 ID : MSDU2 ID :
  7439. * |-------------------------------------------------------------|
  7440. * | struct htt_tx_compl_ind_append_retries |
  7441. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7442. * | struct htt_tx_compl_ind_append_tx_tstamp |
  7443. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7444. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  7445. * |-------------------------------------------------------------|
  7446. * : MSDU3 ACK RSSI : MSDU2 ACK RSSI :
  7447. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7448. * Where:
  7449. * A0 = append (a.k.a. append0)
  7450. * A1 = append1
  7451. * TP = MSDU tx power presence
  7452. * A2 = append2
  7453. *
  7454. * The following field definitions describe the format of the TX completion
  7455. * indication sent from the target to the host
  7456. * Header fields:
  7457. * - msg_type
  7458. * Bits 7:0
  7459. * Purpose: identifies this as HTT TX completion indication
  7460. * Value: 0x7
  7461. * - status
  7462. * Bits 10:8
  7463. * Purpose: the TX completion status of payload fragmentations descriptors
  7464. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  7465. * - tid
  7466. * Bits 14:11
  7467. * Purpose: the tid associated with those fragmentation descriptors. It is
  7468. * valid or not, depending on the tid_invalid bit.
  7469. * Value: 0 to 15
  7470. * - tid_invalid
  7471. * Bits 15:15
  7472. * Purpose: this bit indicates whether the tid field is valid or not
  7473. * Value: 0 indicates valid; 1 indicates invalid
  7474. * - num
  7475. * Bits 23:16
  7476. * Purpose: the number of payload in this indication
  7477. * Value: 1 to 255
  7478. * - append (a.k.a. append0)
  7479. * Bits 24:24
  7480. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  7481. * the number of tx retries for one MSDU at the end of this message
  7482. * Value: 0 indicates no appending; 1 indicates appending
  7483. * - append1
  7484. * Bits 25:25
  7485. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  7486. * contains the timestamp info for each TX msdu id in payload.
  7487. * The order of the timestamps matches the order of the MSDU IDs.
  7488. * Note that a big-endian host needs to account for the reordering
  7489. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7490. * conversion) when determining which tx timestamp corresponds to
  7491. * which MSDU ID.
  7492. * Value: 0 indicates no appending; 1 indicates appending
  7493. * - msdu_tx_power_presence
  7494. * Bits 26:26
  7495. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  7496. * for each MSDU referenced by the TX_COMPL_IND message.
  7497. * The tx power is reported in 0.5 dBm units.
  7498. * The order of the per-MSDU tx power reports matches the order
  7499. * of the MSDU IDs.
  7500. * Note that a big-endian host needs to account for the reordering
  7501. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7502. * conversion) when determining which Tx Power corresponds to
  7503. * which MSDU ID.
  7504. * Value: 0 indicates MSDU tx power reports are not appended,
  7505. * 1 indicates MSDU tx power reports are appended
  7506. * - append2
  7507. * Bits 27:27
  7508. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  7509. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  7510. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  7511. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  7512. * for each MSDU, for convenience.
  7513. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  7514. * this append2 bit is set).
  7515. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  7516. * dB above the noise floor.
  7517. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  7518. * 1 indicates MSDU ACK RSSI values are appended.
  7519. * Payload fields:
  7520. * - hmsdu_id
  7521. * Bits 15:0
  7522. * Purpose: this ID is used to track the Tx buffer in host
  7523. * Value: 0 to "size of host MSDU descriptor pool - 1"
  7524. */
  7525. #define HTT_TX_COMPL_IND_STATUS_S 8
  7526. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  7527. #define HTT_TX_COMPL_IND_TID_S 11
  7528. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  7529. #define HTT_TX_COMPL_IND_TID_INV_S 15
  7530. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  7531. #define HTT_TX_COMPL_IND_NUM_S 16
  7532. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  7533. #define HTT_TX_COMPL_IND_APPEND_S 24
  7534. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  7535. #define HTT_TX_COMPL_IND_APPEND1_S 25
  7536. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  7537. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  7538. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  7539. #define HTT_TX_COMPL_IND_APPEND2_S 27
  7540. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  7541. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  7542. do { \
  7543. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  7544. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  7545. } while (0)
  7546. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  7547. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  7548. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  7549. do { \
  7550. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  7551. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  7552. } while (0)
  7553. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  7554. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  7555. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  7556. do { \
  7557. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  7558. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  7559. } while (0)
  7560. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  7561. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  7562. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  7563. do { \
  7564. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  7565. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  7566. } while (0)
  7567. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  7568. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  7569. HTT_TX_COMPL_IND_TID_INV_S)
  7570. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  7571. do { \
  7572. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  7573. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  7574. } while (0)
  7575. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  7576. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  7577. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  7578. do { \
  7579. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  7580. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  7581. } while (0)
  7582. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  7583. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  7584. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  7585. do { \
  7586. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  7587. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  7588. } while (0)
  7589. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  7590. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  7591. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  7592. do { \
  7593. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  7594. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  7595. } while (0)
  7596. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  7597. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  7598. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  7599. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  7600. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  7601. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  7602. #define HTT_TX_COMPL_IND_STAT_OK 0
  7603. /* DISCARD:
  7604. * current meaning:
  7605. * MSDUs were queued for transmission but filtered by HW or SW
  7606. * without any over the air attempts
  7607. * legacy meaning (HL Rome):
  7608. * MSDUs were discarded by the target FW without any over the air
  7609. * attempts due to lack of space
  7610. */
  7611. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  7612. /* NO_ACK:
  7613. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  7614. */
  7615. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  7616. /* POSTPONE:
  7617. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  7618. * be downloaded again later (in the appropriate order), when they are
  7619. * deliverable.
  7620. */
  7621. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  7622. /*
  7623. * The PEER_DEL tx completion status is used for HL cases
  7624. * where the peer the frame is for has been deleted.
  7625. * The host has already discarded its copy of the frame, but
  7626. * it still needs the tx completion to restore its credit.
  7627. */
  7628. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  7629. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  7630. #define HTT_TX_COMPL_IND_STAT_DROP 5
  7631. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  7632. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  7633. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  7634. PREPACK struct htt_tx_compl_ind_base {
  7635. A_UINT32 hdr;
  7636. A_UINT16 payload[1/*or more*/];
  7637. } POSTPACK;
  7638. PREPACK struct htt_tx_compl_ind_append_retries {
  7639. A_UINT16 msdu_id;
  7640. A_UINT8 tx_retries;
  7641. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  7642. 0: this is the last append_retries struct */
  7643. } POSTPACK;
  7644. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  7645. A_UINT32 timestamp[1/*or more*/];
  7646. } POSTPACK;
  7647. /**
  7648. * @brief target -> host rate-control update indication message
  7649. *
  7650. * @details
  7651. * The following diagram shows the format of the RC Update message
  7652. * sent from the target to the host, while processing the tx-completion
  7653. * of a transmitted PPDU.
  7654. *
  7655. * |31 24|23 16|15 8|7 0|
  7656. * |-------------------------------------------------------------|
  7657. * | peer ID | vdev ID | msg_type |
  7658. * |-------------------------------------------------------------|
  7659. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7660. * |-------------------------------------------------------------|
  7661. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  7662. * |-------------------------------------------------------------|
  7663. * | : |
  7664. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7665. * | : |
  7666. * |-------------------------------------------------------------|
  7667. * | : |
  7668. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7669. * | : |
  7670. * |-------------------------------------------------------------|
  7671. * : :
  7672. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7673. *
  7674. */
  7675. typedef struct {
  7676. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  7677. A_UINT32 rate_code_flags;
  7678. A_UINT32 flags; /* Encodes information such as excessive
  7679. retransmission, aggregate, some info
  7680. from .11 frame control,
  7681. STBC, LDPC, (SGI and Tx Chain Mask
  7682. are encoded in ptx_rc->flags field),
  7683. AMPDU truncation (BT/time based etc.),
  7684. RTS/CTS attempt */
  7685. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  7686. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  7687. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  7688. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  7689. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  7690. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  7691. } HTT_RC_TX_DONE_PARAMS;
  7692. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  7693. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  7694. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  7695. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  7696. #define HTT_RC_UPDATE_VDEVID_S 8
  7697. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  7698. #define HTT_RC_UPDATE_PEERID_S 16
  7699. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  7700. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  7701. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  7702. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  7703. do { \
  7704. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  7705. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  7706. } while (0)
  7707. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  7708. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  7709. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  7710. do { \
  7711. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  7712. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  7713. } while (0)
  7714. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  7715. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  7716. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  7717. do { \
  7718. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  7719. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  7720. } while (0)
  7721. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  7722. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  7723. /**
  7724. * @brief target -> host rx fragment indication message definition
  7725. *
  7726. * @details
  7727. * The following field definitions describe the format of the rx fragment
  7728. * indication message sent from the target to the host.
  7729. * The rx fragment indication message shares the format of the
  7730. * rx indication message, but not all fields from the rx indication message
  7731. * are relevant to the rx fragment indication message.
  7732. *
  7733. *
  7734. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  7735. * |-----------+-------------------+---------------------+-------------|
  7736. * | peer ID | |FV| ext TID | msg type |
  7737. * |-------------------------------------------------------------------|
  7738. * | | flush | flush |
  7739. * | | end | start |
  7740. * | | seq num | seq num |
  7741. * |-------------------------------------------------------------------|
  7742. * | reserved | FW rx desc bytes |
  7743. * |-------------------------------------------------------------------|
  7744. * | | FW MSDU Rx |
  7745. * | | desc B0 |
  7746. * |-------------------------------------------------------------------|
  7747. * Header fields:
  7748. * - MSG_TYPE
  7749. * Bits 7:0
  7750. * Purpose: identifies this as an rx fragment indication message
  7751. * Value: 0xa
  7752. * - EXT_TID
  7753. * Bits 12:8
  7754. * Purpose: identify the traffic ID of the rx data, including
  7755. * special "extended" TID values for multicast, broadcast, and
  7756. * non-QoS data frames
  7757. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  7758. * - FLUSH_VALID (FV)
  7759. * Bit 13
  7760. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  7761. * is valid
  7762. * Value:
  7763. * 1 -> flush IE is valid and needs to be processed
  7764. * 0 -> flush IE is not valid and should be ignored
  7765. * - PEER_ID
  7766. * Bits 31:16
  7767. * Purpose: Identify, by ID, which peer sent the rx data
  7768. * Value: ID of the peer who sent the rx data
  7769. * - FLUSH_SEQ_NUM_START
  7770. * Bits 5:0
  7771. * Purpose: Indicate the start of a series of MPDUs to flush
  7772. * Not all MPDUs within this series are necessarily valid - the host
  7773. * must check each sequence number within this range to see if the
  7774. * corresponding MPDU is actually present.
  7775. * This field is only valid if the FV bit is set.
  7776. * Value:
  7777. * The sequence number for the first MPDUs to check to flush.
  7778. * The sequence number is masked by 0x3f.
  7779. * - FLUSH_SEQ_NUM_END
  7780. * Bits 11:6
  7781. * Purpose: Indicate the end of a series of MPDUs to flush
  7782. * Value:
  7783. * The sequence number one larger than the sequence number of the
  7784. * last MPDU to check to flush.
  7785. * The sequence number is masked by 0x3f.
  7786. * Not all MPDUs within this series are necessarily valid - the host
  7787. * must check each sequence number within this range to see if the
  7788. * corresponding MPDU is actually present.
  7789. * This field is only valid if the FV bit is set.
  7790. * Rx descriptor fields:
  7791. * - FW_RX_DESC_BYTES
  7792. * Bits 15:0
  7793. * Purpose: Indicate how many bytes in the Rx indication are used for
  7794. * FW Rx descriptors
  7795. * Value: 1
  7796. */
  7797. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  7798. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  7799. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  7800. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  7801. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  7802. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  7803. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  7804. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  7805. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  7806. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  7807. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  7808. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  7809. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  7810. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  7811. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  7812. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  7813. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  7814. #define HTT_RX_FRAG_IND_BYTES \
  7815. (4 /* msg hdr */ + \
  7816. 4 /* flush spec */ + \
  7817. 4 /* (unused) FW rx desc bytes spec */ + \
  7818. 4 /* FW rx desc */)
  7819. /**
  7820. * @brief target -> host test message definition
  7821. *
  7822. * @details
  7823. * The following field definitions describe the format of the test
  7824. * message sent from the target to the host.
  7825. * The message consists of a 4-octet header, followed by a variable
  7826. * number of 32-bit integer values, followed by a variable number
  7827. * of 8-bit character values.
  7828. *
  7829. * |31 16|15 8|7 0|
  7830. * |-----------------------------------------------------------|
  7831. * | num chars | num ints | msg type |
  7832. * |-----------------------------------------------------------|
  7833. * | int 0 |
  7834. * |-----------------------------------------------------------|
  7835. * | int 1 |
  7836. * |-----------------------------------------------------------|
  7837. * | ... |
  7838. * |-----------------------------------------------------------|
  7839. * | char 3 | char 2 | char 1 | char 0 |
  7840. * |-----------------------------------------------------------|
  7841. * | | | ... | char 4 |
  7842. * |-----------------------------------------------------------|
  7843. * - MSG_TYPE
  7844. * Bits 7:0
  7845. * Purpose: identifies this as a test message
  7846. * Value: HTT_MSG_TYPE_TEST
  7847. * - NUM_INTS
  7848. * Bits 15:8
  7849. * Purpose: indicate how many 32-bit integers follow the message header
  7850. * - NUM_CHARS
  7851. * Bits 31:16
  7852. * Purpose: indicate how many 8-bit charaters follow the series of integers
  7853. */
  7854. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  7855. #define HTT_RX_TEST_NUM_INTS_S 8
  7856. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  7857. #define HTT_RX_TEST_NUM_CHARS_S 16
  7858. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  7859. do { \
  7860. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  7861. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  7862. } while (0)
  7863. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  7864. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  7865. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  7866. do { \
  7867. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  7868. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  7869. } while (0)
  7870. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  7871. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  7872. /**
  7873. * @brief target -> host packet log message
  7874. *
  7875. * @details
  7876. * The following field definitions describe the format of the packet log
  7877. * message sent from the target to the host.
  7878. * The message consists of a 4-octet header,followed by a variable number
  7879. * of 32-bit character values.
  7880. *
  7881. * |31 16|15 12|11 10|9 8|7 0|
  7882. * |------------------------------------------------------------------|
  7883. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  7884. * |------------------------------------------------------------------|
  7885. * | payload |
  7886. * |------------------------------------------------------------------|
  7887. * - MSG_TYPE
  7888. * Bits 7:0
  7889. * Purpose: identifies this as a pktlog message
  7890. * Value: HTT_T2H_MSG_TYPE_PKTLOG
  7891. * - mac_id
  7892. * Bits 9:8
  7893. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  7894. * Value: 0-3
  7895. * - pdev_id
  7896. * Bits 11:10
  7897. * Purpose: pdev_id
  7898. * Value: 0-3
  7899. * 0 (for rings at SOC level),
  7900. * 1/2/3 PDEV -> 0/1/2
  7901. * - payload_size
  7902. * Bits 31:16
  7903. * Purpose: explicitly specify the payload size
  7904. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  7905. */
  7906. PREPACK struct htt_pktlog_msg {
  7907. A_UINT32 header;
  7908. A_UINT32 payload[1/* or more */];
  7909. } POSTPACK;
  7910. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  7911. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  7912. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  7913. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  7914. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  7915. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  7916. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  7917. do { \
  7918. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  7919. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  7920. } while (0)
  7921. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  7922. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  7923. HTT_T2H_PKTLOG_MAC_ID_S)
  7924. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  7925. do { \
  7926. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  7927. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  7928. } while (0)
  7929. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  7930. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  7931. HTT_T2H_PKTLOG_PDEV_ID_S)
  7932. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  7933. do { \
  7934. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  7935. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  7936. } while (0)
  7937. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  7938. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  7939. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  7940. /*
  7941. * Rx reorder statistics
  7942. * NB: all the fields must be defined in 4 octets size.
  7943. */
  7944. struct rx_reorder_stats {
  7945. /* Non QoS MPDUs received */
  7946. A_UINT32 deliver_non_qos;
  7947. /* MPDUs received in-order */
  7948. A_UINT32 deliver_in_order;
  7949. /* Flush due to reorder timer expired */
  7950. A_UINT32 deliver_flush_timeout;
  7951. /* Flush due to move out of window */
  7952. A_UINT32 deliver_flush_oow;
  7953. /* Flush due to DELBA */
  7954. A_UINT32 deliver_flush_delba;
  7955. /* MPDUs dropped due to FCS error */
  7956. A_UINT32 fcs_error;
  7957. /* MPDUs dropped due to monitor mode non-data packet */
  7958. A_UINT32 mgmt_ctrl;
  7959. /* Unicast-data MPDUs dropped due to invalid peer */
  7960. A_UINT32 invalid_peer;
  7961. /* MPDUs dropped due to duplication (non aggregation) */
  7962. A_UINT32 dup_non_aggr;
  7963. /* MPDUs dropped due to processed before */
  7964. A_UINT32 dup_past;
  7965. /* MPDUs dropped due to duplicate in reorder queue */
  7966. A_UINT32 dup_in_reorder;
  7967. /* Reorder timeout happened */
  7968. A_UINT32 reorder_timeout;
  7969. /* invalid bar ssn */
  7970. A_UINT32 invalid_bar_ssn;
  7971. /* reorder reset due to bar ssn */
  7972. A_UINT32 ssn_reset;
  7973. /* Flush due to delete peer */
  7974. A_UINT32 deliver_flush_delpeer;
  7975. /* Flush due to offload*/
  7976. A_UINT32 deliver_flush_offload;
  7977. /* Flush due to out of buffer*/
  7978. A_UINT32 deliver_flush_oob;
  7979. /* MPDUs dropped due to PN check fail */
  7980. A_UINT32 pn_fail;
  7981. /* MPDUs dropped due to unable to allocate memory */
  7982. A_UINT32 store_fail;
  7983. /* Number of times the tid pool alloc succeeded */
  7984. A_UINT32 tid_pool_alloc_succ;
  7985. /* Number of times the MPDU pool alloc succeeded */
  7986. A_UINT32 mpdu_pool_alloc_succ;
  7987. /* Number of times the MSDU pool alloc succeeded */
  7988. A_UINT32 msdu_pool_alloc_succ;
  7989. /* Number of times the tid pool alloc failed */
  7990. A_UINT32 tid_pool_alloc_fail;
  7991. /* Number of times the MPDU pool alloc failed */
  7992. A_UINT32 mpdu_pool_alloc_fail;
  7993. /* Number of times the MSDU pool alloc failed */
  7994. A_UINT32 msdu_pool_alloc_fail;
  7995. /* Number of times the tid pool freed */
  7996. A_UINT32 tid_pool_free;
  7997. /* Number of times the MPDU pool freed */
  7998. A_UINT32 mpdu_pool_free;
  7999. /* Number of times the MSDU pool freed */
  8000. A_UINT32 msdu_pool_free;
  8001. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  8002. A_UINT32 msdu_queued;
  8003. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  8004. A_UINT32 msdu_recycled;
  8005. /* Number of MPDUs with invalid peer but A2 found in AST */
  8006. A_UINT32 invalid_peer_a2_in_ast;
  8007. /* Number of MPDUs with invalid peer but A3 found in AST */
  8008. A_UINT32 invalid_peer_a3_in_ast;
  8009. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  8010. A_UINT32 invalid_peer_bmc_mpdus;
  8011. /* Number of MSDUs with err attention word */
  8012. A_UINT32 rxdesc_err_att;
  8013. /* Number of MSDUs with flag of peer_idx_invalid */
  8014. A_UINT32 rxdesc_err_peer_idx_inv;
  8015. /* Number of MSDUs with flag of peer_idx_timeout */
  8016. A_UINT32 rxdesc_err_peer_idx_to;
  8017. /* Number of MSDUs with flag of overflow */
  8018. A_UINT32 rxdesc_err_ov;
  8019. /* Number of MSDUs with flag of msdu_length_err */
  8020. A_UINT32 rxdesc_err_msdu_len;
  8021. /* Number of MSDUs with flag of mpdu_length_err */
  8022. A_UINT32 rxdesc_err_mpdu_len;
  8023. /* Number of MSDUs with flag of tkip_mic_err */
  8024. A_UINT32 rxdesc_err_tkip_mic;
  8025. /* Number of MSDUs with flag of decrypt_err */
  8026. A_UINT32 rxdesc_err_decrypt;
  8027. /* Number of MSDUs with flag of fcs_err */
  8028. A_UINT32 rxdesc_err_fcs;
  8029. /* Number of Unicast (bc_mc bit is not set in attention word)
  8030. * frames with invalid peer handler
  8031. */
  8032. A_UINT32 rxdesc_uc_msdus_inv_peer;
  8033. /* Number of unicast frame directly (direct bit is set in attention word)
  8034. * to DUT with invalid peer handler
  8035. */
  8036. A_UINT32 rxdesc_direct_msdus_inv_peer;
  8037. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  8038. * frames with invalid peer handler
  8039. */
  8040. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  8041. /* Number of MSDUs dropped due to no first MSDU flag */
  8042. A_UINT32 rxdesc_no_1st_msdu;
  8043. /* Number of MSDUs droped due to ring overflow */
  8044. A_UINT32 msdu_drop_ring_ov;
  8045. /* Number of MSDUs dropped due to FC mismatch */
  8046. A_UINT32 msdu_drop_fc_mismatch;
  8047. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  8048. A_UINT32 msdu_drop_mgmt_remote_ring;
  8049. /* Number of MSDUs dropped due to errors not reported in attention word */
  8050. A_UINT32 msdu_drop_misc;
  8051. /* Number of MSDUs go to offload before reorder */
  8052. A_UINT32 offload_msdu_wal;
  8053. /* Number of data frame dropped by offload after reorder */
  8054. A_UINT32 offload_msdu_reorder;
  8055. /* Number of MPDUs with sequence number in the past and within the BA window */
  8056. A_UINT32 dup_past_within_window;
  8057. /* Number of MPDUs with sequence number in the past and outside the BA window */
  8058. A_UINT32 dup_past_outside_window;
  8059. /* Number of MSDUs with decrypt/MIC error */
  8060. A_UINT32 rxdesc_err_decrypt_mic;
  8061. /* Number of data MSDUs received on both local and remote rings */
  8062. A_UINT32 data_msdus_on_both_rings;
  8063. /* MPDUs never filled */
  8064. A_UINT32 holes_not_filled;
  8065. };
  8066. /*
  8067. * Rx Remote buffer statistics
  8068. * NB: all the fields must be defined in 4 octets size.
  8069. */
  8070. struct rx_remote_buffer_mgmt_stats {
  8071. /* Total number of MSDUs reaped for Rx processing */
  8072. A_UINT32 remote_reaped;
  8073. /* MSDUs recycled within firmware */
  8074. A_UINT32 remote_recycled;
  8075. /* MSDUs stored by Data Rx */
  8076. A_UINT32 data_rx_msdus_stored;
  8077. /* Number of HTT indications from WAL Rx MSDU */
  8078. A_UINT32 wal_rx_ind;
  8079. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  8080. A_UINT32 wal_rx_ind_unconsumed;
  8081. /* Number of HTT indications from Data Rx MSDU */
  8082. A_UINT32 data_rx_ind;
  8083. /* Number of unconsumed HTT indications from Data Rx MSDU */
  8084. A_UINT32 data_rx_ind_unconsumed;
  8085. /* Number of HTT indications from ATHBUF */
  8086. A_UINT32 athbuf_rx_ind;
  8087. /* Number of remote buffers requested for refill */
  8088. A_UINT32 refill_buf_req;
  8089. /* Number of remote buffers filled by the host */
  8090. A_UINT32 refill_buf_rsp;
  8091. /* Number of times MAC hw_index = f/w write_index */
  8092. A_INT32 mac_no_bufs;
  8093. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  8094. A_INT32 fw_indices_equal;
  8095. /* Number of times f/w finds no buffers to post */
  8096. A_INT32 host_no_bufs;
  8097. };
  8098. /*
  8099. * TXBF MU/SU packets and NDPA statistics
  8100. * NB: all the fields must be defined in 4 octets size.
  8101. */
  8102. struct rx_txbf_musu_ndpa_pkts_stats {
  8103. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  8104. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  8105. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  8106. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  8107. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  8108. A_UINT32 reserved[3]; /* must be set to 0x0 */
  8109. };
  8110. /*
  8111. * htt_dbg_stats_status -
  8112. * present - The requested stats have been delivered in full.
  8113. * This indicates that either the stats information was contained
  8114. * in its entirety within this message, or else this message
  8115. * completes the delivery of the requested stats info that was
  8116. * partially delivered through earlier STATS_CONF messages.
  8117. * partial - The requested stats have been delivered in part.
  8118. * One or more subsequent STATS_CONF messages with the same
  8119. * cookie value will be sent to deliver the remainder of the
  8120. * information.
  8121. * error - The requested stats could not be delivered, for example due
  8122. * to a shortage of memory to construct a message holding the
  8123. * requested stats.
  8124. * invalid - The requested stat type is either not recognized, or the
  8125. * target is configured to not gather the stats type in question.
  8126. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  8127. * series_done - This special value indicates that no further stats info
  8128. * elements are present within a series of stats info elems
  8129. * (within a stats upload confirmation message).
  8130. */
  8131. enum htt_dbg_stats_status {
  8132. HTT_DBG_STATS_STATUS_PRESENT = 0,
  8133. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  8134. HTT_DBG_STATS_STATUS_ERROR = 2,
  8135. HTT_DBG_STATS_STATUS_INVALID = 3,
  8136. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  8137. };
  8138. /**
  8139. * @brief target -> host statistics upload
  8140. *
  8141. * @details
  8142. * The following field definitions describe the format of the HTT target
  8143. * to host stats upload confirmation message.
  8144. * The message contains a cookie echoed from the HTT host->target stats
  8145. * upload request, which identifies which request the confirmation is
  8146. * for, and a series of tag-length-value stats information elements.
  8147. * The tag-length header for each stats info element also includes a
  8148. * status field, to indicate whether the request for the stat type in
  8149. * question was fully met, partially met, unable to be met, or invalid
  8150. * (if the stat type in question is disabled in the target).
  8151. * A special value of all 1's in this status field is used to indicate
  8152. * the end of the series of stats info elements.
  8153. *
  8154. *
  8155. * |31 16|15 8|7 5|4 0|
  8156. * |------------------------------------------------------------|
  8157. * | reserved | msg type |
  8158. * |------------------------------------------------------------|
  8159. * | cookie LSBs |
  8160. * |------------------------------------------------------------|
  8161. * | cookie MSBs |
  8162. * |------------------------------------------------------------|
  8163. * | stats entry length | reserved | S |stat type|
  8164. * |------------------------------------------------------------|
  8165. * | |
  8166. * | type-specific stats info |
  8167. * | |
  8168. * |------------------------------------------------------------|
  8169. * | stats entry length | reserved | S |stat type|
  8170. * |------------------------------------------------------------|
  8171. * | |
  8172. * | type-specific stats info |
  8173. * | |
  8174. * |------------------------------------------------------------|
  8175. * | n/a | reserved | 111 | n/a |
  8176. * |------------------------------------------------------------|
  8177. * Header fields:
  8178. * - MSG_TYPE
  8179. * Bits 7:0
  8180. * Purpose: identifies this is a statistics upload confirmation message
  8181. * Value: 0x9
  8182. * - COOKIE_LSBS
  8183. * Bits 31:0
  8184. * Purpose: Provide a mechanism to match a target->host stats confirmation
  8185. * message with its preceding host->target stats request message.
  8186. * Value: LSBs of the opaque cookie specified by the host-side requestor
  8187. * - COOKIE_MSBS
  8188. * Bits 31:0
  8189. * Purpose: Provide a mechanism to match a target->host stats confirmation
  8190. * message with its preceding host->target stats request message.
  8191. * Value: MSBs of the opaque cookie specified by the host-side requestor
  8192. *
  8193. * Stats Information Element tag-length header fields:
  8194. * - STAT_TYPE
  8195. * Bits 4:0
  8196. * Purpose: identifies the type of statistics info held in the
  8197. * following information element
  8198. * Value: htt_dbg_stats_type
  8199. * - STATUS
  8200. * Bits 7:5
  8201. * Purpose: indicate whether the requested stats are present
  8202. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  8203. * the completion of the stats entry series
  8204. * - LENGTH
  8205. * Bits 31:16
  8206. * Purpose: indicate the stats information size
  8207. * Value: This field specifies the number of bytes of stats information
  8208. * that follows the element tag-length header.
  8209. * It is expected but not required that this length is a multiple of
  8210. * 4 bytes. Even if the length is not an integer multiple of 4, the
  8211. * subsequent stats entry header will begin on a 4-byte aligned
  8212. * boundary.
  8213. */
  8214. #define HTT_T2H_STATS_COOKIE_SIZE 8
  8215. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  8216. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  8217. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  8218. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  8219. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  8220. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  8221. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  8222. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  8223. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  8224. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  8225. do { \
  8226. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  8227. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  8228. } while (0)
  8229. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  8230. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  8231. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  8232. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  8233. do { \
  8234. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  8235. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  8236. } while (0)
  8237. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  8238. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  8239. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  8240. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  8241. do { \
  8242. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  8243. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  8244. } while (0)
  8245. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  8246. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  8247. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  8248. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  8249. #define HTT_MAX_AGGR 64
  8250. #define HTT_HL_MAX_AGGR 18
  8251. /**
  8252. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  8253. *
  8254. * @details
  8255. * The following field definitions describe the format of the HTT host
  8256. * to target frag_desc/msdu_ext bank configuration message.
  8257. * The message contains the based address and the min and max id of the
  8258. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  8259. * MSDU_EXT/FRAG_DESC.
  8260. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  8261. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  8262. * the hardware does the mapping/translation.
  8263. *
  8264. * Total banks that can be configured is configured to 16.
  8265. *
  8266. * This should be called before any TX has be initiated by the HTT
  8267. *
  8268. * |31 16|15 8|7 5|4 0|
  8269. * |------------------------------------------------------------|
  8270. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  8271. * |------------------------------------------------------------|
  8272. * | BANK0_BASE_ADDRESS (bits 31:0) |
  8273. #if HTT_PADDR64
  8274. * | BANK0_BASE_ADDRESS (bits 63:32) |
  8275. #endif
  8276. * |------------------------------------------------------------|
  8277. * | ... |
  8278. * |------------------------------------------------------------|
  8279. * | BANK15_BASE_ADDRESS (bits 31:0) |
  8280. #if HTT_PADDR64
  8281. * | BANK15_BASE_ADDRESS (bits 63:32) |
  8282. #endif
  8283. * |------------------------------------------------------------|
  8284. * | BANK0_MAX_ID | BANK0_MIN_ID |
  8285. * |------------------------------------------------------------|
  8286. * | ... |
  8287. * |------------------------------------------------------------|
  8288. * | BANK15_MAX_ID | BANK15_MIN_ID |
  8289. * |------------------------------------------------------------|
  8290. * Header fields:
  8291. * - MSG_TYPE
  8292. * Bits 7:0
  8293. * Value: 0x6
  8294. * for systems with 64-bit format for bus addresses:
  8295. * - BANKx_BASE_ADDRESS_LO
  8296. * Bits 31:0
  8297. * Purpose: Provide a mechanism to specify the base address of the
  8298. * MSDU_EXT bank physical/bus address.
  8299. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  8300. * - BANKx_BASE_ADDRESS_HI
  8301. * Bits 31:0
  8302. * Purpose: Provide a mechanism to specify the base address of the
  8303. * MSDU_EXT bank physical/bus address.
  8304. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  8305. * for systems with 32-bit format for bus addresses:
  8306. * - BANKx_BASE_ADDRESS
  8307. * Bits 31:0
  8308. * Purpose: Provide a mechanism to specify the base address of the
  8309. * MSDU_EXT bank physical/bus address.
  8310. * Value: MSDU_EXT bank physical / bus address
  8311. * - BANKx_MIN_ID
  8312. * Bits 15:0
  8313. * Purpose: Provide a mechanism to specify the min index that needs to
  8314. * mapped.
  8315. * - BANKx_MAX_ID
  8316. * Bits 31:16
  8317. * Purpose: Provide a mechanism to specify the max index that needs to
  8318. * mapped.
  8319. *
  8320. */
  8321. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  8322. * safe value.
  8323. * @note MAX supported banks is 16.
  8324. */
  8325. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  8326. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  8327. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  8328. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  8329. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  8330. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  8331. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  8332. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  8333. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  8334. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  8335. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  8336. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  8337. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  8338. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  8339. do { \
  8340. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  8341. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  8342. } while (0)
  8343. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  8344. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  8345. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  8346. do { \
  8347. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  8348. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  8349. } while (0)
  8350. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  8351. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  8352. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  8353. do { \
  8354. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  8355. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  8356. } while (0)
  8357. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  8358. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  8359. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  8360. do { \
  8361. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  8362. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  8363. } while (0)
  8364. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  8365. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  8366. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  8367. do { \
  8368. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  8369. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  8370. } while (0)
  8371. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  8372. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  8373. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  8374. do { \
  8375. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  8376. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  8377. } while (0)
  8378. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  8379. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  8380. /*
  8381. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  8382. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  8383. * addresses are stored in a XXX-bit field.
  8384. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  8385. * htt_tx_frag_desc64_bank_cfg_t structs.
  8386. */
  8387. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  8388. _paddr_bits_, \
  8389. _paddr__bank_base_address_) \
  8390. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  8391. /** word 0 \
  8392. * msg_type: 8, \
  8393. * pdev_id: 2, \
  8394. * swap: 1, \
  8395. * reserved0: 5, \
  8396. * num_banks: 8, \
  8397. * desc_size: 8; \
  8398. */ \
  8399. A_UINT32 word0; \
  8400. /* \
  8401. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  8402. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  8403. * the second A_UINT32). \
  8404. */ \
  8405. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8406. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8407. } POSTPACK
  8408. /* define htt_tx_frag_desc32_bank_cfg_t */
  8409. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  8410. /* define htt_tx_frag_desc64_bank_cfg_t */
  8411. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  8412. /*
  8413. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  8414. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  8415. */
  8416. #if HTT_PADDR64
  8417. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  8418. #else
  8419. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  8420. #endif
  8421. /**
  8422. * @brief target -> host HTT TX Credit total count update message definition
  8423. *
  8424. *|31 16|15|14 9| 8 |7 0 |
  8425. *|---------------------+--+----------+-------+----------|
  8426. *|cur htt credit delta | Q| reserved | sign | msg type |
  8427. *|------------------------------------------------------|
  8428. *
  8429. * Header fields:
  8430. * - MSG_TYPE
  8431. * Bits 7:0
  8432. * Purpose: identifies this as a htt tx credit delta update message
  8433. * Value: 0xe
  8434. * - SIGN
  8435. * Bits 8
  8436. * identifies whether credit delta is positive or negative
  8437. * Value:
  8438. * - 0x0: credit delta is positive, rebalance in some buffers
  8439. * - 0x1: credit delta is negative, rebalance out some buffers
  8440. * - reserved
  8441. * Bits 14:9
  8442. * Value: 0x0
  8443. * - TXQ_GRP
  8444. * Bit 15
  8445. * Purpose: indicates whether any tx queue group information elements
  8446. * are appended to the tx credit update message
  8447. * Value: 0 -> no tx queue group information element is present
  8448. * 1 -> a tx queue group information element immediately follows
  8449. * - DELTA_COUNT
  8450. * Bits 31:16
  8451. * Purpose: Specify current htt credit delta absolute count
  8452. */
  8453. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  8454. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  8455. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  8456. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  8457. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  8458. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  8459. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  8460. do { \
  8461. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  8462. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  8463. } while (0)
  8464. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  8465. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  8466. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  8467. do { \
  8468. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  8469. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  8470. } while (0)
  8471. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  8472. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  8473. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  8474. do { \
  8475. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  8476. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  8477. } while (0)
  8478. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  8479. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  8480. #define HTT_TX_CREDIT_MSG_BYTES 4
  8481. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  8482. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  8483. /**
  8484. * @brief HTT WDI_IPA Operation Response Message
  8485. *
  8486. * @details
  8487. * HTT WDI_IPA Operation Response message is sent by target
  8488. * to host confirming suspend or resume operation.
  8489. * |31 24|23 16|15 8|7 0|
  8490. * |----------------+----------------+----------------+----------------|
  8491. * | op_code | Rsvd | msg_type |
  8492. * |-------------------------------------------------------------------|
  8493. * | Rsvd | Response len |
  8494. * |-------------------------------------------------------------------|
  8495. * | |
  8496. * | Response-type specific info |
  8497. * | |
  8498. * | |
  8499. * |-------------------------------------------------------------------|
  8500. * Header fields:
  8501. * - MSG_TYPE
  8502. * Bits 7:0
  8503. * Purpose: Identifies this as WDI_IPA Operation Response message
  8504. * value: = 0x13
  8505. * - OP_CODE
  8506. * Bits 31:16
  8507. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  8508. * value: = enum htt_wdi_ipa_op_code
  8509. * - RSP_LEN
  8510. * Bits 16:0
  8511. * Purpose: length for the response-type specific info
  8512. * value: = length in bytes for response-type specific info
  8513. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  8514. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  8515. */
  8516. PREPACK struct htt_wdi_ipa_op_response_t
  8517. {
  8518. /* DWORD 0: flags and meta-data */
  8519. A_UINT32
  8520. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8521. reserved1: 8,
  8522. op_code: 16;
  8523. A_UINT32
  8524. rsp_len: 16,
  8525. reserved2: 16;
  8526. } POSTPACK;
  8527. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  8528. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  8529. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  8530. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  8531. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  8532. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  8533. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  8534. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  8535. do { \
  8536. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  8537. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  8538. } while (0)
  8539. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  8540. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  8541. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  8542. do { \
  8543. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  8544. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  8545. } while (0)
  8546. enum htt_phy_mode {
  8547. htt_phy_mode_11a = 0,
  8548. htt_phy_mode_11g = 1,
  8549. htt_phy_mode_11b = 2,
  8550. htt_phy_mode_11g_only = 3,
  8551. htt_phy_mode_11na_ht20 = 4,
  8552. htt_phy_mode_11ng_ht20 = 5,
  8553. htt_phy_mode_11na_ht40 = 6,
  8554. htt_phy_mode_11ng_ht40 = 7,
  8555. htt_phy_mode_11ac_vht20 = 8,
  8556. htt_phy_mode_11ac_vht40 = 9,
  8557. htt_phy_mode_11ac_vht80 = 10,
  8558. htt_phy_mode_11ac_vht20_2g = 11,
  8559. htt_phy_mode_11ac_vht40_2g = 12,
  8560. htt_phy_mode_11ac_vht80_2g = 13,
  8561. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  8562. htt_phy_mode_11ac_vht160 = 15,
  8563. htt_phy_mode_max,
  8564. };
  8565. /**
  8566. * @brief target -> host HTT channel change indication
  8567. * @details
  8568. * Specify when a channel change occurs.
  8569. * This allows the host to precisely determine which rx frames arrived
  8570. * on the old channel and which rx frames arrived on the new channel.
  8571. *
  8572. *|31 |7 0 |
  8573. *|-------------------------------------------+----------|
  8574. *| reserved | msg type |
  8575. *|------------------------------------------------------|
  8576. *| primary_chan_center_freq_mhz |
  8577. *|------------------------------------------------------|
  8578. *| contiguous_chan1_center_freq_mhz |
  8579. *|------------------------------------------------------|
  8580. *| contiguous_chan2_center_freq_mhz |
  8581. *|------------------------------------------------------|
  8582. *| phy_mode |
  8583. *|------------------------------------------------------|
  8584. *
  8585. * Header fields:
  8586. * - MSG_TYPE
  8587. * Bits 7:0
  8588. * Purpose: identifies this as a htt channel change indication message
  8589. * Value: 0x15
  8590. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  8591. * Bits 31:0
  8592. * Purpose: identify the (center of the) new 20 MHz primary channel
  8593. * Value: center frequency of the 20 MHz primary channel, in MHz units
  8594. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  8595. * Bits 31:0
  8596. * Purpose: identify the (center of the) contiguous frequency range
  8597. * comprising the new channel.
  8598. * For example, if the new channel is a 80 MHz channel extending
  8599. * 60 MHz beyond the primary channel, this field would be 30 larger
  8600. * than the primary channel center frequency field.
  8601. * Value: center frequency of the contiguous frequency range comprising
  8602. * the full channel in MHz units
  8603. * (80+80 channels also use the CONTIG_CHAN2 field)
  8604. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  8605. * Bits 31:0
  8606. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  8607. * within a VHT 80+80 channel.
  8608. * This field is only relevant for VHT 80+80 channels.
  8609. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  8610. * channel (arbitrary value for cases besides VHT 80+80)
  8611. * - PHY_MODE
  8612. * Bits 31:0
  8613. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  8614. * and band
  8615. * Value: htt_phy_mode enum value
  8616. */
  8617. PREPACK struct htt_chan_change_t
  8618. {
  8619. /* DWORD 0: flags and meta-data */
  8620. A_UINT32
  8621. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8622. reserved1: 24;
  8623. A_UINT32 primary_chan_center_freq_mhz;
  8624. A_UINT32 contig_chan1_center_freq_mhz;
  8625. A_UINT32 contig_chan2_center_freq_mhz;
  8626. A_UINT32 phy_mode;
  8627. } POSTPACK;
  8628. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  8629. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  8630. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  8631. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  8632. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  8633. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  8634. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  8635. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  8636. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  8637. do { \
  8638. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  8639. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  8640. } while (0)
  8641. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  8642. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  8643. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  8644. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  8645. do { \
  8646. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  8647. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  8648. } while (0)
  8649. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  8650. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  8651. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  8652. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  8653. do { \
  8654. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  8655. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  8656. } while (0)
  8657. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  8658. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  8659. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  8660. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  8661. do { \
  8662. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  8663. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  8664. } while (0)
  8665. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  8666. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  8667. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  8668. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  8669. /**
  8670. * @brief rx offload packet error message
  8671. *
  8672. * @details
  8673. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  8674. * of target payload like mic err.
  8675. *
  8676. * |31 24|23 16|15 8|7 0|
  8677. * |----------------+----------------+----------------+----------------|
  8678. * | tid | vdev_id | msg_sub_type | msg_type |
  8679. * |-------------------------------------------------------------------|
  8680. * : (sub-type dependent content) :
  8681. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8682. * Header fields:
  8683. * - msg_type
  8684. * Bits 7:0
  8685. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  8686. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  8687. * - msg_sub_type
  8688. * Bits 15:8
  8689. * Purpose: Identifies which type of rx error is reported by this message
  8690. * value: htt_rx_ofld_pkt_err_type
  8691. * - vdev_id
  8692. * Bits 23:16
  8693. * Purpose: Identifies which vdev received the erroneous rx frame
  8694. * value:
  8695. * - tid
  8696. * Bits 31:24
  8697. * Purpose: Identifies the traffic type of the rx frame
  8698. * value:
  8699. *
  8700. * - The payload fields used if the sub-type == MIC error are shown below.
  8701. * Note - MIC err is per MSDU, while PN is per MPDU.
  8702. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  8703. * with MIC err in A-MSDU case, so FW will send only one HTT message
  8704. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  8705. * instead of sending separate HTT messages for each wrong MSDU within
  8706. * the MPDU.
  8707. *
  8708. * |31 24|23 16|15 8|7 0|
  8709. * |----------------+----------------+----------------+----------------|
  8710. * | Rsvd | key_id | peer_id |
  8711. * |-------------------------------------------------------------------|
  8712. * | receiver MAC addr 31:0 |
  8713. * |-------------------------------------------------------------------|
  8714. * | Rsvd | receiver MAC addr 47:32 |
  8715. * |-------------------------------------------------------------------|
  8716. * | transmitter MAC addr 31:0 |
  8717. * |-------------------------------------------------------------------|
  8718. * | Rsvd | transmitter MAC addr 47:32 |
  8719. * |-------------------------------------------------------------------|
  8720. * | PN 31:0 |
  8721. * |-------------------------------------------------------------------|
  8722. * | Rsvd | PN 47:32 |
  8723. * |-------------------------------------------------------------------|
  8724. * - peer_id
  8725. * Bits 15:0
  8726. * Purpose: identifies which peer is frame is from
  8727. * value:
  8728. * - key_id
  8729. * Bits 23:16
  8730. * Purpose: identifies key_id of rx frame
  8731. * value:
  8732. * - RA_31_0 (receiver MAC addr 31:0)
  8733. * Bits 31:0
  8734. * Purpose: identifies by MAC address which vdev received the frame
  8735. * value: MAC address lower 4 bytes
  8736. * - RA_47_32 (receiver MAC addr 47:32)
  8737. * Bits 15:0
  8738. * Purpose: identifies by MAC address which vdev received the frame
  8739. * value: MAC address upper 2 bytes
  8740. * - TA_31_0 (transmitter MAC addr 31:0)
  8741. * Bits 31:0
  8742. * Purpose: identifies by MAC address which peer transmitted the frame
  8743. * value: MAC address lower 4 bytes
  8744. * - TA_47_32 (transmitter MAC addr 47:32)
  8745. * Bits 15:0
  8746. * Purpose: identifies by MAC address which peer transmitted the frame
  8747. * value: MAC address upper 2 bytes
  8748. * - PN_31_0
  8749. * Bits 31:0
  8750. * Purpose: Identifies pn of rx frame
  8751. * value: PN lower 4 bytes
  8752. * - PN_47_32
  8753. * Bits 15:0
  8754. * Purpose: Identifies pn of rx frame
  8755. * value:
  8756. * TKIP or CCMP: PN upper 2 bytes
  8757. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  8758. */
  8759. enum htt_rx_ofld_pkt_err_type {
  8760. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  8761. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  8762. };
  8763. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  8764. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  8765. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  8766. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  8767. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  8768. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  8769. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  8770. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  8771. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  8772. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  8773. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  8774. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  8775. do { \
  8776. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  8777. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  8778. } while (0)
  8779. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  8780. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  8781. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  8782. do { \
  8783. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  8784. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  8785. } while (0)
  8786. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  8787. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  8788. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  8789. do { \
  8790. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  8791. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  8792. } while (0)
  8793. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  8794. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  8795. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  8796. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  8797. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  8798. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  8799. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  8800. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  8801. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  8802. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  8803. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  8804. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  8805. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  8806. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  8807. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  8808. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  8809. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  8810. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  8811. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  8812. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  8813. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  8814. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  8815. do { \
  8816. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  8817. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  8818. } while (0)
  8819. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  8820. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  8821. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  8822. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  8823. do { \
  8824. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  8825. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  8826. } while (0)
  8827. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  8828. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  8829. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  8830. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  8831. do { \
  8832. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  8833. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  8834. } while (0)
  8835. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  8836. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  8837. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  8838. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  8839. do { \
  8840. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  8841. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  8842. } while (0)
  8843. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  8844. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  8845. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  8846. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  8847. do { \
  8848. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  8849. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  8850. } while (0)
  8851. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  8852. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  8853. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  8854. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  8855. do { \
  8856. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  8857. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  8858. } while (0)
  8859. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  8860. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  8861. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  8862. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  8863. do { \
  8864. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  8865. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  8866. } while (0)
  8867. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  8868. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  8869. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  8870. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  8871. do { \
  8872. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  8873. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  8874. } while (0)
  8875. /**
  8876. * @brief peer rate report message
  8877. *
  8878. * @details
  8879. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  8880. * justified rate of all the peers.
  8881. *
  8882. * |31 24|23 16|15 8|7 0|
  8883. * |----------------+----------------+----------------+----------------|
  8884. * | peer_count | | msg_type |
  8885. * |-------------------------------------------------------------------|
  8886. * : Payload (variant number of peer rate report) :
  8887. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8888. * Header fields:
  8889. * - msg_type
  8890. * Bits 7:0
  8891. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  8892. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  8893. * - reserved
  8894. * Bits 15:8
  8895. * Purpose:
  8896. * value:
  8897. * - peer_count
  8898. * Bits 31:16
  8899. * Purpose: Specify how many peer rate report elements are present in the payload.
  8900. * value:
  8901. *
  8902. * Payload:
  8903. * There are variant number of peer rate report follow the first 32 bits.
  8904. * The peer rate report is defined as follows.
  8905. *
  8906. * |31 20|19 16|15 0|
  8907. * |-----------------------+---------+---------------------------------|-
  8908. * | reserved | phy | peer_id | \
  8909. * |-------------------------------------------------------------------| -> report #0
  8910. * | rate | /
  8911. * |-----------------------+---------+---------------------------------|-
  8912. * | reserved | phy | peer_id | \
  8913. * |-------------------------------------------------------------------| -> report #1
  8914. * | rate | /
  8915. * |-----------------------+---------+---------------------------------|-
  8916. * | reserved | phy | peer_id | \
  8917. * |-------------------------------------------------------------------| -> report #2
  8918. * | rate | /
  8919. * |-------------------------------------------------------------------|-
  8920. * : :
  8921. * : :
  8922. * : :
  8923. * :-------------------------------------------------------------------:
  8924. *
  8925. * - peer_id
  8926. * Bits 15:0
  8927. * Purpose: identify the peer
  8928. * value:
  8929. * - phy
  8930. * Bits 19:16
  8931. * Purpose: identify which phy is in use
  8932. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  8933. * Please see enum htt_peer_report_phy_type for detail.
  8934. * - reserved
  8935. * Bits 31:20
  8936. * Purpose:
  8937. * value:
  8938. * - rate
  8939. * Bits 31:0
  8940. * Purpose: represent the justified rate of the peer specified by peer_id
  8941. * value:
  8942. */
  8943. enum htt_peer_rate_report_phy_type {
  8944. HTT_PEER_RATE_REPORT_11B = 0,
  8945. HTT_PEER_RATE_REPORT_11A_G,
  8946. HTT_PEER_RATE_REPORT_11N,
  8947. HTT_PEER_RATE_REPORT_11AC,
  8948. };
  8949. #define HTT_PEER_RATE_REPORT_SIZE 8
  8950. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  8951. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  8952. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  8953. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  8954. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  8955. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  8956. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  8957. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  8958. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  8959. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  8960. do { \
  8961. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  8962. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  8963. } while (0)
  8964. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  8965. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  8966. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  8967. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  8968. do { \
  8969. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  8970. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  8971. } while (0)
  8972. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  8973. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  8974. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  8975. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  8976. do { \
  8977. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  8978. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  8979. } while (0)
  8980. /**
  8981. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  8982. *
  8983. * @details
  8984. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  8985. * a flow of descriptors.
  8986. *
  8987. * This message is in TLV format and indicates the parameters to be setup a
  8988. * flow in the host. Each entry indicates that a particular flow ID is ready to
  8989. * receive descriptors from a specified pool.
  8990. *
  8991. * The message would appear as follows:
  8992. *
  8993. * |31 24|23 16|15 8|7 0|
  8994. * |----------------+----------------+----------------+----------------|
  8995. * header | reserved | num_flows | msg_type |
  8996. * |-------------------------------------------------------------------|
  8997. * | |
  8998. * : payload :
  8999. * | |
  9000. * |-------------------------------------------------------------------|
  9001. *
  9002. * The header field is one DWORD long and is interpreted as follows:
  9003. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  9004. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  9005. * this message
  9006. * b'16-31 - reserved: These bits are reserved for future use
  9007. *
  9008. * Payload:
  9009. * The payload would contain multiple objects of the following structure. Each
  9010. * object represents a flow.
  9011. *
  9012. * |31 24|23 16|15 8|7 0|
  9013. * |----------------+----------------+----------------+----------------|
  9014. * header | reserved | num_flows | msg_type |
  9015. * |-------------------------------------------------------------------|
  9016. * payload0| flow_type |
  9017. * |-------------------------------------------------------------------|
  9018. * | flow_id |
  9019. * |-------------------------------------------------------------------|
  9020. * | reserved0 | flow_pool_id |
  9021. * |-------------------------------------------------------------------|
  9022. * | reserved1 | flow_pool_size |
  9023. * |-------------------------------------------------------------------|
  9024. * | reserved2 |
  9025. * |-------------------------------------------------------------------|
  9026. * payload1| flow_type |
  9027. * |-------------------------------------------------------------------|
  9028. * | flow_id |
  9029. * |-------------------------------------------------------------------|
  9030. * | reserved0 | flow_pool_id |
  9031. * |-------------------------------------------------------------------|
  9032. * | reserved1 | flow_pool_size |
  9033. * |-------------------------------------------------------------------|
  9034. * | reserved2 |
  9035. * |-------------------------------------------------------------------|
  9036. * | . |
  9037. * | . |
  9038. * | . |
  9039. * |-------------------------------------------------------------------|
  9040. *
  9041. * Each payload is 5 DWORDS long and is interpreted as follows:
  9042. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  9043. * this flow is associated. It can be VDEV, peer,
  9044. * or tid (AC). Based on enum htt_flow_type.
  9045. *
  9046. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  9047. * object. For flow_type vdev it is set to the
  9048. * vdevid, for peer it is peerid and for tid, it is
  9049. * tid_num.
  9050. *
  9051. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  9052. * in the host for this flow
  9053. * b'16:31 - reserved0: This field in reserved for the future. In case
  9054. * we have a hierarchical implementation (HCM) of
  9055. * pools, it can be used to indicate the ID of the
  9056. * parent-pool.
  9057. *
  9058. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  9059. * Descriptors for this flow will be
  9060. * allocated from this pool in the host.
  9061. * b'16:31 - reserved1: This field in reserved for the future. In case
  9062. * we have a hierarchical implementation of pools,
  9063. * it can be used to indicate the max number of
  9064. * descriptors in the pool. The b'0:15 can be used
  9065. * to indicate min number of descriptors in the
  9066. * HCM scheme.
  9067. *
  9068. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  9069. * we have a hierarchical implementation of pools,
  9070. * b'0:15 can be used to indicate the
  9071. * priority-based borrowing (PBB) threshold of
  9072. * the flow's pool. The b'16:31 are still left
  9073. * reserved.
  9074. */
  9075. enum htt_flow_type {
  9076. FLOW_TYPE_VDEV = 0,
  9077. /* Insert new flow types above this line */
  9078. };
  9079. PREPACK struct htt_flow_pool_map_payload_t {
  9080. A_UINT32 flow_type;
  9081. A_UINT32 flow_id;
  9082. A_UINT32 flow_pool_id:16,
  9083. reserved0:16;
  9084. A_UINT32 flow_pool_size:16,
  9085. reserved1:16;
  9086. A_UINT32 reserved2;
  9087. } POSTPACK;
  9088. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  9089. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  9090. (sizeof(struct htt_flow_pool_map_payload_t))
  9091. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  9092. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  9093. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  9094. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  9095. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  9096. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  9097. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  9098. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  9099. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  9100. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  9101. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  9102. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  9103. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  9104. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  9105. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  9106. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  9107. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  9108. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  9109. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  9110. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  9111. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  9112. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  9113. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  9114. do { \
  9115. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  9116. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  9117. } while (0)
  9118. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  9119. do { \
  9120. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  9121. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  9122. } while (0)
  9123. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  9124. do { \
  9125. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  9126. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  9127. } while (0)
  9128. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  9129. do { \
  9130. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  9131. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  9132. } while (0)
  9133. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  9134. do { \
  9135. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  9136. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  9137. } while (0)
  9138. /**
  9139. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  9140. *
  9141. * @details
  9142. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  9143. * down a flow of descriptors.
  9144. * This message indicates that for the flow (whose ID is provided) is wanting
  9145. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  9146. * pool of descriptors from where descriptors are being allocated for this
  9147. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  9148. * be unmapped by the host.
  9149. *
  9150. * The message would appear as follows:
  9151. *
  9152. * |31 24|23 16|15 8|7 0|
  9153. * |----------------+----------------+----------------+----------------|
  9154. * | reserved0 | msg_type |
  9155. * |-------------------------------------------------------------------|
  9156. * | flow_type |
  9157. * |-------------------------------------------------------------------|
  9158. * | flow_id |
  9159. * |-------------------------------------------------------------------|
  9160. * | reserved1 | flow_pool_id |
  9161. * |-------------------------------------------------------------------|
  9162. *
  9163. * The message is interpreted as follows:
  9164. * dword0 - b'0:7 - msg_type: This will be set to
  9165. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  9166. * b'8:31 - reserved0: Reserved for future use
  9167. *
  9168. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  9169. * this flow is associated. It can be VDEV, peer,
  9170. * or tid (AC). Based on enum htt_flow_type.
  9171. *
  9172. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  9173. * object. For flow_type vdev it is set to the
  9174. * vdevid, for peer it is peerid and for tid, it is
  9175. * tid_num.
  9176. *
  9177. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  9178. * used in the host for this flow
  9179. * b'16:31 - reserved0: This field in reserved for the future.
  9180. *
  9181. */
  9182. PREPACK struct htt_flow_pool_unmap_t {
  9183. A_UINT32 msg_type:8,
  9184. reserved0:24;
  9185. A_UINT32 flow_type;
  9186. A_UINT32 flow_id;
  9187. A_UINT32 flow_pool_id:16,
  9188. reserved1:16;
  9189. } POSTPACK;
  9190. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  9191. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  9192. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  9193. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  9194. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  9195. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  9196. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  9197. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  9198. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  9199. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  9200. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  9201. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  9202. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  9203. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  9204. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  9205. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  9206. do { \
  9207. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  9208. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  9209. } while (0)
  9210. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  9211. do { \
  9212. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  9213. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  9214. } while (0)
  9215. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  9216. do { \
  9217. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  9218. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  9219. } while (0)
  9220. /**
  9221. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  9222. *
  9223. * @details
  9224. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  9225. * SRNG ring setup is done
  9226. *
  9227. * This message indicates whether the last setup operation is successful.
  9228. * It will be sent to host when host set respose_required bit in
  9229. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  9230. * The message would appear as follows:
  9231. *
  9232. * |31 24|23 16|15 8|7 0|
  9233. * |--------------- +----------------+----------------+----------------|
  9234. * | setup_status | ring_id | pdev_id | msg_type |
  9235. * |-------------------------------------------------------------------|
  9236. *
  9237. * The message is interpreted as follows:
  9238. * dword0 - b'0:7 - msg_type: This will be set to
  9239. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  9240. * b'8:15 - pdev_id:
  9241. * 0 (for rings at SOC/UMAC level),
  9242. * 1/2/3 mac id (for rings at LMAC level)
  9243. * b'16:23 - ring_id: Identify the ring which is set up
  9244. * More details can be got from enum htt_srng_ring_id
  9245. * b'24:31 - setup_status: Indicate status of setup operation
  9246. * Refer to htt_ring_setup_status
  9247. */
  9248. PREPACK struct htt_sring_setup_done_t {
  9249. A_UINT32 msg_type: 8,
  9250. pdev_id: 8,
  9251. ring_id: 8,
  9252. setup_status: 8;
  9253. } POSTPACK;
  9254. enum htt_ring_setup_status {
  9255. htt_ring_setup_status_ok = 0,
  9256. htt_ring_setup_status_error,
  9257. };
  9258. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  9259. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  9260. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  9261. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  9262. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  9263. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  9264. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  9265. do { \
  9266. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  9267. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  9268. } while (0)
  9269. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  9270. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  9271. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  9272. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  9273. HTT_SRING_SETUP_DONE_RING_ID_S)
  9274. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  9275. do { \
  9276. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  9277. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  9278. } while (0)
  9279. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  9280. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  9281. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  9282. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  9283. HTT_SRING_SETUP_DONE_STATUS_S)
  9284. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  9285. do { \
  9286. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  9287. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  9288. } while (0)
  9289. /**
  9290. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  9291. *
  9292. * @details
  9293. * HTT TX map flow entry with tqm flow pointer
  9294. * Sent from firmware to host to add tqm flow pointer in corresponding
  9295. * flow search entry. Flow metadata is replayed back to host as part of this
  9296. * struct to enable host to find the specific flow search entry
  9297. *
  9298. * The message would appear as follows:
  9299. *
  9300. * |31 28|27 18|17 14|13 8|7 0|
  9301. * |-------+------------------------------------------+----------------|
  9302. * | rsvd0 | fse_hsh_idx | msg_type |
  9303. * |-------------------------------------------------------------------|
  9304. * | rsvd1 | tid | peer_id |
  9305. * |-------------------------------------------------------------------|
  9306. * | tqm_flow_pntr_lo |
  9307. * |-------------------------------------------------------------------|
  9308. * | tqm_flow_pntr_hi |
  9309. * |-------------------------------------------------------------------|
  9310. * | fse_meta_data |
  9311. * |-------------------------------------------------------------------|
  9312. *
  9313. * The message is interpreted as follows:
  9314. *
  9315. * dword0 - b'0:7 - msg_type: This will be set to
  9316. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  9317. *
  9318. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  9319. * for this flow entry
  9320. *
  9321. * dword0 - b'28:31 - rsvd0: Reserved for future use
  9322. *
  9323. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  9324. *
  9325. * dword1 - b'14:17 - tid
  9326. *
  9327. * dword1 - b'18:31 - rsvd1: Reserved for future use
  9328. *
  9329. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  9330. *
  9331. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  9332. *
  9333. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  9334. * given by host
  9335. */
  9336. PREPACK struct htt_tx_map_flow_info {
  9337. A_UINT32
  9338. msg_type: 8,
  9339. fse_hsh_idx: 20,
  9340. rsvd0: 4;
  9341. A_UINT32
  9342. peer_id: 14,
  9343. tid: 4,
  9344. rsvd1: 14;
  9345. A_UINT32 tqm_flow_pntr_lo;
  9346. A_UINT32 tqm_flow_pntr_hi;
  9347. struct htt_tx_flow_metadata fse_meta_data;
  9348. } POSTPACK;
  9349. /* DWORD 0 */
  9350. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  9351. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  9352. /* DWORD 1 */
  9353. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  9354. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  9355. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  9356. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  9357. /* DWORD 0 */
  9358. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  9359. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  9360. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  9361. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  9362. do { \
  9363. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  9364. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  9365. } while (0)
  9366. /* DWORD 1 */
  9367. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  9368. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  9369. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  9370. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  9371. do { \
  9372. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  9373. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  9374. } while (0)
  9375. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  9376. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  9377. HTT_TX_MAP_FLOW_INFO_TID_S)
  9378. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  9379. do { \
  9380. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  9381. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  9382. } while (0)
  9383. /*
  9384. * htt_dbg_ext_stats_status -
  9385. * present - The requested stats have been delivered in full.
  9386. * This indicates that either the stats information was contained
  9387. * in its entirety within this message, or else this message
  9388. * completes the delivery of the requested stats info that was
  9389. * partially delivered through earlier STATS_CONF messages.
  9390. * partial - The requested stats have been delivered in part.
  9391. * One or more subsequent STATS_CONF messages with the same
  9392. * cookie value will be sent to deliver the remainder of the
  9393. * information.
  9394. * error - The requested stats could not be delivered, for example due
  9395. * to a shortage of memory to construct a message holding the
  9396. * requested stats.
  9397. * invalid - The requested stat type is either not recognized, or the
  9398. * target is configured to not gather the stats type in question.
  9399. */
  9400. enum htt_dbg_ext_stats_status {
  9401. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  9402. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  9403. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  9404. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  9405. };
  9406. /**
  9407. * @brief target -> host ppdu stats upload
  9408. *
  9409. * @details
  9410. * The following field definitions describe the format of the HTT target
  9411. * to host ppdu stats indication message.
  9412. *
  9413. *
  9414. * |31 16|15 12|11 10|9 8|7 0 |
  9415. * |----------------------------------------------------------------------|
  9416. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  9417. * |----------------------------------------------------------------------|
  9418. * | ppdu_id |
  9419. * |----------------------------------------------------------------------|
  9420. * | Timestamp in us |
  9421. * |----------------------------------------------------------------------|
  9422. * | reserved |
  9423. * |----------------------------------------------------------------------|
  9424. * | type-specific stats info |
  9425. * | (see htt_ppdu_stats.h) |
  9426. * |----------------------------------------------------------------------|
  9427. * Header fields:
  9428. * - MSG_TYPE
  9429. * Bits 7:0
  9430. * Purpose: Identifies this is a PPDU STATS indication
  9431. * message.
  9432. * Value: 0x1d
  9433. * - mac_id
  9434. * Bits 9:8
  9435. * Purpose: mac_id of this ppdu_id
  9436. * Value: 0-3
  9437. * - pdev_id
  9438. * Bits 11:10
  9439. * Purpose: pdev_id of this ppdu_id
  9440. * Value: 0-3
  9441. * 0 (for rings at SOC level),
  9442. * 1/2/3 PDEV -> 0/1/2
  9443. * - payload_size
  9444. * Bits 31:16
  9445. * Purpose: total tlv size
  9446. * Value: payload_size in bytes
  9447. */
  9448. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  9449. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  9450. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  9451. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  9452. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  9453. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  9454. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  9455. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  9456. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  9457. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  9458. do { \
  9459. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  9460. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  9461. } while (0)
  9462. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  9463. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  9464. HTT_T2H_PPDU_STATS_MAC_ID_S)
  9465. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  9466. do { \
  9467. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  9468. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  9469. } while (0)
  9470. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  9471. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  9472. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  9473. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  9474. do { \
  9475. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  9476. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  9477. } while (0)
  9478. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  9479. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  9480. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  9481. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  9482. do { \
  9483. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  9484. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  9485. } while (0)
  9486. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  9487. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  9488. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  9489. /* htt_t2h_ppdu_stats_ind_hdr_t
  9490. * This struct contains the fields within the header of the
  9491. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  9492. * stats info.
  9493. * This struct assumes little-endian layout, and thus is only
  9494. * suitable for use within processors known to be little-endian
  9495. * (such as the target).
  9496. * In contrast, the above macros provide endian-portable methods
  9497. * to get and set the bitfields within this PPDU_STATS_IND header.
  9498. */
  9499. typedef struct {
  9500. A_UINT32 msg_type: 8, /* bits 7:0 */
  9501. mac_id: 2, /* bits 9:8 */
  9502. pdev_id: 2, /* bits 11:10 */
  9503. reserved1: 4, /* bits 15:12 */
  9504. payload_size: 16; /* bits 31:16 */
  9505. A_UINT32 ppdu_id;
  9506. A_UINT32 timestamp_us;
  9507. A_UINT32 reserved2;
  9508. } htt_t2h_ppdu_stats_ind_hdr_t;
  9509. /**
  9510. * @brief target -> host extended statistics upload
  9511. *
  9512. * @details
  9513. * The following field definitions describe the format of the HTT target
  9514. * to host stats upload confirmation message.
  9515. * The message contains a cookie echoed from the HTT host->target stats
  9516. * upload request, which identifies which request the confirmation is
  9517. * for, and a single stats can span over multiple HTT stats indication
  9518. * due to the HTT message size limitation so every HTT ext stats indication
  9519. * will have tag-length-value stats information elements.
  9520. * The tag-length header for each HTT stats IND message also includes a
  9521. * status field, to indicate whether the request for the stat type in
  9522. * question was fully met, partially met, unable to be met, or invalid
  9523. * (if the stat type in question is disabled in the target).
  9524. * A Done bit 1's indicate the end of the of stats info elements.
  9525. *
  9526. *
  9527. * |31 16|15 12|11|10 8|7 5|4 0|
  9528. * |--------------------------------------------------------------|
  9529. * | reserved | msg type |
  9530. * |--------------------------------------------------------------|
  9531. * | cookie LSBs |
  9532. * |--------------------------------------------------------------|
  9533. * | cookie MSBs |
  9534. * |--------------------------------------------------------------|
  9535. * | stats entry length | rsvd | D| S | stat type |
  9536. * |--------------------------------------------------------------|
  9537. * | type-specific stats info |
  9538. * | (see htt_stats.h) |
  9539. * |--------------------------------------------------------------|
  9540. * Header fields:
  9541. * - MSG_TYPE
  9542. * Bits 7:0
  9543. * Purpose: Identifies this is a extended statistics upload confirmation
  9544. * message.
  9545. * Value: 0x1c
  9546. * - COOKIE_LSBS
  9547. * Bits 31:0
  9548. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9549. * message with its preceding host->target stats request message.
  9550. * Value: LSBs of the opaque cookie specified by the host-side requestor
  9551. * - COOKIE_MSBS
  9552. * Bits 31:0
  9553. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9554. * message with its preceding host->target stats request message.
  9555. * Value: MSBs of the opaque cookie specified by the host-side requestor
  9556. *
  9557. * Stats Information Element tag-length header fields:
  9558. * - STAT_TYPE
  9559. * Bits 7:0
  9560. * Purpose: identifies the type of statistics info held in the
  9561. * following information element
  9562. * Value: htt_dbg_ext_stats_type
  9563. * - STATUS
  9564. * Bits 10:8
  9565. * Purpose: indicate whether the requested stats are present
  9566. * Value: htt_dbg_ext_stats_status
  9567. * - DONE
  9568. * Bits 11
  9569. * Purpose:
  9570. * Indicates the completion of the stats entry, this will be the last
  9571. * stats conf HTT segment for the requested stats type.
  9572. * Value:
  9573. * 0 -> the stats retrieval is ongoing
  9574. * 1 -> the stats retrieval is complete
  9575. * - LENGTH
  9576. * Bits 31:16
  9577. * Purpose: indicate the stats information size
  9578. * Value: This field specifies the number of bytes of stats information
  9579. * that follows the element tag-length header.
  9580. * It is expected but not required that this length is a multiple of
  9581. * 4 bytes.
  9582. */
  9583. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  9584. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  9585. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  9586. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  9587. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  9588. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  9589. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  9590. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  9591. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  9592. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  9593. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  9594. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  9595. do { \
  9596. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  9597. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  9598. } while (0)
  9599. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  9600. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  9601. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  9602. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  9603. do { \
  9604. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  9605. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  9606. } while (0)
  9607. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  9608. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  9609. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  9610. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  9611. do { \
  9612. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  9613. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  9614. } while (0)
  9615. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  9616. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  9617. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  9618. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  9619. do { \
  9620. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  9621. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  9622. } while (0)
  9623. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  9624. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  9625. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  9626. typedef enum {
  9627. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  9628. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  9629. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  9630. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  9631. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  9632. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  9633. /* Reserved from 128 - 255 for target internal use.*/
  9634. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  9635. } HTT_PEER_TYPE;
  9636. /** 2 word representation of MAC addr */
  9637. typedef struct {
  9638. /** upper 4 bytes of MAC address */
  9639. A_UINT32 mac_addr31to0;
  9640. /** lower 2 bytes of MAC address */
  9641. A_UINT32 mac_addr47to32;
  9642. } htt_mac_addr;
  9643. /** macro to convert MAC address from char array to HTT word format */
  9644. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  9645. (phtt_mac_addr)->mac_addr31to0 = \
  9646. (((c_macaddr)[0] << 0) | \
  9647. ((c_macaddr)[1] << 8) | \
  9648. ((c_macaddr)[2] << 16) | \
  9649. ((c_macaddr)[3] << 24)); \
  9650. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  9651. } while (0)
  9652. /**
  9653. * @brief target -> host monitor mac header indication message
  9654. *
  9655. * @details
  9656. * The following diagram shows the format of the monitor mac header message
  9657. * sent from the target to the host.
  9658. * This message is primarily sent when promiscuous rx mode is enabled.
  9659. * One message is sent per rx PPDU.
  9660. *
  9661. * |31 24|23 16|15 8|7 0|
  9662. * |-------------------------------------------------------------|
  9663. * | peer_id | reserved0 | msg_type |
  9664. * |-------------------------------------------------------------|
  9665. * | reserved1 | num_mpdu |
  9666. * |-------------------------------------------------------------|
  9667. * | struct hw_rx_desc |
  9668. * | (see wal_rx_desc.h) |
  9669. * |-------------------------------------------------------------|
  9670. * | struct ieee80211_frame_addr4 |
  9671. * | (see ieee80211_defs.h) |
  9672. * |-------------------------------------------------------------|
  9673. * | struct ieee80211_frame_addr4 |
  9674. * | (see ieee80211_defs.h) |
  9675. * |-------------------------------------------------------------|
  9676. * | ...... |
  9677. * |-------------------------------------------------------------|
  9678. *
  9679. * Header fields:
  9680. * - msg_type
  9681. * Bits 7:0
  9682. * Purpose: Identifies this is a monitor mac header indication message.
  9683. * Value: 0x20
  9684. * - peer_id
  9685. * Bits 31:16
  9686. * Purpose: Software peer id given by host during association,
  9687. * During promiscuous mode, the peer ID will be invalid (0xFF)
  9688. * for rx PPDUs received from unassociated peers.
  9689. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  9690. * - num_mpdu
  9691. * Bits 15:0
  9692. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  9693. * delivered within the message.
  9694. * Value: 1 to 32
  9695. * num_mpdu is limited to a maximum value of 32, due to buffer
  9696. * size limits. For PPDUs with more than 32 MPDUs, only the
  9697. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  9698. * the PPDU will be provided.
  9699. */
  9700. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  9701. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  9702. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  9703. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  9704. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  9705. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  9706. do { \
  9707. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  9708. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  9709. } while (0)
  9710. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  9711. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  9712. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  9713. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  9714. do { \
  9715. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  9716. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  9717. } while (0)
  9718. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  9719. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  9720. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  9721. /**
  9722. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE Message
  9723. *
  9724. * @details
  9725. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  9726. * the flow pool associated with the specified ID is resized
  9727. *
  9728. * The message would appear as follows:
  9729. *
  9730. * |31 16|15 8|7 0|
  9731. * |---------------------------------+----------------+----------------|
  9732. * | reserved0 | Msg type |
  9733. * |-------------------------------------------------------------------|
  9734. * | flow pool new size | flow pool ID |
  9735. * |-------------------------------------------------------------------|
  9736. *
  9737. * The message is interpreted as follows:
  9738. * b'0:7 - msg_type: This will be set to
  9739. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  9740. *
  9741. * b'0:15 - flow pool ID: Existing flow pool ID
  9742. *
  9743. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  9744. *
  9745. */
  9746. PREPACK struct htt_flow_pool_resize_t {
  9747. A_UINT32 msg_type:8,
  9748. reserved0:24;
  9749. A_UINT32 flow_pool_id:16,
  9750. flow_pool_new_size:16;
  9751. } POSTPACK;
  9752. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  9753. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  9754. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  9755. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  9756. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  9757. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  9758. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  9759. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  9760. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  9761. do { \
  9762. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  9763. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  9764. } while (0)
  9765. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  9766. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  9767. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  9768. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  9769. do { \
  9770. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  9771. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  9772. } while (0)
  9773. /**
  9774. * @brief host -> target channel change message
  9775. *
  9776. * @details
  9777. * the meesage is generated by FW every time FW changes channel. This will be used by host mainly
  9778. * to associate RX frames to correct channel they were received on.
  9779. * The following field definitions describe the format of the HTT target
  9780. * to host channel change message.
  9781. * |31 16|15 8|7 5|4 0|
  9782. * |------------------------------------------------------------|
  9783. * | reserved | MSG_TYPE |
  9784. * |------------------------------------------------------------|
  9785. * | CHAN_MHZ |
  9786. * |------------------------------------------------------------|
  9787. * | BAND_CENTER_FREQ1 |
  9788. * |------------------------------------------------------------|
  9789. * | BAND_CENTER_FREQ2 |
  9790. * |------------------------------------------------------------|
  9791. * | CHAN_PHY_MODE |
  9792. * |------------------------------------------------------------|
  9793. * Header fields:
  9794. * - MSG_TYPE
  9795. * Bits 7:0
  9796. * Value: 0xf
  9797. * - CHAN_MHZ
  9798. * Bits 31:0
  9799. * Purpose: frequency of the primary 20mhz channel.
  9800. * - BAND_CENTER_FREQ1
  9801. * Bits 31:0
  9802. * Purpose: centre frequency of the full channel.
  9803. * - BAND_CENTER_FREQ2
  9804. * Bits 31:0
  9805. * Purpose: centre frequency2 of the channel. is only valid for 11acvht 80plus80.
  9806. * - CHAN_PHY_MODE
  9807. * Bits 31:0
  9808. * Purpose: phy mode of the channel.
  9809. */
  9810. PREPACK struct htt_chan_change_msg {
  9811. A_UINT32 chan_mhz; /* frequency in mhz */
  9812. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz*/
  9813. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  9814. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  9815. } POSTPACK;
  9816. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  9817. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  9818. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  9819. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  9820. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  9821. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  9822. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  9823. /*
  9824. * The read and write indices point to the data within the host buffer.
  9825. * Because the first 4 bytes of the host buffer is used for the read index and
  9826. * the next 4 bytes for the write index, the data itself starts at offset 8.
  9827. * The read index and write index are the byte offsets from the base of the
  9828. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  9829. * Refer the ASCII text picture below.
  9830. */
  9831. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  9832. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  9833. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  9834. /*
  9835. ***************************************************************************
  9836. *
  9837. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  9838. *
  9839. ***************************************************************************
  9840. *
  9841. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  9842. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  9843. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  9844. * written into the Host memory region mentioned below.
  9845. *
  9846. * Read index is updated by the Host. At any point of time, the read index will
  9847. * indicate the index that will next be read by the Host. The read index is
  9848. * in units of bytes offset from the base of the meta-data buffer.
  9849. *
  9850. * Write index is updated by the FW. At any point of time, the write index will
  9851. * indicate from where the FW can start writing any new data. The write index is
  9852. * in units of bytes offset from the base of the meta-data buffer.
  9853. *
  9854. * If the Host is not fast enough in reading the CFR data, any new capture data
  9855. * would be dropped if there is no space left to write the new captures.
  9856. *
  9857. * The last 4 bytes of the memory region will have the magic pattern
  9858. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  9859. * not overrun the host buffer.
  9860. *
  9861. * ,--------------------. read and write indices store the
  9862. * | | byte offset from the base of the
  9863. * | ,--------+--------. meta-data buffer to the next
  9864. * | | | | location within the data buffer
  9865. * | | v v that will be read / written
  9866. * ************************************************************************
  9867. * * Read * Write * * Magic *
  9868. * * index * index * CFR data1 ...... CFR data N * pattern *
  9869. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  9870. * ************************************************************************
  9871. * |<---------- data buffer ---------->|
  9872. *
  9873. * |<----------------- meta-data buffer allocated in Host ----------------|
  9874. *
  9875. * Note:
  9876. * - Considering the 4 bytes needed to store the Read index (R) and the
  9877. * Write index (W), the initial value is as follows:
  9878. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  9879. * - Buffer empty condition:
  9880. * R = W
  9881. *
  9882. * Regarding CFR data format:
  9883. * --------------------------
  9884. *
  9885. * Each CFR tone is stored in HW as 16-bits with the following format:
  9886. * {bits[15:12], bits[11:6], bits[5:0]} =
  9887. * {unsigned exponent (4 bits),
  9888. * signed mantissa_real (6 bits),
  9889. * signed mantissa_imag (6 bits)}
  9890. *
  9891. * CFR_real = mantissa_real * 2^(exponent-5)
  9892. * CFR_imag = mantissa_imag * 2^(exponent-5)
  9893. *
  9894. *
  9895. * The CFR data is written to the 16-bit unsigned output array (buff) in
  9896. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  9897. *
  9898. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  9899. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  9900. * .
  9901. * .
  9902. * .
  9903. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  9904. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  9905. */
  9906. /* Bandwidth of peer CFR captures */
  9907. typedef enum {
  9908. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  9909. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  9910. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  9911. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  9912. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  9913. HTT_PEER_CFR_CAPTURE_BW_MAX,
  9914. } HTT_PEER_CFR_CAPTURE_BW;
  9915. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  9916. * was captured
  9917. */
  9918. typedef enum {
  9919. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  9920. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  9921. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  9922. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  9923. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  9924. } HTT_PEER_CFR_CAPTURE_MODE;
  9925. typedef enum {
  9926. /* This message type is currently used for the below purpose:
  9927. *
  9928. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  9929. * wmi_peer_cfr_capture_cmd.
  9930. * If payload_present bit is set to 0 then the associated memory region
  9931. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  9932. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  9933. * message; the CFR dump will be present at the end of the message,
  9934. * after the chan_phy_mode.
  9935. */
  9936. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  9937. /* Always keep this last */
  9938. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  9939. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  9940. /**
  9941. * @brief target -> host CFR dump completion indication message definition
  9942. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  9943. *
  9944. * @details
  9945. * The following diagram shows the format of the Channel Frequency Response
  9946. * (CFR) dump completion indication. This inidcation is sent to the Host when
  9947. * the channel capture of a peer is copied by Firmware into the Host memory
  9948. *
  9949. * **************************************************************************
  9950. *
  9951. * Message format when the CFR capture message type is
  9952. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  9953. *
  9954. * **************************************************************************
  9955. *
  9956. * |31 16|15 |8|7 0|
  9957. * |----------------------------------------------------------------|
  9958. * header: | reserved |P| msg_type |
  9959. * word 0 | | | |
  9960. * |----------------------------------------------------------------|
  9961. * payload: | cfr_capture_msg_type |
  9962. * word 1 | |
  9963. * |----------------------------------------------------------------|
  9964. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  9965. * word 2 | | | | | | | | |
  9966. * |----------------------------------------------------------------|
  9967. * | mac_addr31to0 |
  9968. * word 3 | |
  9969. * |----------------------------------------------------------------|
  9970. * | unused / reserved | mac_addr47to32 |
  9971. * word 4 | | |
  9972. * |----------------------------------------------------------------|
  9973. * | index |
  9974. * word 5 | |
  9975. * |----------------------------------------------------------------|
  9976. * | length |
  9977. * word 6 | |
  9978. * |----------------------------------------------------------------|
  9979. * | timestamp |
  9980. * word 7 | |
  9981. * |----------------------------------------------------------------|
  9982. * | counter |
  9983. * word 8 | |
  9984. * |----------------------------------------------------------------|
  9985. * | chan_mhz |
  9986. * word 9 | |
  9987. * |----------------------------------------------------------------|
  9988. * | band_center_freq1 |
  9989. * word 10 | |
  9990. * |----------------------------------------------------------------|
  9991. * | band_center_freq2 |
  9992. * word 11 | |
  9993. * |----------------------------------------------------------------|
  9994. * | chan_phy_mode |
  9995. * word 12 | |
  9996. * |----------------------------------------------------------------|
  9997. * where,
  9998. * P - payload present bit (payload_present explained below)
  9999. * req_id - memory request id (mem_req_id explained below)
  10000. * S - status field (status explained below)
  10001. * capbw - capture bandwidth (capture_bw explained below)
  10002. * mode - mode of capture (mode explained below)
  10003. * sts - space time streams (sts_count explained below)
  10004. * chbw - channel bandwidth (channel_bw explained below)
  10005. * captype - capture type (cap_type explained below)
  10006. *
  10007. * The following field definitions describe the format of the CFR dump
  10008. * completion indication sent from the target to the host
  10009. *
  10010. * Header fields:
  10011. *
  10012. * Word 0
  10013. * - msg_type
  10014. * Bits 7:0
  10015. * Purpose: Identifies this as CFR TX completion indication
  10016. * Value: HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  10017. * - payload_present
  10018. * Bit 8
  10019. * Purpose: Identifies how CFR data is sent to host
  10020. * Value: 0 - If CFR Payload is written to host memory
  10021. * 1 - If CFR Payload is sent as part of HTT message
  10022. * (This is the requirement for SDIO/USB where it is
  10023. * not possible to write CFR data to host memory)
  10024. * - reserved
  10025. * Bits 31:9
  10026. * Purpose: Reserved
  10027. * Value: 0
  10028. *
  10029. * Payload fields:
  10030. *
  10031. * Word 1
  10032. * - cfr_capture_msg_type
  10033. * Bits 31:0
  10034. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  10035. * to specify the format used for the remainder of the message
  10036. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  10037. * (currently only MSG_TYPE_1 is defined)
  10038. *
  10039. * Word 2
  10040. * - mem_req_id
  10041. * Bits 6:0
  10042. * Purpose: Contain the mem request id of the region where the CFR capture
  10043. * has been stored - of type WMI_HOST_MEM_REQ_ID
  10044. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  10045. this value is invalid)
  10046. * - status
  10047. * Bit 7
  10048. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  10049. * Value: 1 (True) - Successful; 0 (False) - Not successful
  10050. * - capture_bw
  10051. * Bits 10:8
  10052. * Purpose: Carry the bandwidth of the CFR capture
  10053. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  10054. * - mode
  10055. * Bits 13:11
  10056. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  10057. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  10058. * - sts_count
  10059. * Bits 16:14
  10060. * Purpose: Carry the number of space time streams
  10061. * Value: Number of space time streams
  10062. * - channel_bw
  10063. * Bits 19:17
  10064. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  10065. * measurement
  10066. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  10067. * - cap_type
  10068. * Bits 23:20
  10069. * Purpose: Carry the type of the capture
  10070. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  10071. * - vdev_id
  10072. * Bits 31:24
  10073. * Purpose: Carry the virtual device id
  10074. * Value: vdev ID
  10075. *
  10076. * Word 3
  10077. * - mac_addr31to0
  10078. * Bits 31:0
  10079. * Purpose: Contain the bits 31:0 of the peer MAC address
  10080. * Value: Bits 31:0 of the peer MAC address
  10081. *
  10082. * Word 4
  10083. * - mac_addr47to32
  10084. * Bits 15:0
  10085. * Purpose: Contain the bits 47:32 of the peer MAC address
  10086. * Value: Bits 47:32 of the peer MAC address
  10087. *
  10088. * Word 5
  10089. * - index
  10090. * Bits 31:0
  10091. * Purpose: Contain the index at which this CFR dump was written in the Host
  10092. * allocated memory. This index is the number of bytes from the base address.
  10093. * Value: Index position
  10094. *
  10095. * Word 6
  10096. * - length
  10097. * Bits 31:0
  10098. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  10099. * Value: Length of the CFR capture of the peer
  10100. *
  10101. * Word 7
  10102. * - timestamp
  10103. * Bits 31:0
  10104. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  10105. * clock used for this timestamp is private to the target and not visible to
  10106. * the host i.e., Host can interpret only the relative timestamp deltas from
  10107. * one message to the next, but can't interpret the absolute timestamp from a
  10108. * single message.
  10109. * Value: Timestamp in microseconds
  10110. *
  10111. * Word 8
  10112. * - counter
  10113. * Bits 31:0
  10114. * Purpose: Carry the count of the current CFR capture from FW. This is
  10115. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  10116. * in host memory)
  10117. * Value: Count of the current CFR capture
  10118. *
  10119. * Word 9
  10120. * - chan_mhz
  10121. * Bits 31:0
  10122. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  10123. * Value: Primary 20 channel frequency
  10124. *
  10125. * Word 10
  10126. * - band_center_freq1
  10127. * Bits 31:0
  10128. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  10129. * Value: Center frequency 1 in MHz
  10130. *
  10131. * Word 11
  10132. * - band_center_freq2
  10133. * Bits 31:0
  10134. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  10135. * the VDEV
  10136. * 80plus80 mode
  10137. * Value: Center frequency 2 in MHz
  10138. *
  10139. * Word 12
  10140. * - chan_phy_mode
  10141. * Bits 31:0
  10142. * Purpose: Carry the phy mode of the channel, of the VDEV
  10143. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  10144. */
  10145. PREPACK struct htt_cfr_dump_ind_type_1 {
  10146. A_UINT32 mem_req_id:7,
  10147. status:1,
  10148. capture_bw:3,
  10149. mode:3,
  10150. sts_count:3,
  10151. channel_bw:3,
  10152. cap_type:4,
  10153. vdev_id:8;
  10154. htt_mac_addr addr;
  10155. A_UINT32 index;
  10156. A_UINT32 length;
  10157. A_UINT32 timestamp;
  10158. A_UINT32 counter;
  10159. struct htt_chan_change_msg chan;
  10160. } POSTPACK;
  10161. PREPACK struct htt_cfr_dump_compl_ind {
  10162. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  10163. union {
  10164. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  10165. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  10166. /* If there is a need to change the memory layout and its associated
  10167. * HTT indication format, a new CFR capture message type can be
  10168. * introduced and added into this union.
  10169. */
  10170. };
  10171. } POSTPACK;
  10172. /*
  10173. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  10174. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  10175. */
  10176. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  10177. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  10178. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  10179. do { \
  10180. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  10181. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  10182. } while(0)
  10183. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  10184. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  10185. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  10186. /*
  10187. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  10188. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  10189. */
  10190. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  10191. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  10192. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  10193. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  10194. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  10195. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  10196. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  10197. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  10198. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  10199. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  10200. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  10201. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  10202. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  10203. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  10204. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  10205. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  10206. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  10207. do { \
  10208. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  10209. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  10210. } while (0)
  10211. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  10212. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  10213. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  10214. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  10215. do { \
  10216. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  10217. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  10218. } while (0)
  10219. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  10220. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  10221. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  10222. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  10223. do { \
  10224. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  10225. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  10226. } while (0)
  10227. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  10228. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  10229. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  10230. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  10231. do { \
  10232. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  10233. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  10234. } while (0)
  10235. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  10236. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  10237. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  10238. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  10239. do { \
  10240. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  10241. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  10242. } while (0)
  10243. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  10244. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  10245. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  10246. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  10247. do { \
  10248. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  10249. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  10250. } while (0)
  10251. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  10252. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  10253. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  10254. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  10255. do { \
  10256. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  10257. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  10258. } while (0)
  10259. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  10260. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  10261. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  10262. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  10263. do { \
  10264. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  10265. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  10266. } while (0)
  10267. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  10268. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  10269. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  10270. /**
  10271. * @brief target -> host peer (PPDU) stats message
  10272. * HTT_T2H_MSG_TYPE_PEER_STATS_IND
  10273. * @details
  10274. * This message is generated by FW when FW is sending stats to host
  10275. * about one or more PPDUs that the FW has transmitted to one or more peers.
  10276. * This message is sent autonomously by the target rather than upon request
  10277. * by the host.
  10278. * The following field definitions describe the format of the HTT target
  10279. * to host peer stats indication message.
  10280. *
  10281. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  10282. * or more PPDU stats records.
  10283. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  10284. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  10285. * then the message would start with the
  10286. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  10287. * below.
  10288. *
  10289. * |31 16|15|14|13 11|10 9|8|7 0|
  10290. * |-------------------------------------------------------------|
  10291. * | reserved |MSG_TYPE |
  10292. * |-------------------------------------------------------------|
  10293. * rec 0 | TLV header |
  10294. * rec 0 |-------------------------------------------------------------|
  10295. * rec 0 | ppdu successful bytes |
  10296. * rec 0 |-------------------------------------------------------------|
  10297. * rec 0 | ppdu retry bytes |
  10298. * rec 0 |-------------------------------------------------------------|
  10299. * rec 0 | ppdu failed bytes |
  10300. * rec 0 |-------------------------------------------------------------|
  10301. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  10302. * rec 0 |-------------------------------------------------------------|
  10303. * rec 0 | retried MSDUs | successful MSDUs |
  10304. * rec 0 |-------------------------------------------------------------|
  10305. * rec 0 | TX duration | failed MSDUs |
  10306. * rec 0 |-------------------------------------------------------------|
  10307. * ...
  10308. * |-------------------------------------------------------------|
  10309. * rec N | TLV header |
  10310. * rec N |-------------------------------------------------------------|
  10311. * rec N | ppdu successful bytes |
  10312. * rec N |-------------------------------------------------------------|
  10313. * rec N | ppdu retry bytes |
  10314. * rec N |-------------------------------------------------------------|
  10315. * rec N | ppdu failed bytes |
  10316. * rec N |-------------------------------------------------------------|
  10317. * rec N | peer id | S|SG| BW | BA |A|rate code|
  10318. * rec N |-------------------------------------------------------------|
  10319. * rec N | retried MSDUs | successful MSDUs |
  10320. * rec N |-------------------------------------------------------------|
  10321. * rec N | TX duration | failed MSDUs |
  10322. * rec N |-------------------------------------------------------------|
  10323. *
  10324. * where:
  10325. * A = is A-MPDU flag
  10326. * BA = block-ack failure flags
  10327. * BW = bandwidth spec
  10328. * SG = SGI enabled spec
  10329. * S = skipped rate ctrl
  10330. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  10331. *
  10332. * Header
  10333. * ------
  10334. * dword0 - b'0:7 - msg_type : HTT_T2H_MSG_TYPE_PEER_STATS_IND
  10335. * dword0 - b'8:31 - reserved : Reserved for future use
  10336. *
  10337. * payload include below peer_stats information
  10338. * --------------------------------------------
  10339. * @TLV : HTT_PPDU_STATS_INFO_TLV
  10340. * @tx_success_bytes : total successful bytes in the PPDU.
  10341. * @tx_retry_bytes : total retried bytes in the PPDU.
  10342. * @tx_failed_bytes : total failed bytes in the PPDU.
  10343. * @tx_ratecode : rate code used for the PPDU.
  10344. * @is_ampdu : Indicates PPDU is AMPDU or not.
  10345. * @ba_ack_failed : BA/ACK failed for this PPDU
  10346. * b00 -> BA received
  10347. * b01 -> BA failed once
  10348. * b10 -> BA failed twice, when HW retry is enabled.
  10349. * @bw : BW
  10350. * b00 -> 20 MHz
  10351. * b01 -> 40 MHz
  10352. * b10 -> 80 MHz
  10353. * b11 -> 160 MHz (or 80+80)
  10354. * @sg : SGI enabled
  10355. * @s : skipped ratectrl
  10356. * @peer_id : peer id
  10357. * @tx_success_msdus : successful MSDUs
  10358. * @tx_retry_msdus : retried MSDUs
  10359. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  10360. * @tx_duration : Tx duration for the PPDU (microsecond units)
  10361. */
  10362. #endif