htt.h 499 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086
  1. /*
  2. * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /**
  27. * @file htt.h
  28. *
  29. * @details the public header file of HTT layer
  30. */
  31. #ifndef _HTT_H_
  32. #define _HTT_H_
  33. #include <htt_deps.h>
  34. #include <htt_common.h>
  35. /*
  36. * Unless explicitly specified to use 64 bits to represent physical addresses
  37. * (or more precisely, bus addresses), default to 32 bits.
  38. */
  39. #ifndef HTT_PADDR64
  40. #define HTT_PADDR64 0
  41. #endif
  42. #ifndef offsetof
  43. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  44. #endif
  45. /*
  46. * HTT version history:
  47. * 1.0 initial numbered version
  48. * 1.1 modifications to STATS messages.
  49. * These modifications are not backwards compatible, but since the
  50. * STATS messages themselves are non-essential (they are for debugging),
  51. * the 1.1 version of the HTT message library as a whole is compatible
  52. * with the 1.0 version.
  53. * 1.2 reset mask IE added to STATS_REQ message
  54. * 1.3 stat config IE added to STATS_REQ message
  55. *----
  56. * 2.0 FW rx PPDU desc added to RX_IND message
  57. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  58. *----
  59. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  60. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  61. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  62. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  63. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  64. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  65. * 3.5 Added flush and fail stats in rx_reorder stats structure
  66. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  67. * 3.7 Made changes to support EOS Mac_core 3.0
  68. * 3.8 Added txq_group information element definition;
  69. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  70. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  71. * Allow buffer addresses in bus-address format to be stored as
  72. * either 32 bits or 64 bits.
  73. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  74. * messages to specify which HTT options to use.
  75. * Initial TLV options cover:
  76. * - whether to use 32 or 64 bits to represent LL bus addresses
  77. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  78. * - how many tx queue groups to use
  79. * 3.11 Expand rx debug stats:
  80. * - Expand the rx_reorder_stats struct with stats about successful and
  81. * failed rx buffer allcoations.
  82. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  83. * the supply, allocation, use, and recycling of rx buffers for the
  84. * "remote ring" of rx buffers in host member in LL systems.
  85. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  86. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  87. * 3.13 Add constants + macros to support 64-bit address format for the
  88. * tx fragments descriptor, the rx ring buffer, and the rx ring
  89. * index shadow register.
  90. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  91. * - Add htt_tx_msdu_desc_ext_t struct def.
  92. * - Add TLV to specify whether the target supports the HTT tx MSDU
  93. * extension descriptor.
  94. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  95. * "extension" bit, to specify whether a HTT tx MSDU extension
  96. * descriptor is present.
  97. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  98. * (This allows the host to obtain key information about the MSDU
  99. * from a memory location already in the cache, rather than taking a
  100. * cache miss for each MSDU by reading the HW rx descs.)
  101. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  102. * whether a copy-engine classification result is appended to TX_FRM.
  103. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  104. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  105. * tx frames in the target after the peer has already been deleted.
  106. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  107. * 3.20 Expand rx_reorder_stats.
  108. * 3.21 Add optional rx channel spec to HL RX_IND.
  109. * 3.22 Expand rx_reorder_stats
  110. * (distinguish duplicates within vs. outside block ack window)
  111. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  112. * The justified rate is calculated by two steps. The first is to multiply
  113. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  114. * by a low pass filter.
  115. * This change allows HL download scheduling to consider the WLAN rate
  116. * that will be used for transmitting the downloaded frames.
  117. * 3.24 Expand rx_reorder_stats
  118. * (add counter for decrypt / MIC errors)
  119. * 3.25 Expand rx_reorder_stats
  120. * (add counter of frames received into both local + remote rings)
  121. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  122. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  123. * 3.27 Add a new interface for flow-control. The following t2h messages have
  124. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  125. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  126. * 3.28 Add a new interface for ring interface change. The following two h2t
  127. * and one t2h messages have been included:
  128. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  129. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  130. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  131. * information elements passed from the host to a Lithium target,
  132. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  133. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  134. * targets).
  135. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  136. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  137. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  138. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  139. * sharing stats
  140. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  141. * 3.34 Add HW_PEER_ID field to PEER_MAP
  142. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  143. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  144. * not yet in use)
  145. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  146. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  147. * 3.38 Add holes_no_filled field to rx_reorder_stats
  148. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  149. * 3.40 Add optional timestamps in the HTT tx completion
  150. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  151. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  152. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  153. * 3.44 Add htt_tx_wbm_completion_v2
  154. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  155. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  156. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  157. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  158. * HTT_T2H_MSG_TYPE_PKTLOG
  159. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  160. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  161. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  162. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  163. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  165. * 3.55 Add initiator / responder flags to RX_DELBA indication
  166. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  167. */
  168. #define HTT_CURRENT_VERSION_MAJOR 3
  169. #define HTT_CURRENT_VERSION_MINOR 56
  170. #define HTT_NUM_TX_FRAG_DESC 1024
  171. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  172. #define HTT_CHECK_SET_VAL(field, val) \
  173. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  174. /* macros to assist in sign-extending fields from HTT messages */
  175. #define HTT_SIGN_BIT_MASK(field) \
  176. ((field ## _M + (1 << field ## _S)) >> 1)
  177. #define HTT_SIGN_BIT(_val, field) \
  178. (_val & HTT_SIGN_BIT_MASK(field))
  179. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  180. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  181. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  182. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  183. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  184. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  185. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  186. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  187. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  188. /*
  189. * TEMPORARY:
  190. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  191. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  192. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  193. * updated.
  194. */
  195. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  196. /*
  197. * TEMPORARY:
  198. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  199. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  200. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  201. * updated.
  202. */
  203. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  204. /* HTT Access Category values */
  205. enum HTT_AC_WMM {
  206. /* WMM Access Categories */
  207. HTT_AC_WMM_BE = 0x0,
  208. HTT_AC_WMM_BK = 0x1,
  209. HTT_AC_WMM_VI = 0x2,
  210. HTT_AC_WMM_VO = 0x3,
  211. /* extension Access Categories */
  212. HTT_AC_EXT_NON_QOS = 0x4,
  213. HTT_AC_EXT_UCAST_MGMT = 0x5,
  214. HTT_AC_EXT_MCAST_DATA = 0x6,
  215. HTT_AC_EXT_MCAST_MGMT = 0x7,
  216. };
  217. enum HTT_AC_WMM_MASK {
  218. /* WMM Access Categories */
  219. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  220. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  221. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  222. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  223. /* extension Access Categories */
  224. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  225. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  226. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  227. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  228. };
  229. #define HTT_AC_MASK_WMM \
  230. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  231. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  232. #define HTT_AC_MASK_EXT \
  233. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  234. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  235. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  236. /*
  237. * htt_dbg_stats_type -
  238. * bit positions for each stats type within a stats type bitmask
  239. * The bitmask contains 24 bits.
  240. */
  241. enum htt_dbg_stats_type {
  242. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  243. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  244. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  245. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  246. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  247. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  248. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  249. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  250. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  251. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  252. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  253. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  254. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  255. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  256. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  257. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  258. /* bits 16-23 currently reserved */
  259. /* keep this last */
  260. HTT_DBG_NUM_STATS
  261. };
  262. /*=== HTT option selection TLVs ===
  263. * Certain HTT messages have alternatives or options.
  264. * For such cases, the host and target need to agree on which option to use.
  265. * Option specification TLVs can be appended to the VERSION_REQ and
  266. * VERSION_CONF messages to select options other than the default.
  267. * These TLVs are entirely optional - if they are not provided, there is a
  268. * well-defined default for each option. If they are provided, they can be
  269. * provided in any order. Each TLV can be present or absent independent of
  270. * the presence / absence of other TLVs.
  271. *
  272. * The HTT option selection TLVs use the following format:
  273. * |31 16|15 8|7 0|
  274. * |---------------------------------+----------------+----------------|
  275. * | value (payload) | length | tag |
  276. * |-------------------------------------------------------------------|
  277. * The value portion need not be only 2 bytes; it can be extended by any
  278. * integer number of 4-byte units. The total length of the TLV, including
  279. * the tag and length fields, must be a multiple of 4 bytes. The length
  280. * field specifies the total TLV size in 4-byte units. Thus, the typical
  281. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  282. * field, would store 0x1 in its length field, to show that the TLV occupies
  283. * a single 4-byte unit.
  284. */
  285. /*--- TLV header format - applies to all HTT option TLVs ---*/
  286. enum HTT_OPTION_TLV_TAGS {
  287. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  288. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  289. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  290. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  291. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  292. };
  293. PREPACK struct htt_option_tlv_header_t {
  294. A_UINT8 tag;
  295. A_UINT8 length;
  296. } POSTPACK;
  297. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  298. #define HTT_OPTION_TLV_TAG_S 0
  299. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  300. #define HTT_OPTION_TLV_LENGTH_S 8
  301. /*
  302. * value0 - 16 bit value field stored in word0
  303. * The TLV's value field may be longer than 2 bytes, in which case
  304. * the remainder of the value is stored in word1, word2, etc.
  305. */
  306. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  307. #define HTT_OPTION_TLV_VALUE0_S 16
  308. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  309. do { \
  310. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  311. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  312. } while (0)
  313. #define HTT_OPTION_TLV_TAG_GET(word) \
  314. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  315. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  316. do { \
  317. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  318. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  319. } while (0)
  320. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  321. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  322. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  323. do { \
  324. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  325. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  326. } while (0)
  327. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  328. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  329. /*--- format of specific HTT option TLVs ---*/
  330. /*
  331. * HTT option TLV for specifying LL bus address size
  332. * Some chips require bus addresses used by the target to access buffers
  333. * within the host's memory to be 32 bits; others require bus addresses
  334. * used by the target to access buffers within the host's memory to be
  335. * 64 bits.
  336. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  337. * a suffix to the VERSION_CONF message to specify which bus address format
  338. * the target requires.
  339. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  340. * default to providing bus addresses to the target in 32-bit format.
  341. */
  342. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  343. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  344. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  345. };
  346. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  347. struct htt_option_tlv_header_t hdr;
  348. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  349. } POSTPACK;
  350. /*
  351. * HTT option TLV for specifying whether HL systems should indicate
  352. * over-the-air tx completion for individual frames, or should instead
  353. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  354. * requests an OTA tx completion for a particular tx frame.
  355. * This option does not apply to LL systems, where the TX_COMPL_IND
  356. * is mandatory.
  357. * This option is primarily intended for HL systems in which the tx frame
  358. * downloads over the host --> target bus are as slow as or slower than
  359. * the transmissions over the WLAN PHY. For cases where the bus is faster
  360. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  361. * and consquently will send one TX_COMPL_IND message that covers several
  362. * tx frames. For cases where the WLAN PHY is faster than the bus,
  363. * the target will end up transmitting very short A-MPDUs, and consequently
  364. * sending many TX_COMPL_IND messages, which each cover a very small number
  365. * of tx frames.
  366. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  367. * a suffix to the VERSION_REQ message to request whether the host desires to
  368. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  369. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  370. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  371. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  372. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  373. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  374. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  375. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  376. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  377. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  378. * TLV.
  379. */
  380. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  381. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  382. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  383. };
  384. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  385. struct htt_option_tlv_header_t hdr;
  386. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  387. } POSTPACK;
  388. /*
  389. * HTT option TLV for specifying how many tx queue groups the target
  390. * may establish.
  391. * This TLV specifies the maximum value the target may send in the
  392. * txq_group_id field of any TXQ_GROUP information elements sent by
  393. * the target to the host. This allows the host to pre-allocate an
  394. * appropriate number of tx queue group structs.
  395. *
  396. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  397. * a suffix to the VERSION_REQ message to specify whether the host supports
  398. * tx queue groups at all, and if so if there is any limit on the number of
  399. * tx queue groups that the host supports.
  400. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  401. * a suffix to the VERSION_CONF message. If the host has specified in the
  402. * VER_REQ message a limit on the number of tx queue groups the host can
  403. * supprt, the target shall limit its specification of the maximum tx groups
  404. * to be no larger than this host-specified limit.
  405. *
  406. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  407. * shall preallocate 4 tx queue group structs, and the target shall not
  408. * specify a txq_group_id larger than 3.
  409. */
  410. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  411. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  412. /*
  413. * values 1 through N specify the max number of tx queue groups
  414. * the sender supports
  415. */
  416. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  417. };
  418. /* TEMPORARY backwards-compatibility alias for a typo fix -
  419. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  420. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  421. * to support the old name (with the typo) until all references to the
  422. * old name are replaced with the new name.
  423. */
  424. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  425. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  426. struct htt_option_tlv_header_t hdr;
  427. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  428. } POSTPACK;
  429. /*
  430. * HTT option TLV for specifying whether the target supports an extended
  431. * version of the HTT tx descriptor. If the target provides this TLV
  432. * and specifies in the TLV that the target supports an extended version
  433. * of the HTT tx descriptor, the target must check the "extension" bit in
  434. * the HTT tx descriptor, and if the extension bit is set, to expect a
  435. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  436. * descriptor. Furthermore, the target must provide room for the HTT
  437. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  438. * This option is intended for systems where the host needs to explicitly
  439. * control the transmission parameters such as tx power for individual
  440. * tx frames.
  441. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  442. * as a suffix to the VERSION_CONF message to explicitly specify whether
  443. * the target supports the HTT tx MSDU extension descriptor.
  444. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  445. * by the host as lack of target support for the HTT tx MSDU extension
  446. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  447. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  448. * the HTT tx MSDU extension descriptor.
  449. * The host is not required to provide the HTT tx MSDU extension descriptor
  450. * just because the target supports it; the target must check the
  451. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  452. * extension descriptor is present.
  453. */
  454. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  455. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  456. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  457. };
  458. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  459. struct htt_option_tlv_header_t hdr;
  460. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  461. } POSTPACK;
  462. /*=== host -> target messages ===============================================*/
  463. enum htt_h2t_msg_type {
  464. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  465. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  466. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  467. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  468. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  469. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  470. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  471. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  472. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  473. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  474. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  475. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  476. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  477. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  478. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  479. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  480. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  481. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  482. /* keep this last */
  483. HTT_H2T_NUM_MSGS
  484. };
  485. /*
  486. * HTT host to target message type -
  487. * stored in bits 7:0 of the first word of the message
  488. */
  489. #define HTT_H2T_MSG_TYPE_M 0xff
  490. #define HTT_H2T_MSG_TYPE_S 0
  491. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  492. do { \
  493. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  494. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  495. } while (0)
  496. #define HTT_H2T_MSG_TYPE_GET(word) \
  497. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  498. /**
  499. * @brief host -> target version number request message definition
  500. *
  501. * |31 24|23 16|15 8|7 0|
  502. * |----------------+----------------+----------------+----------------|
  503. * | reserved | msg type |
  504. * |-------------------------------------------------------------------|
  505. * : option request TLV (optional) |
  506. * :...................................................................:
  507. *
  508. * The VER_REQ message may consist of a single 4-byte word, or may be
  509. * extended with TLVs that specify which HTT options the host is requesting
  510. * from the target.
  511. * The following option TLVs may be appended to the VER_REQ message:
  512. * - HL_SUPPRESS_TX_COMPL_IND
  513. * - HL_MAX_TX_QUEUE_GROUPS
  514. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  515. * may be appended to the VER_REQ message (but only one TLV of each type).
  516. *
  517. * Header fields:
  518. * - MSG_TYPE
  519. * Bits 7:0
  520. * Purpose: identifies this as a version number request message
  521. * Value: 0x0
  522. */
  523. #define HTT_VER_REQ_BYTES 4
  524. /* TBDXXX: figure out a reasonable number */
  525. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  526. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  527. /**
  528. * @brief HTT tx MSDU descriptor
  529. *
  530. * @details
  531. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  532. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  533. * the target firmware needs for the FW's tx processing, particularly
  534. * for creating the HW msdu descriptor.
  535. * The same HTT tx descriptor is used for HL and LL systems, though
  536. * a few fields within the tx descriptor are used only by LL or
  537. * only by HL.
  538. * The HTT tx descriptor is defined in two manners: by a struct with
  539. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  540. * definitions.
  541. * The target should use the struct def, for simplicitly and clarity,
  542. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  543. * neutral. Specifically, the host shall use the get/set macros built
  544. * around the mask + shift defs.
  545. */
  546. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  547. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  548. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  549. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  550. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  551. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  552. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  553. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  554. #define HTT_TX_VDEV_ID_WORD 0
  555. #define HTT_TX_VDEV_ID_MASK 0x3f
  556. #define HTT_TX_VDEV_ID_SHIFT 16
  557. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  558. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  559. #define HTT_TX_MSDU_LEN_DWORD 1
  560. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  561. /*
  562. * HTT_VAR_PADDR macros
  563. * Allow physical / bus addresses to be either a single 32-bit value,
  564. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  565. */
  566. #define HTT_VAR_PADDR32(var_name) \
  567. A_UINT32 var_name
  568. #define HTT_VAR_PADDR64_LE(var_name) \
  569. struct { \
  570. /* little-endian: lo precedes hi */ \
  571. A_UINT32 lo; \
  572. A_UINT32 hi; \
  573. } var_name
  574. /*
  575. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  576. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  577. * addresses are stored in a XXX-bit field.
  578. * This macro is used to define both htt_tx_msdu_desc32_t and
  579. * htt_tx_msdu_desc64_t structs.
  580. */
  581. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  582. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  583. { \
  584. /* DWORD 0: flags and meta-data */ \
  585. A_UINT32 \
  586. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  587. \
  588. /* pkt_subtype - \
  589. * Detailed specification of the tx frame contents, extending the \
  590. * general specification provided by pkt_type. \
  591. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  592. * pkt_type | pkt_subtype \
  593. * ============================================================== \
  594. * 802.3 | bit 0:3 - Reserved \
  595. * | bit 4: 0x0 - Copy-Engine Classification Results \
  596. * | not appended to the HTT message \
  597. * | 0x1 - Copy-Engine Classification Results \
  598. * | appended to the HTT message in the \
  599. * | format: \
  600. * | [HTT tx desc, frame header, \
  601. * | CE classification results] \
  602. * | The CE classification results begin \
  603. * | at the next 4-byte boundary after \
  604. * | the frame header. \
  605. * ------------+------------------------------------------------- \
  606. * Eth2 | bit 0:3 - Reserved \
  607. * | bit 4: 0x0 - Copy-Engine Classification Results \
  608. * | not appended to the HTT message \
  609. * | 0x1 - Copy-Engine Classification Results \
  610. * | appended to the HTT message. \
  611. * | See the above specification of the \
  612. * | CE classification results location. \
  613. * ------------+------------------------------------------------- \
  614. * native WiFi | bit 0:3 - Reserved \
  615. * | bit 4: 0x0 - Copy-Engine Classification Results \
  616. * | not appended to the HTT message \
  617. * | 0x1 - Copy-Engine Classification Results \
  618. * | appended to the HTT message. \
  619. * | See the above specification of the \
  620. * | CE classification results location. \
  621. * ------------+------------------------------------------------- \
  622. * mgmt | 0x0 - 802.11 MAC header absent \
  623. * | 0x1 - 802.11 MAC header present \
  624. * ------------+------------------------------------------------- \
  625. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  626. * | 0x1 - 802.11 MAC header present \
  627. * | bit 1: 0x0 - allow aggregation \
  628. * | 0x1 - don't allow aggregation \
  629. * | bit 2: 0x0 - perform encryption \
  630. * | 0x1 - don't perform encryption \
  631. * | bit 3: 0x0 - perform tx classification / queuing \
  632. * | 0x1 - don't perform tx classification; \
  633. * | insert the frame into the "misc" \
  634. * | tx queue \
  635. * | bit 4: 0x0 - Copy-Engine Classification Results \
  636. * | not appended to the HTT message \
  637. * | 0x1 - Copy-Engine Classification Results \
  638. * | appended to the HTT message. \
  639. * | See the above specification of the \
  640. * | CE classification results location. \
  641. */ \
  642. pkt_subtype: 5, \
  643. \
  644. /* pkt_type - \
  645. * General specification of the tx frame contents. \
  646. * The htt_pkt_type enum should be used to specify and check the \
  647. * value of this field. \
  648. */ \
  649. pkt_type: 3, \
  650. \
  651. /* vdev_id - \
  652. * ID for the vdev that is sending this tx frame. \
  653. * For certain non-standard packet types, e.g. pkt_type == raw \
  654. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  655. * This field is used primarily for determining where to queue \
  656. * broadcast and multicast frames. \
  657. */ \
  658. vdev_id: 6, \
  659. /* ext_tid - \
  660. * The extended traffic ID. \
  661. * If the TID is unknown, the extended TID is set to \
  662. * HTT_TX_EXT_TID_INVALID. \
  663. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  664. * value of the QoS TID. \
  665. * If the tx frame is non-QoS data, then the extended TID is set to \
  666. * HTT_TX_EXT_TID_NON_QOS. \
  667. * If the tx frame is multicast or broadcast, then the extended TID \
  668. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  669. */ \
  670. ext_tid: 5, \
  671. \
  672. /* postponed - \
  673. * This flag indicates whether the tx frame has been downloaded to \
  674. * the target before but discarded by the target, and now is being \
  675. * downloaded again; or if this is a new frame that is being \
  676. * downloaded for the first time. \
  677. * This flag allows the target to determine the correct order for \
  678. * transmitting new vs. old frames. \
  679. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  680. * This flag only applies to HL systems, since in LL systems, \
  681. * the tx flow control is handled entirely within the target. \
  682. */ \
  683. postponed: 1, \
  684. \
  685. /* extension - \
  686. * This flag indicates whether a HTT tx MSDU extension descriptor \
  687. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  688. * \
  689. * 0x0 - no extension MSDU descriptor is present \
  690. * 0x1 - an extension MSDU descriptor immediately follows the \
  691. * regular MSDU descriptor \
  692. */ \
  693. extension: 1, \
  694. \
  695. /* cksum_offload - \
  696. * This flag indicates whether checksum offload is enabled or not \
  697. * for this frame. Target FW use this flag to turn on HW checksumming \
  698. * 0x0 - No checksum offload \
  699. * 0x1 - L3 header checksum only \
  700. * 0x2 - L4 checksum only \
  701. * 0x3 - L3 header checksum + L4 checksum \
  702. */ \
  703. cksum_offload: 2, \
  704. \
  705. /* tx_comp_req - \
  706. * This flag indicates whether Tx Completion \
  707. * from fw is required or not. \
  708. * This flag is only relevant if tx completion is not \
  709. * universally enabled. \
  710. * For all LL systems, tx completion is mandatory, \
  711. * so this flag will be irrelevant. \
  712. * For HL systems tx completion is optional, but HL systems in which \
  713. * the bus throughput exceeds the WLAN throughput will \
  714. * probably want to always use tx completion, and thus \
  715. * would not check this flag. \
  716. * This flag is required when tx completions are not used universally, \
  717. * but are still required for certain tx frames for which \
  718. * an OTA delivery acknowledgment is needed by the host. \
  719. * In practice, this would be for HL systems in which the \
  720. * bus throughput is less than the WLAN throughput. \
  721. * \
  722. * 0x0 - Tx Completion Indication from Fw not required \
  723. * 0x1 - Tx Completion Indication from Fw is required \
  724. */ \
  725. tx_compl_req: 1; \
  726. \
  727. \
  728. /* DWORD 1: MSDU length and ID */ \
  729. A_UINT32 \
  730. len: 16, /* MSDU length, in bytes */ \
  731. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  732. * and this id is used to calculate fragmentation \
  733. * descriptor pointer inside the target based on \
  734. * the base address, configured inside the target. \
  735. */ \
  736. \
  737. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  738. /* frags_desc_ptr - \
  739. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  740. * where the tx frame's fragments reside in memory. \
  741. * This field only applies to LL systems, since in HL systems the \
  742. * (degenerate single-fragment) fragmentation descriptor is created \
  743. * within the target. \
  744. */ \
  745. _paddr__frags_desc_ptr_; \
  746. \
  747. /* DWORD 3 (or 4): peerid, chanfreq */ \
  748. /* \
  749. * Peer ID : Target can use this value to know which peer-id packet \
  750. * destined to. \
  751. * It's intended to be specified by host in case of NAWDS. \
  752. */ \
  753. A_UINT16 peerid; \
  754. \
  755. /* \
  756. * Channel frequency: This identifies the desired channel \
  757. * frequency (in mhz) for tx frames. This is used by FW to help \
  758. * determine when it is safe to transmit or drop frames for \
  759. * off-channel operation. \
  760. * The default value of zero indicates to FW that the corresponding \
  761. * VDEV's home channel (if there is one) is the desired channel \
  762. * frequency. \
  763. */ \
  764. A_UINT16 chanfreq; \
  765. \
  766. /* Reason reserved is commented is increasing the htt structure size \
  767. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  768. * A_UINT32 reserved_dword3_bits0_31; \
  769. */ \
  770. } POSTPACK
  771. /* define a htt_tx_msdu_desc32_t type */
  772. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  773. /* define a htt_tx_msdu_desc64_t type */
  774. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  775. /*
  776. * Make htt_tx_msdu_desc_t be an alias for either
  777. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  778. */
  779. #if HTT_PADDR64
  780. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  781. #else
  782. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  783. #endif
  784. /* decriptor information for Management frame*/
  785. /*
  786. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  787. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  788. */
  789. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  790. extern A_UINT32 mgmt_hdr_len;
  791. PREPACK struct htt_mgmt_tx_desc_t {
  792. A_UINT32 msg_type;
  793. #if HTT_PADDR64
  794. A_UINT64 frag_paddr; /* DMAble address of the data */
  795. #else
  796. A_UINT32 frag_paddr; /* DMAble address of the data */
  797. #endif
  798. A_UINT32 desc_id; /* returned to host during completion
  799. * to free the meory*/
  800. A_UINT32 len; /* Fragment length */
  801. A_UINT32 vdev_id; /* virtual device ID*/
  802. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  803. } POSTPACK;
  804. PREPACK struct htt_mgmt_tx_compl_ind {
  805. A_UINT32 desc_id;
  806. A_UINT32 status;
  807. } POSTPACK;
  808. /*
  809. * This SDU header size comes from the summation of the following:
  810. * 1. Max of:
  811. * a. Native WiFi header, for native WiFi frames: 24 bytes
  812. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  813. * b. 802.11 header, for raw frames: 36 bytes
  814. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  815. * QoS header, HT header)
  816. * c. 802.3 header, for ethernet frames: 14 bytes
  817. * (destination address, source address, ethertype / length)
  818. * 2. Max of:
  819. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  820. * b. IPv6 header, up through the Traffic Class: 2 bytes
  821. * 3. 802.1Q VLAN header: 4 bytes
  822. * 4. LLC/SNAP header: 8 bytes
  823. */
  824. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  825. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  826. #define HTT_TX_HDR_SIZE_ETHERNET 14
  827. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  828. A_COMPILE_TIME_ASSERT(
  829. htt_encap_hdr_size_max_check_nwifi,
  830. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  831. A_COMPILE_TIME_ASSERT(
  832. htt_encap_hdr_size_max_check_enet,
  833. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  834. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  835. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  836. #define HTT_TX_HDR_SIZE_802_1Q 4
  837. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  838. #define HTT_COMMON_TX_FRM_HDR_LEN \
  839. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  840. HTT_TX_HDR_SIZE_802_1Q + \
  841. HTT_TX_HDR_SIZE_LLC_SNAP)
  842. #define HTT_HL_TX_FRM_HDR_LEN \
  843. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  844. #define HTT_LL_TX_FRM_HDR_LEN \
  845. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  846. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  847. /* dword 0 */
  848. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  849. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  850. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  851. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  852. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  853. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  854. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  855. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  856. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  857. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  858. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  859. #define HTT_TX_DESC_PKT_TYPE_S 13
  860. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  861. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  862. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  863. #define HTT_TX_DESC_VDEV_ID_S 16
  864. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  865. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  866. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  867. #define HTT_TX_DESC_EXT_TID_S 22
  868. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  869. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  870. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  871. #define HTT_TX_DESC_POSTPONED_S 27
  872. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  873. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  874. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  875. #define HTT_TX_DESC_EXTENSION_S 28
  876. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  877. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  878. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  879. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  880. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  881. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  882. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  883. #define HTT_TX_DESC_TX_COMP_S 31
  884. /* dword 1 */
  885. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  886. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  887. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  888. #define HTT_TX_DESC_FRM_LEN_S 0
  889. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  890. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  891. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  892. #define HTT_TX_DESC_FRM_ID_S 16
  893. /* dword 2 */
  894. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  895. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  896. /* for systems using 64-bit format for bus addresses */
  897. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  898. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  899. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  900. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  901. /* for systems using 32-bit format for bus addresses */
  902. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  903. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  904. /* dword 3 */
  905. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  906. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  907. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  908. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  909. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  910. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  911. #if HTT_PADDR64
  912. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  913. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  914. #else
  915. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  916. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  917. #endif
  918. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  919. #define HTT_TX_DESC_PEER_ID_S 0
  920. /*
  921. * TEMPORARY:
  922. * The original definitions for the PEER_ID fields contained typos
  923. * (with _DESC_PADDR appended to this PEER_ID field name).
  924. * Retain deprecated original names for PEER_ID fields until all code that
  925. * refers to them has been updated.
  926. */
  927. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  928. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  929. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  930. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  931. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  932. HTT_TX_DESC_PEER_ID_M
  933. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  934. HTT_TX_DESC_PEER_ID_S
  935. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  936. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  937. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  938. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  939. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  940. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  941. #if HTT_PADDR64
  942. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  943. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  944. #else
  945. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  946. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  947. #endif
  948. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  949. #define HTT_TX_DESC_CHAN_FREQ_S 16
  950. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  951. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  952. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  953. do { \
  954. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  955. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  956. } while (0)
  957. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  958. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  959. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  960. do { \
  961. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  962. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  963. } while (0)
  964. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  965. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  966. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  967. do { \
  968. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  969. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  970. } while (0)
  971. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  972. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  973. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  974. do { \
  975. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  976. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  977. } while (0)
  978. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  979. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  980. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  981. do { \
  982. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  983. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  984. } while (0)
  985. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  986. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  987. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  988. do { \
  989. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  990. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  991. } while (0)
  992. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  993. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  994. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  995. do { \
  996. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  997. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  998. } while (0)
  999. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1000. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1001. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1002. do { \
  1003. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1004. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1005. } while (0)
  1006. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1007. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1008. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1009. do { \
  1010. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1011. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1012. } while (0)
  1013. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1014. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1015. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1016. do { \
  1017. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1018. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1019. } while (0)
  1020. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1021. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1022. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1023. do { \
  1024. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1025. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1026. } while (0)
  1027. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1028. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1029. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1030. do { \
  1031. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1032. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1033. } while (0)
  1034. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1035. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1036. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1037. do { \
  1038. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1039. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1040. } while (0)
  1041. /* enums used in the HTT tx MSDU extension descriptor */
  1042. enum {
  1043. htt_tx_guard_interval_regular = 0,
  1044. htt_tx_guard_interval_short = 1,
  1045. };
  1046. enum {
  1047. htt_tx_preamble_type_ofdm = 0,
  1048. htt_tx_preamble_type_cck = 1,
  1049. htt_tx_preamble_type_ht = 2,
  1050. htt_tx_preamble_type_vht = 3,
  1051. };
  1052. enum {
  1053. htt_tx_bandwidth_5MHz = 0,
  1054. htt_tx_bandwidth_10MHz = 1,
  1055. htt_tx_bandwidth_20MHz = 2,
  1056. htt_tx_bandwidth_40MHz = 3,
  1057. htt_tx_bandwidth_80MHz = 4,
  1058. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1059. };
  1060. /**
  1061. * @brief HTT tx MSDU extension descriptor
  1062. * @details
  1063. * If the target supports HTT tx MSDU extension descriptors, the host has
  1064. * the option of appending the following struct following the regular
  1065. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1066. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1067. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1068. * tx specs for each frame.
  1069. */
  1070. PREPACK struct htt_tx_msdu_desc_ext_t {
  1071. /* DWORD 0: flags */
  1072. A_UINT32
  1073. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1074. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1075. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1076. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1077. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1078. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1079. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1080. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1081. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1082. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1083. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1084. /* DWORD 1: tx power, tx rate, tx BW */
  1085. A_UINT32
  1086. /* pwr -
  1087. * Specify what power the tx frame needs to be transmitted at.
  1088. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1089. * The value needs to be appropriately sign-extended when extracting
  1090. * the value from the message and storing it in a variable that is
  1091. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1092. * automatically handles this sign-extension.)
  1093. * If the transmission uses multiple tx chains, this power spec is
  1094. * the total transmit power, assuming incoherent combination of
  1095. * per-chain power to produce the total power.
  1096. */
  1097. pwr: 8,
  1098. /* mcs_mask -
  1099. * Specify the allowable values for MCS index (modulation and coding)
  1100. * to use for transmitting the frame.
  1101. *
  1102. * For HT / VHT preamble types, this mask directly corresponds to
  1103. * the HT or VHT MCS indices that are allowed. For each bit N set
  1104. * within the mask, MCS index N is allowed for transmitting the frame.
  1105. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1106. * rates versus OFDM rates, so the host has the option of specifying
  1107. * that the target must transmit the frame with CCK or OFDM rates
  1108. * (not HT or VHT), but leaving the decision to the target whether
  1109. * to use CCK or OFDM.
  1110. *
  1111. * For CCK and OFDM, the bits within this mask are interpreted as
  1112. * follows:
  1113. * bit 0 -> CCK 1 Mbps rate is allowed
  1114. * bit 1 -> CCK 2 Mbps rate is allowed
  1115. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1116. * bit 3 -> CCK 11 Mbps rate is allowed
  1117. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1118. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1119. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1120. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1121. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1122. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1123. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1124. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1125. *
  1126. * The MCS index specification needs to be compatible with the
  1127. * bandwidth mask specification. For example, a MCS index == 9
  1128. * specification is inconsistent with a preamble type == VHT,
  1129. * Nss == 1, and channel bandwidth == 20 MHz.
  1130. *
  1131. * Furthermore, the host has only a limited ability to specify to
  1132. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1133. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1134. */
  1135. mcs_mask: 12,
  1136. /* nss_mask -
  1137. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1138. * Each bit in this mask corresponds to a Nss value:
  1139. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1140. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1141. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1142. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1143. * The values in the Nss mask must be suitable for the recipient, e.g.
  1144. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1145. * recipient which only supports 2x2 MIMO.
  1146. */
  1147. nss_mask: 4,
  1148. /* guard_interval -
  1149. * Specify a htt_tx_guard_interval enum value to indicate whether
  1150. * the transmission should use a regular guard interval or a
  1151. * short guard interval.
  1152. */
  1153. guard_interval: 1,
  1154. /* preamble_type_mask -
  1155. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1156. * may choose from for transmitting this frame.
  1157. * The bits in this mask correspond to the values in the
  1158. * htt_tx_preamble_type enum. For example, to allow the target
  1159. * to transmit the frame as either CCK or OFDM, this field would
  1160. * be set to
  1161. * (1 << htt_tx_preamble_type_ofdm) |
  1162. * (1 << htt_tx_preamble_type_cck)
  1163. */
  1164. preamble_type_mask: 4,
  1165. reserved1_31_29: 3; /* unused, set to 0x0 */
  1166. /* DWORD 2: tx chain mask, tx retries */
  1167. A_UINT32
  1168. /* chain_mask - specify which chains to transmit from */
  1169. chain_mask: 4,
  1170. /* retry_limit -
  1171. * Specify the maximum number of transmissions, including the
  1172. * initial transmission, to attempt before giving up if no ack
  1173. * is received.
  1174. * If the tx rate is specified, then all retries shall use the
  1175. * same rate as the initial transmission.
  1176. * If no tx rate is specified, the target can choose whether to
  1177. * retain the original rate during the retransmissions, or to
  1178. * fall back to a more robust rate.
  1179. */
  1180. retry_limit: 4,
  1181. /* bandwidth_mask -
  1182. * Specify what channel widths may be used for the transmission.
  1183. * A value of zero indicates "don't care" - the target may choose
  1184. * the transmission bandwidth.
  1185. * The bits within this mask correspond to the htt_tx_bandwidth
  1186. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1187. * The bandwidth_mask must be consistent with the preamble_type_mask
  1188. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1189. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1190. */
  1191. bandwidth_mask: 6,
  1192. reserved2_31_14: 18; /* unused, set to 0x0 */
  1193. /* DWORD 3: tx expiry time (TSF) LSBs */
  1194. A_UINT32 expire_tsf_lo;
  1195. /* DWORD 4: tx expiry time (TSF) MSBs */
  1196. A_UINT32 expire_tsf_hi;
  1197. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1198. } POSTPACK;
  1199. /* DWORD 0 */
  1200. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1201. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1202. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1203. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1204. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1205. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1206. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1207. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1208. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1209. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1210. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1211. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1212. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1213. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1214. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1215. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1216. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1217. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1218. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1219. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1220. /* DWORD 1 */
  1221. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1222. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1223. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1224. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1225. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1226. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1227. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1228. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1229. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1230. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1231. /* DWORD 2 */
  1232. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1233. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1234. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1235. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1236. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1237. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1238. /* DWORD 0 */
  1239. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1240. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1241. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1242. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1243. do { \
  1244. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1245. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1246. } while (0)
  1247. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1248. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1249. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1250. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1251. do { \
  1252. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1253. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1254. } while (0)
  1255. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1256. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1257. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1258. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1259. do { \
  1260. HTT_CHECK_SET_VAL( \
  1261. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1262. ((_var) |= ((_val) \
  1263. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1264. } while (0)
  1265. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1266. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1267. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1268. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1269. do { \
  1270. HTT_CHECK_SET_VAL( \
  1271. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1272. ((_var) |= ((_val) \
  1273. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1274. } while (0)
  1275. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1276. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1277. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1278. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1279. do { \
  1280. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1281. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1282. } while (0)
  1283. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1284. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1285. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1286. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1287. do { \
  1288. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1289. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1290. } while (0)
  1291. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1292. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1293. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1294. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1295. do { \
  1296. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1297. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1298. } while (0)
  1299. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1300. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1301. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1302. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1303. do { \
  1304. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1305. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1306. } while (0)
  1307. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1308. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1309. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1310. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1311. do { \
  1312. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1313. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1314. } while (0)
  1315. /* DWORD 1 */
  1316. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1317. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1318. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1319. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1320. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1321. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1322. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1323. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1324. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1325. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1326. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1327. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1328. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1329. do { \
  1330. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1331. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1332. } while (0)
  1333. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1334. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1335. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1336. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1337. do { \
  1338. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1339. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1340. } while (0)
  1341. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1342. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1343. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1344. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1345. do { \
  1346. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1347. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1348. } while (0)
  1349. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1350. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1351. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1352. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1353. do { \
  1354. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1355. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1356. } while (0)
  1357. /* DWORD 2 */
  1358. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1359. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1360. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1361. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1362. do { \
  1363. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1364. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1365. } while (0)
  1366. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1367. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1368. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1369. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1370. do { \
  1371. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1372. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1373. } while (0)
  1374. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1375. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1376. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1377. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1378. do { \
  1379. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1380. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1381. } while (0)
  1382. typedef enum {
  1383. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1384. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1385. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1386. } htt_11ax_ltf_subtype_t;
  1387. typedef enum {
  1388. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1389. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1390. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1391. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1392. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1393. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1394. } htt_tx_ext2_preamble_type_t;
  1395. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1396. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1397. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1398. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1399. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1400. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1401. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1402. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1403. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1404. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1405. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1406. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1407. /**
  1408. * @brief HTT tx MSDU extension descriptor v2
  1409. * @details
  1410. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1411. * is received as tcl_exit_base->host_meta_info in firmware.
  1412. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1413. * are already part of tcl_exit_base.
  1414. */
  1415. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1416. /* DWORD 0: flags */
  1417. A_UINT32
  1418. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1419. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1420. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1421. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1422. valid_retries : 1, /* if set, tx retries spec is valid */
  1423. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1424. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1425. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1426. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1427. valid_key_flags : 1, /* if set, key flags is valid */
  1428. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1429. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1430. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1431. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1432. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1433. 1 = ENCRYPT,
  1434. 2 ~ 3 - Reserved */
  1435. /* retry_limit -
  1436. * Specify the maximum number of transmissions, including the
  1437. * initial transmission, to attempt before giving up if no ack
  1438. * is received.
  1439. * If the tx rate is specified, then all retries shall use the
  1440. * same rate as the initial transmission.
  1441. * If no tx rate is specified, the target can choose whether to
  1442. * retain the original rate during the retransmissions, or to
  1443. * fall back to a more robust rate.
  1444. */
  1445. retry_limit : 4,
  1446. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1447. * Valid only for 11ax preamble types HE_SU
  1448. * and HE_EXT_SU
  1449. */
  1450. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1451. * Valid only for 11ax preamble types HE_SU
  1452. * and HE_EXT_SU
  1453. */
  1454. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1455. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1456. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1457. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1458. */
  1459. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1460. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1461. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1462. * Use cases:
  1463. * Any time firmware uses TQM-BYPASS for Data
  1464. * TID, firmware expect host to set this bit.
  1465. */
  1466. /* DWORD 1: tx power, tx rate */
  1467. A_UINT32
  1468. power : 8, /* unit of the power field is 0.5 dbm
  1469. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1470. * signed value ranging from -64dbm to 63.5 dbm
  1471. */
  1472. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1473. * Setting more than one MCS isn't currently
  1474. * supported by the target (but is supported
  1475. * in the interface in case in the future
  1476. * the target supports specifications of
  1477. * a limited set of MCS values.
  1478. */
  1479. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1480. * Setting more than one Nss isn't currently
  1481. * supported by the target (but is supported
  1482. * in the interface in case in the future
  1483. * the target supports specifications of
  1484. * a limited set of Nss values.
  1485. */
  1486. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1487. update_peer_cache : 1; /* When set these custom values will be
  1488. * used for all packets, until the next
  1489. * update via this ext header.
  1490. * This is to make sure not all packets
  1491. * need to include this header.
  1492. */
  1493. /* DWORD 2: tx chain mask, tx retries */
  1494. A_UINT32
  1495. /* chain_mask - specify which chains to transmit from */
  1496. chain_mask : 8,
  1497. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1498. * TODO: Update Enum values for key_flags
  1499. */
  1500. /*
  1501. * Channel frequency: This identifies the desired channel
  1502. * frequency (in MHz) for tx frames. This is used by FW to help
  1503. * determine when it is safe to transmit or drop frames for
  1504. * off-channel operation.
  1505. * The default value of zero indicates to FW that the corresponding
  1506. * VDEV's home channel (if there is one) is the desired channel
  1507. * frequency.
  1508. */
  1509. chanfreq : 16;
  1510. /* DWORD 3: tx expiry time (TSF) LSBs */
  1511. A_UINT32 expire_tsf_lo;
  1512. /* DWORD 4: tx expiry time (TSF) MSBs */
  1513. A_UINT32 expire_tsf_hi;
  1514. /* DWORD 5: reserved
  1515. * This structure can be expanded further up to 60 bytes
  1516. * by adding further DWORDs as needed.
  1517. */
  1518. A_UINT32
  1519. /* learning_frame
  1520. * When this flag is set, this frame will be dropped by FW
  1521. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1522. */
  1523. learning_frame : 1,
  1524. rsvd0 : 31;
  1525. } POSTPACK;
  1526. /* DWORD 0 */
  1527. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1528. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1529. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1530. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1531. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1532. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1533. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1534. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1535. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1536. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1537. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1538. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1539. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1540. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1541. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1542. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1543. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1544. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1545. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1546. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1547. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1548. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1549. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1550. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1551. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1552. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1553. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1554. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1555. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1556. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1557. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1558. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1559. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1560. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1561. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1562. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1563. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1564. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1565. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1566. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1567. /* DWORD 1 */
  1568. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1569. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1570. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1571. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1572. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1573. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1574. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1575. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1576. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1577. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1578. /* DWORD 2 */
  1579. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1580. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1581. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1582. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1583. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1584. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1585. /* DWORD 5 */
  1586. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1587. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1588. /* DWORD 0 */
  1589. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1590. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1591. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1592. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1593. do { \
  1594. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1595. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1596. } while (0)
  1597. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1598. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1599. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1600. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1601. do { \
  1602. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1603. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1604. } while (0)
  1605. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1606. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1607. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1608. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1609. do { \
  1610. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1611. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1612. } while (0)
  1613. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1614. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1615. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1616. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1617. do { \
  1618. HTT_CHECK_SET_VAL( \
  1619. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1620. ((_var) |= ((_val) \
  1621. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1622. } while (0)
  1623. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1624. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1625. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1626. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1627. do { \
  1628. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1629. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1630. } while (0)
  1631. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1632. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1633. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1634. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1635. do { \
  1636. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1637. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1638. } while (0)
  1639. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1640. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1641. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1642. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1643. do { \
  1644. HTT_CHECK_SET_VAL( \
  1645. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1646. ((_var) |= ((_val) \
  1647. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1648. } while (0)
  1649. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1650. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1651. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1652. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1653. do { \
  1654. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1655. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1656. } while (0)
  1657. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1658. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1659. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1660. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1661. do { \
  1662. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1663. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1664. } while (0)
  1665. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1666. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1667. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1668. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1669. do { \
  1670. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1671. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1672. } while (0)
  1673. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1674. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1675. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1676. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1677. do { \
  1678. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1679. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1680. } while (0)
  1681. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1682. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1683. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1684. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1685. do { \
  1686. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1687. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1688. } while (0)
  1689. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1690. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1691. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1692. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1693. do { \
  1694. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1695. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1696. } while (0)
  1697. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1698. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1699. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1700. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1701. do { \
  1702. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1703. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1704. } while (0)
  1705. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1706. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1707. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1708. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1709. do { \
  1710. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1711. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1712. } while (0)
  1713. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1714. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1715. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1716. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1717. do { \
  1718. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1719. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1720. } while (0)
  1721. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1722. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1723. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1724. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1725. do { \
  1726. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1727. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1728. } while (0)
  1729. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1730. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1731. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1732. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1733. do { \
  1734. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1735. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1736. } while (0)
  1737. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1738. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1739. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1740. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1741. do { \
  1742. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1743. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1744. } while (0)
  1745. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1746. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1747. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1748. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1749. do { \
  1750. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1751. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1752. } while (0)
  1753. /* DWORD 1 */
  1754. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1755. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1756. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1757. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1758. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1759. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1760. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1761. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1762. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1763. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1764. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1765. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1766. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1767. do { \
  1768. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1769. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1770. } while (0)
  1771. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1772. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1773. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1774. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1775. do { \
  1776. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1777. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1778. } while (0)
  1779. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1780. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1781. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1782. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1783. do { \
  1784. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1785. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1786. } while (0)
  1787. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1788. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1789. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1790. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1791. do { \
  1792. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1793. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1794. } while (0)
  1795. /* DWORD 2 */
  1796. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1797. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1798. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1799. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1800. do { \
  1801. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1802. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1803. } while (0)
  1804. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1805. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1806. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1807. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1808. do { \
  1809. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1810. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1811. } while (0)
  1812. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1813. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1814. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1815. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1816. do { \
  1817. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1818. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1819. } while (0)
  1820. /* DWORD 5 */
  1821. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  1822. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  1823. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  1824. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  1825. do { \
  1826. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  1827. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  1828. } while (0)
  1829. typedef enum {
  1830. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1831. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1832. } htt_tcl_metadata_type;
  1833. /**
  1834. * @brief HTT TCL command number format
  1835. * @details
  1836. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1837. * available to firmware as tcl_exit_base->tcl_status_number.
  1838. * For regular / multicast packets host will send vdev and mac id and for
  1839. * NAWDS packets, host will send peer id.
  1840. * A_UINT32 is used to avoid endianness conversion problems.
  1841. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1842. */
  1843. typedef struct {
  1844. A_UINT32
  1845. type: 1, /* vdev_id based or peer_id based */
  1846. rsvd: 31;
  1847. } htt_tx_tcl_vdev_or_peer_t;
  1848. typedef struct {
  1849. A_UINT32
  1850. type: 1, /* vdev_id based or peer_id based */
  1851. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1852. vdev_id: 8,
  1853. pdev_id: 2,
  1854. host_inspected:1,
  1855. rsvd: 19;
  1856. } htt_tx_tcl_vdev_metadata;
  1857. typedef struct {
  1858. A_UINT32
  1859. type: 1, /* vdev_id based or peer_id based */
  1860. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1861. peer_id: 14,
  1862. rsvd: 16;
  1863. } htt_tx_tcl_peer_metadata;
  1864. PREPACK struct htt_tx_tcl_metadata {
  1865. union {
  1866. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1867. htt_tx_tcl_vdev_metadata vdev_meta;
  1868. htt_tx_tcl_peer_metadata peer_meta;
  1869. };
  1870. } POSTPACK;
  1871. /* DWORD 0 */
  1872. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1873. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1874. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1875. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1876. /* VDEV metadata */
  1877. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1878. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1879. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1880. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1881. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1882. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1883. /* PEER metadata */
  1884. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1885. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1886. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1887. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1888. HTT_TX_TCL_METADATA_TYPE_S)
  1889. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1890. do { \
  1891. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1892. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1893. } while (0)
  1894. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1895. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1896. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1897. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1898. do { \
  1899. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1900. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1901. } while (0)
  1902. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1903. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1904. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1905. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1906. do { \
  1907. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1908. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1909. } while (0)
  1910. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1911. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1912. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1913. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1914. do { \
  1915. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1916. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1917. } while (0)
  1918. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1919. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1920. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  1921. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  1922. do { \
  1923. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  1924. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  1925. } while (0)
  1926. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1927. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  1928. HTT_TX_TCL_METADATA_PEER_ID_S)
  1929. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  1930. do { \
  1931. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  1932. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  1933. } while (0)
  1934. typedef enum {
  1935. HTT_TX_FW2WBM_TX_STATUS_OK,
  1936. HTT_TX_FW2WBM_TX_STATUS_DROP,
  1937. HTT_TX_FW2WBM_TX_STATUS_TTL,
  1938. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  1939. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  1940. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  1941. HTT_TX_FW2WBM_TX_STATUS_MAX
  1942. } htt_tx_fw2wbm_tx_status_t;
  1943. typedef enum {
  1944. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  1945. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  1946. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  1947. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  1948. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  1949. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  1950. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  1951. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  1952. } htt_tx_fw2wbm_reinject_reason_t;
  1953. /**
  1954. * @brief HTT TX WBM Completion from firmware to host
  1955. * @details
  1956. * This structure is passed from firmware to host overlayed on wbm_release_ring
  1957. * DWORD 3 and 4 for software based completions (Exception frames and
  1958. * TQM bypass frames)
  1959. * For software based completions, wbm_release_ring->release_source_module will
  1960. * be set to release_source_fw
  1961. */
  1962. PREPACK struct htt_tx_wbm_completion {
  1963. A_UINT32
  1964. sch_cmd_id: 24,
  1965. exception_frame: 1, /* If set, this packet was queued via exception path */
  1966. rsvd0_31_25: 7;
  1967. A_UINT32
  1968. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  1969. * reception of an ACK or BA, this field indicates
  1970. * the RSSI of the received ACK or BA frame.
  1971. * When the frame is removed as result of a direct
  1972. * remove command from the SW, this field is set
  1973. * to 0x0 (which is never a valid value when real
  1974. * RSSI is available).
  1975. * Units: dB w.r.t noise floor
  1976. */
  1977. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  1978. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  1979. rsvd1_31_16: 16;
  1980. } POSTPACK;
  1981. /* DWORD 0 */
  1982. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  1983. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  1984. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  1985. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  1986. /* DWORD 1 */
  1987. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  1988. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  1989. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  1990. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  1991. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  1992. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  1993. /* DWORD 0 */
  1994. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  1995. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  1996. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  1997. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  1998. do { \
  1999. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2000. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2001. } while (0)
  2002. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2003. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2004. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2005. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2006. do { \
  2007. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2008. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2009. } while (0)
  2010. /* DWORD 1 */
  2011. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2012. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2013. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2014. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2015. do { \
  2016. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2017. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2018. } while (0)
  2019. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2020. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2021. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2022. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2023. do { \
  2024. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2025. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2026. } while (0)
  2027. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2028. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2029. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2030. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2031. do { \
  2032. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2033. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2034. } while (0)
  2035. /**
  2036. * @brief HTT TX WBM Completion from firmware to host
  2037. * @details
  2038. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2039. * (WBM) offload HW.
  2040. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2041. * For software based completions, release_source_module will
  2042. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2043. * struct wbm_release_ring and then switch to this after looking at
  2044. * release_source_module.
  2045. */
  2046. PREPACK struct htt_tx_wbm_completion_v2 {
  2047. A_UINT32
  2048. used_by_hw0; /* Refer to struct wbm_release_ring */
  2049. A_UINT32
  2050. used_by_hw1; /* Refer to struct wbm_release_ring */
  2051. A_UINT32
  2052. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2053. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2054. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2055. exception_frame: 1,
  2056. rsvd0: 12, /* For future use */
  2057. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2058. rsvd1: 1; /* For future use */
  2059. A_UINT32
  2060. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2061. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2062. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2063. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2064. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2065. */
  2066. A_UINT32
  2067. data1: 32;
  2068. A_UINT32
  2069. data2: 32;
  2070. A_UINT32
  2071. used_by_hw3; /* Refer to struct wbm_release_ring */
  2072. } POSTPACK;
  2073. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2074. /* DWORD 3 */
  2075. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2076. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2077. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2078. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2079. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2080. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2081. /* DWORD 3 */
  2082. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2083. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2084. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2085. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2086. do { \
  2087. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2088. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2089. } while (0)
  2090. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2091. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2092. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2093. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2094. do { \
  2095. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2096. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2097. } while (0)
  2098. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2099. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2100. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2101. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2102. do { \
  2103. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2104. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2105. } while (0)
  2106. /**
  2107. * @brief HTT TX WBM transmit status from firmware to host
  2108. * @details
  2109. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2110. * (WBM) offload HW.
  2111. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2112. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2113. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2114. */
  2115. PREPACK struct htt_tx_wbm_transmit_status {
  2116. A_UINT32
  2117. sch_cmd_id: 24,
  2118. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2119. * reception of an ACK or BA, this field indicates
  2120. * the RSSI of the received ACK or BA frame.
  2121. * When the frame is removed as result of a direct
  2122. * remove command from the SW, this field is set
  2123. * to 0x0 (which is never a valid value when real
  2124. * RSSI is available).
  2125. * Units: dB w.r.t noise floor
  2126. */
  2127. A_UINT32
  2128. sw_peer_id: 16,
  2129. tid_num: 5,
  2130. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2131. * and tid_num fields contain valid data.
  2132. * If this "valid" flag is not set, the
  2133. * sw_peer_id and tid_num fields must be ignored.
  2134. */
  2135. mcast: 1,
  2136. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2137. * contains valid data.
  2138. */
  2139. reserved0: 8;
  2140. A_UINT32
  2141. reserved1: 32;
  2142. } POSTPACK;
  2143. /* DWORD 4 */
  2144. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2145. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2146. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2147. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2148. /* DWORD 5 */
  2149. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2150. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2151. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2152. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2153. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2154. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2155. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2156. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2157. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2158. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2159. /* DWORD 4 */
  2160. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2161. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2162. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2163. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2164. do { \
  2165. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2166. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2167. } while (0)
  2168. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2169. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2170. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2171. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2172. do { \
  2173. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2174. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2175. } while (0)
  2176. /* DWORD 5 */
  2177. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2178. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2179. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2180. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2181. do { \
  2182. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2183. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2184. } while (0)
  2185. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2186. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2187. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2188. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2189. do { \
  2190. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2191. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2192. } while (0)
  2193. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2194. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2195. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2196. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2197. do { \
  2198. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2199. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2200. } while (0)
  2201. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2202. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2203. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2204. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2205. do { \
  2206. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2207. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2208. } while (0)
  2209. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2210. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2211. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2212. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2213. do { \
  2214. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2215. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2216. } while (0)
  2217. /**
  2218. * @brief HTT TX WBM reinject status from firmware to host
  2219. * @details
  2220. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2221. * (WBM) offload HW.
  2222. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2223. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2224. */
  2225. PREPACK struct htt_tx_wbm_reinject_status {
  2226. A_UINT32
  2227. reserved0: 32;
  2228. A_UINT32
  2229. reserved1: 32;
  2230. A_UINT32
  2231. reserved2: 32;
  2232. } POSTPACK;
  2233. /**
  2234. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2235. * @details
  2236. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2237. * (WBM) offload HW.
  2238. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2239. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2240. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2241. * STA side.
  2242. */
  2243. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2244. A_UINT32
  2245. mec_sa_addr_31_0;
  2246. A_UINT32
  2247. mec_sa_addr_47_32: 16,
  2248. sa_ast_index: 16;
  2249. A_UINT32
  2250. vdev_id: 8,
  2251. reserved0: 24;
  2252. } POSTPACK;
  2253. /* DWORD 4 - mec_sa_addr_31_0 */
  2254. /* DWORD 5 */
  2255. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2256. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2257. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2258. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2259. /* DWORD 6 */
  2260. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2261. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2262. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2263. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2264. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2265. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2266. do { \
  2267. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2268. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2269. } while (0)
  2270. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2271. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2272. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2273. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2274. do { \
  2275. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2276. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2277. } while (0)
  2278. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2279. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2280. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2281. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2282. do { \
  2283. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2284. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2285. } while (0)
  2286. typedef enum {
  2287. TX_FLOW_PRIORITY_BE,
  2288. TX_FLOW_PRIORITY_HIGH,
  2289. TX_FLOW_PRIORITY_LOW,
  2290. } htt_tx_flow_priority_t;
  2291. typedef enum {
  2292. TX_FLOW_LATENCY_SENSITIVE,
  2293. TX_FLOW_LATENCY_INSENSITIVE,
  2294. } htt_tx_flow_latency_t;
  2295. typedef enum {
  2296. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2297. TX_FLOW_INTERACTIVE_TRAFFIC,
  2298. TX_FLOW_PERIODIC_TRAFFIC,
  2299. TX_FLOW_BURSTY_TRAFFIC,
  2300. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2301. } htt_tx_flow_traffic_pattern_t;
  2302. /**
  2303. * @brief HTT TX Flow search metadata format
  2304. * @details
  2305. * Host will set this metadata in flow table's flow search entry along with
  2306. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2307. * firmware and TQM ring if the flow search entry wins.
  2308. * This metadata is available to firmware in that first MSDU's
  2309. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2310. * to one of the available flows for specific tid and returns the tqm flow
  2311. * pointer as part of htt_tx_map_flow_info message.
  2312. */
  2313. PREPACK struct htt_tx_flow_metadata {
  2314. A_UINT32
  2315. rsvd0_1_0: 2,
  2316. tid: 4,
  2317. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2318. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2319. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2320. * Else choose final tid based on latency, priority.
  2321. */
  2322. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2323. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2324. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2325. } POSTPACK;
  2326. /* DWORD 0 */
  2327. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2328. #define HTT_TX_FLOW_METADATA_TID_S 2
  2329. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2330. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2331. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2332. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2333. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2334. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2335. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2336. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2337. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2338. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2339. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2340. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2341. /* DWORD 0 */
  2342. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2343. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2344. HTT_TX_FLOW_METADATA_TID_S)
  2345. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2346. do { \
  2347. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2348. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2349. } while (0)
  2350. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2351. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2352. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2353. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2354. do { \
  2355. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2356. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2357. } while (0)
  2358. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2359. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2360. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2361. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2362. do { \
  2363. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2364. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2365. } while (0)
  2366. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2367. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2368. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2369. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2370. do { \
  2371. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2372. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2373. } while (0)
  2374. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2375. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2376. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2377. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2378. do { \
  2379. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2380. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2381. } while (0)
  2382. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2383. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2384. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2385. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2386. do { \
  2387. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2388. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2389. } while (0)
  2390. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2391. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2392. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2393. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2394. do { \
  2395. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2396. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2397. } while (0)
  2398. /**
  2399. * @brief Used in HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2400. *
  2401. * @details
  2402. * HTT wds entry from source port learning
  2403. * Host will learn wds entries from rx and send this message to firmware
  2404. * to enable firmware to configure/delete AST entries for wds clients.
  2405. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2406. * and when SA's entry is deleted, firmware removes this AST entry
  2407. *
  2408. * The message would appear as follows:
  2409. *
  2410. * |31 30|29 |17 16|15 8|7 0|
  2411. * |----------------+----------------+----------------+----------------|
  2412. * | rsvd0 |PDVID| vdev_id | msg_type |
  2413. * |-------------------------------------------------------------------|
  2414. * | sa_addr_31_0 |
  2415. * |-------------------------------------------------------------------|
  2416. * | | ta_peer_id | sa_addr_47_32 |
  2417. * |-------------------------------------------------------------------|
  2418. * Where PDVID = pdev_id
  2419. *
  2420. * The message is interpreted as follows:
  2421. *
  2422. * dword0 - b'0:7 - msg_type: This will be set to
  2423. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2424. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2425. *
  2426. * dword0 - b'8:15 - vdev_id
  2427. *
  2428. * dword0 - b'16:17 - pdev_id
  2429. *
  2430. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2431. *
  2432. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2433. *
  2434. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2435. *
  2436. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2437. */
  2438. PREPACK struct htt_wds_entry {
  2439. A_UINT32
  2440. msg_type: 8,
  2441. vdev_id: 8,
  2442. pdev_id: 2,
  2443. rsvd0: 14;
  2444. A_UINT32 sa_addr_31_0;
  2445. A_UINT32
  2446. sa_addr_47_32: 16,
  2447. ta_peer_id: 14,
  2448. rsvd2: 2;
  2449. } POSTPACK;
  2450. /* DWORD 0 */
  2451. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2452. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2453. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2454. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2455. /* DWORD 2 */
  2456. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2457. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2458. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2459. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2460. /* DWORD 0 */
  2461. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2462. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2463. HTT_WDS_ENTRY_VDEV_ID_S)
  2464. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2465. do { \
  2466. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2467. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2468. } while (0)
  2469. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2470. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2471. HTT_WDS_ENTRY_PDEV_ID_S)
  2472. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2473. do { \
  2474. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2475. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2476. } while (0)
  2477. /* DWORD 2 */
  2478. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2479. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2480. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2481. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2482. do { \
  2483. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2484. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2485. } while (0)
  2486. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2487. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2488. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2489. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2490. do { \
  2491. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2492. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2493. } while (0)
  2494. /**
  2495. * @brief MAC DMA rx ring setup specification
  2496. * @details
  2497. * To allow for dynamic rx ring reconfiguration and to avoid race
  2498. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2499. * it uses. Instead, it sends this message to the target, indicating how
  2500. * the rx ring used by the host should be set up and maintained.
  2501. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2502. * specifications.
  2503. *
  2504. * |31 16|15 8|7 0|
  2505. * |---------------------------------------------------------------|
  2506. * header: | reserved | num rings | msg type |
  2507. * |---------------------------------------------------------------|
  2508. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2509. #if HTT_PADDR64
  2510. * | FW_IDX shadow register physical address (bits 63:32) |
  2511. #endif
  2512. * |---------------------------------------------------------------|
  2513. * | rx ring base physical address (bits 31:0) |
  2514. #if HTT_PADDR64
  2515. * | rx ring base physical address (bits 63:32) |
  2516. #endif
  2517. * |---------------------------------------------------------------|
  2518. * | rx ring buffer size | rx ring length |
  2519. * |---------------------------------------------------------------|
  2520. * | FW_IDX initial value | enabled flags |
  2521. * |---------------------------------------------------------------|
  2522. * | MSDU payload offset | 802.11 header offset |
  2523. * |---------------------------------------------------------------|
  2524. * | PPDU end offset | PPDU start offset |
  2525. * |---------------------------------------------------------------|
  2526. * | MPDU end offset | MPDU start offset |
  2527. * |---------------------------------------------------------------|
  2528. * | MSDU end offset | MSDU start offset |
  2529. * |---------------------------------------------------------------|
  2530. * | frag info offset | rx attention offset |
  2531. * |---------------------------------------------------------------|
  2532. * payload 2, if present, has the same format as payload 1
  2533. * Header fields:
  2534. * - MSG_TYPE
  2535. * Bits 7:0
  2536. * Purpose: identifies this as an rx ring configuration message
  2537. * Value: 0x2
  2538. * - NUM_RINGS
  2539. * Bits 15:8
  2540. * Purpose: indicates whether the host is setting up one rx ring or two
  2541. * Value: 1 or 2
  2542. * Payload:
  2543. * for systems using 64-bit format for bus addresses:
  2544. * - IDX_SHADOW_REG_PADDR_LO
  2545. * Bits 31:0
  2546. * Value: lower 4 bytes of physical address of the host's
  2547. * FW_IDX shadow register
  2548. * - IDX_SHADOW_REG_PADDR_HI
  2549. * Bits 31:0
  2550. * Value: upper 4 bytes of physical address of the host's
  2551. * FW_IDX shadow register
  2552. * - RING_BASE_PADDR_LO
  2553. * Bits 31:0
  2554. * Value: lower 4 bytes of physical address of the host's rx ring
  2555. * - RING_BASE_PADDR_HI
  2556. * Bits 31:0
  2557. * Value: uppper 4 bytes of physical address of the host's rx ring
  2558. * for systems using 32-bit format for bus addresses:
  2559. * - IDX_SHADOW_REG_PADDR
  2560. * Bits 31:0
  2561. * Value: physical address of the host's FW_IDX shadow register
  2562. * - RING_BASE_PADDR
  2563. * Bits 31:0
  2564. * Value: physical address of the host's rx ring
  2565. * - RING_LEN
  2566. * Bits 15:0
  2567. * Value: number of elements in the rx ring
  2568. * - RING_BUF_SZ
  2569. * Bits 31:16
  2570. * Value: size of the buffers referenced by the rx ring, in byte units
  2571. * - ENABLED_FLAGS
  2572. * Bits 15:0
  2573. * Value: 1-bit flags to show whether different rx fields are enabled
  2574. * bit 0: 802.11 header enabled (1) or disabled (0)
  2575. * bit 1: MSDU payload enabled (1) or disabled (0)
  2576. * bit 2: PPDU start enabled (1) or disabled (0)
  2577. * bit 3: PPDU end enabled (1) or disabled (0)
  2578. * bit 4: MPDU start enabled (1) or disabled (0)
  2579. * bit 5: MPDU end enabled (1) or disabled (0)
  2580. * bit 6: MSDU start enabled (1) or disabled (0)
  2581. * bit 7: MSDU end enabled (1) or disabled (0)
  2582. * bit 8: rx attention enabled (1) or disabled (0)
  2583. * bit 9: frag info enabled (1) or disabled (0)
  2584. * bit 10: unicast rx enabled (1) or disabled (0)
  2585. * bit 11: multicast rx enabled (1) or disabled (0)
  2586. * bit 12: ctrl rx enabled (1) or disabled (0)
  2587. * bit 13: mgmt rx enabled (1) or disabled (0)
  2588. * bit 14: null rx enabled (1) or disabled (0)
  2589. * bit 15: phy data rx enabled (1) or disabled (0)
  2590. * - IDX_INIT_VAL
  2591. * Bits 31:16
  2592. * Purpose: Specify the initial value for the FW_IDX.
  2593. * Value: the number of buffers initially present in the host's rx ring
  2594. * - OFFSET_802_11_HDR
  2595. * Bits 15:0
  2596. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2597. * - OFFSET_MSDU_PAYLOAD
  2598. * Bits 31:16
  2599. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2600. * - OFFSET_PPDU_START
  2601. * Bits 15:0
  2602. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2603. * - OFFSET_PPDU_END
  2604. * Bits 31:16
  2605. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2606. * - OFFSET_MPDU_START
  2607. * Bits 15:0
  2608. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2609. * - OFFSET_MPDU_END
  2610. * Bits 31:16
  2611. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2612. * - OFFSET_MSDU_START
  2613. * Bits 15:0
  2614. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2615. * - OFFSET_MSDU_END
  2616. * Bits 31:16
  2617. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2618. * - OFFSET_RX_ATTN
  2619. * Bits 15:0
  2620. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2621. * - OFFSET_FRAG_INFO
  2622. * Bits 31:16
  2623. * Value: offset in QUAD-bytes of frag info table
  2624. */
  2625. /* header fields */
  2626. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2627. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2628. /* payload fields */
  2629. /* for systems using a 64-bit format for bus addresses */
  2630. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2631. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2632. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2633. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2634. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2635. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2636. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2637. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2638. /* for systems using a 32-bit format for bus addresses */
  2639. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2640. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2641. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2642. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2643. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2644. #define HTT_RX_RING_CFG_LEN_S 0
  2645. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2646. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2647. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2648. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2649. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2650. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2651. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2652. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2653. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2654. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2655. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2656. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2657. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2658. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2659. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2660. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2661. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2662. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2663. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2664. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2665. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2666. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2667. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2668. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2669. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2670. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2671. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2672. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2673. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2674. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2675. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2676. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2677. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2678. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2679. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2680. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2681. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2682. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2683. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2684. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2685. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2686. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2687. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2688. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2689. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2690. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2691. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2692. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2693. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2694. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2695. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2696. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2697. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2698. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2699. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2700. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2701. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2702. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2703. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2704. #if HTT_PADDR64
  2705. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2706. #else
  2707. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2708. #endif
  2709. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2710. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2711. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2712. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2713. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2714. do { \
  2715. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2716. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2717. } while (0)
  2718. /* degenerate case for 32-bit fields */
  2719. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2720. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2721. ((_var) = (_val))
  2722. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2723. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2724. ((_var) = (_val))
  2725. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2726. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2727. ((_var) = (_val))
  2728. /* degenerate case for 32-bit fields */
  2729. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2730. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2731. ((_var) = (_val))
  2732. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2733. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2734. ((_var) = (_val))
  2735. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2736. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2737. ((_var) = (_val))
  2738. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2739. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2740. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2741. do { \
  2742. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2743. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2744. } while (0)
  2745. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2746. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2747. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2748. do { \
  2749. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2750. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2751. } while (0)
  2752. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2753. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2754. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2755. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2756. do { \
  2757. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2758. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2759. } while (0)
  2760. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2761. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2762. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2763. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2764. do { \
  2765. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2766. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2767. } while (0)
  2768. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2769. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2770. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2771. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2772. do { \
  2773. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2774. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2775. } while (0)
  2776. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2777. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2778. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2779. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2780. do { \
  2781. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2782. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2783. } while (0)
  2784. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2785. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2786. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2787. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2788. do { \
  2789. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2790. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2791. } while (0)
  2792. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2793. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2794. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2795. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2796. do { \
  2797. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2798. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2799. } while (0)
  2800. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2801. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2802. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2803. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2804. do { \
  2805. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2806. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2807. } while (0)
  2808. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2809. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2810. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2811. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2812. do { \
  2813. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2814. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2815. } while (0)
  2816. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2817. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2818. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2819. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2820. do { \
  2821. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2822. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2823. } while (0)
  2824. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2825. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2826. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2827. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2828. do { \
  2829. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2830. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2831. } while (0)
  2832. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2833. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2834. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2835. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2836. do { \
  2837. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2838. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2839. } while (0)
  2840. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2841. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2842. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2843. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2844. do { \
  2845. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2846. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2847. } while (0)
  2848. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2849. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2850. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2851. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2852. do { \
  2853. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2854. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2855. } while (0)
  2856. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2857. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2858. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2859. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2860. do { \
  2861. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2862. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2863. } while (0)
  2864. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2865. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2866. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2867. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2868. do { \
  2869. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2870. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2871. } while (0)
  2872. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2873. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2874. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2875. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2876. do { \
  2877. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2878. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2879. } while (0)
  2880. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2881. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2882. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2883. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2884. do { \
  2885. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2886. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2887. } while (0)
  2888. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2889. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2890. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2891. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2892. do { \
  2893. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2894. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2895. } while (0)
  2896. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2897. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2898. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2899. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2900. do { \
  2901. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2902. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2903. } while (0)
  2904. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2905. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2906. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2907. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2908. do { \
  2909. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2910. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2911. } while (0)
  2912. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2913. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2914. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2915. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2916. do { \
  2917. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2918. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2919. } while (0)
  2920. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  2921. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  2922. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  2923. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  2924. do { \
  2925. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  2926. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  2927. } while (0)
  2928. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  2929. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  2930. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  2931. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  2932. do { \
  2933. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  2934. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  2935. } while (0)
  2936. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  2937. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  2938. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  2939. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  2940. do { \
  2941. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  2942. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  2943. } while (0)
  2944. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  2945. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  2946. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  2947. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  2948. do { \
  2949. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  2950. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  2951. } while (0)
  2952. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  2953. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  2954. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  2955. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  2956. do { \
  2957. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  2958. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  2959. } while (0)
  2960. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  2961. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  2962. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  2963. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  2964. do { \
  2965. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  2966. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  2967. } while (0)
  2968. /**
  2969. * @brief host -> target FW statistics retrieve
  2970. *
  2971. * @details
  2972. * The following field definitions describe the format of the HTT host
  2973. * to target FW stats retrieve message. The message specifies the type of
  2974. * stats host wants to retrieve.
  2975. *
  2976. * |31 24|23 16|15 8|7 0|
  2977. * |-----------------------------------------------------------|
  2978. * | stats types request bitmask | msg type |
  2979. * |-----------------------------------------------------------|
  2980. * | stats types reset bitmask | reserved |
  2981. * |-----------------------------------------------------------|
  2982. * | stats type | config value |
  2983. * |-----------------------------------------------------------|
  2984. * | cookie LSBs |
  2985. * |-----------------------------------------------------------|
  2986. * | cookie MSBs |
  2987. * |-----------------------------------------------------------|
  2988. * Header fields:
  2989. * - MSG_TYPE
  2990. * Bits 7:0
  2991. * Purpose: identifies this is a stats upload request message
  2992. * Value: 0x3
  2993. * - UPLOAD_TYPES
  2994. * Bits 31:8
  2995. * Purpose: identifies which types of FW statistics to upload
  2996. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  2997. * - RESET_TYPES
  2998. * Bits 31:8
  2999. * Purpose: identifies which types of FW statistics to reset
  3000. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3001. * - CFG_VAL
  3002. * Bits 23:0
  3003. * Purpose: give an opaque configuration value to the specified stats type
  3004. * Value: stats-type specific configuration value
  3005. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3006. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3007. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3008. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3009. * - CFG_STAT_TYPE
  3010. * Bits 31:24
  3011. * Purpose: specify which stats type (if any) the config value applies to
  3012. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3013. * a valid configuration specification
  3014. * - COOKIE_LSBS
  3015. * Bits 31:0
  3016. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3017. * message with its preceding host->target stats request message.
  3018. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3019. * - COOKIE_MSBS
  3020. * Bits 31:0
  3021. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3022. * message with its preceding host->target stats request message.
  3023. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3024. */
  3025. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3026. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3027. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3028. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3029. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3030. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3031. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3032. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3033. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3034. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3035. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3036. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3037. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3038. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3039. do { \
  3040. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3041. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3042. } while (0)
  3043. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3044. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3045. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3046. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3047. do { \
  3048. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3049. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3050. } while (0)
  3051. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3052. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3053. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3054. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3055. do { \
  3056. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3057. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3058. } while (0)
  3059. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3060. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3061. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3062. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3063. do { \
  3064. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3065. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3066. } while (0)
  3067. /**
  3068. * @brief host -> target HTT out-of-band sync request
  3069. *
  3070. * @details
  3071. * The HTT SYNC tells the target to suspend processing of subsequent
  3072. * HTT host-to-target messages until some other target agent locally
  3073. * informs the target HTT FW that the current sync counter is equal to
  3074. * or greater than (in a modulo sense) the sync counter specified in
  3075. * the SYNC message.
  3076. * This allows other host-target components to synchronize their operation
  3077. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3078. * security key has been downloaded to and activated by the target.
  3079. * In the absence of any explicit synchronization counter value
  3080. * specification, the target HTT FW will use zero as the default current
  3081. * sync value.
  3082. *
  3083. * |31 24|23 16|15 8|7 0|
  3084. * |-----------------------------------------------------------|
  3085. * | reserved | sync count | msg type |
  3086. * |-----------------------------------------------------------|
  3087. * Header fields:
  3088. * - MSG_TYPE
  3089. * Bits 7:0
  3090. * Purpose: identifies this as a sync message
  3091. * Value: 0x4
  3092. * - SYNC_COUNT
  3093. * Bits 15:8
  3094. * Purpose: specifies what sync value the HTT FW will wait for from
  3095. * an out-of-band specification to resume its operation
  3096. * Value: in-band sync counter value to compare against the out-of-band
  3097. * counter spec.
  3098. * The HTT target FW will suspend its host->target message processing
  3099. * as long as
  3100. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3101. */
  3102. #define HTT_H2T_SYNC_MSG_SZ 4
  3103. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3104. #define HTT_H2T_SYNC_COUNT_S 8
  3105. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3106. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3107. HTT_H2T_SYNC_COUNT_S)
  3108. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3109. do { \
  3110. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3111. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3112. } while (0)
  3113. /**
  3114. * @brief HTT aggregation configuration
  3115. */
  3116. #define HTT_AGGR_CFG_MSG_SZ 4
  3117. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3118. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3119. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3120. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3121. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3122. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3123. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3124. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3125. do { \
  3126. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3127. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3128. } while (0)
  3129. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3130. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3131. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3132. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3133. do { \
  3134. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3135. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3136. } while (0)
  3137. /**
  3138. * @brief host -> target HTT configure max amsdu info per vdev
  3139. *
  3140. * @details
  3141. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3142. *
  3143. * |31 21|20 16|15 8|7 0|
  3144. * |-----------------------------------------------------------|
  3145. * | reserved | vdev id | max amsdu | msg type |
  3146. * |-----------------------------------------------------------|
  3147. * Header fields:
  3148. * - MSG_TYPE
  3149. * Bits 7:0
  3150. * Purpose: identifies this as a aggr cfg ex message
  3151. * Value: 0xa
  3152. * - MAX_NUM_AMSDU_SUBFRM
  3153. * Bits 15:8
  3154. * Purpose: max MSDUs per A-MSDU
  3155. * - VDEV_ID
  3156. * Bits 20:16
  3157. * Purpose: ID of the vdev to which this limit is applied
  3158. */
  3159. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3160. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3161. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3162. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3163. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3164. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3165. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3166. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3167. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3168. do { \
  3169. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3170. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3171. } while (0)
  3172. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3173. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3174. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3175. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3176. do { \
  3177. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3178. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3179. } while (0)
  3180. /**
  3181. * @brief HTT WDI_IPA Config Message
  3182. *
  3183. * @details
  3184. * The HTT WDI_IPA config message is created/sent by host at driver
  3185. * init time. It contains information about data structures used on
  3186. * WDI_IPA TX and RX path.
  3187. * TX CE ring is used for pushing packet metadata from IPA uC
  3188. * to WLAN FW
  3189. * TX Completion ring is used for generating TX completions from
  3190. * WLAN FW to IPA uC
  3191. * RX Indication ring is used for indicating RX packets from FW
  3192. * to IPA uC
  3193. * RX Ring2 is used as either completion ring or as second
  3194. * indication ring. when Ring2 is used as completion ring, IPA uC
  3195. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3196. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3197. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3198. * indicated in RX Indication ring. Please see WDI_IPA specification
  3199. * for more details.
  3200. * |31 24|23 16|15 8|7 0|
  3201. * |----------------+----------------+----------------+----------------|
  3202. * | tx pkt pool size | Rsvd | msg_type |
  3203. * |-------------------------------------------------------------------|
  3204. * | tx comp ring base (bits 31:0) |
  3205. #if HTT_PADDR64
  3206. * | tx comp ring base (bits 63:32) |
  3207. #endif
  3208. * |-------------------------------------------------------------------|
  3209. * | tx comp ring size |
  3210. * |-------------------------------------------------------------------|
  3211. * | tx comp WR_IDX physical address (bits 31:0) |
  3212. #if HTT_PADDR64
  3213. * | tx comp WR_IDX physical address (bits 63:32) |
  3214. #endif
  3215. * |-------------------------------------------------------------------|
  3216. * | tx CE WR_IDX physical address (bits 31:0) |
  3217. #if HTT_PADDR64
  3218. * | tx CE WR_IDX physical address (bits 63:32) |
  3219. #endif
  3220. * |-------------------------------------------------------------------|
  3221. * | rx indication ring base (bits 31:0) |
  3222. #if HTT_PADDR64
  3223. * | rx indication ring base (bits 63:32) |
  3224. #endif
  3225. * |-------------------------------------------------------------------|
  3226. * | rx indication ring size |
  3227. * |-------------------------------------------------------------------|
  3228. * | rx ind RD_IDX physical address (bits 31:0) |
  3229. #if HTT_PADDR64
  3230. * | rx ind RD_IDX physical address (bits 63:32) |
  3231. #endif
  3232. * |-------------------------------------------------------------------|
  3233. * | rx ind WR_IDX physical address (bits 31:0) |
  3234. #if HTT_PADDR64
  3235. * | rx ind WR_IDX physical address (bits 63:32) |
  3236. #endif
  3237. * |-------------------------------------------------------------------|
  3238. * |-------------------------------------------------------------------|
  3239. * | rx ring2 base (bits 31:0) |
  3240. #if HTT_PADDR64
  3241. * | rx ring2 base (bits 63:32) |
  3242. #endif
  3243. * |-------------------------------------------------------------------|
  3244. * | rx ring2 size |
  3245. * |-------------------------------------------------------------------|
  3246. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3247. #if HTT_PADDR64
  3248. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3249. #endif
  3250. * |-------------------------------------------------------------------|
  3251. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3252. #if HTT_PADDR64
  3253. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3254. #endif
  3255. * |-------------------------------------------------------------------|
  3256. *
  3257. * Header fields:
  3258. * Header fields:
  3259. * - MSG_TYPE
  3260. * Bits 7:0
  3261. * Purpose: Identifies this as WDI_IPA config message
  3262. * value: = 0x8
  3263. * - TX_PKT_POOL_SIZE
  3264. * Bits 15:0
  3265. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3266. * WDI_IPA TX path
  3267. * For systems using 32-bit format for bus addresses:
  3268. * - TX_COMP_RING_BASE_ADDR
  3269. * Bits 31:0
  3270. * Purpose: TX Completion Ring base address in DDR
  3271. * - TX_COMP_RING_SIZE
  3272. * Bits 31:0
  3273. * Purpose: TX Completion Ring size (must be power of 2)
  3274. * - TX_COMP_WR_IDX_ADDR
  3275. * Bits 31:0
  3276. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3277. * updates the Write Index for WDI_IPA TX completion ring
  3278. * - TX_CE_WR_IDX_ADDR
  3279. * Bits 31:0
  3280. * Purpose: DDR address where IPA uC
  3281. * updates the WR Index for TX CE ring
  3282. * (needed for fusion platforms)
  3283. * - RX_IND_RING_BASE_ADDR
  3284. * Bits 31:0
  3285. * Purpose: RX Indication Ring base address in DDR
  3286. * - RX_IND_RING_SIZE
  3287. * Bits 31:0
  3288. * Purpose: RX Indication Ring size
  3289. * - RX_IND_RD_IDX_ADDR
  3290. * Bits 31:0
  3291. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3292. * RX indication ring
  3293. * - RX_IND_WR_IDX_ADDR
  3294. * Bits 31:0
  3295. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3296. * updates the Write Index for WDI_IPA RX indication ring
  3297. * - RX_RING2_BASE_ADDR
  3298. * Bits 31:0
  3299. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3300. * - RX_RING2_SIZE
  3301. * Bits 31:0
  3302. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3303. * - RX_RING2_RD_IDX_ADDR
  3304. * Bits 31:0
  3305. * Purpose: If Second RX ring is Indication ring, DDR address where
  3306. * IPA uC updates the Read Index for Ring2.
  3307. * If Second RX ring is completion ring, this is NOT used
  3308. * - RX_RING2_WR_IDX_ADDR
  3309. * Bits 31:0
  3310. * Purpose: If Second RX ring is Indication ring, DDR address where
  3311. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3312. * If second RX ring is completion ring, DDR address where
  3313. * IPA uC updates the Write Index for Ring 2.
  3314. * For systems using 64-bit format for bus addresses:
  3315. * - TX_COMP_RING_BASE_ADDR_LO
  3316. * Bits 31:0
  3317. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3318. * - TX_COMP_RING_BASE_ADDR_HI
  3319. * Bits 31:0
  3320. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3321. * - TX_COMP_RING_SIZE
  3322. * Bits 31:0
  3323. * Purpose: TX Completion Ring size (must be power of 2)
  3324. * - TX_COMP_WR_IDX_ADDR_LO
  3325. * Bits 31:0
  3326. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3327. * Lower 4 bytes of DDR address where WIFI FW
  3328. * updates the Write Index for WDI_IPA TX completion ring
  3329. * - TX_COMP_WR_IDX_ADDR_HI
  3330. * Bits 31:0
  3331. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3332. * Higher 4 bytes of DDR address where WIFI FW
  3333. * updates the Write Index for WDI_IPA TX completion ring
  3334. * - TX_CE_WR_IDX_ADDR_LO
  3335. * Bits 31:0
  3336. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3337. * updates the WR Index for TX CE ring
  3338. * (needed for fusion platforms)
  3339. * - TX_CE_WR_IDX_ADDR_HI
  3340. * Bits 31:0
  3341. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3342. * updates the WR Index for TX CE ring
  3343. * (needed for fusion platforms)
  3344. * - RX_IND_RING_BASE_ADDR_LO
  3345. * Bits 31:0
  3346. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3347. * - RX_IND_RING_BASE_ADDR_HI
  3348. * Bits 31:0
  3349. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3350. * - RX_IND_RING_SIZE
  3351. * Bits 31:0
  3352. * Purpose: RX Indication Ring size
  3353. * - RX_IND_RD_IDX_ADDR_LO
  3354. * Bits 31:0
  3355. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3356. * for WDI_IPA RX indication ring
  3357. * - RX_IND_RD_IDX_ADDR_HI
  3358. * Bits 31:0
  3359. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3360. * for WDI_IPA RX indication ring
  3361. * - RX_IND_WR_IDX_ADDR_LO
  3362. * Bits 31:0
  3363. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3364. * Lower 4 bytes of DDR address where WIFI FW
  3365. * updates the Write Index for WDI_IPA RX indication ring
  3366. * - RX_IND_WR_IDX_ADDR_HI
  3367. * Bits 31:0
  3368. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3369. * Higher 4 bytes of DDR address where WIFI FW
  3370. * updates the Write Index for WDI_IPA RX indication ring
  3371. * - RX_RING2_BASE_ADDR_LO
  3372. * Bits 31:0
  3373. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3374. * - RX_RING2_BASE_ADDR_HI
  3375. * Bits 31:0
  3376. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3377. * - RX_RING2_SIZE
  3378. * Bits 31:0
  3379. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3380. * - RX_RING2_RD_IDX_ADDR_LO
  3381. * Bits 31:0
  3382. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3383. * DDR address where IPA uC updates the Read Index for Ring2.
  3384. * If Second RX ring is completion ring, this is NOT used
  3385. * - RX_RING2_RD_IDX_ADDR_HI
  3386. * Bits 31:0
  3387. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3388. * DDR address where IPA uC updates the Read Index for Ring2.
  3389. * If Second RX ring is completion ring, this is NOT used
  3390. * - RX_RING2_WR_IDX_ADDR_LO
  3391. * Bits 31:0
  3392. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3393. * DDR address where WIFI FW updates the Write Index
  3394. * for WDI_IPA RX ring2
  3395. * If second RX ring is completion ring, lower 4 bytes of
  3396. * DDR address where IPA uC updates the Write Index for Ring 2.
  3397. * - RX_RING2_WR_IDX_ADDR_HI
  3398. * Bits 31:0
  3399. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3400. * DDR address where WIFI FW updates the Write Index
  3401. * for WDI_IPA RX ring2
  3402. * If second RX ring is completion ring, higher 4 bytes of
  3403. * DDR address where IPA uC updates the Write Index for Ring 2.
  3404. */
  3405. #if HTT_PADDR64
  3406. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3407. #else
  3408. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3409. #endif
  3410. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3411. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3412. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3413. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3414. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3415. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3416. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3417. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3418. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3419. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3420. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3421. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3422. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3423. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3424. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3425. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3426. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3427. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3428. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3429. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3430. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3431. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3432. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3433. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3434. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3435. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3436. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3437. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3438. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3439. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3440. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3441. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3442. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3443. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3444. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3445. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3446. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3447. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3448. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3449. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3450. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3451. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3452. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3453. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3454. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3455. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3456. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3457. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3458. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3459. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3460. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3461. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3462. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3463. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3464. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3465. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3466. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3467. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3468. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3469. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3470. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3471. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3472. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3473. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3474. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3475. do { \
  3476. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3477. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3478. } while (0)
  3479. /* for systems using 32-bit format for bus addr */
  3480. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3481. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3482. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3483. do { \
  3484. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3485. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3486. } while (0)
  3487. /* for systems using 64-bit format for bus addr */
  3488. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3489. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3490. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3491. do { \
  3492. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3493. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3494. } while (0)
  3495. /* for systems using 64-bit format for bus addr */
  3496. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3497. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3498. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3499. do { \
  3500. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3501. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3502. } while (0)
  3503. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3504. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3505. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3506. do { \
  3507. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3508. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3509. } while (0)
  3510. /* for systems using 32-bit format for bus addr */
  3511. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3512. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3513. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3514. do { \
  3515. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3516. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3517. } while (0)
  3518. /* for systems using 64-bit format for bus addr */
  3519. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3520. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3521. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3522. do { \
  3523. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3524. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3525. } while (0)
  3526. /* for systems using 64-bit format for bus addr */
  3527. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3528. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3529. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3530. do { \
  3531. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3532. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3533. } while (0)
  3534. /* for systems using 32-bit format for bus addr */
  3535. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3536. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3537. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3538. do { \
  3539. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3540. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3541. } while (0)
  3542. /* for systems using 64-bit format for bus addr */
  3543. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3544. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3545. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3546. do { \
  3547. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3548. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3549. } while (0)
  3550. /* for systems using 64-bit format for bus addr */
  3551. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3552. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3553. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3554. do { \
  3555. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3556. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3557. } while (0)
  3558. /* for systems using 32-bit format for bus addr */
  3559. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3560. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3561. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3562. do { \
  3563. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3564. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3565. } while (0)
  3566. /* for systems using 64-bit format for bus addr */
  3567. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3568. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3569. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3570. do { \
  3571. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3572. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3573. } while (0)
  3574. /* for systems using 64-bit format for bus addr */
  3575. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3576. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3577. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3578. do { \
  3579. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3580. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3581. } while (0)
  3582. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3583. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3584. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3585. do { \
  3586. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3587. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3588. } while (0)
  3589. /* for systems using 32-bit format for bus addr */
  3590. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3591. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3592. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3593. do { \
  3594. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3595. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3596. } while (0)
  3597. /* for systems using 64-bit format for bus addr */
  3598. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3599. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3600. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3601. do { \
  3602. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3603. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3604. } while (0)
  3605. /* for systems using 64-bit format for bus addr */
  3606. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3607. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3608. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3609. do { \
  3610. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3611. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3612. } while (0)
  3613. /* for systems using 32-bit format for bus addr */
  3614. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3615. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3616. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3617. do { \
  3618. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3619. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3620. } while (0)
  3621. /* for systems using 64-bit format for bus addr */
  3622. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3623. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3624. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3625. do { \
  3626. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3627. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3628. } while (0)
  3629. /* for systems using 64-bit format for bus addr */
  3630. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3631. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3632. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3633. do { \
  3634. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3635. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3636. } while (0)
  3637. /* for systems using 32-bit format for bus addr */
  3638. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3639. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3640. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3641. do { \
  3642. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3643. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3644. } while (0)
  3645. /* for systems using 64-bit format for bus addr */
  3646. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3647. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3648. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3649. do { \
  3650. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3651. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3652. } while (0)
  3653. /* for systems using 64-bit format for bus addr */
  3654. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3655. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3656. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3657. do { \
  3658. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3659. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3660. } while (0)
  3661. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3662. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3663. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3664. do { \
  3665. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3666. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3667. } while (0)
  3668. /* for systems using 32-bit format for bus addr */
  3669. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3670. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3671. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3672. do { \
  3673. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3674. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3675. } while (0)
  3676. /* for systems using 64-bit format for bus addr */
  3677. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3678. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3679. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3680. do { \
  3681. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3682. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3683. } while (0)
  3684. /* for systems using 64-bit format for bus addr */
  3685. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3686. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3687. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3688. do { \
  3689. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3690. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3691. } while (0)
  3692. /* for systems using 32-bit format for bus addr */
  3693. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3694. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3695. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3696. do { \
  3697. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3698. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3699. } while (0)
  3700. /* for systems using 64-bit format for bus addr */
  3701. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3702. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3703. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3704. do { \
  3705. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3706. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3707. } while (0)
  3708. /* for systems using 64-bit format for bus addr */
  3709. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3710. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3711. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3712. do { \
  3713. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3714. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3715. } while (0)
  3716. /*
  3717. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3718. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3719. * addresses are stored in a XXX-bit field.
  3720. * This macro is used to define both htt_wdi_ipa_config32_t and
  3721. * htt_wdi_ipa_config64_t structs.
  3722. */
  3723. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3724. _paddr__tx_comp_ring_base_addr_, \
  3725. _paddr__tx_comp_wr_idx_addr_, \
  3726. _paddr__tx_ce_wr_idx_addr_, \
  3727. _paddr__rx_ind_ring_base_addr_, \
  3728. _paddr__rx_ind_rd_idx_addr_, \
  3729. _paddr__rx_ind_wr_idx_addr_, \
  3730. _paddr__rx_ring2_base_addr_,\
  3731. _paddr__rx_ring2_rd_idx_addr_,\
  3732. _paddr__rx_ring2_wr_idx_addr_) \
  3733. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3734. { \
  3735. /* DWORD 0: flags and meta-data */ \
  3736. A_UINT32 \
  3737. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3738. reserved: 8, \
  3739. tx_pkt_pool_size: 16;\
  3740. /* DWORD 1 */\
  3741. _paddr__tx_comp_ring_base_addr_;\
  3742. /* DWORD 2 (or 3)*/\
  3743. A_UINT32 tx_comp_ring_size;\
  3744. /* DWORD 3 (or 4)*/\
  3745. _paddr__tx_comp_wr_idx_addr_;\
  3746. /* DWORD 4 (or 6)*/\
  3747. _paddr__tx_ce_wr_idx_addr_;\
  3748. /* DWORD 5 (or 8)*/\
  3749. _paddr__rx_ind_ring_base_addr_;\
  3750. /* DWORD 6 (or 10)*/\
  3751. A_UINT32 rx_ind_ring_size;\
  3752. /* DWORD 7 (or 11)*/\
  3753. _paddr__rx_ind_rd_idx_addr_;\
  3754. /* DWORD 8 (or 13)*/\
  3755. _paddr__rx_ind_wr_idx_addr_;\
  3756. /* DWORD 9 (or 15)*/\
  3757. _paddr__rx_ring2_base_addr_;\
  3758. /* DWORD 10 (or 17) */\
  3759. A_UINT32 rx_ring2_size;\
  3760. /* DWORD 11 (or 18) */\
  3761. _paddr__rx_ring2_rd_idx_addr_;\
  3762. /* DWORD 12 (or 20) */\
  3763. _paddr__rx_ring2_wr_idx_addr_;\
  3764. } POSTPACK
  3765. /* define a htt_wdi_ipa_config32_t type */
  3766. 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));
  3767. /* define a htt_wdi_ipa_config64_t type */
  3768. 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));
  3769. #if HTT_PADDR64
  3770. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3771. #else
  3772. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3773. #endif
  3774. enum htt_wdi_ipa_op_code {
  3775. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3776. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3777. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3778. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3779. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3780. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3781. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3782. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3783. /* keep this last */
  3784. HTT_WDI_IPA_OPCODE_MAX
  3785. };
  3786. /**
  3787. * @brief HTT WDI_IPA Operation Request Message
  3788. *
  3789. * @details
  3790. * HTT WDI_IPA Operation Request message is sent by host
  3791. * to either suspend or resume WDI_IPA TX or RX path.
  3792. * |31 24|23 16|15 8|7 0|
  3793. * |----------------+----------------+----------------+----------------|
  3794. * | op_code | Rsvd | msg_type |
  3795. * |-------------------------------------------------------------------|
  3796. *
  3797. * Header fields:
  3798. * - MSG_TYPE
  3799. * Bits 7:0
  3800. * Purpose: Identifies this as WDI_IPA Operation Request message
  3801. * value: = 0x9
  3802. * - OP_CODE
  3803. * Bits 31:16
  3804. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3805. * value: = enum htt_wdi_ipa_op_code
  3806. */
  3807. PREPACK struct htt_wdi_ipa_op_request_t
  3808. {
  3809. /* DWORD 0: flags and meta-data */
  3810. A_UINT32
  3811. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3812. reserved: 8,
  3813. op_code: 16;
  3814. } POSTPACK;
  3815. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3816. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3817. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3818. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3819. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3820. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3821. do { \
  3822. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3823. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3824. } while (0)
  3825. /*
  3826. * @brief host -> target HTT_SRING_SETUP message
  3827. *
  3828. * @details
  3829. * After target is booted up, Host can send SRING setup message for
  3830. * each host facing LMAC SRING. Target setups up HW registers based
  3831. * on setup message and confirms back to Host if response_required is set.
  3832. * Host should wait for confirmation message before sending new SRING
  3833. * setup message
  3834. *
  3835. * The message would appear as follows:
  3836. * |31 24|23 20|19|18 16|15|14 8|7 0|
  3837. * |--------------- +-----------------+----------------+------------------|
  3838. * | ring_type | ring_id | pdev_id | msg_type |
  3839. * |----------------------------------------------------------------------|
  3840. * | ring_base_addr_lo |
  3841. * |----------------------------------------------------------------------|
  3842. * | ring_base_addr_hi |
  3843. * |----------------------------------------------------------------------|
  3844. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3845. * |----------------------------------------------------------------------|
  3846. * | ring_head_offset32_remote_addr_lo |
  3847. * |----------------------------------------------------------------------|
  3848. * | ring_head_offset32_remote_addr_hi |
  3849. * |----------------------------------------------------------------------|
  3850. * | ring_tail_offset32_remote_addr_lo |
  3851. * |----------------------------------------------------------------------|
  3852. * | ring_tail_offset32_remote_addr_hi |
  3853. * |----------------------------------------------------------------------|
  3854. * | ring_msi_addr_lo |
  3855. * |----------------------------------------------------------------------|
  3856. * | ring_msi_addr_hi |
  3857. * |----------------------------------------------------------------------|
  3858. * | ring_msi_data |
  3859. * |----------------------------------------------------------------------|
  3860. * | intr_timer_th |IM| intr_batch_counter_th |
  3861. * |----------------------------------------------------------------------|
  3862. * | reserved |RR|PTCF| intr_low_threshold |
  3863. * |----------------------------------------------------------------------|
  3864. * Where
  3865. * IM = sw_intr_mode
  3866. * RR = response_required
  3867. * PTCF = prefetch_timer_cfg
  3868. *
  3869. * The message is interpreted as follows:
  3870. * dword0 - b'0:7 - msg_type: This will be set to
  3871. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3872. * b'8:15 - pdev_id:
  3873. * 0 (for rings at SOC/UMAC level),
  3874. * 1/2/3 mac id (for rings at LMAC level)
  3875. * b'16:23 - ring_id: identify which ring is to setup,
  3876. * more details can be got from enum htt_srng_ring_id
  3877. * b'24:31 - ring_type: identify type of host rings,
  3878. * more details can be got from enum htt_srng_ring_type
  3879. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3880. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3881. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3882. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3883. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3884. * SW_TO_HW_RING.
  3885. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3886. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3887. * Lower 32 bits of memory address of the remote variable
  3888. * storing the 4-byte word offset that identifies the head
  3889. * element within the ring.
  3890. * (The head offset variable has type A_UINT32.)
  3891. * Valid for HW_TO_SW and SW_TO_SW rings.
  3892. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3893. * Upper 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. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3899. * Lower 32 bits of memory address of the remote variable
  3900. * storing the 4-byte word offset that identifies the tail
  3901. * element within the ring.
  3902. * (The tail offset variable has type A_UINT32.)
  3903. * Valid for HW_TO_SW and SW_TO_SW rings.
  3904. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3905. * Upper 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. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  3911. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3912. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  3913. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3914. * dword10 - b'0:31 - ring_msi_data: MSI data
  3915. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  3916. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3917. * dword11 - b'0:14 - intr_batch_counter_th:
  3918. * batch counter threshold is in units of 4-byte words.
  3919. * HW internally maintains and increments batch count.
  3920. * (see SRING spec for detail description).
  3921. * When batch count reaches threshold value, an interrupt
  3922. * is generated by HW.
  3923. * b'15 - sw_intr_mode:
  3924. * This configuration shall be static.
  3925. * Only programmed at power up.
  3926. * 0: generate pulse style sw interrupts
  3927. * 1: generate level style sw interrupts
  3928. * b'16:31 - intr_timer_th:
  3929. * The timer init value when timer is idle or is
  3930. * initialized to start downcounting.
  3931. * In 8us units (to cover a range of 0 to 524 ms)
  3932. * dword12 - b'0:15 - intr_low_threshold:
  3933. * Used only by Consumer ring to generate ring_sw_int_p.
  3934. * Ring entries low threshold water mark, that is used
  3935. * in combination with the interrupt timer as well as
  3936. * the the clearing of the level interrupt.
  3937. * b'16:18 - prefetch_timer_cfg:
  3938. * Used only by Consumer ring to set timer mode to
  3939. * support Application prefetch handling.
  3940. * The external tail offset/pointer will be updated
  3941. * at following intervals:
  3942. * 3'b000: (Prefetch feature disabled; used only for debug)
  3943. * 3'b001: 1 usec
  3944. * 3'b010: 4 usec
  3945. * 3'b011: 8 usec (default)
  3946. * 3'b100: 16 usec
  3947. * Others: Reserverd
  3948. * b'19 - response_required:
  3949. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  3950. * b'20:31 - reserved: reserved for future use
  3951. */
  3952. PREPACK struct htt_sring_setup_t {
  3953. A_UINT32 msg_type: 8,
  3954. pdev_id: 8,
  3955. ring_id: 8,
  3956. ring_type: 8;
  3957. A_UINT32 ring_base_addr_lo;
  3958. A_UINT32 ring_base_addr_hi;
  3959. A_UINT32 ring_size: 16,
  3960. ring_entry_size: 8,
  3961. ring_misc_cfg_flag: 8;
  3962. A_UINT32 ring_head_offset32_remote_addr_lo;
  3963. A_UINT32 ring_head_offset32_remote_addr_hi;
  3964. A_UINT32 ring_tail_offset32_remote_addr_lo;
  3965. A_UINT32 ring_tail_offset32_remote_addr_hi;
  3966. A_UINT32 ring_msi_addr_lo;
  3967. A_UINT32 ring_msi_addr_hi;
  3968. A_UINT32 ring_msi_data;
  3969. A_UINT32 intr_batch_counter_th: 15,
  3970. sw_intr_mode: 1,
  3971. intr_timer_th: 16;
  3972. A_UINT32 intr_low_threshold: 16,
  3973. prefetch_timer_cfg: 3,
  3974. response_required: 1,
  3975. reserved1: 12;
  3976. } POSTPACK;
  3977. enum htt_srng_ring_type {
  3978. HTT_HW_TO_SW_RING = 0,
  3979. HTT_SW_TO_HW_RING,
  3980. HTT_SW_TO_SW_RING,
  3981. /* Insert new ring types above this line */
  3982. };
  3983. enum htt_srng_ring_id {
  3984. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  3985. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  3986. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  3987. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  3988. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  3989. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  3990. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  3991. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  3992. /* Add Other SRING which can't be directly configured by host software above this line */
  3993. };
  3994. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  3995. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  3996. #define HTT_SRING_SETUP_PDEV_ID_S 8
  3997. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  3998. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  3999. HTT_SRING_SETUP_PDEV_ID_S)
  4000. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4001. do { \
  4002. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4003. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4004. } while (0)
  4005. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4006. #define HTT_SRING_SETUP_RING_ID_S 16
  4007. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4008. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4009. HTT_SRING_SETUP_RING_ID_S)
  4010. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4011. do { \
  4012. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4013. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4014. } while (0)
  4015. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4016. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4017. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4018. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4019. HTT_SRING_SETUP_RING_TYPE_S)
  4020. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4021. do { \
  4022. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4023. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4024. } while (0)
  4025. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4026. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4027. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4028. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4029. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4030. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4031. do { \
  4032. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4033. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4034. } while (0)
  4035. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4036. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4037. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4038. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4039. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4040. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4041. do { \
  4042. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4043. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4044. } while (0)
  4045. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4046. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4047. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4048. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4049. HTT_SRING_SETUP_RING_SIZE_S)
  4050. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4051. do { \
  4052. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4053. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4054. } while (0)
  4055. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4056. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4057. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4058. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4059. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4060. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4061. do { \
  4062. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4063. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4064. } while (0)
  4065. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4066. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4067. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4068. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4069. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4070. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4071. do { \
  4072. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4073. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4074. } while (0)
  4075. /* This control bit is applicable to only Producer, which updates Ring ID field
  4076. * of each descriptor before pushing into the ring.
  4077. * 0: updates ring_id(default)
  4078. * 1: ring_id updating disabled */
  4079. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4080. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4081. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4082. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4083. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4084. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4085. do { \
  4086. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4087. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4088. } while (0)
  4089. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4090. * of each descriptor before pushing into the ring.
  4091. * 0: updates Loopcnt(default)
  4092. * 1: Loopcnt updating disabled */
  4093. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4094. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4095. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4096. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4097. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4098. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4099. do { \
  4100. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4101. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4102. } while (0)
  4103. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4104. * into security_id port of GXI/AXI. */
  4105. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4106. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4107. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4108. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4109. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4110. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4111. do { \
  4112. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4113. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4114. } while (0)
  4115. /* During MSI write operation, SRNG drives value of this register bit into
  4116. * swap bit of GXI/AXI. */
  4117. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4118. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4119. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4120. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4121. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4122. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4123. do { \
  4124. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4125. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4126. } while (0)
  4127. /* During Pointer write operation, SRNG drives value of this register bit into
  4128. * swap bit of GXI/AXI. */
  4129. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4130. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4131. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4132. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4133. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4134. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4135. do { \
  4136. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4137. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4138. } while (0)
  4139. /* During any data or TLV write operation, SRNG drives value of this register
  4140. * bit into swap bit of GXI/AXI. */
  4141. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4142. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4143. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4144. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4145. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4146. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4147. do { \
  4148. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4149. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4150. } while (0)
  4151. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4152. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4153. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4154. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4155. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4156. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4157. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4158. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4159. do { \
  4160. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4161. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4162. } while (0)
  4163. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4164. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4165. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4166. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4167. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4168. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4169. do { \
  4170. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4171. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4172. } while (0)
  4173. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4174. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4175. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4176. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4177. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4178. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4179. do { \
  4180. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4181. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4182. } while (0)
  4183. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4184. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4185. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4186. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4187. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4188. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4189. do { \
  4190. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4191. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4192. } while (0)
  4193. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4194. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4195. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4196. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4197. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4198. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4199. do { \
  4200. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4201. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4202. } while (0)
  4203. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4204. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4205. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4206. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4207. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4208. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4209. do { \
  4210. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4211. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4212. } while (0)
  4213. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4214. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4215. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4216. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4217. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4218. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4219. do { \
  4220. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4221. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4222. } while (0)
  4223. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4224. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4225. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4226. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4227. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4228. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4229. do { \
  4230. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4231. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4232. } while (0)
  4233. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4234. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4235. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4236. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4237. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4238. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4239. do { \
  4240. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4241. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4242. } while (0)
  4243. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4244. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4245. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4246. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4247. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4248. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4249. do { \
  4250. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4251. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4252. } while (0)
  4253. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4254. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4255. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4256. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4257. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4258. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4259. do { \
  4260. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4261. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4262. } while (0)
  4263. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4264. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4265. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4266. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4267. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4268. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4269. do { \
  4270. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4271. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4272. } while (0)
  4273. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4274. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4275. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4276. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4277. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4278. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4279. do { \
  4280. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4281. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4282. } while (0)
  4283. /**
  4284. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4285. *
  4286. * @details
  4287. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4288. * configure RXDMA rings.
  4289. * The configuration is per ring based and includes both packet subtypes
  4290. * and PPDU/MPDU TLVs.
  4291. *
  4292. * The message would appear as follows:
  4293. *
  4294. * |31 26|25|24|23 16|15 8|7 0|
  4295. * |-----------------+----------------+----------------+---------------|
  4296. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  4297. * |-------------------------------------------------------------------|
  4298. * | rsvd2 | ring_buffer_size |
  4299. * |-------------------------------------------------------------------|
  4300. * | packet_type_enable_flags_0 |
  4301. * |-------------------------------------------------------------------|
  4302. * | packet_type_enable_flags_1 |
  4303. * |-------------------------------------------------------------------|
  4304. * | packet_type_enable_flags_2 |
  4305. * |-------------------------------------------------------------------|
  4306. * | packet_type_enable_flags_3 |
  4307. * |-------------------------------------------------------------------|
  4308. * | tlv_filter_in_flags |
  4309. * |-------------------------------------------------------------------|
  4310. * Where:
  4311. * PS = pkt_swap
  4312. * SS = status_swap
  4313. * The message is interpreted as follows:
  4314. * dword0 - b'0:7 - msg_type: This will be set to
  4315. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4316. * b'8:15 - pdev_id:
  4317. * 0 (for rings at SOC/UMAC level),
  4318. * 1/2/3 mac id (for rings at LMAC level)
  4319. * b'16:23 - ring_id : Identify the ring to configure.
  4320. * More details can be got from enum htt_srng_ring_id
  4321. * b'24 - status_swap: 1 is to swap status TLV
  4322. * b'25 - pkt_swap: 1 is to swap packet TLV
  4323. * b'26:31 - rsvd1: reserved for future use
  4324. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4325. * in byte units.
  4326. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4327. * - b'16:31 - rsvd2: Reserved for future use
  4328. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4329. * Enable MGMT packet from 0b0000 to 0b1001
  4330. * bits from low to high: FP, MD, MO - 3 bits
  4331. * FP: Filter_Pass
  4332. * MD: Monitor_Direct
  4333. * MO: Monitor_Other
  4334. * 10 mgmt subtypes * 3 bits -> 30 bits
  4335. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4336. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4337. * Enable MGMT packet from 0b1010 to 0b1111
  4338. * bits from low to high: FP, MD, MO - 3 bits
  4339. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4340. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4341. * Enable CTRL packet from 0b0000 to 0b1001
  4342. * bits from low to high: FP, MD, MO - 3 bits
  4343. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4344. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4345. * Enable CTRL packet from 0b1010 to 0b1111,
  4346. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4347. * bits from low to high: FP, MD, MO - 3 bits
  4348. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4349. * dword6 - b'0:31 - tlv_filter_in_flags:
  4350. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4351. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4352. */
  4353. PREPACK struct htt_rx_ring_selection_cfg_t {
  4354. A_UINT32 msg_type: 8,
  4355. pdev_id: 8,
  4356. ring_id: 8,
  4357. status_swap: 1,
  4358. pkt_swap: 1,
  4359. rsvd1: 6;
  4360. A_UINT32 ring_buffer_size: 16,
  4361. rsvd2: 16;
  4362. A_UINT32 packet_type_enable_flags_0;
  4363. A_UINT32 packet_type_enable_flags_1;
  4364. A_UINT32 packet_type_enable_flags_2;
  4365. A_UINT32 packet_type_enable_flags_3;
  4366. A_UINT32 tlv_filter_in_flags;
  4367. } POSTPACK;
  4368. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4369. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4370. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4371. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4372. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4373. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4374. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4375. do { \
  4376. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4377. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4378. } while (0)
  4379. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4380. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4381. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4382. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4383. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4384. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4385. do { \
  4386. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4387. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4388. } while (0)
  4389. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4390. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4391. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4392. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4393. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4394. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4395. do { \
  4396. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4397. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4398. } while (0)
  4399. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4400. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4401. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4402. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4403. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4404. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4405. do { \
  4406. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4407. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4408. } while (0)
  4409. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4410. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4411. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4412. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4413. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4414. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4415. do { \
  4416. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4417. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4418. } while (0)
  4419. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4420. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4421. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4422. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4423. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4424. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4425. do { \
  4426. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4427. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4428. } while (0)
  4429. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4430. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4431. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4432. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4433. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4434. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4435. do { \
  4436. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4437. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4438. } while (0)
  4439. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4440. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4441. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4442. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4443. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4444. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4445. do { \
  4446. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4447. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4448. } while (0)
  4449. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4450. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4451. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4452. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4453. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4454. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4455. do { \
  4456. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4457. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4458. } while (0)
  4459. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4460. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4461. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4462. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4463. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4464. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4465. do { \
  4466. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4467. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4468. } while (0)
  4469. /*
  4470. * Subtype based MGMT frames enable bits.
  4471. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4472. */
  4473. /* association request */
  4474. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4475. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4476. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4477. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4478. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4479. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4480. /* association response */
  4481. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4482. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4483. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4484. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4485. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4486. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4487. /* Reassociation request */
  4488. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4489. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4490. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4491. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4492. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4493. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4494. /* Reassociation response */
  4495. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4496. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4497. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4498. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4499. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4500. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4501. /* Probe request */
  4502. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4503. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4504. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4505. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4506. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4507. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4508. /* Probe response */
  4509. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4510. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4511. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4512. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4513. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4514. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4515. /* Timing Advertisement */
  4516. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4517. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4518. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4519. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4520. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4521. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4522. /* Reserved */
  4523. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4524. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4525. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4526. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4527. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4528. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4529. /* Beacon */
  4530. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  4531. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4532. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  4533. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4534. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  4535. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4536. /* ATIM */
  4537. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  4538. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4539. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  4540. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4541. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  4542. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4543. /* Disassociation */
  4544. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4545. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4546. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4547. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4548. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4549. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4550. /* Authentication */
  4551. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4552. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4553. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4554. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4555. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4556. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4557. /* Deauthentication */
  4558. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4559. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4560. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4561. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4562. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4563. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4564. /* Action */
  4565. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4566. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4567. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4568. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4569. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4570. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4571. /* Action No Ack */
  4572. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4573. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4574. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4575. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4576. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4577. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4578. /* Reserved */
  4579. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4580. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4581. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4582. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4583. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4584. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4585. /*
  4586. * Subtype based CTRL frames enable bits.
  4587. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4588. */
  4589. /* Reserved */
  4590. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4591. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4592. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4593. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4594. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4595. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4596. /* Reserved */
  4597. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4598. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4599. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4600. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4601. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4602. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4603. /* Reserved */
  4604. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4605. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4606. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4607. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4608. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4609. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4610. /* Reserved */
  4611. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4612. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4613. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4614. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4615. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4616. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4617. /* Reserved */
  4618. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4619. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4620. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4621. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4622. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4623. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4624. /* Reserved */
  4625. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4626. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4627. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4628. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4629. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4630. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4631. /* Reserved */
  4632. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4633. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4634. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4635. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4636. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4637. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4638. /* Control Wrapper */
  4639. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4640. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4641. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4642. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4643. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4644. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4645. /* Block Ack Request */
  4646. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  4647. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4648. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  4649. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4650. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  4651. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4652. /* Block Ack*/
  4653. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  4654. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4655. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  4656. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4657. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  4658. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4659. /* PS-POLL */
  4660. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4661. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4662. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4663. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4664. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4665. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4666. /* RTS */
  4667. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4668. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4669. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4670. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4671. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4672. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4673. /* CTS */
  4674. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4675. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4676. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4677. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4678. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4679. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4680. /* ACK */
  4681. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4682. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4683. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4684. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4685. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4686. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4687. /* CF-END */
  4688. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4689. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4690. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4691. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4692. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  4693. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4694. /* CF-END + CF-ACK */
  4695. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  4696. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4697. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  4698. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4699. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  4700. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4701. /* Multicast data */
  4702. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  4703. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4704. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  4705. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  4706. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  4707. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  4708. /* Unicast data */
  4709. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  4710. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  4711. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  4712. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  4713. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  4714. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  4715. /* NULL data */
  4716. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  4717. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  4718. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  4719. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  4720. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  4721. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  4722. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  4723. do { \
  4724. HTT_CHECK_SET_VAL(httsym, value); \
  4725. (word) |= (value) << httsym##_S; \
  4726. } while (0)
  4727. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  4728. (((word) & httsym##_M) >> httsym##_S)
  4729. #define htt_rx_ring_pkt_enable_subtype_set( \
  4730. word, flag, mode, type, subtype, val) \
  4731. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  4732. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  4733. #define htt_rx_ring_pkt_enable_subtype_get( \
  4734. word, flag, mode, type, subtype) \
  4735. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  4736. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  4737. /* Definition to filter in TLVs */
  4738. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  4739. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  4740. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  4741. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  4742. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  4743. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  4744. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  4745. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  4746. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  4747. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  4748. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  4749. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  4750. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  4751. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  4752. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  4753. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  4754. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  4755. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  4756. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  4757. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  4758. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  4759. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  4760. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  4761. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  4762. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  4763. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  4764. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  4765. do { \
  4766. HTT_CHECK_SET_VAL(httsym, enable); \
  4767. (word) |= (enable) << httsym##_S; \
  4768. } while (0)
  4769. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  4770. (((word) & httsym##_M) >> httsym##_S)
  4771. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  4772. HTT_RX_RING_TLV_ENABLE_SET( \
  4773. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  4774. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  4775. HTT_RX_RING_TLV_ENABLE_GET( \
  4776. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  4777. /**
  4778. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  4779. * host --> target Receive Flow Steering configuration message definition.
  4780. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4781. * The reason for this is we want RFS to be configured and ready before MAC
  4782. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4783. *
  4784. * |31 24|23 16|15 9|8|7 0|
  4785. * |----------------+----------------+----------------+----------------|
  4786. * | reserved |E| msg type |
  4787. * |-------------------------------------------------------------------|
  4788. * Where E = RFS enable flag
  4789. *
  4790. * The RFS_CONFIG message consists of a single 4-byte word.
  4791. *
  4792. * Header fields:
  4793. * - MSG_TYPE
  4794. * Bits 7:0
  4795. * Purpose: identifies this as a RFS config msg
  4796. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  4797. * - RFS_CONFIG
  4798. * Bit 8
  4799. * Purpose: Tells target whether to enable (1) or disable (0)
  4800. * flow steering feature when sending rx indication messages to host
  4801. */
  4802. #define HTT_H2T_RFS_CONFIG_M 0x100
  4803. #define HTT_H2T_RFS_CONFIG_S 8
  4804. #define HTT_RX_RFS_CONFIG_GET(_var) \
  4805. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  4806. HTT_H2T_RFS_CONFIG_S)
  4807. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  4808. do { \
  4809. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  4810. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  4811. } while (0)
  4812. #define HTT_RFS_CFG_REQ_BYTES 4
  4813. /**
  4814. * @brief host -> target FW extended statistics retrieve
  4815. *
  4816. * @details
  4817. * The following field definitions describe the format of the HTT host
  4818. * to target FW extended stats retrieve message.
  4819. * The message specifies the type of stats the host wants to retrieve.
  4820. *
  4821. * |31 24|23 16|15 8|7 0|
  4822. * |-----------------------------------------------------------|
  4823. * | reserved | stats type | pdev_mask | msg type |
  4824. * |-----------------------------------------------------------|
  4825. * | config param [0] |
  4826. * |-----------------------------------------------------------|
  4827. * | config param [1] |
  4828. * |-----------------------------------------------------------|
  4829. * | config param [2] |
  4830. * |-----------------------------------------------------------|
  4831. * | config param [3] |
  4832. * |-----------------------------------------------------------|
  4833. * | reserved |
  4834. * |-----------------------------------------------------------|
  4835. * | cookie LSBs |
  4836. * |-----------------------------------------------------------|
  4837. * | cookie MSBs |
  4838. * |-----------------------------------------------------------|
  4839. * Header fields:
  4840. * - MSG_TYPE
  4841. * Bits 7:0
  4842. * Purpose: identifies this is a extended stats upload request message
  4843. * Value: 0x10
  4844. * - PDEV_MASK
  4845. * Bits 8:15
  4846. * Purpose: identifies the mask of PDEVs to retrieve stats from
  4847. * Value: This is a overloaded field, refer to usage and interpretation of
  4848. * PDEV in interface document.
  4849. * Bit 8 : Reserved for SOC stats
  4850. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  4851. * Indicates MACID_MASK in DBS
  4852. * - STATS_TYPE
  4853. * Bits 23:16
  4854. * Purpose: identifies which FW statistics to upload
  4855. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  4856. * - Reserved
  4857. * Bits 31:24
  4858. * - CONFIG_PARAM [0]
  4859. * Bits 31:0
  4860. * Purpose: give an opaque configuration value to the specified stats type
  4861. * Value: stats-type specific configuration value
  4862. * Refer to htt_stats.h for interpretation for each stats sub_type
  4863. * - CONFIG_PARAM [1]
  4864. * Bits 31:0
  4865. * Purpose: give an opaque configuration value to the specified stats type
  4866. * Value: stats-type specific configuration value
  4867. * Refer to htt_stats.h for interpretation for each stats sub_type
  4868. * - CONFIG_PARAM [2]
  4869. * Bits 31:0
  4870. * Purpose: give an opaque configuration value to the specified stats type
  4871. * Value: stats-type specific configuration value
  4872. * Refer to htt_stats.h for interpretation for each stats sub_type
  4873. * - CONFIG_PARAM [3]
  4874. * Bits 31:0
  4875. * Purpose: give an opaque configuration value to the specified stats type
  4876. * Value: stats-type specific configuration value
  4877. * Refer to htt_stats.h for interpretation for each stats sub_type
  4878. * - Reserved [31:0] for future use.
  4879. * - COOKIE_LSBS
  4880. * Bits 31:0
  4881. * Purpose: Provide a mechanism to match a target->host stats confirmation
  4882. * message with its preceding host->target stats request message.
  4883. * Value: LSBs of the opaque cookie specified by the host-side requestor
  4884. * - COOKIE_MSBS
  4885. * Bits 31:0
  4886. * Purpose: Provide a mechanism to match a target->host stats confirmation
  4887. * message with its preceding host->target stats request message.
  4888. * Value: MSBs of the opaque cookie specified by the host-side requestor
  4889. */
  4890. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  4891. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  4892. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  4893. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  4894. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  4895. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  4896. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  4897. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  4898. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  4899. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  4900. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  4901. do { \
  4902. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  4903. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  4904. } while (0)
  4905. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  4906. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  4907. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  4908. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  4909. do { \
  4910. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  4911. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  4912. } while (0)
  4913. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  4914. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  4915. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  4916. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  4917. do { \
  4918. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  4919. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  4920. } while (0)
  4921. /**
  4922. * @brief host -> target FW PPDU_STATS request message
  4923. *
  4924. * @details
  4925. * The following field definitions describe the format of the HTT host
  4926. * to target FW for PPDU_STATS_CFG msg.
  4927. * The message allows the host to configure the PPDU_STATS_IND messages
  4928. * produced by the target.
  4929. *
  4930. * |31 24|23 16|15 8|7 0|
  4931. * |-----------------------------------------------------------|
  4932. * | REQ bit mask | pdev_mask | msg type |
  4933. * |-----------------------------------------------------------|
  4934. * Header fields:
  4935. * - MSG_TYPE
  4936. * Bits 7:0
  4937. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  4938. * Value: 0x11
  4939. * - PDEV_MASK
  4940. * Bits 8:15
  4941. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  4942. * Value: This is a overloaded field, refer to usage and interpretation of
  4943. * PDEV in interface document.
  4944. * Bit 8 : Reserved for SOC stats
  4945. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  4946. * Indicates MACID_MASK in DBS
  4947. * - REQ_TLV_BIT_MASK
  4948. * Bits 16:31
  4949. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  4950. * needs to be included in the target's PPDU_STATS_IND messages.
  4951. * Value: refer htt_ppdu_stats_tlv_tag_t
  4952. *
  4953. */
  4954. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  4955. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  4956. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  4957. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  4958. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  4959. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  4960. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  4961. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  4962. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  4963. do { \
  4964. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  4965. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  4966. } while (0)
  4967. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  4968. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  4969. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  4970. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  4971. do { \
  4972. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  4973. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  4974. } while (0)
  4975. /*=== target -> host messages ===============================================*/
  4976. enum htt_t2h_msg_type {
  4977. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  4978. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  4979. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  4980. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  4981. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  4982. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  4983. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  4984. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  4985. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  4986. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  4987. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  4988. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  4989. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  4990. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  4991. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  4992. /* only used for HL, add HTT MSG for HTT CREDIT update */
  4993. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  4994. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  4995. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  4996. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  4997. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  4998. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  4999. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  5000. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  5001. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  5002. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  5003. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  5004. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  5005. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  5006. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  5007. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  5008. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  5009. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  5010. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  5011. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  5012. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  5013. HTT_T2H_MSG_TYPE_TEST,
  5014. /* keep this last */
  5015. HTT_T2H_NUM_MSGS
  5016. };
  5017. /*
  5018. * HTT target to host message type -
  5019. * stored in bits 7:0 of the first word of the message
  5020. */
  5021. #define HTT_T2H_MSG_TYPE_M 0xff
  5022. #define HTT_T2H_MSG_TYPE_S 0
  5023. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  5024. do { \
  5025. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  5026. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  5027. } while (0)
  5028. #define HTT_T2H_MSG_TYPE_GET(word) \
  5029. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  5030. /**
  5031. * @brief target -> host version number confirmation message definition
  5032. *
  5033. * |31 24|23 16|15 8|7 0|
  5034. * |----------------+----------------+----------------+----------------|
  5035. * | reserved | major number | minor number | msg type |
  5036. * |-------------------------------------------------------------------|
  5037. * : option request TLV (optional) |
  5038. * :...................................................................:
  5039. *
  5040. * The VER_CONF message may consist of a single 4-byte word, or may be
  5041. * extended with TLVs that specify HTT options selected by the target.
  5042. * The following option TLVs may be appended to the VER_CONF message:
  5043. * - LL_BUS_ADDR_SIZE
  5044. * - HL_SUPPRESS_TX_COMPL_IND
  5045. * - MAX_TX_QUEUE_GROUPS
  5046. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  5047. * may be appended to the VER_CONF message (but only one TLV of each type).
  5048. *
  5049. * Header fields:
  5050. * - MSG_TYPE
  5051. * Bits 7:0
  5052. * Purpose: identifies this as a version number confirmation message
  5053. * Value: 0x0
  5054. * - VER_MINOR
  5055. * Bits 15:8
  5056. * Purpose: Specify the minor number of the HTT message library version
  5057. * in use by the target firmware.
  5058. * The minor number specifies the specific revision within a range
  5059. * of fundamentally compatible HTT message definition revisions.
  5060. * Compatible revisions involve adding new messages or perhaps
  5061. * adding new fields to existing messages, in a backwards-compatible
  5062. * manner.
  5063. * Incompatible revisions involve changing the message type values,
  5064. * or redefining existing messages.
  5065. * Value: minor number
  5066. * - VER_MAJOR
  5067. * Bits 15:8
  5068. * Purpose: Specify the major number of the HTT message library version
  5069. * in use by the target firmware.
  5070. * The major number specifies the family of minor revisions that are
  5071. * fundamentally compatible with each other, but not with prior or
  5072. * later families.
  5073. * Value: major number
  5074. */
  5075. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  5076. #define HTT_VER_CONF_MINOR_S 8
  5077. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  5078. #define HTT_VER_CONF_MAJOR_S 16
  5079. #define HTT_VER_CONF_MINOR_SET(word, value) \
  5080. do { \
  5081. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  5082. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  5083. } while (0)
  5084. #define HTT_VER_CONF_MINOR_GET(word) \
  5085. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  5086. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  5087. do { \
  5088. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  5089. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  5090. } while (0)
  5091. #define HTT_VER_CONF_MAJOR_GET(word) \
  5092. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  5093. #define HTT_VER_CONF_BYTES 4
  5094. /**
  5095. * @brief - target -> host HTT Rx In order indication message
  5096. *
  5097. * @details
  5098. *
  5099. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  5100. * |----------------+-------------------+---------------------+---------------|
  5101. * | peer ID | P| F| O| ext TID | msg type |
  5102. * |--------------------------------------------------------------------------|
  5103. * | MSDU count | Reserved | vdev id |
  5104. * |--------------------------------------------------------------------------|
  5105. * | MSDU 0 bus address (bits 31:0) |
  5106. #if HTT_PADDR64
  5107. * | MSDU 0 bus address (bits 63:32) |
  5108. #endif
  5109. * |--------------------------------------------------------------------------|
  5110. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  5111. * |--------------------------------------------------------------------------|
  5112. * | MSDU 1 bus address (bits 31:0) |
  5113. #if HTT_PADDR64
  5114. * | MSDU 1 bus address (bits 63:32) |
  5115. #endif
  5116. * |--------------------------------------------------------------------------|
  5117. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  5118. * |--------------------------------------------------------------------------|
  5119. */
  5120. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  5121. *
  5122. * @details
  5123. * bits
  5124. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  5125. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5126. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  5127. * | | frag | | | | fail |chksum fail|
  5128. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5129. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  5130. */
  5131. struct htt_rx_in_ord_paddr_ind_hdr_t
  5132. {
  5133. A_UINT32 /* word 0 */
  5134. msg_type: 8,
  5135. ext_tid: 5,
  5136. offload: 1,
  5137. frag: 1,
  5138. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  5139. peer_id: 16;
  5140. A_UINT32 /* word 1 */
  5141. vap_id: 8,
  5142. reserved_1: 8,
  5143. msdu_cnt: 16;
  5144. };
  5145. struct htt_rx_in_ord_paddr_ind_msdu32_t
  5146. {
  5147. A_UINT32 dma_addr;
  5148. A_UINT32
  5149. length: 16,
  5150. fw_desc: 8,
  5151. msdu_info:8;
  5152. };
  5153. struct htt_rx_in_ord_paddr_ind_msdu64_t
  5154. {
  5155. A_UINT32 dma_addr_lo;
  5156. A_UINT32 dma_addr_hi;
  5157. A_UINT32
  5158. length: 16,
  5159. fw_desc: 8,
  5160. msdu_info:8;
  5161. };
  5162. #if HTT_PADDR64
  5163. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  5164. #else
  5165. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  5166. #endif
  5167. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  5168. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  5169. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  5170. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  5171. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  5172. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  5173. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  5174. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  5175. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  5176. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  5177. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  5178. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  5179. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  5180. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  5181. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  5182. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  5183. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  5184. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  5185. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  5186. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  5187. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  5188. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  5189. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  5190. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  5191. /* for systems using 64-bit format for bus addresses */
  5192. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  5193. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  5194. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  5195. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  5196. /* for systems using 32-bit format for bus addresses */
  5197. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  5198. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  5199. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  5200. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  5201. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  5202. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  5203. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  5204. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  5205. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  5206. do { \
  5207. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  5208. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  5209. } while (0)
  5210. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  5211. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  5212. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  5213. do { \
  5214. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  5215. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  5216. } while (0)
  5217. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  5218. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  5219. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  5220. do { \
  5221. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  5222. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  5223. } while (0)
  5224. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  5225. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  5226. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  5227. do { \
  5228. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  5229. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  5230. } while (0)
  5231. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  5232. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  5233. /* for systems using 64-bit format for bus addresses */
  5234. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  5235. do { \
  5236. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  5237. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  5238. } while (0)
  5239. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  5240. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  5241. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  5242. do { \
  5243. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  5244. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  5245. } while (0)
  5246. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  5247. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  5248. /* for systems using 32-bit format for bus addresses */
  5249. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  5250. do { \
  5251. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  5252. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  5253. } while (0)
  5254. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  5255. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  5256. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  5257. do { \
  5258. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  5259. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  5260. } while (0)
  5261. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  5262. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  5263. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  5264. do { \
  5265. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  5266. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  5267. } while (0)
  5268. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  5269. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  5270. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  5271. do { \
  5272. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  5273. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  5274. } while (0)
  5275. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  5276. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  5277. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  5278. do { \
  5279. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  5280. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  5281. } while (0)
  5282. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  5283. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  5284. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  5285. do { \
  5286. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  5287. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  5288. } while (0)
  5289. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  5290. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  5291. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  5292. do { \
  5293. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  5294. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  5295. } while (0)
  5296. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  5297. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  5298. /* definitions used within target -> host rx indication message */
  5299. PREPACK struct htt_rx_ind_hdr_prefix_t
  5300. {
  5301. A_UINT32 /* word 0 */
  5302. msg_type: 8,
  5303. ext_tid: 5,
  5304. release_valid: 1,
  5305. flush_valid: 1,
  5306. reserved0: 1,
  5307. peer_id: 16;
  5308. A_UINT32 /* word 1 */
  5309. flush_start_seq_num: 6,
  5310. flush_end_seq_num: 6,
  5311. release_start_seq_num: 6,
  5312. release_end_seq_num: 6,
  5313. num_mpdu_ranges: 8;
  5314. } POSTPACK;
  5315. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  5316. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  5317. #define HTT_TGT_RSSI_INVALID 0x80
  5318. PREPACK struct htt_rx_ppdu_desc_t
  5319. {
  5320. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  5321. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  5322. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  5323. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  5324. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  5325. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  5326. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  5327. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  5328. A_UINT32 /* word 0 */
  5329. rssi_cmb: 8,
  5330. timestamp_submicrosec: 8,
  5331. phy_err_code: 8,
  5332. phy_err: 1,
  5333. legacy_rate: 4,
  5334. legacy_rate_sel: 1,
  5335. end_valid: 1,
  5336. start_valid: 1;
  5337. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  5338. union {
  5339. A_UINT32 /* word 1 */
  5340. rssi0_pri20: 8,
  5341. rssi0_ext20: 8,
  5342. rssi0_ext40: 8,
  5343. rssi0_ext80: 8;
  5344. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  5345. } u0;
  5346. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  5347. union {
  5348. A_UINT32 /* word 2 */
  5349. rssi1_pri20: 8,
  5350. rssi1_ext20: 8,
  5351. rssi1_ext40: 8,
  5352. rssi1_ext80: 8;
  5353. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  5354. } u1;
  5355. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  5356. union {
  5357. A_UINT32 /* word 3 */
  5358. rssi2_pri20: 8,
  5359. rssi2_ext20: 8,
  5360. rssi2_ext40: 8,
  5361. rssi2_ext80: 8;
  5362. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  5363. } u2;
  5364. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  5365. union {
  5366. A_UINT32 /* word 4 */
  5367. rssi3_pri20: 8,
  5368. rssi3_ext20: 8,
  5369. rssi3_ext40: 8,
  5370. rssi3_ext80: 8;
  5371. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  5372. } u3;
  5373. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  5374. A_UINT32 tsf32; /* word 5 */
  5375. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  5376. A_UINT32 timestamp_microsec; /* word 6 */
  5377. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  5378. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  5379. A_UINT32 /* word 7 */
  5380. vht_sig_a1: 24,
  5381. preamble_type: 8;
  5382. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  5383. A_UINT32 /* word 8 */
  5384. vht_sig_a2: 24,
  5385. reserved0: 8;
  5386. } POSTPACK;
  5387. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  5388. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  5389. PREPACK struct htt_rx_ind_hdr_suffix_t
  5390. {
  5391. A_UINT32 /* word 0 */
  5392. fw_rx_desc_bytes: 16,
  5393. reserved0: 16;
  5394. } POSTPACK;
  5395. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  5396. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  5397. PREPACK struct htt_rx_ind_hdr_t
  5398. {
  5399. struct htt_rx_ind_hdr_prefix_t prefix;
  5400. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  5401. struct htt_rx_ind_hdr_suffix_t suffix;
  5402. } POSTPACK;
  5403. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  5404. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  5405. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  5406. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  5407. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  5408. /*
  5409. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  5410. * the offset into the HTT rx indication message at which the
  5411. * FW rx PPDU descriptor resides
  5412. */
  5413. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  5414. /*
  5415. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  5416. * the offset into the HTT rx indication message at which the
  5417. * header suffix (FW rx MSDU byte count) resides
  5418. */
  5419. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  5420. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  5421. /*
  5422. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  5423. * the offset into the HTT rx indication message at which the per-MSDU
  5424. * information starts
  5425. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  5426. * per-MSDU information portion of the message. The per-MSDU info itself
  5427. * starts at byte 12.
  5428. */
  5429. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  5430. /**
  5431. * @brief target -> host rx indication message definition
  5432. *
  5433. * @details
  5434. * The following field definitions describe the format of the rx indication
  5435. * message sent from the target to the host.
  5436. * The message consists of three major sections:
  5437. * 1. a fixed-length header
  5438. * 2. a variable-length list of firmware rx MSDU descriptors
  5439. * 3. one or more 4-octet MPDU range information elements
  5440. * The fixed length header itself has two sub-sections
  5441. * 1. the message meta-information, including identification of the
  5442. * sender and type of the received data, and a 4-octet flush/release IE
  5443. * 2. the firmware rx PPDU descriptor
  5444. *
  5445. * The format of the message is depicted below.
  5446. * in this depiction, the following abbreviations are used for information
  5447. * elements within the message:
  5448. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  5449. * elements associated with the PPDU start are valid.
  5450. * Specifically, the following fields are valid only if SV is set:
  5451. * RSSI (all variants), L, legacy rate, preamble type, service,
  5452. * VHT-SIG-A
  5453. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  5454. * elements associated with the PPDU end are valid.
  5455. * Specifically, the following fields are valid only if EV is set:
  5456. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  5457. * - L - Legacy rate selector - if legacy rates are used, this flag
  5458. * indicates whether the rate is from a CCK (L == 1) or OFDM
  5459. * (L == 0) PHY.
  5460. * - P - PHY error flag - boolean indication of whether the rx frame had
  5461. * a PHY error
  5462. *
  5463. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  5464. * |----------------+-------------------+---------------------+---------------|
  5465. * | peer ID | |RV|FV| ext TID | msg type |
  5466. * |--------------------------------------------------------------------------|
  5467. * | num | release | release | flush | flush |
  5468. * | MPDU | end | start | end | start |
  5469. * | ranges | seq num | seq num | seq num | seq num |
  5470. * |==========================================================================|
  5471. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  5472. * |V|V| | rate | | | timestamp | RSSI |
  5473. * |--------------------------------------------------------------------------|
  5474. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  5475. * |--------------------------------------------------------------------------|
  5476. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  5477. * |--------------------------------------------------------------------------|
  5478. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  5479. * |--------------------------------------------------------------------------|
  5480. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  5481. * |--------------------------------------------------------------------------|
  5482. * | TSF LSBs |
  5483. * |--------------------------------------------------------------------------|
  5484. * | microsec timestamp |
  5485. * |--------------------------------------------------------------------------|
  5486. * | preamble type | HT-SIG / VHT-SIG-A1 |
  5487. * |--------------------------------------------------------------------------|
  5488. * | service | HT-SIG / VHT-SIG-A2 |
  5489. * |==========================================================================|
  5490. * | reserved | FW rx desc bytes |
  5491. * |--------------------------------------------------------------------------|
  5492. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  5493. * | desc B3 | desc B2 | desc B1 | desc B0 |
  5494. * |--------------------------------------------------------------------------|
  5495. * : : :
  5496. * |--------------------------------------------------------------------------|
  5497. * | alignment | MSDU Rx |
  5498. * | padding | desc Bn |
  5499. * |--------------------------------------------------------------------------|
  5500. * | reserved | MPDU range status | MPDU count |
  5501. * |--------------------------------------------------------------------------|
  5502. * : reserved : MPDU range status : MPDU count :
  5503. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  5504. *
  5505. * Header fields:
  5506. * - MSG_TYPE
  5507. * Bits 7:0
  5508. * Purpose: identifies this as an rx indication message
  5509. * Value: 0x1
  5510. * - EXT_TID
  5511. * Bits 12:8
  5512. * Purpose: identify the traffic ID of the rx data, including
  5513. * special "extended" TID values for multicast, broadcast, and
  5514. * non-QoS data frames
  5515. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  5516. * - FLUSH_VALID (FV)
  5517. * Bit 13
  5518. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  5519. * is valid
  5520. * Value:
  5521. * 1 -> flush IE is valid and needs to be processed
  5522. * 0 -> flush IE is not valid and should be ignored
  5523. * - REL_VALID (RV)
  5524. * Bit 13
  5525. * Purpose: indicate whether the release IE (start/end sequence numbers)
  5526. * is valid
  5527. * Value:
  5528. * 1 -> release IE is valid and needs to be processed
  5529. * 0 -> release IE is not valid and should be ignored
  5530. * - PEER_ID
  5531. * Bits 31:16
  5532. * Purpose: Identify, by ID, which peer sent the rx data
  5533. * Value: ID of the peer who sent the rx data
  5534. * - FLUSH_SEQ_NUM_START
  5535. * Bits 5:0
  5536. * Purpose: Indicate the start of a series of MPDUs to flush
  5537. * Not all MPDUs within this series are necessarily valid - the host
  5538. * must check each sequence number within this range to see if the
  5539. * corresponding MPDU is actually present.
  5540. * This field is only valid if the FV bit is set.
  5541. * Value:
  5542. * The sequence number for the first MPDUs to check to flush.
  5543. * The sequence number is masked by 0x3f.
  5544. * - FLUSH_SEQ_NUM_END
  5545. * Bits 11:6
  5546. * Purpose: Indicate the end of a series of MPDUs to flush
  5547. * Value:
  5548. * The sequence number one larger than the sequence number of the
  5549. * last MPDU to check to flush.
  5550. * The sequence number is masked by 0x3f.
  5551. * Not all MPDUs within this series are necessarily valid - the host
  5552. * must check each sequence number within this range to see if the
  5553. * corresponding MPDU is actually present.
  5554. * This field is only valid if the FV bit is set.
  5555. * - REL_SEQ_NUM_START
  5556. * Bits 17:12
  5557. * Purpose: Indicate the start of a series of MPDUs to release.
  5558. * All MPDUs within this series are present and valid - the host
  5559. * need not check each sequence number within this range to see if
  5560. * the corresponding MPDU is actually present.
  5561. * This field is only valid if the RV bit is set.
  5562. * Value:
  5563. * The sequence number for the first MPDUs to check to release.
  5564. * The sequence number is masked by 0x3f.
  5565. * - REL_SEQ_NUM_END
  5566. * Bits 23:18
  5567. * Purpose: Indicate the end of a series of MPDUs to release.
  5568. * Value:
  5569. * The sequence number one larger than the sequence number of the
  5570. * last MPDU to check to release.
  5571. * The sequence number is masked by 0x3f.
  5572. * All MPDUs within this series are present and valid - the host
  5573. * need not check each sequence number within this range to see if
  5574. * the corresponding MPDU is actually present.
  5575. * This field is only valid if the RV bit is set.
  5576. * - NUM_MPDU_RANGES
  5577. * Bits 31:24
  5578. * Purpose: Indicate how many ranges of MPDUs are present.
  5579. * Each MPDU range consists of a series of contiguous MPDUs within the
  5580. * rx frame sequence which all have the same MPDU status.
  5581. * Value: 1-63 (typically a small number, like 1-3)
  5582. *
  5583. * Rx PPDU descriptor fields:
  5584. * - RSSI_CMB
  5585. * Bits 7:0
  5586. * Purpose: Combined RSSI from all active rx chains, across the active
  5587. * bandwidth.
  5588. * Value: RSSI dB units w.r.t. noise floor
  5589. * - TIMESTAMP_SUBMICROSEC
  5590. * Bits 15:8
  5591. * Purpose: high-resolution timestamp
  5592. * Value:
  5593. * Sub-microsecond time of PPDU reception.
  5594. * This timestamp ranges from [0,MAC clock MHz).
  5595. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  5596. * to form a high-resolution, large range rx timestamp.
  5597. * - PHY_ERR_CODE
  5598. * Bits 23:16
  5599. * Purpose:
  5600. * If the rx frame processing resulted in a PHY error, indicate what
  5601. * type of rx PHY error occurred.
  5602. * Value:
  5603. * This field is valid if the "P" (PHY_ERR) flag is set.
  5604. * TBD: document/specify the values for this field
  5605. * - PHY_ERR
  5606. * Bit 24
  5607. * Purpose: indicate whether the rx PPDU had a PHY error
  5608. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  5609. * - LEGACY_RATE
  5610. * Bits 28:25
  5611. * Purpose:
  5612. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  5613. * specify which rate was used.
  5614. * Value:
  5615. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  5616. * flag.
  5617. * If LEGACY_RATE_SEL is 0:
  5618. * 0x8: OFDM 48 Mbps
  5619. * 0x9: OFDM 24 Mbps
  5620. * 0xA: OFDM 12 Mbps
  5621. * 0xB: OFDM 6 Mbps
  5622. * 0xC: OFDM 54 Mbps
  5623. * 0xD: OFDM 36 Mbps
  5624. * 0xE: OFDM 18 Mbps
  5625. * 0xF: OFDM 9 Mbps
  5626. * If LEGACY_RATE_SEL is 1:
  5627. * 0x8: CCK 11 Mbps long preamble
  5628. * 0x9: CCK 5.5 Mbps long preamble
  5629. * 0xA: CCK 2 Mbps long preamble
  5630. * 0xB: CCK 1 Mbps long preamble
  5631. * 0xC: CCK 11 Mbps short preamble
  5632. * 0xD: CCK 5.5 Mbps short preamble
  5633. * 0xE: CCK 2 Mbps short preamble
  5634. * - LEGACY_RATE_SEL
  5635. * Bit 29
  5636. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  5637. * Value:
  5638. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  5639. * used a legacy rate.
  5640. * 0 -> OFDM, 1 -> CCK
  5641. * - END_VALID
  5642. * Bit 30
  5643. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5644. * the start of the PPDU are valid. Specifically, the following
  5645. * fields are only valid if END_VALID is set:
  5646. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  5647. * TIMESTAMP_SUBMICROSEC
  5648. * Value:
  5649. * 0 -> rx PPDU desc end fields are not valid
  5650. * 1 -> rx PPDU desc end fields are valid
  5651. * - START_VALID
  5652. * Bit 31
  5653. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5654. * the end of the PPDU are valid. Specifically, the following
  5655. * fields are only valid if START_VALID is set:
  5656. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  5657. * VHT-SIG-A
  5658. * Value:
  5659. * 0 -> rx PPDU desc start fields are not valid
  5660. * 1 -> rx PPDU desc start fields are valid
  5661. * - RSSI0_PRI20
  5662. * Bits 7:0
  5663. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  5664. * Value: RSSI dB units w.r.t. noise floor
  5665. *
  5666. * - RSSI0_EXT20
  5667. * Bits 7:0
  5668. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  5669. * (if the rx bandwidth was >= 40 MHz)
  5670. * Value: RSSI dB units w.r.t. noise floor
  5671. * - RSSI0_EXT40
  5672. * Bits 7:0
  5673. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  5674. * (if the rx bandwidth was >= 80 MHz)
  5675. * Value: RSSI dB units w.r.t. noise floor
  5676. * - RSSI0_EXT80
  5677. * Bits 7:0
  5678. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  5679. * (if the rx bandwidth was >= 160 MHz)
  5680. * Value: RSSI dB units w.r.t. noise floor
  5681. *
  5682. * - RSSI1_PRI20
  5683. * Bits 7:0
  5684. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  5685. * Value: RSSI dB units w.r.t. noise floor
  5686. * - RSSI1_EXT20
  5687. * Bits 7:0
  5688. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  5689. * (if the rx bandwidth was >= 40 MHz)
  5690. * Value: RSSI dB units w.r.t. noise floor
  5691. * - RSSI1_EXT40
  5692. * Bits 7:0
  5693. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  5694. * (if the rx bandwidth was >= 80 MHz)
  5695. * Value: RSSI dB units w.r.t. noise floor
  5696. * - RSSI1_EXT80
  5697. * Bits 7:0
  5698. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  5699. * (if the rx bandwidth was >= 160 MHz)
  5700. * Value: RSSI dB units w.r.t. noise floor
  5701. *
  5702. * - RSSI2_PRI20
  5703. * Bits 7:0
  5704. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  5705. * Value: RSSI dB units w.r.t. noise floor
  5706. * - RSSI2_EXT20
  5707. * Bits 7:0
  5708. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  5709. * (if the rx bandwidth was >= 40 MHz)
  5710. * Value: RSSI dB units w.r.t. noise floor
  5711. * - RSSI2_EXT40
  5712. * Bits 7:0
  5713. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  5714. * (if the rx bandwidth was >= 80 MHz)
  5715. * Value: RSSI dB units w.r.t. noise floor
  5716. * - RSSI2_EXT80
  5717. * Bits 7:0
  5718. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  5719. * (if the rx bandwidth was >= 160 MHz)
  5720. * Value: RSSI dB units w.r.t. noise floor
  5721. *
  5722. * - RSSI3_PRI20
  5723. * Bits 7:0
  5724. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  5725. * Value: RSSI dB units w.r.t. noise floor
  5726. * - RSSI3_EXT20
  5727. * Bits 7:0
  5728. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  5729. * (if the rx bandwidth was >= 40 MHz)
  5730. * Value: RSSI dB units w.r.t. noise floor
  5731. * - RSSI3_EXT40
  5732. * Bits 7:0
  5733. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  5734. * (if the rx bandwidth was >= 80 MHz)
  5735. * Value: RSSI dB units w.r.t. noise floor
  5736. * - RSSI3_EXT80
  5737. * Bits 7:0
  5738. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  5739. * (if the rx bandwidth was >= 160 MHz)
  5740. * Value: RSSI dB units w.r.t. noise floor
  5741. *
  5742. * - TSF32
  5743. * Bits 31:0
  5744. * Purpose: specify the time the rx PPDU was received, in TSF units
  5745. * Value: 32 LSBs of the TSF
  5746. * - TIMESTAMP_MICROSEC
  5747. * Bits 31:0
  5748. * Purpose: specify the time the rx PPDU was received, in microsecond units
  5749. * Value: PPDU rx time, in microseconds
  5750. * - VHT_SIG_A1
  5751. * Bits 23:0
  5752. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  5753. * from the rx PPDU
  5754. * Value:
  5755. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5756. * VHT-SIG-A1 data.
  5757. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5758. * first 24 bits of the HT-SIG data.
  5759. * Otherwise, this field is invalid.
  5760. * Refer to the the 802.11 protocol for the definition of the
  5761. * HT-SIG and VHT-SIG-A1 fields
  5762. * - VHT_SIG_A2
  5763. * Bits 23:0
  5764. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  5765. * from the rx PPDU
  5766. * Value:
  5767. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5768. * VHT-SIG-A2 data.
  5769. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5770. * last 24 bits of the HT-SIG data.
  5771. * Otherwise, this field is invalid.
  5772. * Refer to the the 802.11 protocol for the definition of the
  5773. * HT-SIG and VHT-SIG-A2 fields
  5774. * - PREAMBLE_TYPE
  5775. * Bits 31:24
  5776. * Purpose: indicate the PHY format of the received burst
  5777. * Value:
  5778. * 0x4: Legacy (OFDM/CCK)
  5779. * 0x8: HT
  5780. * 0x9: HT with TxBF
  5781. * 0xC: VHT
  5782. * 0xD: VHT with TxBF
  5783. * - SERVICE
  5784. * Bits 31:24
  5785. * Purpose: TBD
  5786. * Value: TBD
  5787. *
  5788. * Rx MSDU descriptor fields:
  5789. * - FW_RX_DESC_BYTES
  5790. * Bits 15:0
  5791. * Purpose: Indicate how many bytes in the Rx indication are used for
  5792. * FW Rx descriptors
  5793. *
  5794. * Payload fields:
  5795. * - MPDU_COUNT
  5796. * Bits 7:0
  5797. * Purpose: Indicate how many sequential MPDUs share the same status.
  5798. * All MPDUs within the indicated list are from the same RA-TA-TID.
  5799. * - MPDU_STATUS
  5800. * Bits 15:8
  5801. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  5802. * received successfully.
  5803. * Value:
  5804. * 0x1: success
  5805. * 0x2: FCS error
  5806. * 0x3: duplicate error
  5807. * 0x4: replay error
  5808. * 0x5: invalid peer
  5809. */
  5810. /* header fields */
  5811. #define HTT_RX_IND_EXT_TID_M 0x1f00
  5812. #define HTT_RX_IND_EXT_TID_S 8
  5813. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  5814. #define HTT_RX_IND_FLUSH_VALID_S 13
  5815. #define HTT_RX_IND_REL_VALID_M 0x4000
  5816. #define HTT_RX_IND_REL_VALID_S 14
  5817. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  5818. #define HTT_RX_IND_PEER_ID_S 16
  5819. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  5820. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  5821. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  5822. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  5823. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  5824. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  5825. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  5826. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  5827. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  5828. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  5829. /* rx PPDU descriptor fields */
  5830. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  5831. #define HTT_RX_IND_RSSI_CMB_S 0
  5832. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  5833. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  5834. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  5835. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  5836. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  5837. #define HTT_RX_IND_PHY_ERR_S 24
  5838. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  5839. #define HTT_RX_IND_LEGACY_RATE_S 25
  5840. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  5841. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  5842. #define HTT_RX_IND_END_VALID_M 0x40000000
  5843. #define HTT_RX_IND_END_VALID_S 30
  5844. #define HTT_RX_IND_START_VALID_M 0x80000000
  5845. #define HTT_RX_IND_START_VALID_S 31
  5846. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  5847. #define HTT_RX_IND_RSSI_PRI20_S 0
  5848. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  5849. #define HTT_RX_IND_RSSI_EXT20_S 8
  5850. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  5851. #define HTT_RX_IND_RSSI_EXT40_S 16
  5852. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  5853. #define HTT_RX_IND_RSSI_EXT80_S 24
  5854. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  5855. #define HTT_RX_IND_VHT_SIG_A1_S 0
  5856. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  5857. #define HTT_RX_IND_VHT_SIG_A2_S 0
  5858. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  5859. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  5860. #define HTT_RX_IND_SERVICE_M 0xff000000
  5861. #define HTT_RX_IND_SERVICE_S 24
  5862. /* rx MSDU descriptor fields */
  5863. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  5864. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  5865. /* payload fields */
  5866. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  5867. #define HTT_RX_IND_MPDU_COUNT_S 0
  5868. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  5869. #define HTT_RX_IND_MPDU_STATUS_S 8
  5870. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  5871. do { \
  5872. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  5873. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  5874. } while (0)
  5875. #define HTT_RX_IND_EXT_TID_GET(word) \
  5876. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  5877. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  5878. do { \
  5879. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  5880. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  5881. } while (0)
  5882. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  5883. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  5884. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  5885. do { \
  5886. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  5887. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  5888. } while (0)
  5889. #define HTT_RX_IND_REL_VALID_GET(word) \
  5890. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  5891. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  5892. do { \
  5893. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  5894. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  5895. } while (0)
  5896. #define HTT_RX_IND_PEER_ID_GET(word) \
  5897. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  5898. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  5899. do { \
  5900. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  5901. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  5902. } while (0)
  5903. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  5904. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  5905. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  5906. do { \
  5907. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  5908. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  5909. } while (0)
  5910. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  5911. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  5912. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  5913. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  5914. do { \
  5915. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  5916. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  5917. } while (0)
  5918. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  5919. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  5920. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  5921. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  5922. do { \
  5923. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  5924. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  5925. } while (0)
  5926. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  5927. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  5928. HTT_RX_IND_REL_SEQ_NUM_START_S)
  5929. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  5930. do { \
  5931. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  5932. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  5933. } while (0)
  5934. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  5935. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  5936. HTT_RX_IND_REL_SEQ_NUM_END_S)
  5937. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  5938. do { \
  5939. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  5940. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  5941. } while (0)
  5942. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  5943. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  5944. HTT_RX_IND_NUM_MPDU_RANGES_S)
  5945. /* FW rx PPDU descriptor fields */
  5946. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  5947. do { \
  5948. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  5949. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  5950. } while (0)
  5951. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  5952. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  5953. HTT_RX_IND_RSSI_CMB_S)
  5954. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  5955. do { \
  5956. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  5957. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  5958. } while (0)
  5959. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  5960. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  5961. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  5962. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  5963. do { \
  5964. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  5965. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  5966. } while (0)
  5967. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  5968. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  5969. HTT_RX_IND_PHY_ERR_CODE_S)
  5970. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  5971. do { \
  5972. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  5973. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  5974. } while (0)
  5975. #define HTT_RX_IND_PHY_ERR_GET(word) \
  5976. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  5977. HTT_RX_IND_PHY_ERR_S)
  5978. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  5979. do { \
  5980. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  5981. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  5982. } while (0)
  5983. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  5984. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  5985. HTT_RX_IND_LEGACY_RATE_S)
  5986. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  5987. do { \
  5988. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  5989. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  5990. } while (0)
  5991. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  5992. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  5993. HTT_RX_IND_LEGACY_RATE_SEL_S)
  5994. #define HTT_RX_IND_END_VALID_SET(word, value) \
  5995. do { \
  5996. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  5997. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  5998. } while (0)
  5999. #define HTT_RX_IND_END_VALID_GET(word) \
  6000. (((word) & HTT_RX_IND_END_VALID_M) >> \
  6001. HTT_RX_IND_END_VALID_S)
  6002. #define HTT_RX_IND_START_VALID_SET(word, value) \
  6003. do { \
  6004. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  6005. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  6006. } while (0)
  6007. #define HTT_RX_IND_START_VALID_GET(word) \
  6008. (((word) & HTT_RX_IND_START_VALID_M) >> \
  6009. HTT_RX_IND_START_VALID_S)
  6010. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  6011. do { \
  6012. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  6013. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  6014. } while (0)
  6015. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  6016. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  6017. HTT_RX_IND_RSSI_PRI20_S)
  6018. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  6019. do { \
  6020. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  6021. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  6022. } while (0)
  6023. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  6024. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  6025. HTT_RX_IND_RSSI_EXT20_S)
  6026. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  6027. do { \
  6028. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  6029. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  6030. } while (0)
  6031. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  6032. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  6033. HTT_RX_IND_RSSI_EXT40_S)
  6034. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  6035. do { \
  6036. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  6037. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  6038. } while (0)
  6039. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  6040. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  6041. HTT_RX_IND_RSSI_EXT80_S)
  6042. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  6043. do { \
  6044. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  6045. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  6046. } while (0)
  6047. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  6048. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  6049. HTT_RX_IND_VHT_SIG_A1_S)
  6050. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  6051. do { \
  6052. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  6053. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  6054. } while (0)
  6055. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  6056. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  6057. HTT_RX_IND_VHT_SIG_A2_S)
  6058. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  6059. do { \
  6060. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  6061. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  6062. } while (0)
  6063. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  6064. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  6065. HTT_RX_IND_PREAMBLE_TYPE_S)
  6066. #define HTT_RX_IND_SERVICE_SET(word, value) \
  6067. do { \
  6068. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  6069. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  6070. } while (0)
  6071. #define HTT_RX_IND_SERVICE_GET(word) \
  6072. (((word) & HTT_RX_IND_SERVICE_M) >> \
  6073. HTT_RX_IND_SERVICE_S)
  6074. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  6075. do { \
  6076. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  6077. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  6078. } while (0)
  6079. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  6080. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  6081. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  6082. do { \
  6083. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  6084. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  6085. } while (0)
  6086. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  6087. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  6088. #define HTT_RX_IND_HL_BYTES \
  6089. (HTT_RX_IND_HDR_BYTES + \
  6090. 4 /* single FW rx MSDU descriptor, plus padding */ + \
  6091. 4 /* single MPDU range information element */)
  6092. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  6093. /* Could we use one macro entry? */
  6094. #define HTT_WORD_SET(word, field, value) \
  6095. do { \
  6096. HTT_CHECK_SET_VAL(field, value); \
  6097. (word) |= ((value) << field ## _S); \
  6098. } while (0)
  6099. #define HTT_WORD_GET(word, field) \
  6100. (((word) & field ## _M) >> field ## _S)
  6101. PREPACK struct hl_htt_rx_ind_base {
  6102. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  6103. } POSTPACK;
  6104. /*
  6105. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  6106. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  6107. * HL host needed info. The field is just after the msdu fw rx desc.
  6108. */
  6109. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  6110. struct htt_rx_ind_hl_rx_desc_t {
  6111. A_UINT8 ver;
  6112. A_UINT8 len;
  6113. struct {
  6114. A_UINT8
  6115. first_msdu: 1,
  6116. last_msdu: 1,
  6117. c3_failed: 1,
  6118. c4_failed: 1,
  6119. ipv6: 1,
  6120. tcp: 1,
  6121. udp: 1,
  6122. reserved: 1;
  6123. } flags;
  6124. };
  6125. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  6126. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6127. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  6128. #define HTT_RX_IND_HL_RX_DESC_VER 0
  6129. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  6130. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6131. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  6132. #define HTT_RX_IND_HL_FLAG_OFFSET \
  6133. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6134. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  6135. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  6136. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  6137. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  6138. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  6139. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  6140. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  6141. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  6142. /* This structure is used in HL, the basic descriptor information
  6143. * used by host. the structure is translated by FW from HW desc
  6144. * or generated by FW. But in HL monitor mode, the host would use
  6145. * the same structure with LL.
  6146. */
  6147. PREPACK struct hl_htt_rx_desc_base {
  6148. A_UINT32
  6149. seq_num:12,
  6150. encrypted:1,
  6151. chan_info_present:1,
  6152. resv0:2,
  6153. mcast_bcast:1,
  6154. fragment:1,
  6155. key_id_oct:8,
  6156. resv1:6;
  6157. A_UINT32
  6158. pn_31_0;
  6159. union {
  6160. struct {
  6161. A_UINT16 pn_47_32;
  6162. A_UINT16 pn_63_48;
  6163. } pn16;
  6164. A_UINT32 pn_63_32;
  6165. } u0;
  6166. A_UINT32
  6167. pn_95_64;
  6168. A_UINT32
  6169. pn_127_96;
  6170. } POSTPACK;
  6171. /*
  6172. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  6173. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  6174. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  6175. * Please see htt_chan_change_t for description of the fields.
  6176. */
  6177. PREPACK struct htt_chan_info_t
  6178. {
  6179. A_UINT32 primary_chan_center_freq_mhz: 16,
  6180. contig_chan1_center_freq_mhz: 16;
  6181. A_UINT32 contig_chan2_center_freq_mhz: 16,
  6182. phy_mode: 8,
  6183. reserved: 8;
  6184. } POSTPACK;
  6185. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  6186. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  6187. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  6188. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  6189. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  6190. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  6191. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  6192. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  6193. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  6194. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  6195. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  6196. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  6197. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  6198. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  6199. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  6200. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  6201. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  6202. /* Channel information */
  6203. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  6204. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  6205. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  6206. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  6207. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  6208. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  6209. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  6210. #define HTT_CHAN_INFO_PHY_MODE_S 16
  6211. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  6212. do { \
  6213. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  6214. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  6215. } while (0)
  6216. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  6217. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  6218. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  6219. do { \
  6220. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  6221. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  6222. } while (0)
  6223. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  6224. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  6225. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  6226. do { \
  6227. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  6228. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  6229. } while (0)
  6230. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  6231. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  6232. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  6233. do { \
  6234. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  6235. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  6236. } while (0)
  6237. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  6238. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  6239. /*
  6240. * @brief target -> host rx reorder flush message definition
  6241. *
  6242. * @details
  6243. * The following field definitions describe the format of the rx flush
  6244. * message sent from the target to the host.
  6245. * The message consists of a 4-octet header, followed by one or more
  6246. * 4-octet payload information elements.
  6247. *
  6248. * |31 24|23 8|7 0|
  6249. * |--------------------------------------------------------------|
  6250. * | TID | peer ID | msg type |
  6251. * |--------------------------------------------------------------|
  6252. * | seq num end | seq num start | MPDU status | reserved |
  6253. * |--------------------------------------------------------------|
  6254. * First DWORD:
  6255. * - MSG_TYPE
  6256. * Bits 7:0
  6257. * Purpose: identifies this as an rx flush message
  6258. * Value: 0x2
  6259. * - PEER_ID
  6260. * Bits 23:8 (only bits 18:8 actually used)
  6261. * Purpose: identify which peer's rx data is being flushed
  6262. * Value: (rx) peer ID
  6263. * - TID
  6264. * Bits 31:24 (only bits 27:24 actually used)
  6265. * Purpose: Specifies which traffic identifier's rx data is being flushed
  6266. * Value: traffic identifier
  6267. * Second DWORD:
  6268. * - MPDU_STATUS
  6269. * Bits 15:8
  6270. * Purpose:
  6271. * Indicate whether the flushed MPDUs should be discarded or processed.
  6272. * Value:
  6273. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  6274. * stages of rx processing
  6275. * other: discard the MPDUs
  6276. * It is anticipated that flush messages will always have
  6277. * MPDU status == 1, but the status flag is included for
  6278. * flexibility.
  6279. * - SEQ_NUM_START
  6280. * Bits 23:16
  6281. * Purpose:
  6282. * Indicate the start of a series of consecutive MPDUs being flushed.
  6283. * Not all MPDUs within this range are necessarily valid - the host
  6284. * must check each sequence number within this range to see if the
  6285. * corresponding MPDU is actually present.
  6286. * Value:
  6287. * The sequence number for the first MPDU in the sequence.
  6288. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6289. * - SEQ_NUM_END
  6290. * Bits 30:24
  6291. * Purpose:
  6292. * Indicate the end of a series of consecutive MPDUs being flushed.
  6293. * Value:
  6294. * The sequence number one larger than the sequence number of the
  6295. * last MPDU being flushed.
  6296. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6297. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  6298. * are to be released for further rx processing.
  6299. * Not all MPDUs within this range are necessarily valid - the host
  6300. * must check each sequence number within this range to see if the
  6301. * corresponding MPDU is actually present.
  6302. */
  6303. /* first DWORD */
  6304. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  6305. #define HTT_RX_FLUSH_PEER_ID_S 8
  6306. #define HTT_RX_FLUSH_TID_M 0xff000000
  6307. #define HTT_RX_FLUSH_TID_S 24
  6308. /* second DWORD */
  6309. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  6310. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  6311. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  6312. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  6313. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  6314. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  6315. #define HTT_RX_FLUSH_BYTES 8
  6316. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  6317. do { \
  6318. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  6319. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  6320. } while (0)
  6321. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  6322. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  6323. #define HTT_RX_FLUSH_TID_SET(word, value) \
  6324. do { \
  6325. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  6326. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  6327. } while (0)
  6328. #define HTT_RX_FLUSH_TID_GET(word) \
  6329. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  6330. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  6331. do { \
  6332. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  6333. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  6334. } while (0)
  6335. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  6336. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  6337. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  6338. do { \
  6339. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  6340. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  6341. } while (0)
  6342. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  6343. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  6344. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  6345. do { \
  6346. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  6347. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  6348. } while (0)
  6349. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  6350. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  6351. /*
  6352. * @brief target -> host rx pn check indication message
  6353. *
  6354. * @details
  6355. * The following field definitions describe the format of the Rx PN check
  6356. * indication message sent from the target to the host.
  6357. * The message consists of a 4-octet header, followed by the start and
  6358. * end sequence numbers to be released, followed by the PN IEs. Each PN
  6359. * IE is one octet containing the sequence number that failed the PN
  6360. * check.
  6361. *
  6362. * |31 24|23 8|7 0|
  6363. * |--------------------------------------------------------------|
  6364. * | TID | peer ID | msg type |
  6365. * |--------------------------------------------------------------|
  6366. * | Reserved | PN IE count | seq num end | seq num start|
  6367. * |--------------------------------------------------------------|
  6368. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  6369. * |--------------------------------------------------------------|
  6370. * First DWORD:
  6371. * - MSG_TYPE
  6372. * Bits 7:0
  6373. * Purpose: Identifies this as an rx pn check indication message
  6374. * Value: 0x2
  6375. * - PEER_ID
  6376. * Bits 23:8 (only bits 18:8 actually used)
  6377. * Purpose: identify which peer
  6378. * Value: (rx) peer ID
  6379. * - TID
  6380. * Bits 31:24 (only bits 27:24 actually used)
  6381. * Purpose: identify traffic identifier
  6382. * Value: traffic identifier
  6383. * Second DWORD:
  6384. * - SEQ_NUM_START
  6385. * Bits 7:0
  6386. * Purpose:
  6387. * Indicates the starting sequence number of the MPDU in this
  6388. * series of MPDUs that went though PN check.
  6389. * Value:
  6390. * The sequence number for the first MPDU in the sequence.
  6391. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6392. * - SEQ_NUM_END
  6393. * Bits 15:8
  6394. * Purpose:
  6395. * Indicates the ending sequence number of the MPDU in this
  6396. * series of MPDUs that went though PN check.
  6397. * Value:
  6398. * The sequence number one larger then the sequence number of the last
  6399. * MPDU being flushed.
  6400. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6401. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  6402. * for invalid PN numbers and are ready to be released for further processing.
  6403. * Not all MPDUs within this range are necessarily valid - the host
  6404. * must check each sequence number within this range to see if the
  6405. * corresponding MPDU is actually present.
  6406. * - PN_IE_COUNT
  6407. * Bits 23:16
  6408. * Purpose:
  6409. * Used to determine the variable number of PN information elements in this
  6410. * message
  6411. *
  6412. * PN information elements:
  6413. * - PN_IE_x-
  6414. * Purpose:
  6415. * Each PN information element contains the sequence number of the MPDU that
  6416. * has failed the target PN check.
  6417. * Value:
  6418. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  6419. * that failed the PN check.
  6420. */
  6421. /* first DWORD */
  6422. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  6423. #define HTT_RX_PN_IND_PEER_ID_S 8
  6424. #define HTT_RX_PN_IND_TID_M 0xff000000
  6425. #define HTT_RX_PN_IND_TID_S 24
  6426. /* second DWORD */
  6427. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  6428. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  6429. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  6430. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  6431. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  6432. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  6433. #define HTT_RX_PN_IND_BYTES 8
  6434. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  6435. do { \
  6436. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  6437. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  6438. } while (0)
  6439. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  6440. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  6441. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  6442. do { \
  6443. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  6444. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  6445. } while (0)
  6446. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  6447. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  6448. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  6449. do { \
  6450. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  6451. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  6452. } while (0)
  6453. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  6454. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  6455. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  6456. do { \
  6457. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  6458. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  6459. } while (0)
  6460. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  6461. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  6462. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  6463. do { \
  6464. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  6465. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  6466. } while (0)
  6467. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  6468. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  6469. /*
  6470. * @brief target -> host rx offload deliver message for LL system
  6471. *
  6472. * @details
  6473. * In a low latency system this message is sent whenever the offload
  6474. * manager flushes out the packets it has coalesced in its coalescing buffer.
  6475. * The DMA of the actual packets into host memory is done before sending out
  6476. * this message. This message indicates only how many MSDUs to reap. The
  6477. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  6478. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  6479. * DMA'd by the MAC directly into host memory these packets do not contain
  6480. * the MAC descriptors in the header portion of the packet. Instead they contain
  6481. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  6482. * message, the packets are delivered directly to the NW stack without going
  6483. * through the regular reorder buffering and PN checking path since it has
  6484. * already been done in target.
  6485. *
  6486. * |31 24|23 16|15 8|7 0|
  6487. * |-----------------------------------------------------------------------|
  6488. * | Total MSDU count | reserved | msg type |
  6489. * |-----------------------------------------------------------------------|
  6490. *
  6491. * @brief target -> host rx offload deliver message for HL system
  6492. *
  6493. * @details
  6494. * In a high latency system this message is sent whenever the offload manager
  6495. * flushes out the packets it has coalesced in its coalescing buffer. The
  6496. * actual packets are also carried along with this message. When the host
  6497. * receives this message, it is expected to deliver these packets to the NW
  6498. * stack directly instead of routing them through the reorder buffering and
  6499. * PN checking path since it has already been done in target.
  6500. *
  6501. * |31 24|23 16|15 8|7 0|
  6502. * |-----------------------------------------------------------------------|
  6503. * | Total MSDU count | reserved | msg type |
  6504. * |-----------------------------------------------------------------------|
  6505. * | peer ID | MSDU length |
  6506. * |-----------------------------------------------------------------------|
  6507. * | MSDU payload | FW Desc | tid | vdev ID |
  6508. * |-----------------------------------------------------------------------|
  6509. * | MSDU payload contd. |
  6510. * |-----------------------------------------------------------------------|
  6511. * | peer ID | MSDU length |
  6512. * |-----------------------------------------------------------------------|
  6513. * | MSDU payload | FW Desc | tid | vdev ID |
  6514. * |-----------------------------------------------------------------------|
  6515. * | MSDU payload contd. |
  6516. * |-----------------------------------------------------------------------|
  6517. *
  6518. */
  6519. /* first DWORD */
  6520. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  6521. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  6522. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  6523. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  6524. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  6525. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  6526. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  6527. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  6528. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  6529. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  6530. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  6531. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  6532. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  6533. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  6534. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  6535. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  6536. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  6537. do { \
  6538. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  6539. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  6540. } while (0)
  6541. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  6542. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  6543. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  6544. do { \
  6545. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  6546. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  6547. } while (0)
  6548. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  6549. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  6550. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  6551. do { \
  6552. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  6553. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  6554. } while (0)
  6555. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  6556. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  6557. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  6558. do { \
  6559. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  6560. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  6561. } while (0)
  6562. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  6563. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  6564. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  6565. do { \
  6566. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  6567. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  6568. } while (0)
  6569. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  6570. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  6571. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  6572. do { \
  6573. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  6574. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  6575. } while (0)
  6576. /**
  6577. * @brief target -> host rx peer map/unmap message definition
  6578. *
  6579. * @details
  6580. * The following diagram shows the format of the rx peer map message sent
  6581. * from the target to the host. This layout assumes the target operates
  6582. * as little-endian.
  6583. *
  6584. * This message always contains a SW peer ID. The main purpose of the
  6585. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6586. * with, so that the host can use that peer ID to determine which peer
  6587. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6588. * other purposes, such as identifying during tx completions which peer
  6589. * the tx frames in question were transmitted to.
  6590. *
  6591. * In certain generations of chips, the peer map message also contains
  6592. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  6593. * to identify which peer the frame needs to be forwarded to (i.e. the
  6594. * peer assocated with the Destination MAC Address within the packet),
  6595. * and particularly which vdev needs to transmit the frame (for cases
  6596. * of inter-vdev rx --> tx forwarding).
  6597. * This DA-based peer ID that is provided for certain rx frames
  6598. * (the rx frames that need to be re-transmitted as tx frames)
  6599. * is the ID that the HW uses for referring to the peer in question,
  6600. * rather than the peer ID that the SW+FW use to refer to the peer.
  6601. *
  6602. *
  6603. * |31 24|23 16|15 8|7 0|
  6604. * |-----------------------------------------------------------------------|
  6605. * | SW peer ID | VDEV ID | msg type |
  6606. * |-----------------------------------------------------------------------|
  6607. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6608. * |-----------------------------------------------------------------------|
  6609. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6610. * |-----------------------------------------------------------------------|
  6611. *
  6612. *
  6613. * The following diagram shows the format of the rx peer unmap message sent
  6614. * from the target to the host.
  6615. *
  6616. * |31 24|23 16|15 8|7 0|
  6617. * |-----------------------------------------------------------------------|
  6618. * | SW peer ID | VDEV ID | msg type |
  6619. * |-----------------------------------------------------------------------|
  6620. *
  6621. * The following field definitions describe the format of the rx peer map
  6622. * and peer unmap messages sent from the target to the host.
  6623. * - MSG_TYPE
  6624. * Bits 7:0
  6625. * Purpose: identifies this as an rx peer map or peer unmap message
  6626. * Value: peer map -> 0x3, peer unmap -> 0x4
  6627. * - VDEV_ID
  6628. * Bits 15:8
  6629. * Purpose: Indicates which virtual device the peer is associated
  6630. * with.
  6631. * Value: vdev ID (used in the host to look up the vdev object)
  6632. * - PEER_ID (a.k.a. SW_PEER_ID)
  6633. * Bits 31:16
  6634. * Purpose: The peer ID (index) that WAL is allocating (map) or
  6635. * freeing (unmap)
  6636. * Value: (rx) peer ID
  6637. * - MAC_ADDR_L32 (peer map only)
  6638. * Bits 31:0
  6639. * Purpose: Identifies which peer node the peer ID is for.
  6640. * Value: lower 4 bytes of peer node's MAC address
  6641. * - MAC_ADDR_U16 (peer map only)
  6642. * Bits 15:0
  6643. * Purpose: Identifies which peer node the peer ID is for.
  6644. * Value: upper 2 bytes of peer node's MAC address
  6645. * - HW_PEER_ID
  6646. * Bits 31:16
  6647. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6648. * address, so for rx frames marked for rx --> tx forwarding, the
  6649. * host can determine from the HW peer ID provided as meta-data with
  6650. * the rx frame which peer the frame is supposed to be forwarded to.
  6651. * Value: ID used by the MAC HW to identify the peer
  6652. */
  6653. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  6654. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  6655. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  6656. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  6657. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  6658. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  6659. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  6660. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  6661. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  6662. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  6663. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  6664. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  6665. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  6666. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  6667. do { \
  6668. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  6669. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  6670. } while (0)
  6671. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  6672. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  6673. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  6674. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  6675. do { \
  6676. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  6677. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  6678. } while (0)
  6679. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  6680. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  6681. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  6682. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  6683. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  6684. do { \
  6685. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  6686. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  6687. } while (0)
  6688. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  6689. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  6690. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  6691. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  6692. #define HTT_RX_PEER_MAP_BYTES 12
  6693. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  6694. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  6695. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  6696. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  6697. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  6698. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  6699. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  6700. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  6701. #define HTT_RX_PEER_UNMAP_BYTES 4
  6702. /**
  6703. * @brief target -> host rx peer map V2 message definition
  6704. *
  6705. * @details
  6706. * The following diagram shows the format of the rx peer map v2 message sent
  6707. * from the target to the host. This layout assumes the target operates
  6708. * as little-endian.
  6709. *
  6710. * This message always contains a SW peer ID. The main purpose of the
  6711. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6712. * with, so that the host can use that peer ID to determine which peer
  6713. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6714. * other purposes, such as identifying during tx completions which peer
  6715. * the tx frames in question were transmitted to.
  6716. *
  6717. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  6718. * is used during rx --> tx frame forwarding to identify which peer the
  6719. * frame needs to be forwarded to (i.e. the peer assocated with the
  6720. * Destination MAC Address within the packet), and particularly which vdev
  6721. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  6722. * This DA-based peer ID that is provided for certain rx frames
  6723. * (the rx frames that need to be re-transmitted as tx frames)
  6724. * is the ID that the HW uses for referring to the peer in question,
  6725. * rather than the peer ID that the SW+FW use to refer to the peer.
  6726. *
  6727. *
  6728. * |31 24|23 16|15 8|7 0|
  6729. * |-----------------------------------------------------------------------|
  6730. * | SW peer ID | VDEV ID | msg type |
  6731. * |-----------------------------------------------------------------------|
  6732. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6733. * |-----------------------------------------------------------------------|
  6734. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6735. * |-----------------------------------------------------------------------|
  6736. * | Reserved_17_31 | Next Hop | AST Hash Value |
  6737. * |-----------------------------------------------------------------------|
  6738. * | Reserved_0 |
  6739. * |-----------------------------------------------------------------------|
  6740. * | Reserved_1 |
  6741. * |-----------------------------------------------------------------------|
  6742. * | Reserved_2 |
  6743. * |-----------------------------------------------------------------------|
  6744. * | Reserved_3 |
  6745. * |-----------------------------------------------------------------------|
  6746. *
  6747. *
  6748. * The following field definitions describe the format of the rx peer map v2
  6749. * messages sent from the target to the host.
  6750. * - MSG_TYPE
  6751. * Bits 7:0
  6752. * Purpose: identifies this as an rx peer map v2 message
  6753. * Value: peer map v2 -> 0x1e
  6754. * - VDEV_ID
  6755. * Bits 15:8
  6756. * Purpose: Indicates which virtual device the peer is associated with.
  6757. * Value: vdev ID (used in the host to look up the vdev object)
  6758. * - SW_PEER_ID
  6759. * Bits 31:16
  6760. * Purpose: The peer ID (index) that WAL is allocating
  6761. * Value: (rx) peer ID
  6762. * - MAC_ADDR_L32
  6763. * Bits 31:0
  6764. * Purpose: Identifies which peer node the peer ID is for.
  6765. * Value: lower 4 bytes of peer node's MAC address
  6766. * - MAC_ADDR_U16
  6767. * Bits 15:0
  6768. * Purpose: Identifies which peer node the peer ID is for.
  6769. * Value: upper 2 bytes of peer node's MAC address
  6770. * - HW_PEER_ID
  6771. * Bits 31:16
  6772. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6773. * address, so for rx frames marked for rx --> tx forwarding, the
  6774. * host can determine from the HW peer ID provided as meta-data with
  6775. * the rx frame which peer the frame is supposed to be forwarded to.
  6776. * Value: ID used by the MAC HW to identify the peer
  6777. * - AST_HASH_VALUE
  6778. * Bits 15:0
  6779. * Purpose: Indicates AST Hash value is required for the TCL AST index
  6780. * override feature.
  6781. * - NEXT_HOP
  6782. * Bit 16
  6783. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  6784. * (Wireless Distribution System).
  6785. */
  6786. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  6787. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  6788. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  6789. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  6790. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  6791. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  6792. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  6793. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  6794. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  6795. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  6796. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  6797. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  6798. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  6799. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  6800. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  6801. do { \
  6802. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  6803. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  6804. } while (0)
  6805. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  6806. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  6807. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  6808. do { \
  6809. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  6810. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  6811. } while (0)
  6812. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  6813. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  6814. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  6815. do { \
  6816. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  6817. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  6818. } while (0)
  6819. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  6820. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  6821. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  6822. do { \
  6823. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  6824. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  6825. } while (0)
  6826. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  6827. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  6828. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  6829. do { \
  6830. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  6831. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  6832. } while (0)
  6833. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  6834. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  6835. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  6836. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  6837. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  6838. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  6839. #define HTT_RX_PEER_MAP_V2_BYTES 32
  6840. /**
  6841. * @brief target -> host rx peer unmap V2 message definition
  6842. *
  6843. *
  6844. * The following diagram shows the format of the rx peer unmap message sent
  6845. * from the target to the host.
  6846. *
  6847. * |31 24|23 16|15 8|7 0|
  6848. * |-----------------------------------------------------------------------|
  6849. * | SW peer ID | VDEV ID | msg type |
  6850. * |-----------------------------------------------------------------------|
  6851. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6852. * |-----------------------------------------------------------------------|
  6853. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  6854. * |-----------------------------------------------------------------------|
  6855. * | Peer Delete Duration |
  6856. * |-----------------------------------------------------------------------|
  6857. * | Reserved_0 |
  6858. * |-----------------------------------------------------------------------|
  6859. * | Reserved_1 |
  6860. * |-----------------------------------------------------------------------|
  6861. * | Reserved_2 |
  6862. * |-----------------------------------------------------------------------|
  6863. *
  6864. *
  6865. * The following field definitions describe the format of the rx peer unmap
  6866. * messages sent from the target to the host.
  6867. * - MSG_TYPE
  6868. * Bits 7:0
  6869. * Purpose: identifies this as an rx peer unmap v2 message
  6870. * Value: peer unmap v2 -> 0x1f
  6871. * - VDEV_ID
  6872. * Bits 15:8
  6873. * Purpose: Indicates which virtual device the peer is associated
  6874. * with.
  6875. * Value: vdev ID (used in the host to look up the vdev object)
  6876. * - SW_PEER_ID
  6877. * Bits 31:16
  6878. * Purpose: The peer ID (index) that WAL is freeing
  6879. * Value: (rx) peer ID
  6880. * - MAC_ADDR_L32
  6881. * Bits 31:0
  6882. * Purpose: Identifies which peer node the peer ID is for.
  6883. * Value: lower 4 bytes of peer node's MAC address
  6884. * - MAC_ADDR_U16
  6885. * Bits 15:0
  6886. * Purpose: Identifies which peer node the peer ID is for.
  6887. * Value: upper 2 bytes of peer node's MAC address
  6888. * - NEXT_HOP
  6889. * Bits 16
  6890. * Purpose: Bit indicates next_hop AST entry used for WDS
  6891. * (Wireless Distribution System).
  6892. * - PEER_DELETE_DURATION
  6893. * Bits 31:0
  6894. * Purpose: Time taken to delete peer, in msec,
  6895. * Used for monitoring / debugging PEER delete response delay
  6896. */
  6897. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  6898. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  6899. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  6900. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  6901. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  6902. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  6903. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  6904. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  6905. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  6906. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  6907. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  6908. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  6909. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  6910. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  6911. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  6912. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  6913. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  6914. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  6915. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  6916. do { \
  6917. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  6918. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  6919. } while (0)
  6920. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  6921. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  6922. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  6923. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  6924. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  6925. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  6926. /**
  6927. * @brief target -> host message specifying security parameters
  6928. *
  6929. * @details
  6930. * The following diagram shows the format of the security specification
  6931. * message sent from the target to the host.
  6932. * This security specification message tells the host whether a PN check is
  6933. * necessary on rx data frames, and if so, how large the PN counter is.
  6934. * This message also tells the host about the security processing to apply
  6935. * to defragmented rx frames - specifically, whether a Message Integrity
  6936. * Check is required, and the Michael key to use.
  6937. *
  6938. * |31 24|23 16|15|14 8|7 0|
  6939. * |-----------------------------------------------------------------------|
  6940. * | peer ID | U| security type | msg type |
  6941. * |-----------------------------------------------------------------------|
  6942. * | Michael Key K0 |
  6943. * |-----------------------------------------------------------------------|
  6944. * | Michael Key K1 |
  6945. * |-----------------------------------------------------------------------|
  6946. * | WAPI RSC Low0 |
  6947. * |-----------------------------------------------------------------------|
  6948. * | WAPI RSC Low1 |
  6949. * |-----------------------------------------------------------------------|
  6950. * | WAPI RSC Hi0 |
  6951. * |-----------------------------------------------------------------------|
  6952. * | WAPI RSC Hi1 |
  6953. * |-----------------------------------------------------------------------|
  6954. *
  6955. * The following field definitions describe the format of the security
  6956. * indication message sent from the target to the host.
  6957. * - MSG_TYPE
  6958. * Bits 7:0
  6959. * Purpose: identifies this as a security specification message
  6960. * Value: 0xb
  6961. * - SEC_TYPE
  6962. * Bits 14:8
  6963. * Purpose: specifies which type of security applies to the peer
  6964. * Value: htt_sec_type enum value
  6965. * - UNICAST
  6966. * Bit 15
  6967. * Purpose: whether this security is applied to unicast or multicast data
  6968. * Value: 1 -> unicast, 0 -> multicast
  6969. * - PEER_ID
  6970. * Bits 31:16
  6971. * Purpose: The ID number for the peer the security specification is for
  6972. * Value: peer ID
  6973. * - MICHAEL_KEY_K0
  6974. * Bits 31:0
  6975. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  6976. * Value: Michael Key K0 (if security type is TKIP)
  6977. * - MICHAEL_KEY_K1
  6978. * Bits 31:0
  6979. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  6980. * Value: Michael Key K1 (if security type is TKIP)
  6981. * - WAPI_RSC_LOW0
  6982. * Bits 31:0
  6983. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  6984. * Value: WAPI RSC Low0 (if security type is WAPI)
  6985. * - WAPI_RSC_LOW1
  6986. * Bits 31:0
  6987. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  6988. * Value: WAPI RSC Low1 (if security type is WAPI)
  6989. * - WAPI_RSC_HI0
  6990. * Bits 31:0
  6991. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  6992. * Value: WAPI RSC Hi0 (if security type is WAPI)
  6993. * - WAPI_RSC_HI1
  6994. * Bits 31:0
  6995. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  6996. * Value: WAPI RSC Hi1 (if security type is WAPI)
  6997. */
  6998. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  6999. #define HTT_SEC_IND_SEC_TYPE_S 8
  7000. #define HTT_SEC_IND_UNICAST_M 0x00008000
  7001. #define HTT_SEC_IND_UNICAST_S 15
  7002. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  7003. #define HTT_SEC_IND_PEER_ID_S 16
  7004. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  7005. do { \
  7006. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  7007. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  7008. } while (0)
  7009. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  7010. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  7011. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  7012. do { \
  7013. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  7014. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  7015. } while (0)
  7016. #define HTT_SEC_IND_UNICAST_GET(word) \
  7017. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  7018. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  7019. do { \
  7020. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  7021. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  7022. } while (0)
  7023. #define HTT_SEC_IND_PEER_ID_GET(word) \
  7024. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  7025. #define HTT_SEC_IND_BYTES 28
  7026. /**
  7027. * @brief target -> host rx ADDBA / DELBA message definitions
  7028. *
  7029. * @details
  7030. * The following diagram shows the format of the rx ADDBA message sent
  7031. * from the target to the host:
  7032. *
  7033. * |31 20|19 16|15 8|7 0|
  7034. * |---------------------------------------------------------------------|
  7035. * | peer ID | TID | window size | msg type |
  7036. * |---------------------------------------------------------------------|
  7037. *
  7038. * The following diagram shows the format of the rx DELBA message sent
  7039. * from the target to the host:
  7040. *
  7041. * |31 20|19 16|15 10|9 8|7 0|
  7042. * |---------------------------------------------------------------------|
  7043. * | peer ID | TID | reserved | IR| msg type |
  7044. * |---------------------------------------------------------------------|
  7045. *
  7046. * The following field definitions describe the format of the rx ADDBA
  7047. * and DELBA messages sent from the target to the host.
  7048. * - MSG_TYPE
  7049. * Bits 7:0
  7050. * Purpose: identifies this as an rx ADDBA or DELBA message
  7051. * Value: ADDBA -> 0x5, DELBA -> 0x6
  7052. * - IR (initiator / recipient)
  7053. * Bits 9:8 (DELBA only)
  7054. * Purpose: specify whether the DELBA handshake was initiated by the
  7055. * local STA/AP, or by the peer STA/AP
  7056. * Value:
  7057. * 0 - unspecified
  7058. * 1 - initiator (a.k.a. originator)
  7059. * 2 - recipient (a.k.a. responder)
  7060. * 3 - unused / reserved
  7061. * - WIN_SIZE
  7062. * Bits 15:8 (ADDBA only)
  7063. * Purpose: Specifies the length of the block ack window (max = 64).
  7064. * Value:
  7065. * block ack window length specified by the received ADDBA
  7066. * management message.
  7067. * - TID
  7068. * Bits 19:16
  7069. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  7070. * Value:
  7071. * TID specified by the received ADDBA or DELBA management message.
  7072. * - PEER_ID
  7073. * Bits 31:20
  7074. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  7075. * Value:
  7076. * ID (hash value) used by the host for fast, direct lookup of
  7077. * host SW peer info, including rx reorder states.
  7078. */
  7079. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  7080. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  7081. #define HTT_RX_ADDBA_TID_M 0xf0000
  7082. #define HTT_RX_ADDBA_TID_S 16
  7083. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  7084. #define HTT_RX_ADDBA_PEER_ID_S 20
  7085. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  7086. do { \
  7087. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  7088. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  7089. } while (0)
  7090. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  7091. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  7092. #define HTT_RX_ADDBA_TID_SET(word, value) \
  7093. do { \
  7094. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  7095. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  7096. } while (0)
  7097. #define HTT_RX_ADDBA_TID_GET(word) \
  7098. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  7099. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  7100. do { \
  7101. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  7102. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  7103. } while (0)
  7104. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  7105. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  7106. #define HTT_RX_ADDBA_BYTES 4
  7107. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  7108. #define HTT_RX_DELBA_INITIATOR_S 8
  7109. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  7110. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  7111. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  7112. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  7113. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  7114. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  7115. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  7116. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  7117. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  7118. do { \
  7119. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  7120. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  7121. } while (0)
  7122. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  7123. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  7124. #define HTT_RX_DELBA_BYTES 4
  7125. /**
  7126. * @brief tx queue group information element definition
  7127. *
  7128. * @details
  7129. * The following diagram shows the format of the tx queue group
  7130. * information element, which can be included in target --> host
  7131. * messages to specify the number of tx "credits" (tx descriptors
  7132. * for LL, or tx buffers for HL) available to a particular group
  7133. * of host-side tx queues, and which host-side tx queues belong to
  7134. * the group.
  7135. *
  7136. * |31|30 24|23 16|15|14|13 0|
  7137. * |------------------------------------------------------------------------|
  7138. * | X| reserved | tx queue grp ID | A| S| credit count |
  7139. * |------------------------------------------------------------------------|
  7140. * | vdev ID mask | AC mask |
  7141. * |------------------------------------------------------------------------|
  7142. *
  7143. * The following definitions describe the fields within the tx queue group
  7144. * information element:
  7145. * - credit_count
  7146. * Bits 13:1
  7147. * Purpose: specify how many tx credits are available to the tx queue group
  7148. * Value: An absolute or relative, positive or negative credit value
  7149. * The 'A' bit specifies whether the value is absolute or relative.
  7150. * The 'S' bit specifies whether the value is positive or negative.
  7151. * A negative value can only be relative, not absolute.
  7152. * An absolute value replaces any prior credit value the host has for
  7153. * the tx queue group in question.
  7154. * A relative value is added to the prior credit value the host has for
  7155. * the tx queue group in question.
  7156. * - sign
  7157. * Bit 14
  7158. * Purpose: specify whether the credit count is positive or negative
  7159. * Value: 0 -> positive, 1 -> negative
  7160. * - absolute
  7161. * Bit 15
  7162. * Purpose: specify whether the credit count is absolute or relative
  7163. * Value: 0 -> relative, 1 -> absolute
  7164. * - txq_group_id
  7165. * Bits 23:16
  7166. * Purpose: indicate which tx queue group's credit and/or membership are
  7167. * being specified
  7168. * Value: 0 to max_tx_queue_groups-1
  7169. * - reserved
  7170. * Bits 30:16
  7171. * Value: 0x0
  7172. * - eXtension
  7173. * Bit 31
  7174. * Purpose: specify whether another tx queue group info element follows
  7175. * Value: 0 -> no more tx queue group information elements
  7176. * 1 -> another tx queue group information element immediately follows
  7177. * - ac_mask
  7178. * Bits 15:0
  7179. * Purpose: specify which Access Categories belong to the tx queue group
  7180. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  7181. * the tx queue group.
  7182. * The AC bit-mask values are obtained by left-shifting by the
  7183. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  7184. * - vdev_id_mask
  7185. * Bits 31:16
  7186. * Purpose: specify which vdev's tx queues belong to the tx queue group
  7187. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  7188. * belong to the tx queue group.
  7189. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  7190. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  7191. */
  7192. PREPACK struct htt_txq_group {
  7193. A_UINT32
  7194. credit_count: 14,
  7195. sign: 1,
  7196. absolute: 1,
  7197. tx_queue_group_id: 8,
  7198. reserved0: 7,
  7199. extension: 1;
  7200. A_UINT32
  7201. ac_mask: 16,
  7202. vdev_id_mask: 16;
  7203. } POSTPACK;
  7204. /* first word */
  7205. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  7206. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  7207. #define HTT_TXQ_GROUP_SIGN_S 14
  7208. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  7209. #define HTT_TXQ_GROUP_ABS_S 15
  7210. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  7211. #define HTT_TXQ_GROUP_ID_S 16
  7212. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  7213. #define HTT_TXQ_GROUP_EXT_S 31
  7214. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  7215. /* second word */
  7216. #define HTT_TXQ_GROUP_AC_MASK_S 0
  7217. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  7218. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  7219. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  7220. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  7221. do { \
  7222. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  7223. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  7224. } while (0)
  7225. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  7226. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  7227. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  7228. do { \
  7229. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  7230. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  7231. } while (0)
  7232. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  7233. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  7234. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  7235. do { \
  7236. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  7237. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  7238. } while (0)
  7239. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  7240. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  7241. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  7242. do { \
  7243. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  7244. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  7245. } while (0)
  7246. #define HTT_TXQ_GROUP_ID_GET(_info) \
  7247. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  7248. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  7249. do { \
  7250. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  7251. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  7252. } while (0)
  7253. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  7254. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  7255. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  7256. do { \
  7257. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  7258. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  7259. } while (0)
  7260. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  7261. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  7262. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  7263. do { \
  7264. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  7265. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  7266. } while (0)
  7267. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  7268. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  7269. /**
  7270. * @brief target -> host TX completion indication message definition
  7271. *
  7272. * @details
  7273. * The following diagram shows the format of the TX completion indication sent
  7274. * from the target to the host
  7275. *
  7276. * |31 27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  7277. * |------------------------------------------------------------|
  7278. * header: | rsvd |TP|A1|A0| num | t_i| tid |status| msg_type |
  7279. * |------------------------------------------------------------|
  7280. * payload: | MSDU1 ID | MSDU0 ID |
  7281. * |------------------------------------------------------------|
  7282. * : MSDU3 ID : MSDU2 ID :
  7283. * |------------------------------------------------------------|
  7284. * | struct htt_tx_compl_ind_append_retries |
  7285. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7286. * | struct htt_tx_compl_ind_append_tx_tstamp |
  7287. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7288. * Where:
  7289. * A0 = append (a.k.a. append0)
  7290. * A1 = append1
  7291. * TP = MSDU tx power presence
  7292. *
  7293. * The following field definitions describe the format of the TX completion
  7294. * indication sent from the target to the host
  7295. * Header fields:
  7296. * - msg_type
  7297. * Bits 7:0
  7298. * Purpose: identifies this as HTT TX completion indication
  7299. * Value: 0x7
  7300. * - status
  7301. * Bits 10:8
  7302. * Purpose: the TX completion status of payload fragmentations descriptors
  7303. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  7304. * - tid
  7305. * Bits 14:11
  7306. * Purpose: the tid associated with those fragmentation descriptors. It is
  7307. * valid or not, depending on the tid_invalid bit.
  7308. * Value: 0 to 15
  7309. * - tid_invalid
  7310. * Bits 15:15
  7311. * Purpose: this bit indicates whether the tid field is valid or not
  7312. * Value: 0 indicates valid; 1 indicates invalid
  7313. * - num
  7314. * Bits 23:16
  7315. * Purpose: the number of payload in this indication
  7316. * Value: 1 to 255
  7317. * - append (a.k.a. append0)
  7318. * Bits 24:24
  7319. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  7320. * the number of tx retries for one MSDU at the end of this message
  7321. * Value: 0 indicates no appending; 1 indicates appending
  7322. * - append1
  7323. * Bits 25:25
  7324. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  7325. * contains the timestamp info for each TX msdu id in payload.
  7326. * The order of the timestamps matches the order of the MSDU IDs.
  7327. * Note that a big-endian host needs to account for the reordering
  7328. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7329. * conversion) when determining which tx timestamp corresponds to
  7330. * which MSDU ID.
  7331. * Value: 0 indicates no appending; 1 indicates appending
  7332. * - msdu_tx_power_presence
  7333. * Bits 26:26
  7334. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  7335. * for each MSDU referenced by the TX_COMPL_IND message.
  7336. * The tx power is reported in 0.5 dBm units.
  7337. * The order of the per-MSDU tx power reports matches the order
  7338. * of the MSDU IDs.
  7339. * Note that a big-endian host needs to account for the reordering
  7340. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7341. * conversion) when determining which Tx Power corresponds to
  7342. * which MSDU ID.
  7343. * Value: 0 indicates MSDU tx power reports are not appended,
  7344. * 1 indicates MSDU tx power reports are appended
  7345. * Payload fields:
  7346. * - hmsdu_id
  7347. * Bits 15:0
  7348. * Purpose: this ID is used to track the Tx buffer in host
  7349. * Value: 0 to "size of host MSDU descriptor pool - 1"
  7350. */
  7351. #define HTT_TX_COMPL_IND_STATUS_S 8
  7352. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  7353. #define HTT_TX_COMPL_IND_TID_S 11
  7354. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  7355. #define HTT_TX_COMPL_IND_TID_INV_S 15
  7356. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  7357. #define HTT_TX_COMPL_IND_NUM_S 16
  7358. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  7359. #define HTT_TX_COMPL_IND_APPEND_S 24
  7360. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  7361. #define HTT_TX_COMPL_IND_APPEND1_S 25
  7362. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  7363. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  7364. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  7365. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  7366. do { \
  7367. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  7368. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  7369. } while (0)
  7370. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  7371. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  7372. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  7373. do { \
  7374. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  7375. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  7376. } while (0)
  7377. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  7378. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  7379. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  7380. do { \
  7381. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  7382. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  7383. } while (0)
  7384. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  7385. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  7386. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  7387. do { \
  7388. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  7389. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  7390. } while (0)
  7391. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  7392. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  7393. HTT_TX_COMPL_IND_TID_INV_S)
  7394. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  7395. do { \
  7396. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  7397. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  7398. } while (0)
  7399. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  7400. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  7401. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  7402. do { \
  7403. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  7404. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  7405. } while (0)
  7406. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  7407. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  7408. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  7409. do { \
  7410. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  7411. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  7412. } while (0)
  7413. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  7414. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  7415. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  7416. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  7417. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  7418. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  7419. #define HTT_TX_COMPL_IND_STAT_OK 0
  7420. /* DISCARD:
  7421. * current meaning:
  7422. * MSDUs were queued for transmission but filtered by HW or SW
  7423. * without any over the air attempts
  7424. * legacy meaning (HL Rome):
  7425. * MSDUs were discarded by the target FW without any over the air
  7426. * attempts due to lack of space
  7427. */
  7428. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  7429. /* NO_ACK:
  7430. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  7431. */
  7432. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  7433. /* POSTPONE:
  7434. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  7435. * be downloaded again later (in the appropriate order), when they are
  7436. * deliverable.
  7437. */
  7438. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  7439. /*
  7440. * The PEER_DEL tx completion status is used for HL cases
  7441. * where the peer the frame is for has been deleted.
  7442. * The host has already discarded its copy of the frame, but
  7443. * it still needs the tx completion to restore its credit.
  7444. */
  7445. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  7446. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  7447. #define HTT_TX_COMPL_IND_STAT_DROP 5
  7448. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  7449. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  7450. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  7451. PREPACK struct htt_tx_compl_ind_base {
  7452. A_UINT32 hdr;
  7453. A_UINT16 payload[1/*or more*/];
  7454. } POSTPACK;
  7455. PREPACK struct htt_tx_compl_ind_append_retries {
  7456. A_UINT16 msdu_id;
  7457. A_UINT8 tx_retries;
  7458. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  7459. 0: this is the last append_retries struct */
  7460. } POSTPACK;
  7461. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  7462. A_UINT32 timestamp[1/*or more*/];
  7463. } POSTPACK;
  7464. /**
  7465. * @brief target -> host rate-control update indication message
  7466. *
  7467. * @details
  7468. * The following diagram shows the format of the RC Update message
  7469. * sent from the target to the host, while processing the tx-completion
  7470. * of a transmitted PPDU.
  7471. *
  7472. * |31 24|23 16|15 8|7 0|
  7473. * |-------------------------------------------------------------|
  7474. * | peer ID | vdev ID | msg_type |
  7475. * |-------------------------------------------------------------|
  7476. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7477. * |-------------------------------------------------------------|
  7478. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  7479. * |-------------------------------------------------------------|
  7480. * | : |
  7481. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7482. * | : |
  7483. * |-------------------------------------------------------------|
  7484. * | : |
  7485. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7486. * | : |
  7487. * |-------------------------------------------------------------|
  7488. * : :
  7489. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7490. *
  7491. */
  7492. typedef struct {
  7493. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  7494. A_UINT32 rate_code_flags;
  7495. A_UINT32 flags; /* Encodes information such as excessive
  7496. retransmission, aggregate, some info
  7497. from .11 frame control,
  7498. STBC, LDPC, (SGI and Tx Chain Mask
  7499. are encoded in ptx_rc->flags field),
  7500. AMPDU truncation (BT/time based etc.),
  7501. RTS/CTS attempt */
  7502. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  7503. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  7504. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  7505. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  7506. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  7507. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  7508. } HTT_RC_TX_DONE_PARAMS;
  7509. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  7510. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  7511. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  7512. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  7513. #define HTT_RC_UPDATE_VDEVID_S 8
  7514. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  7515. #define HTT_RC_UPDATE_PEERID_S 16
  7516. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  7517. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  7518. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  7519. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  7520. do { \
  7521. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  7522. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  7523. } while (0)
  7524. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  7525. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  7526. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  7527. do { \
  7528. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  7529. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  7530. } while (0)
  7531. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  7532. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  7533. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  7534. do { \
  7535. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  7536. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  7537. } while (0)
  7538. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  7539. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  7540. /**
  7541. * @brief target -> host rx fragment indication message definition
  7542. *
  7543. * @details
  7544. * The following field definitions describe the format of the rx fragment
  7545. * indication message sent from the target to the host.
  7546. * The rx fragment indication message shares the format of the
  7547. * rx indication message, but not all fields from the rx indication message
  7548. * are relevant to the rx fragment indication message.
  7549. *
  7550. *
  7551. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  7552. * |-----------+-------------------+---------------------+-------------|
  7553. * | peer ID | |FV| ext TID | msg type |
  7554. * |-------------------------------------------------------------------|
  7555. * | | flush | flush |
  7556. * | | end | start |
  7557. * | | seq num | seq num |
  7558. * |-------------------------------------------------------------------|
  7559. * | reserved | FW rx desc bytes |
  7560. * |-------------------------------------------------------------------|
  7561. * | | FW MSDU Rx |
  7562. * | | desc B0 |
  7563. * |-------------------------------------------------------------------|
  7564. * Header fields:
  7565. * - MSG_TYPE
  7566. * Bits 7:0
  7567. * Purpose: identifies this as an rx fragment indication message
  7568. * Value: 0xa
  7569. * - EXT_TID
  7570. * Bits 12:8
  7571. * Purpose: identify the traffic ID of the rx data, including
  7572. * special "extended" TID values for multicast, broadcast, and
  7573. * non-QoS data frames
  7574. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  7575. * - FLUSH_VALID (FV)
  7576. * Bit 13
  7577. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  7578. * is valid
  7579. * Value:
  7580. * 1 -> flush IE is valid and needs to be processed
  7581. * 0 -> flush IE is not valid and should be ignored
  7582. * - PEER_ID
  7583. * Bits 31:16
  7584. * Purpose: Identify, by ID, which peer sent the rx data
  7585. * Value: ID of the peer who sent the rx data
  7586. * - FLUSH_SEQ_NUM_START
  7587. * Bits 5:0
  7588. * Purpose: Indicate the start of a series of MPDUs to flush
  7589. * Not all MPDUs within this series are necessarily valid - the host
  7590. * must check each sequence number within this range to see if the
  7591. * corresponding MPDU is actually present.
  7592. * This field is only valid if the FV bit is set.
  7593. * Value:
  7594. * The sequence number for the first MPDUs to check to flush.
  7595. * The sequence number is masked by 0x3f.
  7596. * - FLUSH_SEQ_NUM_END
  7597. * Bits 11:6
  7598. * Purpose: Indicate the end of a series of MPDUs to flush
  7599. * Value:
  7600. * The sequence number one larger than the sequence number of the
  7601. * last MPDU to check to flush.
  7602. * The sequence number is masked by 0x3f.
  7603. * Not all MPDUs within this series are necessarily valid - the host
  7604. * must check each sequence number within this range to see if the
  7605. * corresponding MPDU is actually present.
  7606. * This field is only valid if the FV bit is set.
  7607. * Rx descriptor fields:
  7608. * - FW_RX_DESC_BYTES
  7609. * Bits 15:0
  7610. * Purpose: Indicate how many bytes in the Rx indication are used for
  7611. * FW Rx descriptors
  7612. * Value: 1
  7613. */
  7614. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  7615. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  7616. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  7617. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  7618. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  7619. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  7620. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  7621. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  7622. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  7623. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  7624. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  7625. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  7626. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  7627. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  7628. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  7629. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  7630. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  7631. #define HTT_RX_FRAG_IND_BYTES \
  7632. (4 /* msg hdr */ + \
  7633. 4 /* flush spec */ + \
  7634. 4 /* (unused) FW rx desc bytes spec */ + \
  7635. 4 /* FW rx desc */)
  7636. /**
  7637. * @brief target -> host test message definition
  7638. *
  7639. * @details
  7640. * The following field definitions describe the format of the test
  7641. * message sent from the target to the host.
  7642. * The message consists of a 4-octet header, followed by a variable
  7643. * number of 32-bit integer values, followed by a variable number
  7644. * of 8-bit character values.
  7645. *
  7646. * |31 16|15 8|7 0|
  7647. * |-----------------------------------------------------------|
  7648. * | num chars | num ints | msg type |
  7649. * |-----------------------------------------------------------|
  7650. * | int 0 |
  7651. * |-----------------------------------------------------------|
  7652. * | int 1 |
  7653. * |-----------------------------------------------------------|
  7654. * | ... |
  7655. * |-----------------------------------------------------------|
  7656. * | char 3 | char 2 | char 1 | char 0 |
  7657. * |-----------------------------------------------------------|
  7658. * | | | ... | char 4 |
  7659. * |-----------------------------------------------------------|
  7660. * - MSG_TYPE
  7661. * Bits 7:0
  7662. * Purpose: identifies this as a test message
  7663. * Value: HTT_MSG_TYPE_TEST
  7664. * - NUM_INTS
  7665. * Bits 15:8
  7666. * Purpose: indicate how many 32-bit integers follow the message header
  7667. * - NUM_CHARS
  7668. * Bits 31:16
  7669. * Purpose: indicate how many 8-bit charaters follow the series of integers
  7670. */
  7671. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  7672. #define HTT_RX_TEST_NUM_INTS_S 8
  7673. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  7674. #define HTT_RX_TEST_NUM_CHARS_S 16
  7675. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  7676. do { \
  7677. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  7678. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  7679. } while (0)
  7680. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  7681. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  7682. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  7683. do { \
  7684. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  7685. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  7686. } while (0)
  7687. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  7688. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  7689. /**
  7690. * @brief target -> host packet log message
  7691. *
  7692. * @details
  7693. * The following field definitions describe the format of the packet log
  7694. * message sent from the target to the host.
  7695. * The message consists of a 4-octet header,followed by a variable number
  7696. * of 32-bit character values.
  7697. *
  7698. * |31 16|15 12|11 10|9 8|7 0|
  7699. * |------------------------------------------------------------------|
  7700. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  7701. * |------------------------------------------------------------------|
  7702. * | payload |
  7703. * |------------------------------------------------------------------|
  7704. * - MSG_TYPE
  7705. * Bits 7:0
  7706. * Purpose: identifies this as a pktlog message
  7707. * Value: HTT_T2H_MSG_TYPE_PKTLOG
  7708. * - mac_id
  7709. * Bits 9:8
  7710. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  7711. * Value: 0-3
  7712. * - pdev_id
  7713. * Bits 11:10
  7714. * Purpose: pdev_id
  7715. * Value: 0-3
  7716. * 0 (for rings at SOC level),
  7717. * 1/2/3 PDEV -> 0/1/2
  7718. * - payload_size
  7719. * Bits 31:16
  7720. * Purpose: explicitly specify the payload size
  7721. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  7722. */
  7723. PREPACK struct htt_pktlog_msg {
  7724. A_UINT32 header;
  7725. A_UINT32 payload[1/* or more */];
  7726. } POSTPACK;
  7727. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  7728. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  7729. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  7730. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  7731. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  7732. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  7733. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  7734. do { \
  7735. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  7736. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  7737. } while (0)
  7738. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  7739. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  7740. HTT_T2H_PKTLOG_MAC_ID_S)
  7741. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  7742. do { \
  7743. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  7744. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  7745. } while (0)
  7746. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  7747. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  7748. HTT_T2H_PKTLOG_PDEV_ID_S)
  7749. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  7750. do { \
  7751. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  7752. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  7753. } while (0)
  7754. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  7755. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  7756. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  7757. /*
  7758. * Rx reorder statistics
  7759. * NB: all the fields must be defined in 4 octets size.
  7760. */
  7761. struct rx_reorder_stats {
  7762. /* Non QoS MPDUs received */
  7763. A_UINT32 deliver_non_qos;
  7764. /* MPDUs received in-order */
  7765. A_UINT32 deliver_in_order;
  7766. /* Flush due to reorder timer expired */
  7767. A_UINT32 deliver_flush_timeout;
  7768. /* Flush due to move out of window */
  7769. A_UINT32 deliver_flush_oow;
  7770. /* Flush due to DELBA */
  7771. A_UINT32 deliver_flush_delba;
  7772. /* MPDUs dropped due to FCS error */
  7773. A_UINT32 fcs_error;
  7774. /* MPDUs dropped due to monitor mode non-data packet */
  7775. A_UINT32 mgmt_ctrl;
  7776. /* Unicast-data MPDUs dropped due to invalid peer */
  7777. A_UINT32 invalid_peer;
  7778. /* MPDUs dropped due to duplication (non aggregation) */
  7779. A_UINT32 dup_non_aggr;
  7780. /* MPDUs dropped due to processed before */
  7781. A_UINT32 dup_past;
  7782. /* MPDUs dropped due to duplicate in reorder queue */
  7783. A_UINT32 dup_in_reorder;
  7784. /* Reorder timeout happened */
  7785. A_UINT32 reorder_timeout;
  7786. /* invalid bar ssn */
  7787. A_UINT32 invalid_bar_ssn;
  7788. /* reorder reset due to bar ssn */
  7789. A_UINT32 ssn_reset;
  7790. /* Flush due to delete peer */
  7791. A_UINT32 deliver_flush_delpeer;
  7792. /* Flush due to offload*/
  7793. A_UINT32 deliver_flush_offload;
  7794. /* Flush due to out of buffer*/
  7795. A_UINT32 deliver_flush_oob;
  7796. /* MPDUs dropped due to PN check fail */
  7797. A_UINT32 pn_fail;
  7798. /* MPDUs dropped due to unable to allocate memory */
  7799. A_UINT32 store_fail;
  7800. /* Number of times the tid pool alloc succeeded */
  7801. A_UINT32 tid_pool_alloc_succ;
  7802. /* Number of times the MPDU pool alloc succeeded */
  7803. A_UINT32 mpdu_pool_alloc_succ;
  7804. /* Number of times the MSDU pool alloc succeeded */
  7805. A_UINT32 msdu_pool_alloc_succ;
  7806. /* Number of times the tid pool alloc failed */
  7807. A_UINT32 tid_pool_alloc_fail;
  7808. /* Number of times the MPDU pool alloc failed */
  7809. A_UINT32 mpdu_pool_alloc_fail;
  7810. /* Number of times the MSDU pool alloc failed */
  7811. A_UINT32 msdu_pool_alloc_fail;
  7812. /* Number of times the tid pool freed */
  7813. A_UINT32 tid_pool_free;
  7814. /* Number of times the MPDU pool freed */
  7815. A_UINT32 mpdu_pool_free;
  7816. /* Number of times the MSDU pool freed */
  7817. A_UINT32 msdu_pool_free;
  7818. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  7819. A_UINT32 msdu_queued;
  7820. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  7821. A_UINT32 msdu_recycled;
  7822. /* Number of MPDUs with invalid peer but A2 found in AST */
  7823. A_UINT32 invalid_peer_a2_in_ast;
  7824. /* Number of MPDUs with invalid peer but A3 found in AST */
  7825. A_UINT32 invalid_peer_a3_in_ast;
  7826. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  7827. A_UINT32 invalid_peer_bmc_mpdus;
  7828. /* Number of MSDUs with err attention word */
  7829. A_UINT32 rxdesc_err_att;
  7830. /* Number of MSDUs with flag of peer_idx_invalid */
  7831. A_UINT32 rxdesc_err_peer_idx_inv;
  7832. /* Number of MSDUs with flag of peer_idx_timeout */
  7833. A_UINT32 rxdesc_err_peer_idx_to;
  7834. /* Number of MSDUs with flag of overflow */
  7835. A_UINT32 rxdesc_err_ov;
  7836. /* Number of MSDUs with flag of msdu_length_err */
  7837. A_UINT32 rxdesc_err_msdu_len;
  7838. /* Number of MSDUs with flag of mpdu_length_err */
  7839. A_UINT32 rxdesc_err_mpdu_len;
  7840. /* Number of MSDUs with flag of tkip_mic_err */
  7841. A_UINT32 rxdesc_err_tkip_mic;
  7842. /* Number of MSDUs with flag of decrypt_err */
  7843. A_UINT32 rxdesc_err_decrypt;
  7844. /* Number of MSDUs with flag of fcs_err */
  7845. A_UINT32 rxdesc_err_fcs;
  7846. /* Number of Unicast (bc_mc bit is not set in attention word)
  7847. * frames with invalid peer handler
  7848. */
  7849. A_UINT32 rxdesc_uc_msdus_inv_peer;
  7850. /* Number of unicast frame directly (direct bit is set in attention word)
  7851. * to DUT with invalid peer handler
  7852. */
  7853. A_UINT32 rxdesc_direct_msdus_inv_peer;
  7854. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  7855. * frames with invalid peer handler
  7856. */
  7857. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  7858. /* Number of MSDUs dropped due to no first MSDU flag */
  7859. A_UINT32 rxdesc_no_1st_msdu;
  7860. /* Number of MSDUs droped due to ring overflow */
  7861. A_UINT32 msdu_drop_ring_ov;
  7862. /* Number of MSDUs dropped due to FC mismatch */
  7863. A_UINT32 msdu_drop_fc_mismatch;
  7864. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  7865. A_UINT32 msdu_drop_mgmt_remote_ring;
  7866. /* Number of MSDUs dropped due to errors not reported in attention word */
  7867. A_UINT32 msdu_drop_misc;
  7868. /* Number of MSDUs go to offload before reorder */
  7869. A_UINT32 offload_msdu_wal;
  7870. /* Number of data frame dropped by offload after reorder */
  7871. A_UINT32 offload_msdu_reorder;
  7872. /* Number of MPDUs with sequence number in the past and within the BA window */
  7873. A_UINT32 dup_past_within_window;
  7874. /* Number of MPDUs with sequence number in the past and outside the BA window */
  7875. A_UINT32 dup_past_outside_window;
  7876. /* Number of MSDUs with decrypt/MIC error */
  7877. A_UINT32 rxdesc_err_decrypt_mic;
  7878. /* Number of data MSDUs received on both local and remote rings */
  7879. A_UINT32 data_msdus_on_both_rings;
  7880. /* MPDUs never filled */
  7881. A_UINT32 holes_not_filled;
  7882. };
  7883. /*
  7884. * Rx Remote buffer statistics
  7885. * NB: all the fields must be defined in 4 octets size.
  7886. */
  7887. struct rx_remote_buffer_mgmt_stats {
  7888. /* Total number of MSDUs reaped for Rx processing */
  7889. A_UINT32 remote_reaped;
  7890. /* MSDUs recycled within firmware */
  7891. A_UINT32 remote_recycled;
  7892. /* MSDUs stored by Data Rx */
  7893. A_UINT32 data_rx_msdus_stored;
  7894. /* Number of HTT indications from WAL Rx MSDU */
  7895. A_UINT32 wal_rx_ind;
  7896. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  7897. A_UINT32 wal_rx_ind_unconsumed;
  7898. /* Number of HTT indications from Data Rx MSDU */
  7899. A_UINT32 data_rx_ind;
  7900. /* Number of unconsumed HTT indications from Data Rx MSDU */
  7901. A_UINT32 data_rx_ind_unconsumed;
  7902. /* Number of HTT indications from ATHBUF */
  7903. A_UINT32 athbuf_rx_ind;
  7904. /* Number of remote buffers requested for refill */
  7905. A_UINT32 refill_buf_req;
  7906. /* Number of remote buffers filled by the host */
  7907. A_UINT32 refill_buf_rsp;
  7908. /* Number of times MAC hw_index = f/w write_index */
  7909. A_INT32 mac_no_bufs;
  7910. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  7911. A_INT32 fw_indices_equal;
  7912. /* Number of times f/w finds no buffers to post */
  7913. A_INT32 host_no_bufs;
  7914. };
  7915. /*
  7916. * TXBF MU/SU packets and NDPA statistics
  7917. * NB: all the fields must be defined in 4 octets size.
  7918. */
  7919. struct rx_txbf_musu_ndpa_pkts_stats {
  7920. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  7921. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  7922. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  7923. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  7924. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  7925. A_UINT32 reserved[3]; /* must be set to 0x0 */
  7926. };
  7927. /*
  7928. * htt_dbg_stats_status -
  7929. * present - The requested stats have been delivered in full.
  7930. * This indicates that either the stats information was contained
  7931. * in its entirety within this message, or else this message
  7932. * completes the delivery of the requested stats info that was
  7933. * partially delivered through earlier STATS_CONF messages.
  7934. * partial - The requested stats have been delivered in part.
  7935. * One or more subsequent STATS_CONF messages with the same
  7936. * cookie value will be sent to deliver the remainder of the
  7937. * information.
  7938. * error - The requested stats could not be delivered, for example due
  7939. * to a shortage of memory to construct a message holding the
  7940. * requested stats.
  7941. * invalid - The requested stat type is either not recognized, or the
  7942. * target is configured to not gather the stats type in question.
  7943. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7944. * series_done - This special value indicates that no further stats info
  7945. * elements are present within a series of stats info elems
  7946. * (within a stats upload confirmation message).
  7947. */
  7948. enum htt_dbg_stats_status {
  7949. HTT_DBG_STATS_STATUS_PRESENT = 0,
  7950. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  7951. HTT_DBG_STATS_STATUS_ERROR = 2,
  7952. HTT_DBG_STATS_STATUS_INVALID = 3,
  7953. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  7954. };
  7955. /**
  7956. * @brief target -> host statistics upload
  7957. *
  7958. * @details
  7959. * The following field definitions describe the format of the HTT target
  7960. * to host stats upload confirmation message.
  7961. * The message contains a cookie echoed from the HTT host->target stats
  7962. * upload request, which identifies which request the confirmation is
  7963. * for, and a series of tag-length-value stats information elements.
  7964. * The tag-length header for each stats info element also includes a
  7965. * status field, to indicate whether the request for the stat type in
  7966. * question was fully met, partially met, unable to be met, or invalid
  7967. * (if the stat type in question is disabled in the target).
  7968. * A special value of all 1's in this status field is used to indicate
  7969. * the end of the series of stats info elements.
  7970. *
  7971. *
  7972. * |31 16|15 8|7 5|4 0|
  7973. * |------------------------------------------------------------|
  7974. * | reserved | msg type |
  7975. * |------------------------------------------------------------|
  7976. * | cookie LSBs |
  7977. * |------------------------------------------------------------|
  7978. * | cookie MSBs |
  7979. * |------------------------------------------------------------|
  7980. * | stats entry length | reserved | S |stat type|
  7981. * |------------------------------------------------------------|
  7982. * | |
  7983. * | type-specific stats info |
  7984. * | |
  7985. * |------------------------------------------------------------|
  7986. * | stats entry length | reserved | S |stat type|
  7987. * |------------------------------------------------------------|
  7988. * | |
  7989. * | type-specific stats info |
  7990. * | |
  7991. * |------------------------------------------------------------|
  7992. * | n/a | reserved | 111 | n/a |
  7993. * |------------------------------------------------------------|
  7994. * Header fields:
  7995. * - MSG_TYPE
  7996. * Bits 7:0
  7997. * Purpose: identifies this is a statistics upload confirmation message
  7998. * Value: 0x9
  7999. * - COOKIE_LSBS
  8000. * Bits 31:0
  8001. * Purpose: Provide a mechanism to match a target->host stats confirmation
  8002. * message with its preceding host->target stats request message.
  8003. * Value: LSBs of the opaque cookie specified by the host-side requestor
  8004. * - COOKIE_MSBS
  8005. * Bits 31:0
  8006. * Purpose: Provide a mechanism to match a target->host stats confirmation
  8007. * message with its preceding host->target stats request message.
  8008. * Value: MSBs of the opaque cookie specified by the host-side requestor
  8009. *
  8010. * Stats Information Element tag-length header fields:
  8011. * - STAT_TYPE
  8012. * Bits 4:0
  8013. * Purpose: identifies the type of statistics info held in the
  8014. * following information element
  8015. * Value: htt_dbg_stats_type
  8016. * - STATUS
  8017. * Bits 7:5
  8018. * Purpose: indicate whether the requested stats are present
  8019. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  8020. * the completion of the stats entry series
  8021. * - LENGTH
  8022. * Bits 31:16
  8023. * Purpose: indicate the stats information size
  8024. * Value: This field specifies the number of bytes of stats information
  8025. * that follows the element tag-length header.
  8026. * It is expected but not required that this length is a multiple of
  8027. * 4 bytes. Even if the length is not an integer multiple of 4, the
  8028. * subsequent stats entry header will begin on a 4-byte aligned
  8029. * boundary.
  8030. */
  8031. #define HTT_T2H_STATS_COOKIE_SIZE 8
  8032. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  8033. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  8034. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  8035. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  8036. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  8037. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  8038. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  8039. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  8040. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  8041. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  8042. do { \
  8043. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  8044. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  8045. } while (0)
  8046. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  8047. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  8048. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  8049. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  8050. do { \
  8051. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  8052. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  8053. } while (0)
  8054. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  8055. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  8056. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  8057. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  8058. do { \
  8059. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  8060. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  8061. } while (0)
  8062. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  8063. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  8064. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  8065. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  8066. #define HTT_MAX_AGGR 64
  8067. #define HTT_HL_MAX_AGGR 18
  8068. /**
  8069. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  8070. *
  8071. * @details
  8072. * The following field definitions describe the format of the HTT host
  8073. * to target frag_desc/msdu_ext bank configuration message.
  8074. * The message contains the based address and the min and max id of the
  8075. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  8076. * MSDU_EXT/FRAG_DESC.
  8077. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  8078. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  8079. * the hardware does the mapping/translation.
  8080. *
  8081. * Total banks that can be configured is configured to 16.
  8082. *
  8083. * This should be called before any TX has be initiated by the HTT
  8084. *
  8085. * |31 16|15 8|7 5|4 0|
  8086. * |------------------------------------------------------------|
  8087. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  8088. * |------------------------------------------------------------|
  8089. * | BANK0_BASE_ADDRESS (bits 31:0) |
  8090. #if HTT_PADDR64
  8091. * | BANK0_BASE_ADDRESS (bits 63:32) |
  8092. #endif
  8093. * |------------------------------------------------------------|
  8094. * | ... |
  8095. * |------------------------------------------------------------|
  8096. * | BANK15_BASE_ADDRESS (bits 31:0) |
  8097. #if HTT_PADDR64
  8098. * | BANK15_BASE_ADDRESS (bits 63:32) |
  8099. #endif
  8100. * |------------------------------------------------------------|
  8101. * | BANK0_MAX_ID | BANK0_MIN_ID |
  8102. * |------------------------------------------------------------|
  8103. * | ... |
  8104. * |------------------------------------------------------------|
  8105. * | BANK15_MAX_ID | BANK15_MIN_ID |
  8106. * |------------------------------------------------------------|
  8107. * Header fields:
  8108. * - MSG_TYPE
  8109. * Bits 7:0
  8110. * Value: 0x6
  8111. * for systems with 64-bit format for bus addresses:
  8112. * - BANKx_BASE_ADDRESS_LO
  8113. * Bits 31:0
  8114. * Purpose: Provide a mechanism to specify the base address of the
  8115. * MSDU_EXT bank physical/bus address.
  8116. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  8117. * - BANKx_BASE_ADDRESS_HI
  8118. * Bits 31:0
  8119. * Purpose: Provide a mechanism to specify the base address of the
  8120. * MSDU_EXT bank physical/bus address.
  8121. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  8122. * for systems with 32-bit format for bus addresses:
  8123. * - BANKx_BASE_ADDRESS
  8124. * Bits 31:0
  8125. * Purpose: Provide a mechanism to specify the base address of the
  8126. * MSDU_EXT bank physical/bus address.
  8127. * Value: MSDU_EXT bank physical / bus address
  8128. * - BANKx_MIN_ID
  8129. * Bits 15:0
  8130. * Purpose: Provide a mechanism to specify the min index that needs to
  8131. * mapped.
  8132. * - BANKx_MAX_ID
  8133. * Bits 31:16
  8134. * Purpose: Provide a mechanism to specify the max index that needs to
  8135. * mapped.
  8136. *
  8137. */
  8138. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  8139. * safe value.
  8140. * @note MAX supported banks is 16.
  8141. */
  8142. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  8143. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  8144. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  8145. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  8146. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  8147. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  8148. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  8149. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  8150. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  8151. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  8152. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  8153. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  8154. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  8155. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  8156. do { \
  8157. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  8158. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  8159. } while (0)
  8160. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  8161. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  8162. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  8163. do { \
  8164. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  8165. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  8166. } while (0)
  8167. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  8168. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  8169. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  8170. do { \
  8171. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  8172. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  8173. } while (0)
  8174. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  8175. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  8176. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  8177. do { \
  8178. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  8179. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  8180. } while (0)
  8181. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  8182. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  8183. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  8184. do { \
  8185. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  8186. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  8187. } while (0)
  8188. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  8189. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  8190. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  8191. do { \
  8192. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  8193. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  8194. } while (0)
  8195. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  8196. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  8197. /*
  8198. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  8199. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  8200. * addresses are stored in a XXX-bit field.
  8201. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  8202. * htt_tx_frag_desc64_bank_cfg_t structs.
  8203. */
  8204. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  8205. _paddr_bits_, \
  8206. _paddr__bank_base_address_) \
  8207. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  8208. /** word 0 \
  8209. * msg_type: 8, \
  8210. * pdev_id: 2, \
  8211. * swap: 1, \
  8212. * reserved0: 5, \
  8213. * num_banks: 8, \
  8214. * desc_size: 8; \
  8215. */ \
  8216. A_UINT32 word0; \
  8217. /* \
  8218. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  8219. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  8220. * the second A_UINT32). \
  8221. */ \
  8222. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8223. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8224. } POSTPACK
  8225. /* define htt_tx_frag_desc32_bank_cfg_t */
  8226. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  8227. /* define htt_tx_frag_desc64_bank_cfg_t */
  8228. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  8229. /*
  8230. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  8231. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  8232. */
  8233. #if HTT_PADDR64
  8234. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  8235. #else
  8236. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  8237. #endif
  8238. /**
  8239. * @brief target -> host HTT TX Credit total count update message definition
  8240. *
  8241. *|31 16|15|14 9| 8 |7 0 |
  8242. *|---------------------+--+----------+-------+----------|
  8243. *|cur htt credit delta | Q| reserved | sign | msg type |
  8244. *|------------------------------------------------------|
  8245. *
  8246. * Header fields:
  8247. * - MSG_TYPE
  8248. * Bits 7:0
  8249. * Purpose: identifies this as a htt tx credit delta update message
  8250. * Value: 0xe
  8251. * - SIGN
  8252. * Bits 8
  8253. * identifies whether credit delta is positive or negative
  8254. * Value:
  8255. * - 0x0: credit delta is positive, rebalance in some buffers
  8256. * - 0x1: credit delta is negative, rebalance out some buffers
  8257. * - reserved
  8258. * Bits 14:9
  8259. * Value: 0x0
  8260. * - TXQ_GRP
  8261. * Bit 15
  8262. * Purpose: indicates whether any tx queue group information elements
  8263. * are appended to the tx credit update message
  8264. * Value: 0 -> no tx queue group information element is present
  8265. * 1 -> a tx queue group information element immediately follows
  8266. * - DELTA_COUNT
  8267. * Bits 31:16
  8268. * Purpose: Specify current htt credit delta absolute count
  8269. */
  8270. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  8271. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  8272. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  8273. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  8274. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  8275. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  8276. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  8277. do { \
  8278. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  8279. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  8280. } while (0)
  8281. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  8282. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  8283. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  8284. do { \
  8285. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  8286. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  8287. } while (0)
  8288. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  8289. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  8290. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  8291. do { \
  8292. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  8293. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  8294. } while (0)
  8295. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  8296. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  8297. #define HTT_TX_CREDIT_MSG_BYTES 4
  8298. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  8299. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  8300. /**
  8301. * @brief HTT WDI_IPA Operation Response Message
  8302. *
  8303. * @details
  8304. * HTT WDI_IPA Operation Response message is sent by target
  8305. * to host confirming suspend or resume operation.
  8306. * |31 24|23 16|15 8|7 0|
  8307. * |----------------+----------------+----------------+----------------|
  8308. * | op_code | Rsvd | msg_type |
  8309. * |-------------------------------------------------------------------|
  8310. * | Rsvd | Response len |
  8311. * |-------------------------------------------------------------------|
  8312. * | |
  8313. * | Response-type specific info |
  8314. * | |
  8315. * | |
  8316. * |-------------------------------------------------------------------|
  8317. * Header fields:
  8318. * - MSG_TYPE
  8319. * Bits 7:0
  8320. * Purpose: Identifies this as WDI_IPA Operation Response message
  8321. * value: = 0x13
  8322. * - OP_CODE
  8323. * Bits 31:16
  8324. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  8325. * value: = enum htt_wdi_ipa_op_code
  8326. * - RSP_LEN
  8327. * Bits 16:0
  8328. * Purpose: length for the response-type specific info
  8329. * value: = length in bytes for response-type specific info
  8330. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  8331. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  8332. */
  8333. PREPACK struct htt_wdi_ipa_op_response_t
  8334. {
  8335. /* DWORD 0: flags and meta-data */
  8336. A_UINT32
  8337. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8338. reserved1: 8,
  8339. op_code: 16;
  8340. A_UINT32
  8341. rsp_len: 16,
  8342. reserved2: 16;
  8343. } POSTPACK;
  8344. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  8345. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  8346. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  8347. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  8348. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  8349. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  8350. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  8351. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  8352. do { \
  8353. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  8354. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  8355. } while (0)
  8356. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  8357. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  8358. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  8359. do { \
  8360. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  8361. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  8362. } while (0)
  8363. enum htt_phy_mode {
  8364. htt_phy_mode_11a = 0,
  8365. htt_phy_mode_11g = 1,
  8366. htt_phy_mode_11b = 2,
  8367. htt_phy_mode_11g_only = 3,
  8368. htt_phy_mode_11na_ht20 = 4,
  8369. htt_phy_mode_11ng_ht20 = 5,
  8370. htt_phy_mode_11na_ht40 = 6,
  8371. htt_phy_mode_11ng_ht40 = 7,
  8372. htt_phy_mode_11ac_vht20 = 8,
  8373. htt_phy_mode_11ac_vht40 = 9,
  8374. htt_phy_mode_11ac_vht80 = 10,
  8375. htt_phy_mode_11ac_vht20_2g = 11,
  8376. htt_phy_mode_11ac_vht40_2g = 12,
  8377. htt_phy_mode_11ac_vht80_2g = 13,
  8378. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  8379. htt_phy_mode_11ac_vht160 = 15,
  8380. htt_phy_mode_max,
  8381. };
  8382. /**
  8383. * @brief target -> host HTT channel change indication
  8384. * @details
  8385. * Specify when a channel change occurs.
  8386. * This allows the host to precisely determine which rx frames arrived
  8387. * on the old channel and which rx frames arrived on the new channel.
  8388. *
  8389. *|31 |7 0 |
  8390. *|-------------------------------------------+----------|
  8391. *| reserved | msg type |
  8392. *|------------------------------------------------------|
  8393. *| primary_chan_center_freq_mhz |
  8394. *|------------------------------------------------------|
  8395. *| contiguous_chan1_center_freq_mhz |
  8396. *|------------------------------------------------------|
  8397. *| contiguous_chan2_center_freq_mhz |
  8398. *|------------------------------------------------------|
  8399. *| phy_mode |
  8400. *|------------------------------------------------------|
  8401. *
  8402. * Header fields:
  8403. * - MSG_TYPE
  8404. * Bits 7:0
  8405. * Purpose: identifies this as a htt channel change indication message
  8406. * Value: 0x15
  8407. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  8408. * Bits 31:0
  8409. * Purpose: identify the (center of the) new 20 MHz primary channel
  8410. * Value: center frequency of the 20 MHz primary channel, in MHz units
  8411. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  8412. * Bits 31:0
  8413. * Purpose: identify the (center of the) contiguous frequency range
  8414. * comprising the new channel.
  8415. * For example, if the new channel is a 80 MHz channel extending
  8416. * 60 MHz beyond the primary channel, this field would be 30 larger
  8417. * than the primary channel center frequency field.
  8418. * Value: center frequency of the contiguous frequency range comprising
  8419. * the full channel in MHz units
  8420. * (80+80 channels also use the CONTIG_CHAN2 field)
  8421. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  8422. * Bits 31:0
  8423. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  8424. * within a VHT 80+80 channel.
  8425. * This field is only relevant for VHT 80+80 channels.
  8426. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  8427. * channel (arbitrary value for cases besides VHT 80+80)
  8428. * - PHY_MODE
  8429. * Bits 31:0
  8430. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  8431. * and band
  8432. * Value: htt_phy_mode enum value
  8433. */
  8434. PREPACK struct htt_chan_change_t
  8435. {
  8436. /* DWORD 0: flags and meta-data */
  8437. A_UINT32
  8438. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8439. reserved1: 24;
  8440. A_UINT32 primary_chan_center_freq_mhz;
  8441. A_UINT32 contig_chan1_center_freq_mhz;
  8442. A_UINT32 contig_chan2_center_freq_mhz;
  8443. A_UINT32 phy_mode;
  8444. } POSTPACK;
  8445. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  8446. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  8447. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  8448. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  8449. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  8450. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  8451. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  8452. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  8453. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  8454. do { \
  8455. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  8456. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  8457. } while (0)
  8458. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  8459. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  8460. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  8461. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  8462. do { \
  8463. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  8464. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  8465. } while (0)
  8466. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  8467. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  8468. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  8469. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  8470. do { \
  8471. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  8472. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  8473. } while (0)
  8474. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  8475. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  8476. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  8477. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  8478. do { \
  8479. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  8480. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  8481. } while (0)
  8482. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  8483. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  8484. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  8485. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  8486. /**
  8487. * @brief rx offload packet error message
  8488. *
  8489. * @details
  8490. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  8491. * of target payload like mic err.
  8492. *
  8493. * |31 24|23 16|15 8|7 0|
  8494. * |----------------+----------------+----------------+----------------|
  8495. * | tid | vdev_id | msg_sub_type | msg_type |
  8496. * |-------------------------------------------------------------------|
  8497. * : (sub-type dependent content) :
  8498. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8499. * Header fields:
  8500. * - msg_type
  8501. * Bits 7:0
  8502. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  8503. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  8504. * - msg_sub_type
  8505. * Bits 15:8
  8506. * Purpose: Identifies which type of rx error is reported by this message
  8507. * value: htt_rx_ofld_pkt_err_type
  8508. * - vdev_id
  8509. * Bits 23:16
  8510. * Purpose: Identifies which vdev received the erroneous rx frame
  8511. * value:
  8512. * - tid
  8513. * Bits 31:24
  8514. * Purpose: Identifies the traffic type of the rx frame
  8515. * value:
  8516. *
  8517. * - The payload fields used if the sub-type == MIC error are shown below.
  8518. * Note - MIC err is per MSDU, while PN is per MPDU.
  8519. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  8520. * with MIC err in A-MSDU case, so FW will send only one HTT message
  8521. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  8522. * instead of sending separate HTT messages for each wrong MSDU within
  8523. * the MPDU.
  8524. *
  8525. * |31 24|23 16|15 8|7 0|
  8526. * |----------------+----------------+----------------+----------------|
  8527. * | Rsvd | key_id | peer_id |
  8528. * |-------------------------------------------------------------------|
  8529. * | receiver MAC addr 31:0 |
  8530. * |-------------------------------------------------------------------|
  8531. * | Rsvd | receiver MAC addr 47:32 |
  8532. * |-------------------------------------------------------------------|
  8533. * | transmitter MAC addr 31:0 |
  8534. * |-------------------------------------------------------------------|
  8535. * | Rsvd | transmitter MAC addr 47:32 |
  8536. * |-------------------------------------------------------------------|
  8537. * | PN 31:0 |
  8538. * |-------------------------------------------------------------------|
  8539. * | Rsvd | PN 47:32 |
  8540. * |-------------------------------------------------------------------|
  8541. * - peer_id
  8542. * Bits 15:0
  8543. * Purpose: identifies which peer is frame is from
  8544. * value:
  8545. * - key_id
  8546. * Bits 23:16
  8547. * Purpose: identifies key_id of rx frame
  8548. * value:
  8549. * - RA_31_0 (receiver MAC addr 31:0)
  8550. * Bits 31:0
  8551. * Purpose: identifies by MAC address which vdev received the frame
  8552. * value: MAC address lower 4 bytes
  8553. * - RA_47_32 (receiver MAC addr 47:32)
  8554. * Bits 15:0
  8555. * Purpose: identifies by MAC address which vdev received the frame
  8556. * value: MAC address upper 2 bytes
  8557. * - TA_31_0 (transmitter MAC addr 31:0)
  8558. * Bits 31:0
  8559. * Purpose: identifies by MAC address which peer transmitted the frame
  8560. * value: MAC address lower 4 bytes
  8561. * - TA_47_32 (transmitter MAC addr 47:32)
  8562. * Bits 15:0
  8563. * Purpose: identifies by MAC address which peer transmitted the frame
  8564. * value: MAC address upper 2 bytes
  8565. * - PN_31_0
  8566. * Bits 31:0
  8567. * Purpose: Identifies pn of rx frame
  8568. * value: PN lower 4 bytes
  8569. * - PN_47_32
  8570. * Bits 15:0
  8571. * Purpose: Identifies pn of rx frame
  8572. * value:
  8573. * TKIP or CCMP: PN upper 2 bytes
  8574. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  8575. */
  8576. enum htt_rx_ofld_pkt_err_type {
  8577. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  8578. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  8579. };
  8580. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  8581. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  8582. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  8583. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  8584. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  8585. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  8586. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  8587. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  8588. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  8589. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  8590. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  8591. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  8592. do { \
  8593. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  8594. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  8595. } while (0)
  8596. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  8597. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  8598. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  8599. do { \
  8600. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  8601. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  8602. } while (0)
  8603. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  8604. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  8605. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  8606. do { \
  8607. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  8608. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  8609. } while (0)
  8610. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  8611. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  8612. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  8613. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  8614. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  8615. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  8616. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  8617. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  8618. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  8619. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  8620. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  8621. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  8622. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  8623. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  8624. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  8625. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  8626. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  8627. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  8628. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  8629. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  8630. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  8631. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  8632. do { \
  8633. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  8634. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  8635. } while (0)
  8636. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  8637. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  8638. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  8639. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  8640. do { \
  8641. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  8642. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  8643. } while (0)
  8644. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  8645. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  8646. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  8647. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  8648. do { \
  8649. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  8650. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  8651. } while (0)
  8652. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  8653. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  8654. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  8655. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  8656. do { \
  8657. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  8658. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  8659. } while (0)
  8660. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  8661. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  8662. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  8663. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  8664. do { \
  8665. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  8666. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  8667. } while (0)
  8668. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  8669. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  8670. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  8671. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  8672. do { \
  8673. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  8674. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  8675. } while (0)
  8676. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  8677. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  8678. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  8679. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  8680. do { \
  8681. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  8682. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  8683. } while (0)
  8684. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  8685. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  8686. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  8687. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  8688. do { \
  8689. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  8690. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  8691. } while (0)
  8692. /**
  8693. * @brief peer rate report message
  8694. *
  8695. * @details
  8696. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  8697. * justified rate of all the peers.
  8698. *
  8699. * |31 24|23 16|15 8|7 0|
  8700. * |----------------+----------------+----------------+----------------|
  8701. * | peer_count | | msg_type |
  8702. * |-------------------------------------------------------------------|
  8703. * : Payload (variant number of peer rate report) :
  8704. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8705. * Header fields:
  8706. * - msg_type
  8707. * Bits 7:0
  8708. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  8709. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  8710. * - reserved
  8711. * Bits 15:8
  8712. * Purpose:
  8713. * value:
  8714. * - peer_count
  8715. * Bits 31:16
  8716. * Purpose: Specify how many peer rate report elements are present in the payload.
  8717. * value:
  8718. *
  8719. * Payload:
  8720. * There are variant number of peer rate report follow the first 32 bits.
  8721. * The peer rate report is defined as follows.
  8722. *
  8723. * |31 20|19 16|15 0|
  8724. * |-----------------------+---------+---------------------------------|-
  8725. * | reserved | phy | peer_id | \
  8726. * |-------------------------------------------------------------------| -> report #0
  8727. * | rate | /
  8728. * |-----------------------+---------+---------------------------------|-
  8729. * | reserved | phy | peer_id | \
  8730. * |-------------------------------------------------------------------| -> report #1
  8731. * | rate | /
  8732. * |-----------------------+---------+---------------------------------|-
  8733. * | reserved | phy | peer_id | \
  8734. * |-------------------------------------------------------------------| -> report #2
  8735. * | rate | /
  8736. * |-------------------------------------------------------------------|-
  8737. * : :
  8738. * : :
  8739. * : :
  8740. * :-------------------------------------------------------------------:
  8741. *
  8742. * - peer_id
  8743. * Bits 15:0
  8744. * Purpose: identify the peer
  8745. * value:
  8746. * - phy
  8747. * Bits 19:16
  8748. * Purpose: identify which phy is in use
  8749. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  8750. * Please see enum htt_peer_report_phy_type for detail.
  8751. * - reserved
  8752. * Bits 31:20
  8753. * Purpose:
  8754. * value:
  8755. * - rate
  8756. * Bits 31:0
  8757. * Purpose: represent the justified rate of the peer specified by peer_id
  8758. * value:
  8759. */
  8760. enum htt_peer_rate_report_phy_type {
  8761. HTT_PEER_RATE_REPORT_11B = 0,
  8762. HTT_PEER_RATE_REPORT_11A_G,
  8763. HTT_PEER_RATE_REPORT_11N,
  8764. HTT_PEER_RATE_REPORT_11AC,
  8765. };
  8766. #define HTT_PEER_RATE_REPORT_SIZE 8
  8767. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  8768. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  8769. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  8770. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  8771. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  8772. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  8773. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  8774. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  8775. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  8776. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  8777. do { \
  8778. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  8779. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  8780. } while (0)
  8781. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  8782. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  8783. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  8784. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  8785. do { \
  8786. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  8787. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  8788. } while (0)
  8789. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  8790. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  8791. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  8792. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  8793. do { \
  8794. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  8795. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  8796. } while (0)
  8797. /**
  8798. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  8799. *
  8800. * @details
  8801. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  8802. * a flow of descriptors.
  8803. *
  8804. * This message is in TLV format and indicates the parameters to be setup a
  8805. * flow in the host. Each entry indicates that a particular flow ID is ready to
  8806. * receive descriptors from a specified pool.
  8807. *
  8808. * The message would appear as follows:
  8809. *
  8810. * |31 24|23 16|15 8|7 0|
  8811. * |----------------+----------------+----------------+----------------|
  8812. * header | reserved | num_flows | msg_type |
  8813. * |-------------------------------------------------------------------|
  8814. * | |
  8815. * : payload :
  8816. * | |
  8817. * |-------------------------------------------------------------------|
  8818. *
  8819. * The header field is one DWORD long and is interpreted as follows:
  8820. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  8821. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  8822. * this message
  8823. * b'16-31 - reserved: These bits are reserved for future use
  8824. *
  8825. * Payload:
  8826. * The payload would contain multiple objects of the following structure. Each
  8827. * object represents a flow.
  8828. *
  8829. * |31 24|23 16|15 8|7 0|
  8830. * |----------------+----------------+----------------+----------------|
  8831. * header | reserved | num_flows | msg_type |
  8832. * |-------------------------------------------------------------------|
  8833. * payload0| flow_type |
  8834. * |-------------------------------------------------------------------|
  8835. * | flow_id |
  8836. * |-------------------------------------------------------------------|
  8837. * | reserved0 | flow_pool_id |
  8838. * |-------------------------------------------------------------------|
  8839. * | reserved1 | flow_pool_size |
  8840. * |-------------------------------------------------------------------|
  8841. * | reserved2 |
  8842. * |-------------------------------------------------------------------|
  8843. * payload1| flow_type |
  8844. * |-------------------------------------------------------------------|
  8845. * | flow_id |
  8846. * |-------------------------------------------------------------------|
  8847. * | reserved0 | flow_pool_id |
  8848. * |-------------------------------------------------------------------|
  8849. * | reserved1 | flow_pool_size |
  8850. * |-------------------------------------------------------------------|
  8851. * | reserved2 |
  8852. * |-------------------------------------------------------------------|
  8853. * | . |
  8854. * | . |
  8855. * | . |
  8856. * |-------------------------------------------------------------------|
  8857. *
  8858. * Each payload is 5 DWORDS long and is interpreted as follows:
  8859. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  8860. * this flow is associated. It can be VDEV, peer,
  8861. * or tid (AC). Based on enum htt_flow_type.
  8862. *
  8863. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  8864. * object. For flow_type vdev it is set to the
  8865. * vdevid, for peer it is peerid and for tid, it is
  8866. * tid_num.
  8867. *
  8868. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  8869. * in the host for this flow
  8870. * b'16:31 - reserved0: This field in reserved for the future. In case
  8871. * we have a hierarchical implementation (HCM) of
  8872. * pools, it can be used to indicate the ID of the
  8873. * parent-pool.
  8874. *
  8875. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  8876. * Descriptors for this flow will be
  8877. * allocated from this pool in the host.
  8878. * b'16:31 - reserved1: This field in reserved for the future. In case
  8879. * we have a hierarchical implementation of pools,
  8880. * it can be used to indicate the max number of
  8881. * descriptors in the pool. The b'0:15 can be used
  8882. * to indicate min number of descriptors in the
  8883. * HCM scheme.
  8884. *
  8885. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  8886. * we have a hierarchical implementation of pools,
  8887. * b'0:15 can be used to indicate the
  8888. * priority-based borrowing (PBB) threshold of
  8889. * the flow's pool. The b'16:31 are still left
  8890. * reserved.
  8891. */
  8892. enum htt_flow_type {
  8893. FLOW_TYPE_VDEV = 0,
  8894. /* Insert new flow types above this line */
  8895. };
  8896. PREPACK struct htt_flow_pool_map_payload_t {
  8897. A_UINT32 flow_type;
  8898. A_UINT32 flow_id;
  8899. A_UINT32 flow_pool_id:16,
  8900. reserved0:16;
  8901. A_UINT32 flow_pool_size:16,
  8902. reserved1:16;
  8903. A_UINT32 reserved2;
  8904. } POSTPACK;
  8905. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  8906. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  8907. (sizeof(struct htt_flow_pool_map_payload_t))
  8908. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  8909. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  8910. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  8911. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  8912. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  8913. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  8914. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  8915. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  8916. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  8917. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  8918. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  8919. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  8920. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  8921. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  8922. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  8923. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  8924. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  8925. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  8926. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  8927. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  8928. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  8929. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  8930. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  8931. do { \
  8932. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  8933. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  8934. } while (0)
  8935. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  8936. do { \
  8937. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  8938. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  8939. } while (0)
  8940. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  8941. do { \
  8942. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  8943. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  8944. } while (0)
  8945. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  8946. do { \
  8947. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  8948. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  8949. } while (0)
  8950. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  8951. do { \
  8952. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  8953. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  8954. } while (0)
  8955. /**
  8956. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  8957. *
  8958. * @details
  8959. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  8960. * down a flow of descriptors.
  8961. * This message indicates that for the flow (whose ID is provided) is wanting
  8962. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  8963. * pool of descriptors from where descriptors are being allocated for this
  8964. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  8965. * be unmapped by the host.
  8966. *
  8967. * The message would appear as follows:
  8968. *
  8969. * |31 24|23 16|15 8|7 0|
  8970. * |----------------+----------------+----------------+----------------|
  8971. * | reserved0 | msg_type |
  8972. * |-------------------------------------------------------------------|
  8973. * | flow_type |
  8974. * |-------------------------------------------------------------------|
  8975. * | flow_id |
  8976. * |-------------------------------------------------------------------|
  8977. * | reserved1 | flow_pool_id |
  8978. * |-------------------------------------------------------------------|
  8979. *
  8980. * The message is interpreted as follows:
  8981. * dword0 - b'0:7 - msg_type: This will be set to
  8982. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  8983. * b'8:31 - reserved0: Reserved for future use
  8984. *
  8985. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  8986. * this flow is associated. It can be VDEV, peer,
  8987. * or tid (AC). Based on enum htt_flow_type.
  8988. *
  8989. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  8990. * object. For flow_type vdev it is set to the
  8991. * vdevid, for peer it is peerid and for tid, it is
  8992. * tid_num.
  8993. *
  8994. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  8995. * used in the host for this flow
  8996. * b'16:31 - reserved0: This field in reserved for the future.
  8997. *
  8998. */
  8999. PREPACK struct htt_flow_pool_unmap_t {
  9000. A_UINT32 msg_type:8,
  9001. reserved0:24;
  9002. A_UINT32 flow_type;
  9003. A_UINT32 flow_id;
  9004. A_UINT32 flow_pool_id:16,
  9005. reserved1:16;
  9006. } POSTPACK;
  9007. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  9008. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  9009. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  9010. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  9011. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  9012. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  9013. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  9014. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  9015. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  9016. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  9017. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  9018. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  9019. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  9020. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  9021. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  9022. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  9023. do { \
  9024. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  9025. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  9026. } while (0)
  9027. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  9028. do { \
  9029. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  9030. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  9031. } while (0)
  9032. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  9033. do { \
  9034. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  9035. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  9036. } while (0)
  9037. /**
  9038. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  9039. *
  9040. * @details
  9041. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  9042. * SRNG ring setup is done
  9043. *
  9044. * This message indicates whether the last setup operation is successful.
  9045. * It will be sent to host when host set respose_required bit in
  9046. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  9047. * The message would appear as follows:
  9048. *
  9049. * |31 24|23 16|15 8|7 0|
  9050. * |--------------- +----------------+----------------+----------------|
  9051. * | setup_status | ring_id | pdev_id | msg_type |
  9052. * |-------------------------------------------------------------------|
  9053. *
  9054. * The message is interpreted as follows:
  9055. * dword0 - b'0:7 - msg_type: This will be set to
  9056. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  9057. * b'8:15 - pdev_id:
  9058. * 0 (for rings at SOC/UMAC level),
  9059. * 1/2/3 mac id (for rings at LMAC level)
  9060. * b'16:23 - ring_id: Identify the ring which is set up
  9061. * More details can be got from enum htt_srng_ring_id
  9062. * b'24:31 - setup_status: Indicate status of setup operation
  9063. * Refer to htt_ring_setup_status
  9064. */
  9065. PREPACK struct htt_sring_setup_done_t {
  9066. A_UINT32 msg_type: 8,
  9067. pdev_id: 8,
  9068. ring_id: 8,
  9069. setup_status: 8;
  9070. } POSTPACK;
  9071. enum htt_ring_setup_status {
  9072. htt_ring_setup_status_ok = 0,
  9073. htt_ring_setup_status_error,
  9074. };
  9075. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  9076. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  9077. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  9078. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  9079. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  9080. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  9081. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  9082. do { \
  9083. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  9084. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  9085. } while (0)
  9086. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  9087. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  9088. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  9089. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  9090. HTT_SRING_SETUP_DONE_RING_ID_S)
  9091. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  9092. do { \
  9093. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  9094. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  9095. } while (0)
  9096. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  9097. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  9098. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  9099. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  9100. HTT_SRING_SETUP_DONE_STATUS_S)
  9101. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  9102. do { \
  9103. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  9104. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  9105. } while (0)
  9106. /**
  9107. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  9108. *
  9109. * @details
  9110. * HTT TX map flow entry with tqm flow pointer
  9111. * Sent from firmware to host to add tqm flow pointer in corresponding
  9112. * flow search entry. Flow metadata is replayed back to host as part of this
  9113. * struct to enable host to find the specific flow search entry
  9114. *
  9115. * The message would appear as follows:
  9116. *
  9117. * |31 28|27 18|17 14|13 8|7 0|
  9118. * |-------+------------------------------------------+----------------|
  9119. * | rsvd0 | fse_hsh_idx | msg_type |
  9120. * |-------------------------------------------------------------------|
  9121. * | rsvd1 | tid | peer_id |
  9122. * |-------------------------------------------------------------------|
  9123. * | tqm_flow_pntr_lo |
  9124. * |-------------------------------------------------------------------|
  9125. * | tqm_flow_pntr_hi |
  9126. * |-------------------------------------------------------------------|
  9127. * | fse_meta_data |
  9128. * |-------------------------------------------------------------------|
  9129. *
  9130. * The message is interpreted as follows:
  9131. *
  9132. * dword0 - b'0:7 - msg_type: This will be set to
  9133. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  9134. *
  9135. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  9136. * for this flow entry
  9137. *
  9138. * dword0 - b'28:31 - rsvd0: Reserved for future use
  9139. *
  9140. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  9141. *
  9142. * dword1 - b'14:17 - tid
  9143. *
  9144. * dword1 - b'18:31 - rsvd1: Reserved for future use
  9145. *
  9146. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  9147. *
  9148. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  9149. *
  9150. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  9151. * given by host
  9152. */
  9153. PREPACK struct htt_tx_map_flow_info {
  9154. A_UINT32
  9155. msg_type: 8,
  9156. fse_hsh_idx: 20,
  9157. rsvd0: 4;
  9158. A_UINT32
  9159. peer_id: 14,
  9160. tid: 4,
  9161. rsvd1: 14;
  9162. A_UINT32 tqm_flow_pntr_lo;
  9163. A_UINT32 tqm_flow_pntr_hi;
  9164. struct htt_tx_flow_metadata fse_meta_data;
  9165. } POSTPACK;
  9166. /* DWORD 0 */
  9167. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  9168. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  9169. /* DWORD 1 */
  9170. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  9171. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  9172. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  9173. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  9174. /* DWORD 0 */
  9175. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  9176. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  9177. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  9178. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  9179. do { \
  9180. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  9181. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  9182. } while (0)
  9183. /* DWORD 1 */
  9184. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  9185. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  9186. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  9187. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  9188. do { \
  9189. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  9190. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  9191. } while (0)
  9192. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  9193. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  9194. HTT_TX_MAP_FLOW_INFO_TID_S)
  9195. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  9196. do { \
  9197. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  9198. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  9199. } while (0)
  9200. /*
  9201. * htt_dbg_ext_stats_status -
  9202. * present - The requested stats have been delivered in full.
  9203. * This indicates that either the stats information was contained
  9204. * in its entirety within this message, or else this message
  9205. * completes the delivery of the requested stats info that was
  9206. * partially delivered through earlier STATS_CONF messages.
  9207. * partial - The requested stats have been delivered in part.
  9208. * One or more subsequent STATS_CONF messages with the same
  9209. * cookie value will be sent to deliver the remainder of the
  9210. * information.
  9211. * error - The requested stats could not be delivered, for example due
  9212. * to a shortage of memory to construct a message holding the
  9213. * requested stats.
  9214. * invalid - The requested stat type is either not recognized, or the
  9215. * target is configured to not gather the stats type in question.
  9216. */
  9217. enum htt_dbg_ext_stats_status {
  9218. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  9219. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  9220. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  9221. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  9222. };
  9223. /**
  9224. * @brief target -> host ppdu stats upload
  9225. *
  9226. * @details
  9227. * The following field definitions describe the format of the HTT target
  9228. * to host ppdu stats indication message.
  9229. *
  9230. *
  9231. * |31 16|15 12|11 10|9 8|7 0 |
  9232. * |----------------------------------------------------------------------|
  9233. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  9234. * |----------------------------------------------------------------------|
  9235. * | ppdu_id |
  9236. * |----------------------------------------------------------------------|
  9237. * | Timestamp in us |
  9238. * |----------------------------------------------------------------------|
  9239. * | reserved |
  9240. * |----------------------------------------------------------------------|
  9241. * | type-specific stats info |
  9242. * | (see htt_ppdu_stats.h) |
  9243. * |----------------------------------------------------------------------|
  9244. * Header fields:
  9245. * - MSG_TYPE
  9246. * Bits 7:0
  9247. * Purpose: Identifies this is a PPDU STATS indication
  9248. * message.
  9249. * Value: 0x1d
  9250. * - mac_id
  9251. * Bits 9:8
  9252. * Purpose: mac_id of this ppdu_id
  9253. * Value: 0-3
  9254. * - pdev_id
  9255. * Bits 11:10
  9256. * Purpose: pdev_id of this ppdu_id
  9257. * Value: 0-3
  9258. * 0 (for rings at SOC level),
  9259. * 1/2/3 PDEV -> 0/1/2
  9260. * - payload_size
  9261. * Bits 31:16
  9262. * Purpose: total tlv size
  9263. * Value: payload_size in bytes
  9264. */
  9265. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  9266. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  9267. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  9268. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  9269. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  9270. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  9271. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  9272. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  9273. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  9274. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  9275. do { \
  9276. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  9277. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  9278. } while (0)
  9279. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  9280. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  9281. HTT_T2H_PPDU_STATS_MAC_ID_S)
  9282. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  9283. do { \
  9284. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  9285. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  9286. } while (0)
  9287. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  9288. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  9289. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  9290. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  9291. do { \
  9292. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  9293. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  9294. } while (0)
  9295. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  9296. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  9297. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  9298. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  9299. do { \
  9300. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  9301. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  9302. } while (0)
  9303. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  9304. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  9305. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  9306. /**
  9307. * @brief target -> host extended statistics upload
  9308. *
  9309. * @details
  9310. * The following field definitions describe the format of the HTT target
  9311. * to host stats upload confirmation message.
  9312. * The message contains a cookie echoed from the HTT host->target stats
  9313. * upload request, which identifies which request the confirmation is
  9314. * for, and a single stats can span over multiple HTT stats indication
  9315. * due to the HTT message size limitation so every HTT ext stats indication
  9316. * will have tag-length-value stats information elements.
  9317. * The tag-length header for each HTT stats IND message also includes a
  9318. * status field, to indicate whether the request for the stat type in
  9319. * question was fully met, partially met, unable to be met, or invalid
  9320. * (if the stat type in question is disabled in the target).
  9321. * A Done bit 1's indicate the end of the of stats info elements.
  9322. *
  9323. *
  9324. * |31 16|15 12|11|10 8|7 5|4 0|
  9325. * |--------------------------------------------------------------|
  9326. * | reserved | msg type |
  9327. * |--------------------------------------------------------------|
  9328. * | cookie LSBs |
  9329. * |--------------------------------------------------------------|
  9330. * | cookie MSBs |
  9331. * |--------------------------------------------------------------|
  9332. * | stats entry length | rsvd | D| S | stat type |
  9333. * |--------------------------------------------------------------|
  9334. * | type-specific stats info |
  9335. * | (see htt_stats.h) |
  9336. * |--------------------------------------------------------------|
  9337. * Header fields:
  9338. * - MSG_TYPE
  9339. * Bits 7:0
  9340. * Purpose: Identifies this is a extended statistics upload confirmation
  9341. * message.
  9342. * Value: 0x1c
  9343. * - COOKIE_LSBS
  9344. * Bits 31:0
  9345. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9346. * message with its preceding host->target stats request message.
  9347. * Value: LSBs of the opaque cookie specified by the host-side requestor
  9348. * - COOKIE_MSBS
  9349. * Bits 31:0
  9350. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9351. * message with its preceding host->target stats request message.
  9352. * Value: MSBs of the opaque cookie specified by the host-side requestor
  9353. *
  9354. * Stats Information Element tag-length header fields:
  9355. * - STAT_TYPE
  9356. * Bits 7:0
  9357. * Purpose: identifies the type of statistics info held in the
  9358. * following information element
  9359. * Value: htt_dbg_ext_stats_type
  9360. * - STATUS
  9361. * Bits 10:8
  9362. * Purpose: indicate whether the requested stats are present
  9363. * Value: htt_dbg_ext_stats_status
  9364. * - DONE
  9365. * Bits 11
  9366. * Purpose:
  9367. * Indicates the completion of the stats entry, this will be the last
  9368. * stats conf HTT segment for the requested stats type.
  9369. * Value:
  9370. * 0 -> the stats retrieval is ongoing
  9371. * 1 -> the stats retrieval is complete
  9372. * - LENGTH
  9373. * Bits 31:16
  9374. * Purpose: indicate the stats information size
  9375. * Value: This field specifies the number of bytes of stats information
  9376. * that follows the element tag-length header.
  9377. * It is expected but not required that this length is a multiple of
  9378. * 4 bytes.
  9379. */
  9380. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  9381. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  9382. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  9383. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  9384. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  9385. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  9386. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  9387. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  9388. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  9389. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  9390. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  9391. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  9392. do { \
  9393. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  9394. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  9395. } while (0)
  9396. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  9397. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  9398. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  9399. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  9400. do { \
  9401. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  9402. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  9403. } while (0)
  9404. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  9405. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  9406. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  9407. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  9408. do { \
  9409. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  9410. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  9411. } while (0)
  9412. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  9413. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  9414. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  9415. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  9416. do { \
  9417. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  9418. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  9419. } while (0)
  9420. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  9421. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  9422. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  9423. typedef enum {
  9424. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  9425. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  9426. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  9427. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  9428. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  9429. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  9430. /* Reserved from 128 - 255 for target internal use.*/
  9431. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  9432. } HTT_PEER_TYPE;
  9433. /** 2 word representation of MAC addr */
  9434. typedef struct {
  9435. /** upper 4 bytes of MAC address */
  9436. A_UINT32 mac_addr31to0;
  9437. /** lower 2 bytes of MAC address */
  9438. A_UINT32 mac_addr47to32;
  9439. } htt_mac_addr;
  9440. /** macro to convert MAC address from char array to HTT word format */
  9441. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  9442. (phtt_mac_addr)->mac_addr31to0 = \
  9443. (((c_macaddr)[0] << 0) | \
  9444. ((c_macaddr)[1] << 8) | \
  9445. ((c_macaddr)[2] << 16) | \
  9446. ((c_macaddr)[3] << 24)); \
  9447. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  9448. } while (0)
  9449. /**
  9450. * @brief target -> host monitor mac header indication message
  9451. *
  9452. * @details
  9453. * The following diagram shows the format of the monitor mac header message
  9454. * sent from the target to the host.
  9455. * This message is primarily sent when promiscuous rx mode is enabled.
  9456. * One message is sent per rx PPDU.
  9457. *
  9458. * |31 24|23 16|15 8|7 0|
  9459. * |-------------------------------------------------------------|
  9460. * | peer_id | reserved0 | msg_type |
  9461. * |-------------------------------------------------------------|
  9462. * | reserved1 | num_mpdu |
  9463. * |-------------------------------------------------------------|
  9464. * | struct hw_rx_desc |
  9465. * | (see wal_rx_desc.h) |
  9466. * |-------------------------------------------------------------|
  9467. * | struct ieee80211_frame_addr4 |
  9468. * | (see ieee80211_defs.h) |
  9469. * |-------------------------------------------------------------|
  9470. * | struct ieee80211_frame_addr4 |
  9471. * | (see ieee80211_defs.h) |
  9472. * |-------------------------------------------------------------|
  9473. * | ...... |
  9474. * |-------------------------------------------------------------|
  9475. *
  9476. * Header fields:
  9477. * - msg_type
  9478. * Bits 7:0
  9479. * Purpose: Identifies this is a monitor mac header indication message.
  9480. * Value: 0x20
  9481. * - peer_id
  9482. * Bits 31:16
  9483. * Purpose: Software peer id given by host during association,
  9484. * During promiscuous mode, the peer ID will be invalid (0xFF)
  9485. * for rx PPDUs received from unassociated peers.
  9486. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  9487. * - num_mpdu
  9488. * Bits 15:0
  9489. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  9490. * delivered within the message.
  9491. * Value: 1 to 32
  9492. * num_mpdu is limited to a maximum value of 32, due to buffer
  9493. * size limits. For PPDUs with more than 32 MPDUs, only the
  9494. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  9495. * the PPDU will be provided.
  9496. */
  9497. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  9498. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  9499. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  9500. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  9501. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  9502. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  9503. do { \
  9504. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  9505. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  9506. } while (0)
  9507. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  9508. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  9509. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  9510. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  9511. do { \
  9512. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  9513. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  9514. } while (0)
  9515. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  9516. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  9517. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  9518. /**
  9519. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE Message
  9520. *
  9521. * @details
  9522. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  9523. * the flow pool associated with the specified ID is resized
  9524. *
  9525. * The message would appear as follows:
  9526. *
  9527. * |31 16|15 8|7 0|
  9528. * |---------------------------------+----------------+----------------|
  9529. * | reserved0 | Msg type |
  9530. * |-------------------------------------------------------------------|
  9531. * | flow pool new size | flow pool ID |
  9532. * |-------------------------------------------------------------------|
  9533. *
  9534. * The message is interpreted as follows:
  9535. * b'0:7 - msg_type: This will be set to
  9536. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  9537. *
  9538. * b'0:15 - flow pool ID: Existing flow pool ID
  9539. *
  9540. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  9541. *
  9542. */
  9543. PREPACK struct htt_flow_pool_resize_t {
  9544. A_UINT32 msg_type:8,
  9545. reserved0:24;
  9546. A_UINT32 flow_pool_id:16,
  9547. flow_pool_new_size:16;
  9548. } POSTPACK;
  9549. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  9550. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  9551. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  9552. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  9553. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  9554. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  9555. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  9556. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  9557. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  9558. do { \
  9559. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  9560. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  9561. } while (0)
  9562. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  9563. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  9564. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  9565. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  9566. do { \
  9567. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  9568. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  9569. } while (0)
  9570. /**
  9571. * @brief host -> target channel change message
  9572. *
  9573. * @details
  9574. * the meesage is generated by FW every time FW changes channel. This will be used by host mainly
  9575. * to associate RX frames to correct channel they were received on.
  9576. * The following field definitions describe the format of the HTT target
  9577. * to host channel change message.
  9578. * |31 16|15 8|7 5|4 0|
  9579. * |------------------------------------------------------------|
  9580. * | reserved | MSG_TYPE |
  9581. * |------------------------------------------------------------|
  9582. * | CHAN_MHZ |
  9583. * |------------------------------------------------------------|
  9584. * | BAND_CENTER_FREQ1 |
  9585. * |------------------------------------------------------------|
  9586. * | BAND_CENTER_FREQ2 |
  9587. * |------------------------------------------------------------|
  9588. * | CHAN_PHY_MODE |
  9589. * |------------------------------------------------------------|
  9590. * Header fields:
  9591. * - MSG_TYPE
  9592. * Bits 7:0
  9593. * Value: 0xf
  9594. * - CHAN_MHZ
  9595. * Bits 31:0
  9596. * Purpose: frequency of the primary 20mhz channel.
  9597. * - BAND_CENTER_FREQ1
  9598. * Bits 31:0
  9599. * Purpose: centre frequency of the full channel.
  9600. * - BAND_CENTER_FREQ2
  9601. * Bits 31:0
  9602. * Purpose: centre frequency2 of the channel. is only valid for 11acvht 80plus80.
  9603. * - CHAN_PHY_MODE
  9604. * Bits 31:0
  9605. * Purpose: phy mode of the channel.
  9606. */
  9607. PREPACK struct htt_chan_change_msg {
  9608. A_UINT32 chan_mhz; /* frequency in mhz */
  9609. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz*/
  9610. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  9611. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  9612. } POSTPACK;
  9613. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  9614. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  9615. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  9616. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  9617. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  9618. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  9619. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  9620. /*
  9621. * The read and write indices point to the data within the host buffer.
  9622. * Because the first 4 bytes of the host buffer is used for the read index and
  9623. * the next 4 bytes for the write index, the data itself starts at offset 8.
  9624. * The read index and write index are the byte offsets from the base of the
  9625. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  9626. * Refer the ASCII text picture below.
  9627. */
  9628. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  9629. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  9630. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  9631. /*
  9632. ***************************************************************************
  9633. *
  9634. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  9635. *
  9636. ***************************************************************************
  9637. *
  9638. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  9639. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  9640. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  9641. * written into the Host memory region mentioned below.
  9642. *
  9643. * Read index is updated by the Host. At any point of time, the read index will
  9644. * indicate the index that will next be read by the Host. The read index is
  9645. * in units of bytes offset from the base of the meta-data buffer.
  9646. *
  9647. * Write index is updated by the FW. At any point of time, the write index will
  9648. * indicate from where the FW can start writing any new data. The write index is
  9649. * in units of bytes offset from the base of the meta-data buffer.
  9650. *
  9651. * If the Host is not fast enough in reading the CFR data, any new capture data
  9652. * would be dropped if there is no space left to write the new captures.
  9653. *
  9654. * The last 4 bytes of the memory region will have the magic pattern
  9655. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  9656. * not overrun the host buffer.
  9657. *
  9658. * ,--------------------. read and write indices store the
  9659. * | | byte offset from the base of the
  9660. * | ,--------+--------. meta-data buffer to the next
  9661. * | | | | location within the data buffer
  9662. * | | v v that will be read / written
  9663. * ************************************************************************
  9664. * * Read * Write * * Magic *
  9665. * * index * index * CFR data1 ...... CFR data N * pattern *
  9666. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  9667. * ************************************************************************
  9668. * |<---------- data buffer ---------->|
  9669. *
  9670. * |<----------------- meta-data buffer allocated in Host ----------------|
  9671. *
  9672. * Note:
  9673. * - Considering the 4 bytes needed to store the Read index (R) and the
  9674. * Write index (W), the initial value is as follows:
  9675. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  9676. * - Buffer empty condition:
  9677. * R = W
  9678. *
  9679. * Regarding CFR data format:
  9680. * --------------------------
  9681. *
  9682. * Each CFR tone is stored in HW as 16-bits with the following format:
  9683. * {bits[15:12], bits[11:6], bits[5:0]} =
  9684. * {unsigned exponent (4 bits),
  9685. * signed mantissa_real (6 bits),
  9686. * signed mantissa_imag (6 bits)}
  9687. *
  9688. * CFR_real = mantissa_real * 2^(exponent-5)
  9689. * CFR_imag = mantissa_imag * 2^(exponent-5)
  9690. *
  9691. *
  9692. * The CFR data is written to the 16-bit unsigned output array (buff) in
  9693. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  9694. *
  9695. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  9696. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  9697. * .
  9698. * .
  9699. * .
  9700. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  9701. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  9702. */
  9703. /* Bandwidth of peer CFR captures */
  9704. typedef enum {
  9705. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  9706. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  9707. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  9708. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  9709. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  9710. HTT_PEER_CFR_CAPTURE_BW_MAX,
  9711. } HTT_PEER_CFR_CAPTURE_BW;
  9712. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  9713. * was captured
  9714. */
  9715. typedef enum {
  9716. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  9717. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  9718. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  9719. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  9720. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  9721. } HTT_PEER_CFR_CAPTURE_MODE;
  9722. typedef enum {
  9723. /* This message type is currently used for the below purpose:
  9724. *
  9725. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  9726. * wmi_peer_cfr_capture_cmd. The associated memory region gets allocated
  9727. * through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID
  9728. */
  9729. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  9730. /* Always keep this last */
  9731. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  9732. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  9733. /**
  9734. * @brief target -> host CFR dump completion indication message definition
  9735. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  9736. *
  9737. * @details
  9738. * The following diagram shows the format of the Channel Frequency Response
  9739. * (CFR) dump completion indication. This inidcation is sent to the Host when
  9740. * the channel capture of a peer is copied by Firmware into the Host memory
  9741. *
  9742. * **************************************************************************
  9743. *
  9744. * Message format when the CFR capture message type is
  9745. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  9746. *
  9747. * **************************************************************************
  9748. *
  9749. * |31 16|15 |7 0|
  9750. * |----------------------------------------------------------------|
  9751. * header: | reserved | msg_type |
  9752. * word 0 | | |
  9753. * |----------------------------------------------------------------|
  9754. * payload: | cfr_capture_msg_type |
  9755. * word 1 | |
  9756. * |----------------------------------------------------------------|
  9757. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  9758. * word 2 | | | | | | | | |
  9759. * |----------------------------------------------------------------|
  9760. * | mac_addr31to0 |
  9761. * word 3 | |
  9762. * |----------------------------------------------------------------|
  9763. * | unused / reserved | mac_addr47to32 |
  9764. * word 4 | | |
  9765. * |----------------------------------------------------------------|
  9766. * | index |
  9767. * word 5 | |
  9768. * |----------------------------------------------------------------|
  9769. * | length |
  9770. * word 6 | |
  9771. * |----------------------------------------------------------------|
  9772. * | timestamp |
  9773. * word 7 | |
  9774. * |----------------------------------------------------------------|
  9775. * | counter |
  9776. * word 8 | |
  9777. * |----------------------------------------------------------------|
  9778. * | chan_mhz |
  9779. * word 9 | |
  9780. * |----------------------------------------------------------------|
  9781. * | band_center_freq1 |
  9782. * word 10 | |
  9783. * |----------------------------------------------------------------|
  9784. * | band_center_freq2 |
  9785. * word 11 | |
  9786. * |----------------------------------------------------------------|
  9787. * | chan_phy_mode |
  9788. * word 12 | |
  9789. * |----------------------------------------------------------------|
  9790. * where,
  9791. * req_id - memory request id (mem_req_id explained below)
  9792. * S - status field (status explained below)
  9793. * capbw - capture bandwidth (capture_bw explained below)
  9794. * mode - mode of capture (mode explained below)
  9795. * sts - space time streams (sts_count explained below)
  9796. * chbw - channel bandwidth (channel_bw explained below)
  9797. * captype - capture type (cap_type explained below)
  9798. *
  9799. * The following field definitions describe the format of the CFR dump
  9800. * completion indication sent from the target to the host
  9801. *
  9802. * Header fields:
  9803. *
  9804. * Word 0
  9805. * - msg_type
  9806. * Bits 7:0
  9807. * Purpose: Identifies this as CFR TX completion indication
  9808. * Value: HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  9809. * - reserved
  9810. * Bits 31:8
  9811. * Purpose: Reserved
  9812. * Value: 0
  9813. *
  9814. * Payload fields:
  9815. *
  9816. * Word 1
  9817. * - cfr_capture_msg_type
  9818. * Bits 31:0
  9819. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  9820. * to specify the format used for the remainder of the message
  9821. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  9822. * (currently only MSG_TYPE_1 is defined)
  9823. *
  9824. * Word 2
  9825. * - mem_req_id
  9826. * Bits 6:0
  9827. * Purpose: Contain the mem request id of the region where the CFR capture
  9828. * has been stored - of type WMI_HOST_MEM_REQ_ID
  9829. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID
  9830. * - status
  9831. * Bit 7
  9832. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  9833. * Value: 1 (True) - Successful; 0 (False) - Not successful
  9834. * - capture_bw
  9835. * Bits 10:8
  9836. * Purpose: Carry the bandwidth of the CFR capture
  9837. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  9838. * - mode
  9839. * Bits 13:11
  9840. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  9841. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  9842. * - sts_count
  9843. * Bits 16:14
  9844. * Purpose: Carry the number of space time streams
  9845. * Value: Number of space time streams
  9846. * - channel_bw
  9847. * Bits 19:17
  9848. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  9849. * measurement
  9850. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  9851. * - cap_type
  9852. * Bits 23:20
  9853. * Purpose: Carry the type of the capture
  9854. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  9855. * - vdev_id
  9856. * Bits 31:24
  9857. * Purpose: Carry the virtual device id
  9858. * Value: vdev ID
  9859. *
  9860. * Word 3
  9861. * - mac_addr31to0
  9862. * Bits 31:0
  9863. * Purpose: Contain the bits 31:0 of the peer MAC address
  9864. * Value: Bits 31:0 of the peer MAC address
  9865. *
  9866. * Word 4
  9867. * - mac_addr47to32
  9868. * Bits 15:0
  9869. * Purpose: Contain the bits 47:32 of the peer MAC address
  9870. * Value: Bits 47:32 of the peer MAC address
  9871. *
  9872. * Word 5
  9873. * - index
  9874. * Bits 31:0
  9875. * Purpose: Contain the index at which this CFR dump was written in the Host
  9876. * allocated memory. This index is the number of bytes from the base address.
  9877. * Value: Index position
  9878. *
  9879. * Word 6
  9880. * - length
  9881. * Bits 31:0
  9882. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  9883. * Value: Length of the CFR capture of the peer
  9884. *
  9885. * Word 7
  9886. * - timestamp
  9887. * Bits 31:0
  9888. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  9889. * clock used for this timestamp is private to the target and not visible to
  9890. * the host i.e., Host can interpret only the relative timestamp deltas from
  9891. * one message to the next, but can't interpret the absolute timestamp from a
  9892. * single message.
  9893. * Value: Timestamp in microseconds
  9894. *
  9895. * Word 8
  9896. * - counter
  9897. * Bits 31:0
  9898. * Purpose: Carry the count of the current CFR capture from FW. This is
  9899. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  9900. * in host memory)
  9901. * Value: Count of the current CFR capture
  9902. *
  9903. * Word 9
  9904. * - chan_mhz
  9905. * Bits 31:0
  9906. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  9907. * Value: Primary 20 channel frequency
  9908. *
  9909. * Word 10
  9910. * - band_center_freq1
  9911. * Bits 31:0
  9912. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  9913. * Value: Center frequency 1 in MHz
  9914. *
  9915. * Word 11
  9916. * - band_center_freq2
  9917. * Bits 31:0
  9918. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  9919. * the VDEV
  9920. * 80plus80 mode
  9921. * Value: Center frequency 2 in MHz
  9922. *
  9923. * Word 12
  9924. * - chan_phy_mode
  9925. * Bits 31:0
  9926. * Purpose: Carry the phy mode of the channel, of the VDEV
  9927. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  9928. */
  9929. PREPACK struct htt_cfr_dump_ind_type_1 {
  9930. A_UINT32 mem_req_id:7,
  9931. status:1,
  9932. capture_bw:3,
  9933. mode:3,
  9934. sts_count:3,
  9935. channel_bw:3,
  9936. cap_type:4,
  9937. vdev_id:8;
  9938. htt_mac_addr addr;
  9939. A_UINT32 index;
  9940. A_UINT32 length;
  9941. A_UINT32 timestamp;
  9942. A_UINT32 counter;
  9943. struct htt_chan_change_msg chan;
  9944. } POSTPACK;
  9945. PREPACK struct htt_cfr_dump_compl_ind {
  9946. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  9947. union {
  9948. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  9949. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  9950. /* If there is a need to change the memory layout and its associated
  9951. * HTT indication format, a new CFR capture message type can be
  9952. * introduced and added into this union.
  9953. */
  9954. };
  9955. } POSTPACK;
  9956. /*
  9957. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  9958. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  9959. */
  9960. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  9961. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  9962. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  9963. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  9964. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  9965. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  9966. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  9967. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  9968. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  9969. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  9970. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  9971. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  9972. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  9973. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  9974. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  9975. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  9976. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  9977. do { \
  9978. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  9979. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  9980. } while (0)
  9981. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  9982. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  9983. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  9984. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  9985. do { \
  9986. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  9987. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  9988. } while (0)
  9989. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  9990. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  9991. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  9992. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  9993. do { \
  9994. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  9995. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  9996. } while (0)
  9997. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  9998. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  9999. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  10000. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  10001. do { \
  10002. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  10003. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  10004. } while (0)
  10005. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  10006. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  10007. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  10008. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  10009. do { \
  10010. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  10011. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  10012. } while (0)
  10013. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  10014. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  10015. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  10016. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  10017. do { \
  10018. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  10019. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  10020. } while (0)
  10021. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  10022. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  10023. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  10024. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  10025. do { \
  10026. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  10027. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  10028. } while (0)
  10029. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  10030. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  10031. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  10032. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  10033. do { \
  10034. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  10035. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  10036. } while (0)
  10037. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  10038. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  10039. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  10040. #endif