htt.h 282 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034
  1. /*
  2. * Copyright (c) 2011-2015 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 <a_types.h> /* A_UINT32 */
  34. #include <a_osapi.h> /* PREPACK, POSTPACK */
  35. #ifdef ATHR_WIN_NWF
  36. #pragma warning(disable:4214) /*bit field types other than int */
  37. #endif
  38. #include "wlan_defs.h"
  39. #include <htt_common.h>
  40. /*
  41. * Unless explicitly specified to use 64 bits to represent physical addresses
  42. * (or more precisely, bus addresses), default to 32 bits.
  43. */
  44. #ifndef HTT_PADDR64
  45. #define HTT_PADDR64 0
  46. #endif
  47. #ifndef offsetof
  48. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  49. #endif
  50. /*
  51. * HTT version history:
  52. * 1.0 initial numbered version
  53. * 1.1 modifications to STATS messages.
  54. * These modifications are not backwards compatible, but since the
  55. * STATS messages themselves are non-essential (they are for debugging),
  56. * the 1.1 version of the HTT message library as a whole is compatible
  57. * with the 1.0 version.
  58. * 1.2 reset mask IE added to STATS_REQ message
  59. * 1.3 stat config IE added to STATS_REQ message
  60. *----
  61. * 2.0 FW rx PPDU desc added to RX_IND message
  62. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  63. *----
  64. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  65. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  66. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  67. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  68. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  69. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  70. * 3.5 Added flush and fail stats in rx_reorder stats structure
  71. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  72. * 3.7 Made changes to support EOS Mac_core 3.0
  73. * 3.8 Added txq_group information element definition;
  74. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  75. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  76. * Allow buffer addresses in bus-address format to be stored as
  77. * either 32 bits or 64 bits.
  78. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  79. * messages to specify which HTT options to use.
  80. * Initial TLV options cover:
  81. * - whether to use 32 or 64 bits to represent LL bus addresses
  82. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  83. * - how many tx queue groups to use
  84. * 3.11 Expand rx debug stats:
  85. * - Expand the rx_reorder_stats struct with stats about successful and
  86. * failed rx buffer allcoations.
  87. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  88. * the supply, allocation, use, and recycling of rx buffers for the
  89. * "remote ring" of rx buffers in host member in LL systems.
  90. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  91. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  92. * 3.13 Add constants + macros to support 64-bit address format for the
  93. * tx fragments descriptor, the rx ring buffer, and the rx ring
  94. * index shadow register.
  95. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  96. * - Add htt_tx_msdu_desc_ext_t struct def.
  97. * - Add TLV to specify whether the target supports the HTT tx MSDU
  98. * extension descriptor.
  99. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  100. * "extension" bit, to specify whether a HTT tx MSDU extension
  101. * descriptor is present.
  102. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  103. * (This allows the host to obtain key information about the MSDU
  104. * from a memory location already in the cache, rather than taking a
  105. * cache miss for each MSDU by reading the HW rx descs.)
  106. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  107. * whether a copy-engine classification result is appended to TX_FRM.
  108. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  109. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  110. * tx frames in the target after the peer has already been deleted.
  111. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  112. * 3.20 Expand rx_reorder_stats.
  113. * 3.21 Add optional rx channel spec to HL RX_IND.
  114. * 3.22 Expand rx_reorder_stats
  115. * (distinguish duplicates within vs. outside block ack window)
  116. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  117. * The justified rate is calculated by two steps. The first is to multiply
  118. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  119. * by a low pass filter.
  120. * This change allows HL download scheduling to consider the WLAN rate
  121. * that will be used for transmitting the downloaded frames.
  122. * 3.24 Expand rx_reorder_stats
  123. * (add counter for decrypt / MIC errors)
  124. * 3.25 Expand rx_reorder_stats
  125. * (add counter of frames received into both local + remote rings)
  126. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  127. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  128. * 3.27 Add a new interface for flow-control. The following t2h messages have
  129. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  130. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  131. */
  132. #define HTT_CURRENT_VERSION_MAJOR 3
  133. #define HTT_CURRENT_VERSION_MINOR 27
  134. #define HTT_NUM_TX_FRAG_DESC 1024
  135. #define HTT_WIFI_IP_VERSION(x, y) ((x) == (y))
  136. #define HTT_CHECK_SET_VAL(field, val) \
  137. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  138. /* macros to assist in sign-extending fields from HTT messages */
  139. #define HTT_SIGN_BIT_MASK(field) \
  140. ((field ## _M + (1 << field ## _S)) >> 1)
  141. #define HTT_SIGN_BIT(_val, field) \
  142. (_val & HTT_SIGN_BIT_MASK(field))
  143. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  144. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  145. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  146. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  147. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  148. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  149. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  150. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  151. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  152. /*
  153. * TEMPORARY:
  154. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  155. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  156. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  157. * updated.
  158. */
  159. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  160. /*
  161. * TEMPORARY:
  162. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  163. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  164. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  165. * updated.
  166. */
  167. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  168. /* HTT Access Category values */
  169. enum HTT_AC_WMM {
  170. /* WMM Access Categories */
  171. HTT_AC_WMM_BE = 0x0,
  172. HTT_AC_WMM_BK = 0x1,
  173. HTT_AC_WMM_VI = 0x2,
  174. HTT_AC_WMM_VO = 0x3,
  175. /* extension Access Categories */
  176. HTT_AC_EXT_NON_QOS = 0x4,
  177. HTT_AC_EXT_UCAST_MGMT = 0x5,
  178. HTT_AC_EXT_MCAST_DATA = 0x6,
  179. HTT_AC_EXT_MCAST_MGMT = 0x7,
  180. };
  181. enum HTT_AC_WMM_MASK {
  182. /* WMM Access Categories */
  183. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  184. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  185. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  186. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  187. /* extension Access Categories */
  188. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  189. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  190. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  191. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  192. };
  193. #define HTT_AC_MASK_WMM \
  194. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  195. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  196. #define HTT_AC_MASK_EXT \
  197. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  198. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  199. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  200. /*
  201. * htt_dbg_stats_type -
  202. * bit positions for each stats type within a stats type bitmask
  203. * The bitmask contains 24 bits.
  204. */
  205. enum htt_dbg_stats_type {
  206. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  207. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  208. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  209. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  210. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  211. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  212. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  213. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  214. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  215. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  216. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  217. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  218. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  219. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  220. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  221. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  222. /* bits 16-23 currently reserved */
  223. /* keep this last */
  224. HTT_DBG_NUM_STATS
  225. };
  226. /*=== HTT option selection TLVs ===
  227. * Certain HTT messages have alternatives or options.
  228. * For such cases, the host and target need to agree on which option to use.
  229. * Option specification TLVs can be appended to the VERSION_REQ and
  230. * VERSION_CONF messages to select options other than the default.
  231. * These TLVs are entirely optional - if they are not provided, there is a
  232. * well-defined default for each option. If they are provided, they can be
  233. * provided in any order. Each TLV can be present or absent independent of
  234. * the presence / absence of other TLVs.
  235. *
  236. * The HTT option selection TLVs use the following format:
  237. * |31 16|15 8|7 0|
  238. * |---------------------------------+----------------+----------------|
  239. * | value (payload) | length | tag |
  240. * |-------------------------------------------------------------------|
  241. * The value portion need not be only 2 bytes; it can be extended by any
  242. * integer number of 4-byte units. The total length of the TLV, including
  243. * the tag and length fields, must be a multiple of 4 bytes. The length
  244. * field specifies the total TLV size in 4-byte units. Thus, the typical
  245. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  246. * field, would store 0x1 in its length field, to show that the TLV occupies
  247. * a single 4-byte unit.
  248. */
  249. /*--- TLV header format - applies to all HTT option TLVs ---*/
  250. enum HTT_OPTION_TLV_TAGS {
  251. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  252. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  253. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  254. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  255. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  256. };
  257. PREPACK struct htt_option_tlv_header_t {
  258. A_UINT8 tag;
  259. A_UINT8 length;
  260. } POSTPACK;
  261. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  262. #define HTT_OPTION_TLV_TAG_S 0
  263. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  264. #define HTT_OPTION_TLV_LENGTH_S 8
  265. /*
  266. * value0 - 16 bit value field stored in word0
  267. * The TLV's value field may be longer than 2 bytes, in which case
  268. * the remainder of the value is stored in word1, word2, etc.
  269. */
  270. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  271. #define HTT_OPTION_TLV_VALUE0_S 16
  272. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  273. do { \
  274. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  275. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  276. } while (0)
  277. #define HTT_OPTION_TLV_TAG_GET(word) \
  278. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  279. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  280. do { \
  281. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  282. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  283. } while (0)
  284. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  285. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  286. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  287. do { \
  288. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  289. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  290. } while (0)
  291. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  292. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  293. /*--- format of specific HTT option TLVs ---*/
  294. /*
  295. * HTT option TLV for specifying LL bus address size
  296. * Some chips require bus addresses used by the target to access buffers
  297. * within the host's memory to be 32 bits; others require bus addresses
  298. * used by the target to access buffers within the host's memory to be
  299. * 64 bits.
  300. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  301. * a suffix to the VERSION_CONF message to specify which bus address format
  302. * the target requires.
  303. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  304. * default to providing bus addresses to the target in 32-bit format.
  305. */
  306. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  307. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  308. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  309. };
  310. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  311. struct htt_option_tlv_header_t hdr;
  312. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  313. } POSTPACK;
  314. /*
  315. * HTT option TLV for specifying whether HL systems should indicate
  316. * over-the-air tx completion for individual frames, or should instead
  317. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  318. * requests an OTA tx completion for a particular tx frame.
  319. * This option does not apply to LL systems, where the TX_COMPL_IND
  320. * is mandatory.
  321. * This option is primarily intended for HL systems in which the tx frame
  322. * downloads over the host --> target bus are as slow as or slower than
  323. * the transmissions over the WLAN PHY. For cases where the bus is faster
  324. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  325. * and consquently will send one TX_COMPL_IND message that covers several
  326. * tx frames. For cases where the WLAN PHY is faster than the bus,
  327. * the target will end up transmitting very short A-MPDUs, and consequently
  328. * sending many TX_COMPL_IND messages, which each cover a very small number
  329. * of tx frames.
  330. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  331. * a suffix to the VERSION_REQ message to request whether the host desires to
  332. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  333. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  334. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  335. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  336. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  337. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  338. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  339. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  340. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  341. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  342. * TLV.
  343. */
  344. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  345. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  346. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  347. };
  348. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  349. struct htt_option_tlv_header_t hdr;
  350. A_UINT16 hl_suppress_tx_compl_ind;/*HL_SUPPRESS_TX_COMPL_IND enum*/
  351. } POSTPACK;
  352. /*
  353. * HTT option TLV for specifying how many tx queue groups the target
  354. * may establish.
  355. * This TLV specifies the maximum value the target may send in the
  356. * txq_group_id field of any TXQ_GROUP information elements sent by
  357. * the target to the host. This allows the host to pre-allocate an
  358. * appropriate number of tx queue group structs.
  359. *
  360. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  361. * a suffix to the VERSION_REQ message to specify whether the host supports
  362. * tx queue groups at all, and if so if there is any limit on the number of
  363. * tx queue groups that the host supports.
  364. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  365. * a suffix to the VERSION_CONF message. If the host has specified in the
  366. * VER_REQ message a limit on the number of tx queue groups the host can
  367. * supprt, the target shall limit its specification of the maximum tx groups
  368. * to be no larger than this host-specified limit.
  369. *
  370. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  371. * shall preallocate 4 tx queue group structs, and the target shall not
  372. * specify a txq_group_id larger than 3.
  373. */
  374. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  375. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  376. /*
  377. * values 1 through N specify the max number of tx queue groups
  378. * the sender supports
  379. */
  380. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  381. };
  382. /* TEMPORARY backwards-compatibility alias for a typo fix -
  383. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  384. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  385. * to support the old name (with the typo) until all references to the
  386. * old name are replaced with the new name.
  387. */
  388. #define htt_option_tlv_mac_tx_queue_groups_t \
  389. htt_option_tlv_max_tx_queue_groups_t
  390. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  391. struct htt_option_tlv_header_t hdr;
  392. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  393. } POSTPACK;
  394. /*
  395. * HTT option TLV for specifying whether the target supports an extended
  396. * version of the HTT tx descriptor. If the target provides this TLV
  397. * and specifies in the TLV that the target supports an extended version
  398. * of the HTT tx descriptor, the target must check the "extension" bit in
  399. * the HTT tx descriptor, and if the extension bit is set, to expect a
  400. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  401. * descriptor. Furthermore, the target must provide room for the HTT
  402. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  403. * This option is intended for systems where the host needs to explicitly
  404. * control the transmission parameters such as tx power for individual
  405. * tx frames.
  406. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  407. * as a suffix to the VERSION_CONF message to explicitly specify whether
  408. * the target supports the HTT tx MSDU extension descriptor.
  409. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  410. * by the host as lack of target support for the HTT tx MSDU extension
  411. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  412. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  413. * the HTT tx MSDU extension descriptor.
  414. * The host is not required to provide the HTT tx MSDU extension descriptor
  415. * just because the target supports it; the target must check the
  416. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  417. * extension descriptor is present.
  418. */
  419. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  420. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  421. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  422. };
  423. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  424. struct htt_option_tlv_header_t hdr;
  425. A_UINT16 tx_msdu_desc_ext_support;/*SUPPORT_TX_MSDU_DESC_EXT enum*/
  426. } POSTPACK;
  427. /*=== host -> target messages ===============================================*/
  428. enum htt_h2t_msg_type {
  429. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  430. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  431. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  432. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  433. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  434. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  435. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  436. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  437. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  438. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  439. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /*per vdev amsdu subfrm limit*/
  440. /* keep this last */
  441. HTT_H2T_NUM_MSGS
  442. };
  443. /*
  444. * HTT host to target message type -
  445. * stored in bits 7:0 of the first word of the message
  446. */
  447. #define HTT_H2T_MSG_TYPE_M 0xff
  448. #define HTT_H2T_MSG_TYPE_S 0
  449. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  450. do { \
  451. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  452. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  453. } while (0)
  454. #define HTT_H2T_MSG_TYPE_GET(word) \
  455. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  456. /**
  457. * @brief target -> host version number request message definition
  458. *
  459. * |31 24|23 16|15 8|7 0|
  460. * |----------------+----------------+----------------+----------------|
  461. * | reserved | msg type |
  462. * |-------------------------------------------------------------------|
  463. * : option request TLV (optional) |
  464. * :...................................................................:
  465. *
  466. * The VER_REQ message may consist of a single 4-byte word, or may be
  467. * extended with TLVs that specify which HTT options the host is requesting
  468. * from the target.
  469. * The following option TLVs may be appended to the VER_REQ message:
  470. * - HL_SUPPRESS_TX_COMPL_IND
  471. * - HL_MAX_TX_QUEUE_GROUPS
  472. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  473. * may be appended to the VER_REQ message (but only one TLV of each type).
  474. *
  475. * Header fields:
  476. * - MSG_TYPE
  477. * Bits 7:0
  478. * Purpose: identifies this as a version number request message
  479. * Value: 0x0
  480. */
  481. #define HTT_VER_REQ_BYTES 4
  482. /* TBDXXX: figure out a reasonable number */
  483. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  484. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  485. /**
  486. * @brief HTT tx MSDU descriptor
  487. *
  488. * @details
  489. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  490. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  491. * the target firmware needs for the FW's tx processing, particularly
  492. * for creating the HW msdu descriptor.
  493. * The same HTT tx descriptor is used for HL and LL systems, though
  494. * a few fields within the tx descriptor are used only by LL or
  495. * only by HL.
  496. * The HTT tx descriptor is defined in two manners: by a struct with
  497. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  498. * definitions.
  499. * The target should use the struct def, for simplicitly and clarity,
  500. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  501. * neutral. Specifically, the host shall use the get/set macros built
  502. * around the mask + shift defs.
  503. */
  504. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  505. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  506. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  507. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  508. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  509. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  510. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  511. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  512. #define HTT_TX_VDEV_ID_WORD 0
  513. #define HTT_TX_VDEV_ID_MASK 0x3f
  514. #define HTT_TX_VDEV_ID_SHIFT 16
  515. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  516. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  517. #define HTT_TX_MSDU_LEN_DWORD 1
  518. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  519. /*
  520. * HTT_VAR_PADDR macros
  521. * Allow physical / bus addresses to be either a single 32-bit value,
  522. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  523. */
  524. /*
  525. * Note that in this macro A_UINT32 has been converted to
  526. * uint32_t only to address checkpath errors caused by declaring
  527. * var_name as A_UINT32.
  528. */
  529. #define HTT_VAR_PADDR32(var_name) uint32_t (var_name)
  530. #define HTT_VAR_PADDR64_LE(var_name) \
  531. struct { \
  532. /* little-endian: lo precedes hi */ \
  533. A_UINT32 lo; \
  534. A_UINT32 hi; \
  535. } var_name
  536. /*
  537. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  538. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  539. * addresses are stored in a XXX-bit field.
  540. * This macro is used to define both htt_tx_msdu_desc32_t and
  541. * htt_tx_msdu_desc64_t structs.
  542. */
  543. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  544. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  545. { \
  546. /* DWORD 0: flags and meta-data */ \
  547. A_UINT32 \
  548. msg_type:8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  549. \
  550. /* pkt_subtype - \
  551. * Detailed specification of the tx frame contents, extending the \
  552. * general specification provided by pkt_type. \
  553. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  554. *pkt_type | pkt_subtype \
  555. *============================================================== \
  556. *802.3 | bit 0:3 - Reserved \
  557. * | bit 4: 0x0 - Copy-Engine Classification Results \
  558. * | not appended to the HTT message \
  559. * | 0x1 - Copy-Engine Classification Results \
  560. * | appended to the HTT message in the \
  561. * | format: \
  562. * | [HTT tx desc, frame header, \
  563. * | CE classification results] \
  564. * | The CE classification results begin \
  565. * | at the next 4-byte boundary after \
  566. * | the frame header. \
  567. *------------+------------------------------------------------- \
  568. *Eth2 | bit 0:3 - Reserved \
  569. * | bit 4: 0x0 - Copy-Engine Classification Results \
  570. * | not appended to the HTT message \
  571. * | 0x1 - Copy-Engine Classification Results \
  572. * | appended to the HTT message. \
  573. * | See the above specification of the \
  574. * | CE classification results location. \
  575. *------------+------------------------------------------------- \
  576. *native WiFi | bit 0:3 - Reserved \
  577. * | bit 4: 0x0 - Copy-Engine Classification Results \
  578. * | not appended to the HTT message \
  579. * | 0x1 - Copy-Engine Classification Results \
  580. * | appended to the HTT message. \
  581. * | See the above specification of the \
  582. * | CE classification results location. \
  583. *------------+------------------------------------------------- \
  584. *mgmt | 0x0 - 802.11 MAC header absent \
  585. * | 0x1 - 802.11 MAC header present \
  586. *------------+------------------------------------------------- \
  587. *raw | bit 0: 0x0 - 802.11 MAC header absent \
  588. * | 0x1 - 802.11 MAC header present \
  589. * | bit 1: 0x0 - allow aggregation \
  590. * | 0x1 - don't allow aggregation \
  591. * | bit 2: 0x0 - perform encryption \
  592. * | 0x1 - don't perform encryption \
  593. * | bit 3: 0x0 - perform tx classification / queuing \
  594. * | 0x1 - don't perform tx classification; \
  595. * | insert the frame into the "misc" \
  596. * | tx queue \
  597. * | bit 4: 0x0 - Copy-Engine Classification Results \
  598. * | not appended to the HTT message \
  599. * | 0x1 - Copy-Engine Classification Results \
  600. * | appended to the HTT message. \
  601. * | See the above specification of the \
  602. * | CE classification results location. \
  603. */ \
  604. pkt_subtype:5, \
  605. \
  606. /* pkt_type - \
  607. * General specification of the tx frame contents. \
  608. * The htt_pkt_type enum should be used to specify \
  609. * and check the value of this field. \
  610. */ \
  611. pkt_type:3, \
  612. \
  613. /* vdev_id - \
  614. * ID for the vdev that is sending this tx frame. \
  615. * For certain non-standard packet types, e.g. pkt_type == raw \
  616. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  617. * This field is used primarily for determining where to queue \
  618. * broadcast and multicast frames. \
  619. */ \
  620. vdev_id:6, \
  621. /* ext_tid - \
  622. * The extended traffic ID. \
  623. * If the TID is unknown, the extended TID is set to \
  624. * HTT_TX_EXT_TID_INVALID. \
  625. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  626. * value of the QoS TID. \
  627. * If the tx frame is non-QoS data, then the extended TID is set to \
  628. * HTT_TX_EXT_TID_NON_QOS. \
  629. * If the tx frame is multicast or broadcast, then the extended TID \
  630. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  631. */ \
  632. ext_tid:5, \
  633. \
  634. /* postponed - \
  635. * This flag indicates whether the tx frame has been downloaded to \
  636. * the target before but discarded by the target, and now is being \
  637. * downloaded again; or if this is a new frame that is being \
  638. * downloaded for the first time. \
  639. * This flag allows the target to determine the correct order for \
  640. * transmitting new vs. old frames. \
  641. * value: 0 -> new frame, 1 -> re-send of a previously
  642. * sent frame \
  643. * This flag only applies to HL systems, since in LL systems, \
  644. * the tx flow control is handled entirely within the target. \
  645. */ \
  646. postponed:1, \
  647. \
  648. /* extension - \
  649. * This flag indicates whether a HTT tx MSDU extension descriptor\
  650. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor.\
  651. * \
  652. * 0x0 - no extension MSDU descriptor is present \
  653. * 0x1 - an extension MSDU descriptor immediately follows the \
  654. * regular MSDU descriptor \
  655. */ \
  656. extension:1, \
  657. \
  658. /* cksum_offload - \
  659. * This flag indicates whether checksum offload is enabled or not \
  660. * for this frame. Target FW use this flag to turn on HW checksumming \
  661. * 0x0 - No checksum offload \
  662. * 0x1 - L3 header checksum only \
  663. * 0x2 - L4 checksum only \
  664. * 0x3 - L3 header checksum + L4 checksum \
  665. */ \
  666. cksum_offload:2, \
  667. \
  668. /* tx_comp_req - \
  669. * This flag indicates whether Tx Completion \
  670. * from fw is required or not. \
  671. * This flag is only relevant if tx completion is not \
  672. * universally enabled. \
  673. * For all LL systems, tx completion is mandatory, \
  674. * so this flag will be irrelevant. \
  675. * For HL systems tx completion is optional, but HL systems in which \
  676. * the bus throughput exceeds the WLAN throughput will \
  677. * probably want to always use tx completion, and thus \
  678. * would not check this flag. \
  679. * This flag is required when tx completions are not used universally, \
  680. * but are still required for certain tx frames for which \
  681. * an OTA delivery acknowledgment is needed by the host. \
  682. * In practice, this would be for HL systems in which the \
  683. * bus throughput is less than the WLAN throughput. \
  684. * \
  685. * 0x0 - Tx Completion Indication from Fw not required \
  686. * 0x1 - Tx Completion Indication from Fw is required \
  687. */ \
  688. tx_compl_req:1; \
  689. \
  690. \
  691. /* DWORD 1: MSDU length and ID */ \
  692. A_UINT32 \
  693. len:16, /* MSDU length, in bytes */ \
  694. id:16; /* MSDU ID used to identify the MSDU to the host, \
  695. * and this id is used to calculate fragmentation \
  696. * descriptor pointer inside the target based on \
  697. * the base address, configured inside the target. \
  698. */ \
  699. \
  700. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  701. /* frags_desc_ptr - \
  702. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  703. * where the tx frame's fragments reside in memory. \
  704. * This field only applies to LL systems, since in HL systems the \
  705. * (degenerate single-fragment) fragmentation descriptor is created \
  706. * within the target. \
  707. */ \
  708. _paddr__frags_desc_ptr_; \
  709. \
  710. /* DWORD 3 (or 4): peerid, chanfreq */ \
  711. /* \
  712. * Peer ID : Target can use this value to know which peer-id packet \
  713. * destined to. \
  714. * It's intended to be specified by host in case of NAWDS. \
  715. */ \
  716. A_UINT16 peerid; \
  717. \
  718. /* \
  719. * Channel frequency: This identifies the desired channel \
  720. * frequency (in mhz) for tx frames. This is used by FW to help \
  721. * determine when it is safe to transmit or drop frames for \
  722. * off-channel operation. \
  723. * The default value of zero indicates to FW that the \
  724. * corresponding VDEV's home channel (if there is one) is \
  725. * the desired channel frequency. \
  726. */ \
  727. A_UINT16 chanfreq; \
  728. \
  729. /* Reason reserved is commented is increasing the htt
  730. * structure size leads to some wierd issues.
  731. * A_UINT32 reserved_dword3_bits0_31; \
  732. */ \
  733. } POSTPACK
  734. /* define a htt_tx_msdu_desc32_t type */
  735. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  736. /* define a htt_tx_msdu_desc64_t type */
  737. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  738. /*
  739. * Make htt_tx_msdu_desc_t be an alias for either
  740. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  741. */
  742. #if HTT_PADDR64
  743. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  744. #else
  745. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  746. #endif
  747. /* decriptor information for Management frame*/
  748. /*
  749. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  750. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  751. */
  752. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  753. extern A_UINT32 mgmt_hdr_len;
  754. PREPACK struct htt_mgmt_tx_desc_t {
  755. A_UINT32 msg_type;
  756. #if HTT_PADDR64
  757. A_UINT64 frag_paddr; /* DMAble address of the data */
  758. #else
  759. A_UINT32 frag_paddr; /* DMAble address of the data */
  760. #endif
  761. A_UINT32 desc_id; /* returned to host during completion
  762. * to free the meory*/
  763. A_UINT32 len; /* Fragment length */
  764. A_UINT32 vdev_id; /* virtual device ID */
  765. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  766. } POSTPACK;
  767. PREPACK struct htt_mgmt_tx_compl_ind {
  768. A_UINT32 desc_id;
  769. A_UINT32 status;
  770. } POSTPACK;
  771. /*
  772. * This SDU header size comes from the summation of the following:
  773. * 1. Max of:
  774. * a. Native WiFi header, for native WiFi frames: 24 bytes
  775. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  776. * b. 802.11 header, for raw frames: 36 bytes
  777. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  778. * QoS header, HT header)
  779. * c. 802.3 header, for ethernet frames: 14 bytes
  780. * (destination address, source address, ethertype / length)
  781. * 2. Max of:
  782. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  783. * b. IPv6 header, up through the Traffic Class: 2 bytes
  784. * 3. 802.1Q VLAN header: 4 bytes
  785. * 4. LLC/SNAP header: 8 bytes
  786. */
  787. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  788. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  789. #define HTT_TX_HDR_SIZE_ETHERNET 14
  790. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  791. A_COMPILE_TIME_ASSERT(htt_encap_hdr_size_max_check_nwifi,
  792. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >=
  793. HTT_TX_HDR_SIZE_NATIVE_WIFI);
  794. A_COMPILE_TIME_ASSERT(htt_encap_hdr_size_max_check_enet,
  795. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >=
  796. HTT_TX_HDR_SIZE_ETHERNET);
  797. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  798. #define HTT_LL_TX_HDR_SIZE_IP 16 /*up to the end of UDP hdr for v4*/
  799. #define HTT_TX_HDR_SIZE_802_1Q 4
  800. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  801. #define HTT_COMMON_TX_FRM_HDR_LEN \
  802. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  803. HTT_TX_HDR_SIZE_802_1Q + \
  804. HTT_TX_HDR_SIZE_LLC_SNAP)
  805. #define HTT_HL_TX_FRM_HDR_LEN \
  806. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  807. #define HTT_LL_TX_FRM_HDR_LEN \
  808. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  809. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  810. /* dword 0 */
  811. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  812. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  813. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  814. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  815. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  816. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  817. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  818. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  819. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  820. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  821. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  822. #define HTT_TX_DESC_PKT_TYPE_S 13
  823. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  824. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  825. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  826. #define HTT_TX_DESC_VDEV_ID_S 16
  827. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  828. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  829. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  830. #define HTT_TX_DESC_EXT_TID_S 22
  831. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  832. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  833. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  834. #define HTT_TX_DESC_POSTPONED_S 27
  835. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  836. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  837. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  838. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  839. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  840. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  841. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  842. #define HTT_TX_DESC_TX_COMP_S 31
  843. /* dword 1 */
  844. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  845. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  846. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  847. #define HTT_TX_DESC_FRM_LEN_S 0
  848. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  849. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  850. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  851. #define HTT_TX_DESC_FRM_ID_S 16
  852. /* dword 2 */
  853. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  854. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  855. /* for systems using 64-bit format for bus addresses */
  856. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  857. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  858. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  859. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  860. /* for systems using 32-bit format for bus addresses */
  861. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  862. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  863. /* dword 3 */
  864. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  865. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  866. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  867. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  868. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  869. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  870. #if HTT_PADDR64
  871. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  872. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  873. #else
  874. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  875. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  876. #endif
  877. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  878. #define HTT_TX_DESC_PEER_ID_S 0
  879. /*
  880. * TEMPORARY:
  881. * The original definitions for the PEER_ID fields contained typos
  882. * (with _DESC_PADDR appended to this PEER_ID field name).
  883. * Retain deprecated original names for PEER_ID fields until all code that
  884. * refers to them has been updated.
  885. */
  886. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  887. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  888. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  889. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  890. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  891. HTT_TX_DESC_PEER_ID_M
  892. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  893. HTT_TX_DESC_PEER_ID_S
  894. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  895. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  896. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  897. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  898. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  899. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  900. #if HTT_PADDR64
  901. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  902. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  903. #else
  904. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  905. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  906. #endif
  907. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  908. #define HTT_TX_DESC_CHAN_FREQ_S 16
  909. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  910. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  911. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  912. do { \
  913. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  914. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  915. } while (0)
  916. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  917. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  918. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  919. do { \
  920. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  921. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  922. } while (0)
  923. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  924. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  925. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  926. do { \
  927. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  928. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  929. } while (0)
  930. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  931. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  932. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  933. do { \
  934. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  935. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  936. } while (0)
  937. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  938. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  939. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  940. do { \
  941. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  942. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  943. } while (0)
  944. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  945. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  946. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  947. do { \
  948. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  949. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  950. } while (0)
  951. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  952. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  953. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  954. do { \
  955. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  956. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  957. } while (0)
  958. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  959. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  960. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  961. do { \
  962. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  963. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  964. } while (0)
  965. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  966. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  967. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  968. do { \
  969. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  970. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  971. } while (0)
  972. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  973. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  974. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  975. do { \
  976. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  977. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  978. } while (0)
  979. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  980. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  981. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  982. do { \
  983. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  984. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  985. } while (0)
  986. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  987. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  988. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  989. do { \
  990. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  991. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  992. } while (0)
  993. /* enums used in the HTT tx MSDU extension descriptor */
  994. enum {
  995. htt_tx_guard_interval_regular = 0,
  996. htt_tx_guard_interval_short = 1,
  997. };
  998. enum {
  999. htt_tx_preamble_type_ofdm = 0,
  1000. htt_tx_preamble_type_cck = 1,
  1001. htt_tx_preamble_type_ht = 2,
  1002. htt_tx_preamble_type_vht = 3,
  1003. };
  1004. enum {
  1005. htt_tx_bandwidth_5MHz = 0,
  1006. htt_tx_bandwidth_10MHz = 1,
  1007. htt_tx_bandwidth_20MHz = 2,
  1008. htt_tx_bandwidth_40MHz = 3,
  1009. htt_tx_bandwidth_80MHz = 4,
  1010. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1011. };
  1012. /**
  1013. * @brief HTT tx MSDU extension descriptor
  1014. * @details
  1015. * If the target supports HTT tx MSDU extension descriptors, the host has
  1016. * the option of appending the following struct following the regular
  1017. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1018. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1019. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1020. * tx specs for each frame.
  1021. */
  1022. PREPACK struct htt_tx_msdu_desc_ext_t {
  1023. /* DWORD 0: flags */
  1024. A_UINT32 valid_pwr:1,/* bit 0:if set, tx pwr spec is valid */
  1025. valid_mcs_mask:1,/* bit 1:if set, tx MCS mask spec is valid */
  1026. valid_nss_mask:1,/* bit 2:if set, tx Nss mask spec is valid */
  1027. valid_guard_interval:1,/* bit 3:if set, tx guard intv spec is valid */
  1028. valid_preamble_type_mask:1,/* 4:if set, tx preamble mask is valid */
  1029. valid_chainmask:1,/* bit 5:if set, tx chainmask spec is valid */
  1030. valid_retries:1,/* bit 6:if set, tx retries spec is valid */
  1031. valid_bandwidth:1,/* bit 7:if set, tx bandwidth spec is valid */
  1032. valid_expire_tsf:1,/* bit 8:if set, tx expire TSF spec is valid */
  1033. is_dsrc:1, /* bit 9:if set, MSDU is a DSRC frame */
  1034. reserved0_31_7:22; /* bits 31:10 - unused, set to 0x0 */
  1035. /* DWORD 1:tx power, tx rate, tx BW */
  1036. A_UINT32
  1037. /* pwr -
  1038. * Specify what power the tx frame needs to be transmitted at.
  1039. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1040. * The value needs to be appropriately sign-extended when extracting
  1041. * the value from the message and storing it in a variable that is
  1042. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1043. * automatically handles this sign-extension.)
  1044. * If the transmission uses multiple tx chains, this power spec is
  1045. * the total transmit power, assuming incoherent combination of
  1046. * per-chain power to produce the total power.
  1047. */
  1048. pwr:8,
  1049. /* mcs_mask -
  1050. * Specify the allowable values for MCS index (modulation and coding)
  1051. * to use for transmitting the frame.
  1052. *
  1053. * For HT / VHT preamble types, this mask directly corresponds to
  1054. * the HT or VHT MCS indices that are allowed. For each bit N set
  1055. * within the mask, MCS index N is allowed for transmitting the frame.
  1056. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1057. * rates versus OFDM rates, so the host has the option of specifying
  1058. * that the target must transmit the frame with CCK or OFDM rates
  1059. * (not HT or VHT), but leaving the decision to the target whether
  1060. * to use CCK or OFDM.
  1061. *
  1062. * For CCK and OFDM, the bits within this mask are interpreted as
  1063. * follows:
  1064. * bit 0 -> CCK 1 Mbps rate is allowed
  1065. * bit 1 -> CCK 2 Mbps rate is allowed
  1066. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1067. * bit 3 -> CCK 11 Mbps rate is allowed
  1068. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1069. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1070. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1071. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1072. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1073. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1074. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1075. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1076. *
  1077. * The MCS index specification needs to be compatible with the
  1078. * bandwidth mask specification. For example, a MCS index == 9
  1079. * specification is inconsistent with a preamble type == VHT,
  1080. * Nss == 1, and channel bandwidth == 20 MHz.
  1081. *
  1082. * Furthermore, the host has only a limited ability to specify to
  1083. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1084. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1085. */
  1086. mcs_mask:12,
  1087. /* nss_mask -
  1088. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1089. * Each bit in this mask corresponds to a Nss value:
  1090. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1091. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1092. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1093. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1094. * The values in the Nss mask must be suitable for the recipient, e.g.
  1095. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1096. * recipient which only supports 2x2 MIMO.
  1097. */
  1098. nss_mask:4,
  1099. /* guard_interval -
  1100. * Specify a htt_tx_guard_interval enum value to indicate whether
  1101. * the transmission should use a regular guard interval or a
  1102. * short guard interval.
  1103. */
  1104. guard_interval:1,
  1105. /* preamble_type_mask -
  1106. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1107. * may choose from for transmitting this frame.
  1108. * The bits in this mask correspond to the values in the
  1109. * htt_tx_preamble_type enum. For example, to allow the target
  1110. * to transmit the frame as either CCK or OFDM, this field would
  1111. * be set to
  1112. * (1 << htt_tx_preamble_type_ofdm) |
  1113. * (1 << htt_tx_preamble_type_cck)
  1114. */
  1115. preamble_type_mask:4,
  1116. reserved1_31_29:3; /* unused, set to 0x0 */
  1117. /* DWORD 2: tx chain mask, tx retries */
  1118. A_UINT32
  1119. /* chain_mask - specify which chains to transmit from */
  1120. chain_mask:4,
  1121. /* retry_limit -
  1122. * Specify the maximum number of transmissions, including the
  1123. * initial transmission, to attempt before giving up if no ack
  1124. * is received.
  1125. * If the tx rate is specified, then all retries shall use the
  1126. * same rate as the initial transmission.
  1127. * If no tx rate is specified, the target can choose whether to
  1128. * retain the original rate during the retransmissions, or to
  1129. * fall back to a more robust rate.
  1130. */
  1131. retry_limit:4,
  1132. /* bandwidth_mask -
  1133. * Specify what channel widths may be used for the transmission.
  1134. * A value of zero indicates "don't care" - the target may choose
  1135. * the transmission bandwidth.
  1136. * The bits within this mask correspond to the htt_tx_bandwidth
  1137. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1138. * The bandwidth_mask must be consistent with the
  1139. * preamble_type_mask * and mcs_mask specs, if they are
  1140. * provided. For example,
  1141. * 80 MHz and 160 MHz can only be enabled in the mask
  1142. * if preamble_type == VHT.
  1143. */
  1144. bandwidth_mask:6,
  1145. reserved2_31_14:18; /* unused, set to 0x0 */
  1146. /* DWORD 3: tx expiry time (TSF) LSBs */
  1147. A_UINT32 expire_tsf_lo;
  1148. /* DWORD 4: tx expiry time (TSF) MSBs */
  1149. A_UINT32 expire_tsf_hi;
  1150. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1151. } POSTPACK;
  1152. /* DWORD 0 */
  1153. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1154. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1155. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1156. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1157. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1158. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1159. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1160. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1161. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1162. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1163. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1164. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1165. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1166. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1167. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1168. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1169. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1170. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1171. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1172. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1173. /* DWORD 1 */
  1174. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1175. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1176. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1177. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1178. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1179. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1180. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1181. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1182. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1183. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1184. /* DWORD 2 */
  1185. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1186. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1187. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1188. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1189. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1190. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1191. /* DWORD 0 */
  1192. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1193. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1194. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1195. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1196. do { \
  1197. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1198. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1199. } while (0)
  1200. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1201. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1202. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1203. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1204. do { \
  1205. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1206. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1207. } while (0)
  1208. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1209. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1210. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1211. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1212. do { \
  1213. HTT_CHECK_SET_VAL( \
  1214. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1215. ((_var) |= ((_val) \
  1216. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1217. } while (0)
  1218. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1219. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >>\
  1220. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1221. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1222. do { \
  1223. HTT_CHECK_SET_VAL( \
  1224. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1225. ((_var) |= ((_val) \
  1226. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1227. } while (0)
  1228. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1229. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1230. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1231. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1232. do { \
  1233. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1234. ((_var) |= ((_val) << \
  1235. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1236. } while (0)
  1237. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1238. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1239. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1240. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1241. do { \
  1242. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1243. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1244. } while (0)
  1245. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1246. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1247. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1248. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1249. do { \
  1250. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1251. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1252. } while (0)
  1253. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1254. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1255. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1256. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1257. do { \
  1258. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1259. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1260. } while (0)
  1261. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1262. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1263. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1264. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1265. do { \
  1266. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1267. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1268. } while (0)
  1269. /* DWORD 1 */
  1270. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1271. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1272. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1273. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1274. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1275. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1276. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1277. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1278. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1279. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1280. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1281. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1282. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1283. do { \
  1284. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1285. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1286. } while (0)
  1287. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1288. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1289. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1290. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1291. do { \
  1292. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1293. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1294. } while (0)
  1295. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1296. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1297. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1298. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1299. do { \
  1300. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1301. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1302. } while (0)
  1303. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1304. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1305. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1306. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1307. do { \
  1308. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK,\
  1309. _val); \
  1310. ((_var) |= ((_val) << \
  1311. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1312. } while (0)
  1313. /* DWORD 2 */
  1314. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1315. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1316. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1317. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1318. do { \
  1319. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1320. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1321. } while (0)
  1322. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1323. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1324. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1325. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1326. do { \
  1327. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1328. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1329. } while (0)
  1330. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1331. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1332. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1333. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1334. do { \
  1335. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1336. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1337. } while (0)
  1338. /**
  1339. * @brief MAC DMA rx ring setup specification
  1340. * @details
  1341. * To allow for dynamic rx ring reconfiguration and to avoid race
  1342. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  1343. * it uses. Instead, it sends this message to the target, indicating how
  1344. * the rx ring used by the host should be set up and maintained.
  1345. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  1346. * specifications.
  1347. *
  1348. * |31 16|15 8|7 0|
  1349. * |---------------------------------------------------------------|
  1350. * header: | reserved | num rings | msg type |
  1351. * |---------------------------------------------------------------|
  1352. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  1353. #if HTT_PADDR64
  1354. * | FW_IDX shadow register physical address (bits 63:32) |
  1355. #endif
  1356. * |---------------------------------------------------------------|
  1357. * | rx ring base physical address (bits 31:0) |
  1358. #if HTT_PADDR64
  1359. * | rx ring base physical address (bits 63:32) |
  1360. #endif
  1361. * |---------------------------------------------------------------|
  1362. * | rx ring buffer size | rx ring length |
  1363. * |---------------------------------------------------------------|
  1364. * | FW_IDX initial value | enabled flags |
  1365. * |---------------------------------------------------------------|
  1366. * | MSDU payload offset | 802.11 header offset |
  1367. * |---------------------------------------------------------------|
  1368. * | PPDU end offset | PPDU start offset |
  1369. * |---------------------------------------------------------------|
  1370. * | MPDU end offset | MPDU start offset |
  1371. * |---------------------------------------------------------------|
  1372. * | MSDU end offset | MSDU start offset |
  1373. * |---------------------------------------------------------------|
  1374. * | frag info offset | rx attention offset |
  1375. * |---------------------------------------------------------------|
  1376. * payload 2, if present, has the same format as payload 1
  1377. * Header fields:
  1378. * - MSG_TYPE
  1379. * Bits 7:0
  1380. * Purpose: identifies this as an rx ring configuration message
  1381. * Value: 0x2
  1382. * - NUM_RINGS
  1383. * Bits 15:8
  1384. * Purpose: indicates whether the host is setting up one rx ring or two
  1385. * Value: 1 or 2
  1386. * Payload:
  1387. * for systems using 64-bit format for bus addresses:
  1388. * - IDX_SHADOW_REG_PADDR_LO
  1389. * Bits 31:0
  1390. * Value: lower 4 bytes of physical address of the host's
  1391. * FW_IDX shadow register
  1392. * - IDX_SHADOW_REG_PADDR_HI
  1393. * Bits 31:0
  1394. * Value: upper 4 bytes of physical address of the host's
  1395. * FW_IDX shadow register
  1396. * - RING_BASE_PADDR_LO
  1397. * Bits 31:0
  1398. * Value: lower 4 bytes of physical address of the host's rx ring
  1399. * - RING_BASE_PADDR_HI
  1400. * Bits 31:0
  1401. * Value: uppper 4 bytes of physical address of the host's rx ring
  1402. * for systems using 32-bit format for bus addresses:
  1403. * - IDX_SHADOW_REG_PADDR
  1404. * Bits 31:0
  1405. * Value: physical address of the host's FW_IDX shadow register
  1406. * - RING_BASE_PADDR
  1407. * Bits 31:0
  1408. * Value: physical address of the host's rx ring
  1409. * - RING_LEN
  1410. * Bits 15:0
  1411. * Value: number of elements in the rx ring
  1412. * - RING_BUF_SZ
  1413. * Bits 31:16
  1414. * Value: size of the buffers referenced by the rx ring, in byte units
  1415. * - ENABLED_FLAGS
  1416. * Bits 15:0
  1417. * Value: 1-bit flags to show whether different rx fields are enabled
  1418. * bit 0: 802.11 header enabled (1) or disabled (0)
  1419. * bit 1: MSDU payload enabled (1) or disabled (0)
  1420. * bit 2: PPDU start enabled (1) or disabled (0)
  1421. * bit 3: PPDU end enabled (1) or disabled (0)
  1422. * bit 4: MPDU start enabled (1) or disabled (0)
  1423. * bit 5: MPDU end enabled (1) or disabled (0)
  1424. * bit 6: MSDU start enabled (1) or disabled (0)
  1425. * bit 7: MSDU end enabled (1) or disabled (0)
  1426. * bit 8: rx attention enabled (1) or disabled (0)
  1427. * bit 9: frag info enabled (1) or disabled (0)
  1428. * bit 10: unicast rx enabled (1) or disabled (0)
  1429. * bit 11: multicast rx enabled (1) or disabled (0)
  1430. * bit 12: ctrl rx enabled (1) or disabled (0)
  1431. * bit 13: mgmt rx enabled (1) or disabled (0)
  1432. * bit 14: null rx enabled (1) or disabled (0)
  1433. * bit 15: phy data rx enabled (1) or disabled (0)
  1434. * - IDX_INIT_VAL
  1435. * Bits 31:16
  1436. * Purpose: Specify the initial value for the FW_IDX.
  1437. * Value: the number of buffers initially present in the host's rx ring
  1438. * - OFFSET_802_11_HDR
  1439. * Bits 15:0
  1440. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  1441. * - OFFSET_MSDU_PAYLOAD
  1442. * Bits 31:16
  1443. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  1444. * - OFFSET_PPDU_START
  1445. * Bits 15:0
  1446. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  1447. * - OFFSET_PPDU_END
  1448. * Bits 31:16
  1449. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  1450. * - OFFSET_MPDU_START
  1451. * Bits 15:0
  1452. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  1453. * - OFFSET_MPDU_END
  1454. * Bits 31:16
  1455. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  1456. * - OFFSET_MSDU_START
  1457. * Bits 15:0
  1458. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  1459. * - OFFSET_MSDU_END
  1460. * Bits 31:16
  1461. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  1462. * - OFFSET_RX_ATTN
  1463. * Bits 15:0
  1464. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  1465. * - OFFSET_FRAG_INFO
  1466. * Bits 31:16
  1467. * Value: offset in QUAD-bytes of frag info table
  1468. */
  1469. /* header fields */
  1470. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  1471. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  1472. /* payload fields */
  1473. /* for systems using a 64-bit format for bus addresses */
  1474. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  1475. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  1476. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  1477. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  1478. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  1479. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  1480. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  1481. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  1482. /* for systems using a 32-bit format for bus addresses */
  1483. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  1484. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  1485. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  1486. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  1487. #define HTT_RX_RING_CFG_LEN_M 0xffff
  1488. #define HTT_RX_RING_CFG_LEN_S 0
  1489. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  1490. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  1491. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  1492. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  1493. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  1494. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  1495. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  1496. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  1497. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  1498. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  1499. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  1500. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  1501. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  1502. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  1503. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  1504. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  1505. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  1506. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  1507. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  1508. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  1509. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  1510. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  1511. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  1512. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  1513. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  1514. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  1515. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  1516. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  1517. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  1518. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  1519. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  1520. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  1521. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  1522. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  1523. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  1524. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  1525. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  1526. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  1527. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  1528. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  1529. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  1530. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  1531. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  1532. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  1533. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  1534. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  1535. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  1536. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  1537. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  1538. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  1539. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  1540. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  1541. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  1542. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  1543. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  1544. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  1545. #define HTT_RX_RING_CFG_HDR_BYTES 4
  1546. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  1547. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  1548. #if HTT_PADDR64
  1549. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  1550. #else
  1551. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  1552. #endif
  1553. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  1554. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  1555. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  1556. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  1557. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  1558. do { \
  1559. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  1560. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  1561. } while (0)
  1562. /* degenerate case for 32-bit fields */
  1563. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  1564. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  1565. ((_var) = (_val))
  1566. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  1567. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  1568. ((_var) = (_val))
  1569. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  1570. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  1571. ((_var) = (_val))
  1572. /* degenerate case for 32-bit fields */
  1573. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  1574. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) ((_var) = (_val))
  1575. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  1576. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) ((_var) = (_val))
  1577. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  1578. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) ((_var) = (_val))
  1579. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  1580. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  1581. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  1582. do { \
  1583. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  1584. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  1585. } while (0)
  1586. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  1587. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  1588. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  1589. do { \
  1590. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  1591. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  1592. } while (0)
  1593. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  1594. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  1595. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  1596. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  1597. do { \
  1598. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  1599. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  1600. } while (0)
  1601. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  1602. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  1603. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  1604. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  1605. do { \
  1606. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  1607. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  1608. } while (0)
  1609. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  1610. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  1611. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  1612. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  1613. do { \
  1614. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  1615. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  1616. } while (0)
  1617. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  1618. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  1619. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  1620. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  1621. do { \
  1622. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  1623. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  1624. } while (0)
  1625. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  1626. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  1627. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  1628. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  1629. do { \
  1630. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  1631. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  1632. } while (0)
  1633. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  1634. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  1635. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  1636. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  1637. do { \
  1638. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  1639. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  1640. } while (0)
  1641. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  1642. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  1643. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  1644. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  1645. do { \
  1646. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  1647. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  1648. } while (0)
  1649. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  1650. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  1651. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  1652. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  1653. do { \
  1654. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  1655. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  1656. } while (0)
  1657. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  1658. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  1659. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  1660. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  1661. do { \
  1662. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  1663. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  1664. } while (0)
  1665. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  1666. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  1667. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  1668. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  1669. do { \
  1670. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  1671. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  1672. } while (0)
  1673. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  1674. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  1675. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  1676. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  1677. do { \
  1678. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  1679. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  1680. } while (0)
  1681. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  1682. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  1683. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  1684. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  1685. do { \
  1686. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  1687. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  1688. } while (0)
  1689. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  1690. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  1691. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  1692. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  1693. do { \
  1694. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  1695. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  1696. } while (0)
  1697. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  1698. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  1699. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  1700. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  1701. do { \
  1702. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  1703. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  1704. } while (0)
  1705. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  1706. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  1707. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  1708. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  1709. do { \
  1710. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  1711. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  1712. } while (0)
  1713. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  1714. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  1715. HTT_RX_RING_CFG_ENABLED_NULL_S)
  1716. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  1717. do { \
  1718. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  1719. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  1720. } while (0)
  1721. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  1722. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  1723. HTT_RX_RING_CFG_ENABLED_PHY_S)
  1724. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  1725. do { \
  1726. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  1727. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  1728. } while (0)
  1729. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  1730. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  1731. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  1732. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  1733. do { \
  1734. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  1735. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  1736. } while (0)
  1737. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  1738. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  1739. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  1740. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  1741. do { \
  1742. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  1743. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  1744. } while (0)
  1745. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  1746. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  1747. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  1748. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  1749. do { \
  1750. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  1751. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  1752. } while (0)
  1753. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  1754. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  1755. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  1756. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  1757. do { \
  1758. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  1759. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  1760. } while (0)
  1761. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  1762. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  1763. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  1764. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  1765. do { \
  1766. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  1767. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  1768. } while (0)
  1769. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  1770. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  1771. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  1772. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  1773. do { \
  1774. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  1775. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  1776. } while (0)
  1777. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  1778. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  1779. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  1780. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  1781. do { \
  1782. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  1783. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  1784. } while (0)
  1785. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  1786. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  1787. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  1788. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  1789. do { \
  1790. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  1791. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  1792. } while (0)
  1793. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  1794. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  1795. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  1796. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  1797. do { \
  1798. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  1799. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  1800. } while (0)
  1801. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  1802. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  1803. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  1804. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  1805. do { \
  1806. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  1807. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  1808. } while (0)
  1809. /**
  1810. * @brief host -> target FW statistics retrieve
  1811. *
  1812. * @details
  1813. * The following field definitions describe the format of the HTT host
  1814. * to target FW stats retrieve message. The message specifies the type of
  1815. * stats host wants to retrieve.
  1816. *
  1817. * |31 24|23 16|15 8|7 0|
  1818. * |-----------------------------------------------------------|
  1819. * | stats types request bitmask | msg type |
  1820. * |-----------------------------------------------------------|
  1821. * | stats types reset bitmask | reserved |
  1822. * |-----------------------------------------------------------|
  1823. * | stats type | config value |
  1824. * |-----------------------------------------------------------|
  1825. * | cookie LSBs |
  1826. * |-----------------------------------------------------------|
  1827. * | cookie MSBs |
  1828. * |-----------------------------------------------------------|
  1829. * Header fields:
  1830. * - MSG_TYPE
  1831. * Bits 7:0
  1832. * Purpose: identifies this is a stats upload request message
  1833. * Value: 0x3
  1834. * - UPLOAD_TYPES
  1835. * Bits 31:8
  1836. * Purpose: identifies which types of FW statistics to upload
  1837. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  1838. * - RESET_TYPES
  1839. * Bits 31:8
  1840. * Purpose: identifies which types of FW statistics to reset
  1841. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  1842. * - CFG_VAL
  1843. * Bits 23:0
  1844. * Purpose: give an opaque configuration value to the specified stats type
  1845. * Value: stats-type specific configuration value
  1846. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  1847. * bits 7:0 - how many per-MPDU byte counts to include in a record
  1848. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  1849. * bits 23:16 - how many per-MSDU byte counts to include in a record
  1850. * - CFG_STAT_TYPE
  1851. * Bits 31:24
  1852. * Purpose: specify which stats type (if any) the config value applies to
  1853. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  1854. * a valid configuration specification
  1855. * - COOKIE_LSBS
  1856. * Bits 31:0
  1857. * Purpose: Provide a mechanism to match a target->host stats confirmation
  1858. * message with its preceding host->target stats request message.
  1859. * Value: LSBs of the opaque cookie specified by the host-side requestor
  1860. * - COOKIE_MSBS
  1861. * Bits 31:0
  1862. * Purpose: Provide a mechanism to match a target->host stats confirmation
  1863. * message with its preceding host->target stats request message.
  1864. * Value: MSBs of the opaque cookie specified by the host-side requestor
  1865. */
  1866. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  1867. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  1868. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  1869. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  1870. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  1871. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  1872. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  1873. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  1874. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  1875. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  1876. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  1877. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  1878. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  1879. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  1880. do { \
  1881. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  1882. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  1883. } while (0)
  1884. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  1885. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  1886. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  1887. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  1888. do { \
  1889. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  1890. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  1891. } while (0)
  1892. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  1893. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  1894. HTT_H2T_STATS_REQ_CFG_VAL_S)
  1895. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  1896. do { \
  1897. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  1898. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  1899. } while (0)
  1900. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  1901. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  1902. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  1903. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  1904. do { \
  1905. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  1906. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  1907. } while (0)
  1908. /**
  1909. * @brief host -> target HTT out-of-band sync request
  1910. *
  1911. * @details
  1912. * The HTT SYNC tells the target to suspend processing of subsequent
  1913. * HTT host-to-target messages until some other target agent locally
  1914. * informs the target HTT FW that the current sync counter is equal to
  1915. * or greater than (in a modulo sense) the sync counter specified in
  1916. * the SYNC message.
  1917. * This allows other host-target components to synchronize their operation
  1918. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  1919. * security key has been downloaded to and activated by the target.
  1920. * In the absence of any explicit synchronization counter value
  1921. * specification, the target HTT FW will use zero as the default current
  1922. * sync value.
  1923. *
  1924. * |31 24|23 16|15 8|7 0|
  1925. * |-----------------------------------------------------------|
  1926. * | reserved | sync count | msg type |
  1927. * |-----------------------------------------------------------|
  1928. * Header fields:
  1929. * - MSG_TYPE
  1930. * Bits 7:0
  1931. * Purpose: identifies this as a sync message
  1932. * Value: 0x4
  1933. * - SYNC_COUNT
  1934. * Bits 15:8
  1935. * Purpose: specifies what sync value the HTT FW will wait for from
  1936. * an out-of-band specification to resume its operation
  1937. * Value: in-band sync counter value to compare against the out-of-band
  1938. * counter spec.
  1939. * The HTT target FW will suspend its host->target message processing
  1940. * as long as
  1941. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  1942. */
  1943. #define HTT_H2T_SYNC_MSG_SZ 4
  1944. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  1945. #define HTT_H2T_SYNC_COUNT_S 8
  1946. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  1947. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  1948. HTT_H2T_SYNC_COUNT_S)
  1949. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  1950. do { \
  1951. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  1952. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  1953. } while (0)
  1954. /**
  1955. * @brief HTT aggregation configuration
  1956. */
  1957. #define HTT_AGGR_CFG_MSG_SZ 4
  1958. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  1959. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  1960. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  1961. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  1962. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  1963. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  1964. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  1965. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  1966. do { \
  1967. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  1968. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  1969. } while (0)
  1970. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  1971. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  1972. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  1973. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  1974. do { \
  1975. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  1976. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  1977. } while (0)
  1978. /**
  1979. * @brief host -> target HTT configure max amsdu info per vdev
  1980. *
  1981. * @details
  1982. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  1983. *
  1984. * |31 21|20 16|15 8|7 0|
  1985. * |-----------------------------------------------------------|
  1986. * | reserved | vdev id | max amsdu | msg type |
  1987. * |-----------------------------------------------------------|
  1988. * Header fields:
  1989. * - MSG_TYPE
  1990. * Bits 7:0
  1991. * Purpose: identifies this as a aggr cfg ex message
  1992. * Value: 0xa
  1993. * - MAX_NUM_AMSDU_SUBFRM
  1994. * Bits 15:8
  1995. * Purpose: max MSDUs per A-MSDU
  1996. * - VDEV_ID
  1997. * Bits 20:16
  1998. * Purpose: ID of the vdev to which this limit is applied
  1999. */
  2000. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  2001. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  2002. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  2003. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  2004. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  2005. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  2006. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  2007. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  2008. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  2009. do { \
  2010. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  2011. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  2012. } while (0)
  2013. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  2014. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  2015. HTT_AGGR_CFG_EX_VDEV_ID_S)
  2016. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  2017. do { \
  2018. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  2019. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  2020. } while (0)
  2021. /**
  2022. * @brief HTT WDI_IPA Config Message
  2023. *
  2024. * @details
  2025. * The HTT WDI_IPA config message is created/sent by host at driver
  2026. * init time. It contains information about data structures used on
  2027. * WDI_IPA TX and RX path.
  2028. * TX CE ring is used for pushing packet metadata from IPA uC
  2029. * to WLAN FW
  2030. * TX Completion ring is used for generating TX completions from
  2031. * WLAN FW to IPA uC
  2032. * RX Indication ring is used for indicating RX packets from FW
  2033. * to IPA uC
  2034. * RX Ring2 is used as either completion ring or as second
  2035. * indication ring. when Ring2 is used as completion ring, IPA uC
  2036. * puts completed RX packet meta data to Ring2. when Ring2 is used
  2037. * as second indication ring, RX packets for LTE-WLAN aggregation are
  2038. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  2039. * indicated in RX Indication ring. Please see WDI_IPA specification
  2040. * for more details.
  2041. * |31 24|23 16|15 8|7 0|
  2042. * |----------------+----------------+----------------+----------------|
  2043. * | tx pkt pool size | Rsvd | msg_type |
  2044. * |-------------------------------------------------------------------|
  2045. * | tx comp ring base (bits 31:0) |
  2046. #if HTT_PADDR64
  2047. * | tx comp ring base (bits 63:32) |
  2048. #endif
  2049. * |-------------------------------------------------------------------|
  2050. * | tx comp ring size |
  2051. * |-------------------------------------------------------------------|
  2052. * | tx comp WR_IDX physical address (bits 31:0) |
  2053. #if HTT_PADDR64
  2054. * | tx comp WR_IDX physical address (bits 63:32) |
  2055. #endif
  2056. * |-------------------------------------------------------------------|
  2057. * | tx CE WR_IDX physical address (bits 31:0) |
  2058. #if HTT_PADDR64
  2059. * | tx CE WR_IDX physical address (bits 63:32) |
  2060. #endif
  2061. * |-------------------------------------------------------------------|
  2062. * | rx indication ring base (bits 31:0) |
  2063. #if HTT_PADDR64
  2064. * | rx indication ring base (bits 63:32) |
  2065. #endif
  2066. * |-------------------------------------------------------------------|
  2067. * | rx indication ring size |
  2068. * |-------------------------------------------------------------------|
  2069. * | rx ind RD_IDX physical address (bits 31:0) |
  2070. #if HTT_PADDR64
  2071. * | rx ind RD_IDX physical address (bits 63:32) |
  2072. #endif
  2073. * |-------------------------------------------------------------------|
  2074. * | rx ind WR_IDX physical address (bits 31:0) |
  2075. #if HTT_PADDR64
  2076. * | rx ind WR_IDX physical address (bits 63:32) |
  2077. #endif
  2078. * |-------------------------------------------------------------------|
  2079. * |-------------------------------------------------------------------|
  2080. * | rx ring2 base (bits 31:0) |
  2081. #if HTT_PADDR64
  2082. * | rx ring2 base (bits 63:32) |
  2083. #endif
  2084. * |-------------------------------------------------------------------|
  2085. * | rx ring2 size |
  2086. * |-------------------------------------------------------------------|
  2087. * | rx ring2 RD_IDX physical address (bits 31:0) |
  2088. #if HTT_PADDR64
  2089. * | rx ring2 RD_IDX physical address (bits 63:32) |
  2090. #endif
  2091. * |-------------------------------------------------------------------|
  2092. * | rx ring2 WR_IDX physical address (bits 31:0) |
  2093. #if HTT_PADDR64
  2094. * | rx ring2 WR_IDX physical address (bits 63:32) |
  2095. #endif
  2096. * |-------------------------------------------------------------------|
  2097. *
  2098. * Header fields:
  2099. * Header fields:
  2100. * - MSG_TYPE
  2101. * Bits 7:0
  2102. * Purpose: Identifies this as WDI_IPA config message
  2103. * value: = 0x8
  2104. * - TX_PKT_POOL_SIZE
  2105. * Bits 15:0
  2106. * Purpose: Total number of TX packet buffer pool allocated by Host for
  2107. * WDI_IPA TX path
  2108. * For systems using 32-bit format for bus addresses:
  2109. * - TX_COMP_RING_BASE_ADDR
  2110. * Bits 31:0
  2111. * Purpose: TX Completion Ring base address in DDR
  2112. * - TX_COMP_RING_SIZE
  2113. * Bits 31:0
  2114. * Purpose: TX Completion Ring size (must be power of 2)
  2115. * - TX_COMP_WR_IDX_ADDR
  2116. * Bits 31:0
  2117. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  2118. * updates the Write Index for WDI_IPA TX completion ring
  2119. * - TX_CE_WR_IDX_ADDR
  2120. * Bits 31:0
  2121. * Purpose: DDR address where IPA uC
  2122. * updates the WR Index for TX CE ring
  2123. * (needed for fusion platforms)
  2124. * - RX_IND_RING_BASE_ADDR
  2125. * Bits 31:0
  2126. * Purpose: RX Indication Ring base address in DDR
  2127. * - RX_IND_RING_SIZE
  2128. * Bits 31:0
  2129. * Purpose: RX Indication Ring size
  2130. * - RX_IND_RD_IDX_ADDR
  2131. * Bits 31:0
  2132. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  2133. * RX indication ring
  2134. * - RX_IND_WR_IDX_ADDR
  2135. * Bits 31:0
  2136. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  2137. * updates the Write Index for WDI_IPA RX indication ring
  2138. * - RX_RING2_BASE_ADDR
  2139. * Bits 31:0
  2140. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  2141. * - RX_RING2_SIZE
  2142. * Bits 31:0
  2143. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  2144. * - RX_RING2_RD_IDX_ADDR
  2145. * Bits 31:0
  2146. * Purpose: If Second RX ring is Indication ring, DDR address where
  2147. * IPA uC updates the Read Index for Ring2.
  2148. * If Second RX ring is completion ring, this is NOT used
  2149. * - RX_RING2_WR_IDX_ADDR
  2150. * Bits 31:0
  2151. * Purpose: If Second RX ring is Indication ring, DDR address where
  2152. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  2153. * If second RX ring is completion ring, DDR address where
  2154. * IPA uC updates the Write Index for Ring 2.
  2155. * For systems using 64-bit format for bus addresses:
  2156. * - TX_COMP_RING_BASE_ADDR_LO
  2157. * Bits 31:0
  2158. * Purpose: Lower 4 bytes of TX Completion Ring base physical
  2159. * address in DDR
  2160. * - TX_COMP_RING_BASE_ADDR_HI
  2161. * Bits 31:0
  2162. * Purpose: Higher 4 bytes of TX Completion Ring base physical
  2163. * address in DDR
  2164. * - TX_COMP_RING_SIZE
  2165. * Bits 31:0
  2166. * Purpose: TX Completion Ring size (must be power of 2)
  2167. * - TX_COMP_WR_IDX_ADDR_LO
  2168. * Bits 31:0
  2169. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  2170. * Lower 4 bytes of DDR address where WIFI FW
  2171. * updates the Write Index for WDI_IPA TX completion ring
  2172. * - TX_COMP_WR_IDX_ADDR_HI
  2173. * Bits 31:0
  2174. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  2175. * Higher 4 bytes of DDR address where WIFI FW
  2176. * updates the Write Index for WDI_IPA TX completion ring
  2177. * - TX_CE_WR_IDX_ADDR_LO
  2178. * Bits 31:0
  2179. * Purpose: Lower 4 bytes of DDR address where IPA uC
  2180. * updates the WR Index for TX CE ring
  2181. * (needed for fusion platforms)
  2182. * - TX_CE_WR_IDX_ADDR_HI
  2183. * Bits 31:0
  2184. * Purpose: Higher 4 bytes of DDR address where IPA uC
  2185. * updates the WR Index for TX CE ring
  2186. * (needed for fusion platforms)
  2187. * - RX_IND_RING_BASE_ADDR_LO
  2188. * Bits 31:0
  2189. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  2190. * - RX_IND_RING_BASE_ADDR_HI
  2191. * Bits 31:0
  2192. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  2193. * - RX_IND_RING_SIZE
  2194. * Bits 31:0
  2195. * Purpose: RX Indication Ring size
  2196. * - RX_IND_RD_IDX_ADDR_LO
  2197. * Bits 31:0
  2198. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the
  2199. * Read Index for WDI_IPA RX indication ring
  2200. * - RX_IND_RD_IDX_ADDR_HI
  2201. * Bits 31:0
  2202. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the
  2203. * Read Index for WDI_IPA RX indication ring
  2204. * - RX_IND_WR_IDX_ADDR_LO
  2205. * Bits 31:0
  2206. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  2207. * Lower 4 bytes of DDR address where WIFI FW
  2208. * updates the Write Index for WDI_IPA RX indication ring
  2209. * - RX_IND_WR_IDX_ADDR_HI
  2210. * Bits 31:0
  2211. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  2212. * Higher 4 bytes of DDR address where WIFI FW
  2213. * updates the Write Index for WDI_IPA RX indication ring
  2214. * - RX_RING2_BASE_ADDR_LO
  2215. * Bits 31:0
  2216. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)
  2217. * base address in DDR
  2218. * - RX_RING2_BASE_ADDR_HI
  2219. * Bits 31:0
  2220. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)
  2221. * base address in DDR
  2222. * - RX_RING2_SIZE
  2223. * Bits 31:0
  2224. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  2225. * - RX_RING2_RD_IDX_ADDR_LO
  2226. * Bits 31:0
  2227. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  2228. * DDR address where IPA uC updates the Read Index for Ring2.
  2229. * If Second RX ring is completion ring, this is NOT used
  2230. * - RX_RING2_RD_IDX_ADDR_HI
  2231. * Bits 31:0
  2232. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  2233. * DDR address where IPA uC updates the Read Index for Ring2.
  2234. * If Second RX ring is completion ring, this is NOT used
  2235. * - RX_RING2_WR_IDX_ADDR_LO
  2236. * Bits 31:0
  2237. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  2238. * DDR address where WIFI FW updates the Write Index
  2239. * for WDI_IPA RX ring2
  2240. * If second RX ring is completion ring, lower 4 bytes of
  2241. * DDR address where IPA uC updates the Write Index for Ring 2.
  2242. * - RX_RING2_WR_IDX_ADDR_HI
  2243. * Bits 31:0
  2244. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  2245. * DDR address where WIFI FW updates the Write Index
  2246. * for WDI_IPA RX ring2
  2247. * If second RX ring is completion ring, higher 4 bytes of
  2248. * DDR address where IPA uC updates the Write Index for Ring 2.
  2249. */
  2250. #if HTT_PADDR64
  2251. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  2252. #else
  2253. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  2254. #endif
  2255. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  2256. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  2257. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  2258. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  2259. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  2260. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  2261. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  2262. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  2263. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  2264. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  2265. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  2266. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  2267. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  2268. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  2269. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  2270. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  2271. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  2272. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  2273. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  2274. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  2275. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  2276. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  2277. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  2278. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  2279. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  2280. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  2281. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  2282. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  2283. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  2284. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  2285. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  2286. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  2287. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  2288. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  2289. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  2290. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  2291. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  2292. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  2293. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  2294. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  2295. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  2296. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  2297. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  2298. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  2299. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  2300. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  2301. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  2302. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  2303. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  2304. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  2305. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  2306. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  2307. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  2308. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  2309. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  2310. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  2311. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  2312. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  2313. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  2314. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  2315. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  2316. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  2317. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  2318. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> \
  2319. HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  2320. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  2321. do { \
  2322. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  2323. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  2324. } while (0)
  2325. /* for systems using 32-bit format for bus addr */
  2326. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  2327. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> \
  2328. HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  2329. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  2330. do { \
  2331. HTT_CHECK_SET_VAL( \
  2332. HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val);\
  2333. ((_var) |= \
  2334. ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  2335. } while (0)
  2336. /* for systems using 64-bit format for bus addr */
  2337. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  2338. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> \
  2339. HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  2340. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  2341. do { \
  2342. HTT_CHECK_SET_VAL( \
  2343. HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val);\
  2344. ((_var) |= \
  2345. ((_val) << \
  2346. HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  2347. } while (0)
  2348. /* for systems using 64-bit format for bus addr */
  2349. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  2350. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> \
  2351. HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  2352. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  2353. do { \
  2354. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  2355. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  2356. } while (0)
  2357. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  2358. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> \
  2359. HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  2360. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  2361. do { \
  2362. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  2363. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  2364. } while (0)
  2365. /* for systems using 32-bit format for bus addr */
  2366. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  2367. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> \
  2368. HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  2369. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  2370. do { \
  2371. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  2372. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  2373. } while (0)
  2374. /* for systems using 64-bit format for bus addr */
  2375. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  2376. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> \
  2377. HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  2378. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  2379. do { \
  2380. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  2381. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  2382. } while (0)
  2383. /* for systems using 64-bit format for bus addr */
  2384. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  2385. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> \
  2386. HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  2387. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  2388. do { \
  2389. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  2390. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  2391. } while (0)
  2392. /* for systems using 32-bit format for bus addr */
  2393. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  2394. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> \
  2395. HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  2396. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  2397. do { \
  2398. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  2399. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  2400. } while (0)
  2401. /* for systems using 64-bit format for bus addr */
  2402. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  2403. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >>\
  2404. HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  2405. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  2406. do { \
  2407. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  2408. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  2409. } while (0)
  2410. /* for systems using 64-bit format for bus addr */
  2411. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  2412. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> \
  2413. HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  2414. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  2415. do { \
  2416. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  2417. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  2418. } while (0)
  2419. /* for systems using 32-bit format for bus addr */
  2420. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  2421. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> \
  2422. HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  2423. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  2424. do { \
  2425. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  2426. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  2427. } while (0)
  2428. /* for systems using 64-bit format for bus addr */
  2429. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  2430. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> \
  2431. HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  2432. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  2433. do { \
  2434. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  2435. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  2436. } while (0)
  2437. /* for systems using 64-bit format for bus addr */
  2438. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  2439. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> \
  2440. HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  2441. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  2442. do { \
  2443. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  2444. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  2445. } while (0)
  2446. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  2447. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> \
  2448. HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  2449. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  2450. do { \
  2451. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  2452. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  2453. } while (0)
  2454. /* for systems using 32-bit format for bus addr */
  2455. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  2456. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> \
  2457. HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  2458. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  2459. do { \
  2460. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  2461. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  2462. } while (0)
  2463. /* for systems using 64-bit format for bus addr */
  2464. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  2465. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> \
  2466. HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  2467. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  2468. do { \
  2469. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  2470. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  2471. } while (0)
  2472. /* for systems using 64-bit format for bus addr */
  2473. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  2474. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> \
  2475. HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  2476. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  2477. do { \
  2478. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  2479. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  2480. } while (0)
  2481. /* for systems using 32-bit format for bus addr */
  2482. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  2483. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> \
  2484. HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  2485. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  2486. do { \
  2487. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  2488. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  2489. } while (0)
  2490. /* for systems using 64-bit format for bus addr */
  2491. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  2492. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> \
  2493. HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  2494. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  2495. do { \
  2496. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  2497. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  2498. } while (0)
  2499. /* for systems using 64-bit format for bus addr */
  2500. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  2501. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> \
  2502. HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  2503. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  2504. do { \
  2505. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  2506. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  2507. } while (0)
  2508. /* for systems using 32-bit format for bus addr */
  2509. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  2510. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> \
  2511. HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  2512. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  2513. do { \
  2514. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  2515. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  2516. } while (0)
  2517. /* for systems using 64-bit format for bus addr */
  2518. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  2519. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> \
  2520. HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  2521. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  2522. do { \
  2523. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  2524. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  2525. } while (0)
  2526. /* for systems using 64-bit format for bus addr */
  2527. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  2528. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> \
  2529. HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  2530. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  2531. do { \
  2532. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  2533. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  2534. } while (0)
  2535. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  2536. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> \
  2537. HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  2538. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  2539. do { \
  2540. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  2541. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  2542. } while (0)
  2543. /* for systems using 32-bit format for bus addr */
  2544. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  2545. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> \
  2546. HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  2547. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  2548. do { \
  2549. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  2550. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  2551. } while (0)
  2552. /* for systems using 64-bit format for bus addr */
  2553. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  2554. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> \
  2555. HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  2556. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  2557. do { \
  2558. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  2559. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  2560. } while (0)
  2561. /* for systems using 64-bit format for bus addr */
  2562. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  2563. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> \
  2564. HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  2565. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  2566. do { \
  2567. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  2568. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  2569. } while (0)
  2570. /* for systems using 32-bit format for bus addr */
  2571. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  2572. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> \
  2573. HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  2574. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  2575. do { \
  2576. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  2577. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  2578. } while (0)
  2579. /* for systems using 64-bit format for bus addr */
  2580. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  2581. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> \
  2582. HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  2583. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  2584. do { \
  2585. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  2586. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  2587. } while (0)
  2588. /* for systems using 64-bit format for bus addr */
  2589. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  2590. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> \
  2591. HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  2592. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  2593. do { \
  2594. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  2595. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  2596. } while (0)
  2597. /*
  2598. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  2599. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  2600. * addresses are stored in a XXX-bit field.
  2601. * This macro is used to define both htt_wdi_ipa_config32_t and
  2602. * htt_wdi_ipa_config64_t structs.
  2603. */
  2604. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  2605. _paddr__tx_comp_ring_base_addr_, \
  2606. _paddr__tx_comp_wr_idx_addr_, \
  2607. _paddr__tx_ce_wr_idx_addr_, \
  2608. _paddr__rx_ind_ring_base_addr_, \
  2609. _paddr__rx_ind_rd_idx_addr_, \
  2610. _paddr__rx_ind_wr_idx_addr_, \
  2611. _paddr__rx_ring2_base_addr_,\
  2612. _paddr__rx_ring2_rd_idx_addr_,\
  2613. _paddr__rx_ring2_wr_idx_addr_) \
  2614. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  2615. { \
  2616. /* DWORD 0: flags and meta-data */ \
  2617. A_UINT32 \
  2618. msg_type:8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  2619. reserved:8, \
  2620. tx_pkt_pool_size:16;\
  2621. /* DWORD 1 */\
  2622. _paddr__tx_comp_ring_base_addr_;\
  2623. /* DWORD 2 (or 3)*/\
  2624. A_UINT32 tx_comp_ring_size;\
  2625. /* DWORD 3 (or 4)*/\
  2626. _paddr__tx_comp_wr_idx_addr_;\
  2627. /* DWORD 4 (or 6)*/\
  2628. _paddr__tx_ce_wr_idx_addr_;\
  2629. /* DWORD 5 (or 8)*/\
  2630. _paddr__rx_ind_ring_base_addr_;\
  2631. /* DWORD 6 (or 10)*/\
  2632. A_UINT32 rx_ind_ring_size;\
  2633. /* DWORD 7 (or 11)*/\
  2634. _paddr__rx_ind_rd_idx_addr_;\
  2635. /* DWORD 8 (or 13)*/\
  2636. _paddr__rx_ind_wr_idx_addr_;\
  2637. /* DWORD 9 (or 15)*/\
  2638. _paddr__rx_ring2_base_addr_;\
  2639. /* DWORD 10 (or 17) */\
  2640. A_UINT32 rx_ring2_size;\
  2641. /* DWORD 11 (or 18) */\
  2642. _paddr__rx_ring2_rd_idx_addr_;\
  2643. /* DWORD 12 (or 20) */\
  2644. _paddr__rx_ring2_wr_idx_addr_;\
  2645. } POSTPACK
  2646. /* define a htt_wdi_ipa_config32_t type */
  2647. TEMPLATE_HTT_WDI_IPA_CONFIG_T(32, HTT_VAR_PADDR32(tx_comp_ring_base_addr),
  2648. HTT_VAR_PADDR32(tx_comp_wr_idx_addr),
  2649. HTT_VAR_PADDR32(tx_ce_wr_idx_addr),
  2650. HTT_VAR_PADDR32(rx_ind_ring_base_addr),
  2651. HTT_VAR_PADDR32(rx_ind_rd_idx_addr),
  2652. HTT_VAR_PADDR32(rx_ind_wr_idx_addr),
  2653. HTT_VAR_PADDR32(rx_ring2_base_addr),
  2654. HTT_VAR_PADDR32(rx_ring2_rd_idx_addr),
  2655. HTT_VAR_PADDR32(rx_ring2_wr_idx_addr));
  2656. /* define a htt_wdi_ipa_config64_t type */
  2657. TEMPLATE_HTT_WDI_IPA_CONFIG_T(64, HTT_VAR_PADDR64_LE(tx_comp_ring_base_addr),
  2658. HTT_VAR_PADDR64_LE(tx_comp_wr_idx_addr),
  2659. HTT_VAR_PADDR64_LE(tx_ce_wr_idx_addr),
  2660. HTT_VAR_PADDR64_LE(rx_ind_ring_base_addr),
  2661. HTT_VAR_PADDR64_LE(rx_ind_rd_idx_addr),
  2662. HTT_VAR_PADDR64_LE(rx_ind_wr_idx_addr),
  2663. HTT_VAR_PADDR64_LE(rx_ring2_base_addr),
  2664. HTT_VAR_PADDR64_LE(rx_ring2_rd_idx_addr),
  2665. HTT_VAR_PADDR64_LE(rx_ring2_wr_idx_addr));
  2666. #if HTT_PADDR64
  2667. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  2668. #else
  2669. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  2670. #endif
  2671. enum htt_wdi_ipa_op_code {
  2672. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  2673. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  2674. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  2675. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  2676. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  2677. /* keep this last */
  2678. HTT_WDI_IPA_OPCODE_MAX
  2679. };
  2680. /**
  2681. * @brief HTT WDI_IPA Operation Request Message
  2682. *
  2683. * @details
  2684. * HTT WDI_IPA Operation Request message is sent by host
  2685. * to either suspend or resume WDI_IPA TX or RX path.
  2686. * |31 24|23 16|15 8|7 0|
  2687. * |----------------+----------------+----------------+----------------|
  2688. * | op_code | Rsvd | msg_type |
  2689. * |-------------------------------------------------------------------|
  2690. *
  2691. * Header fields:
  2692. * - MSG_TYPE
  2693. * Bits 7:0
  2694. * Purpose: Identifies this as WDI_IPA Operation Request message
  2695. * value: = 0x9
  2696. * - OP_CODE
  2697. * Bits 31:16
  2698. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  2699. * value: = enum htt_wdi_ipa_op_code
  2700. */
  2701. PREPACK struct htt_wdi_ipa_op_request_t {
  2702. /* DWORD 0: flags and meta-data */
  2703. A_UINT32
  2704. msg_type:8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  2705. reserved:8,
  2706. op_code:16;
  2707. } POSTPACK;
  2708. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  2709. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  2710. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  2711. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  2712. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> \
  2713. HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  2714. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  2715. do { \
  2716. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  2717. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  2718. } while (0)
  2719. /*=== target -> host messages ===============================================*/
  2720. enum htt_t2h_msg_type {
  2721. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  2722. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  2723. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  2724. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  2725. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  2726. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  2727. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  2728. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  2729. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  2730. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  2731. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  2732. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  2733. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc,/* no longer used */
  2734. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  2735. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  2736. /* only used for HL, add HTT MSG for HTT CREDIT update */
  2737. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  2738. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  2739. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  2740. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  2741. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  2742. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  2743. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  2744. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  2745. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  2746. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  2747. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  2748. HTT_T2H_MSG_TYPE_TEST,
  2749. /* keep this last */
  2750. HTT_T2H_NUM_MSGS
  2751. };
  2752. /*
  2753. * HTT target to host message type -
  2754. * stored in bits 7:0 of the first word of the message
  2755. */
  2756. #define HTT_T2H_MSG_TYPE_M 0xff
  2757. #define HTT_T2H_MSG_TYPE_S 0
  2758. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  2759. do { \
  2760. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  2761. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  2762. } while (0)
  2763. #define HTT_T2H_MSG_TYPE_GET(word) \
  2764. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  2765. /**
  2766. * @brief target -> host version number confirmation message definition
  2767. *
  2768. * |31 24|23 16|15 8|7 0|
  2769. * |----------------+----------------+----------------+----------------|
  2770. * | reserved | major number | minor number | msg type |
  2771. * |-------------------------------------------------------------------|
  2772. * : option request TLV (optional) |
  2773. * :...................................................................:
  2774. *
  2775. * The VER_CONF message may consist of a single 4-byte word, or may be
  2776. * extended with TLVs that specify HTT options selected by the target.
  2777. * The following option TLVs may be appended to the VER_CONF message:
  2778. * - LL_BUS_ADDR_SIZE
  2779. * - HL_SUPPRESS_TX_COMPL_IND
  2780. * - MAX_TX_QUEUE_GROUPS
  2781. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  2782. * may be appended to the VER_CONF message (but only one TLV of each type).
  2783. *
  2784. * Header fields:
  2785. * - MSG_TYPE
  2786. * Bits 7:0
  2787. * Purpose: identifies this as a version number confirmation message
  2788. * Value: 0x0
  2789. * - VER_MINOR
  2790. * Bits 15:8
  2791. * Purpose: Specify the minor number of the HTT message library version
  2792. * in use by the target firmware.
  2793. * The minor number specifies the specific revision within a range
  2794. * of fundamentally compatible HTT message definition revisions.
  2795. * Compatible revisions involve adding new messages or perhaps
  2796. * adding new fields to existing messages, in a backwards-compatible
  2797. * manner.
  2798. * Incompatible revisions involve changing the message type values,
  2799. * or redefining existing messages.
  2800. * Value: minor number
  2801. * - VER_MAJOR
  2802. * Bits 15:8
  2803. * Purpose: Specify the major number of the HTT message library version
  2804. * in use by the target firmware.
  2805. * The major number specifies the family of minor revisions that are
  2806. * fundamentally compatible with each other, but not with prior or
  2807. * later families.
  2808. * Value: major number
  2809. */
  2810. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  2811. #define HTT_VER_CONF_MINOR_S 8
  2812. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  2813. #define HTT_VER_CONF_MAJOR_S 16
  2814. #define HTT_VER_CONF_MINOR_SET(word, value) \
  2815. do { \
  2816. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  2817. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  2818. } while (0)
  2819. #define HTT_VER_CONF_MINOR_GET(word) \
  2820. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  2821. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  2822. do { \
  2823. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  2824. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  2825. } while (0)
  2826. #define HTT_VER_CONF_MAJOR_GET(word) \
  2827. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  2828. #define HTT_VER_CONF_BYTES 4
  2829. /**
  2830. * @brief - target -> host HTT Rx In order indication message
  2831. *
  2832. * @details
  2833. *
  2834. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  2835. * |----------------+-------------------+---------------------+---------------|
  2836. * | peer ID | | F| O| ext TID | msg type |
  2837. * |--------------------------------------------------------------------------|
  2838. * | MSDU count | Reserved | vdev id |
  2839. * |--------------------------------------------------------------------------|
  2840. * | MSDU 0 bus address (bits 31:0) |
  2841. #if HTT_PADDR64
  2842. * | MSDU 0 bus address (bits 63:32) |
  2843. #endif
  2844. * |--------------------------------------------------------------------------|
  2845. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  2846. * |--------------------------------------------------------------------------|
  2847. * | MSDU 1 bus address (bits 31:0) |
  2848. #if HTT_PADDR64
  2849. * | MSDU 1 bus address (bits 63:32) |
  2850. #endif
  2851. * |--------------------------------------------------------------------------|
  2852. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  2853. * |--------------------------------------------------------------------------|
  2854. */
  2855. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  2856. *
  2857. * @details
  2858. * bits
  2859. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  2860. * |-----+----+-------+--------+--------+---------+---------+-----------|
  2861. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  2862. * | | frag | | | | fail |chksum fail|
  2863. * |-----+----+-------+--------+--------+---------+---------+-----------|
  2864. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  2865. */
  2866. struct htt_rx_in_ord_paddr_ind_hdr_t {
  2867. A_UINT32 /* word 0 */
  2868. msg_type:8,
  2869. ext_tid:5,
  2870. offload:1,
  2871. frag:1,
  2872. reserved_0:1,
  2873. peer_id:16;
  2874. A_UINT32 /* word 1 */
  2875. vap_id:8,
  2876. reserved_1:8,
  2877. msdu_cnt:16;
  2878. };
  2879. struct htt_rx_in_ord_paddr_ind_msdu32_t {
  2880. A_UINT32 dma_addr;
  2881. A_UINT32
  2882. length:16,
  2883. fw_desc:8,
  2884. msdu_info:8;
  2885. };
  2886. struct htt_rx_in_ord_paddr_ind_msdu64_t {
  2887. A_UINT32 dma_addr_lo;
  2888. A_UINT32 dma_addr_hi;
  2889. A_UINT32
  2890. length:16,
  2891. fw_desc:8,
  2892. msdu_info:8;
  2893. };
  2894. #if HTT_PADDR64
  2895. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  2896. #else
  2897. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  2898. #endif
  2899. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES \
  2900. (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  2901. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS \
  2902. (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  2903. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET \
  2904. HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  2905. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET \
  2906. HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  2907. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 \
  2908. (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  2909. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 \
  2910. (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  2911. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 \
  2912. (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  2913. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 \
  2914. (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  2915. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES \
  2916. (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  2917. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS \
  2918. (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  2919. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  2920. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  2921. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  2922. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  2923. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  2924. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  2925. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  2926. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  2927. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  2928. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  2929. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  2930. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  2931. /* for systems using 64-bit format for bus addresses */
  2932. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  2933. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  2934. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  2935. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  2936. /* for systems using 32-bit format for bus addresses */
  2937. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  2938. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  2939. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  2940. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  2941. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  2942. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  2943. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  2944. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  2945. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  2946. do { \
  2947. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  2948. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  2949. } while (0)
  2950. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  2951. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> \
  2952. HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  2953. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  2954. do { \
  2955. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  2956. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  2957. } while (0)
  2958. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  2959. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> \
  2960. HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  2961. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  2962. do { \
  2963. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  2964. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  2965. } while (0)
  2966. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  2967. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> \
  2968. HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  2969. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  2970. do { \
  2971. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  2972. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  2973. } while (0)
  2974. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  2975. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> \
  2976. HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  2977. /* for systems using 64-bit format for bus addresses */
  2978. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  2979. do { \
  2980. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  2981. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  2982. } while (0)
  2983. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  2984. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> \
  2985. HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  2986. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  2987. do { \
  2988. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  2989. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  2990. } while (0)
  2991. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  2992. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> \
  2993. HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  2994. /* for systems using 32-bit format for bus addresses */
  2995. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  2996. do { \
  2997. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  2998. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  2999. } while (0)
  3000. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  3001. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> \
  3002. HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  3003. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  3004. do { \
  3005. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value);\
  3006. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  3007. } while (0)
  3008. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  3009. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> \
  3010. HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  3011. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  3012. do { \
  3013. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  3014. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  3015. } while (0)
  3016. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  3017. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> \
  3018. HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  3019. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  3020. do { \
  3021. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value);\
  3022. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S;\
  3023. } while (0)
  3024. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  3025. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> \
  3026. HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  3027. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  3028. do { \
  3029. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value);\
  3030. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  3031. } while (0)
  3032. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  3033. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> \
  3034. HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  3035. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  3036. do { \
  3037. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  3038. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  3039. } while (0)
  3040. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  3041. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> \
  3042. HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  3043. /* definitions used within target -> host rx indication message */
  3044. PREPACK struct htt_rx_ind_hdr_prefix_t {
  3045. A_UINT32 /* word 0 */
  3046. msg_type:8,
  3047. ext_tid:5,
  3048. release_valid:1,
  3049. flush_valid:1,
  3050. reserved0:1,
  3051. peer_id:16;
  3052. A_UINT32 /* word 1 */
  3053. flush_start_seq_num:6,
  3054. flush_end_seq_num:6,
  3055. release_start_seq_num:6,
  3056. release_end_seq_num:6,
  3057. num_mpdu_ranges:8;
  3058. } POSTPACK;
  3059. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  3060. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  3061. #define HTT_TGT_RSSI_INVALID 0x80
  3062. PREPACK struct htt_rx_ppdu_desc_t {
  3063. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  3064. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  3065. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  3066. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  3067. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  3068. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  3069. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  3070. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  3071. A_UINT32 /* word 0 */
  3072. rssi_cmb:8,
  3073. timestamp_submicrosec:8,
  3074. phy_err_code:8,
  3075. phy_err:1,
  3076. legacy_rate:4,
  3077. legacy_rate_sel:1,
  3078. end_valid:1,
  3079. start_valid:1;
  3080. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  3081. union {
  3082. A_UINT32 /* word 1 */
  3083. rssi0_pri20:8,
  3084. rssi0_ext20:8,
  3085. rssi0_ext40:8,
  3086. rssi0_ext80:8;
  3087. A_UINT32 rssi0; /* access all 20/40/80 per-b/w RSSIs together */
  3088. } u0;
  3089. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  3090. union {
  3091. A_UINT32 /* word 2 */
  3092. rssi1_pri20:8,
  3093. rssi1_ext20:8,
  3094. rssi1_ext40:8,
  3095. rssi1_ext80:8;
  3096. A_UINT32 rssi1; /* access all 20/40/80 per-b/w RSSIs together */
  3097. } u1;
  3098. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  3099. union {
  3100. A_UINT32 /* word 3 */
  3101. rssi2_pri20:8,
  3102. rssi2_ext20:8,
  3103. rssi2_ext40:8,
  3104. rssi2_ext80:8;
  3105. A_UINT32 rssi2; /* access all 20/40/80 per-b/w RSSIs together */
  3106. } u2;
  3107. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  3108. union {
  3109. A_UINT32 /* word 4 */
  3110. rssi3_pri20:8,
  3111. rssi3_ext20:8,
  3112. rssi3_ext40:8,
  3113. rssi3_ext80:8;
  3114. A_UINT32 rssi3; /* access all 20/40/80 per-b/w RSSIs together */
  3115. } u3;
  3116. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  3117. A_UINT32 tsf32; /* word 5 */
  3118. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  3119. A_UINT32 timestamp_microsec; /* word 6 */
  3120. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  3121. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  3122. A_UINT32 /* word 7 */
  3123. vht_sig_a1:24,
  3124. preamble_type:8;
  3125. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  3126. A_UINT32 /* word 8 */
  3127. vht_sig_a2:24,
  3128. reserved0:8;
  3129. } POSTPACK;
  3130. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  3131. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  3132. PREPACK struct htt_rx_ind_hdr_suffix_t {
  3133. A_UINT32 /* word 0 */
  3134. fw_rx_desc_bytes:16,
  3135. reserved0:16;
  3136. } POSTPACK;
  3137. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  3138. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  3139. PREPACK struct htt_rx_ind_hdr_t {
  3140. struct htt_rx_ind_hdr_prefix_t prefix;
  3141. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  3142. struct htt_rx_ind_hdr_suffix_t suffix;
  3143. } POSTPACK;
  3144. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  3145. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  3146. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  3147. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  3148. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  3149. /*
  3150. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  3151. * the offset into the HTT rx indication message at which the
  3152. * FW rx PPDU descriptor resides
  3153. */
  3154. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  3155. /*
  3156. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  3157. * the offset into the HTT rx indication message at which the
  3158. * header suffix (FW rx MSDU byte count) resides
  3159. */
  3160. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  3161. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  3162. /*
  3163. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  3164. * the offset into the HTT rx indication message at which the per-MSDU
  3165. * information starts
  3166. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  3167. * per-MSDU information portion of the message. The per-MSDU info itself
  3168. * starts at byte 12.
  3169. */
  3170. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  3171. /**
  3172. * @brief target -> host rx indication message definition
  3173. *
  3174. * @details
  3175. * The following field definitions describe the format of the rx indication
  3176. * message sent from the target to the host.
  3177. * The message consists of three major sections:
  3178. * 1. a fixed-length header
  3179. * 2. a variable-length list of firmware rx MSDU descriptors
  3180. * 3. one or more 4-octet MPDU range information elements
  3181. * The fixed length header itself has two sub-sections
  3182. * 1. the message meta-information, including identification of the
  3183. * sender and type of the received data, and a 4-octet flush/release IE
  3184. * 2. the firmware rx PPDU descriptor
  3185. *
  3186. * The format of the message is depicted below.
  3187. * in this depiction, the following abbreviations are used for information
  3188. * elements within the message:
  3189. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  3190. * elements associated with the PPDU start are valid.
  3191. * Specifically, the following fields are valid only if SV is set:
  3192. * RSSI (all variants), L, legacy rate, preamble type, service,
  3193. * VHT-SIG-A
  3194. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  3195. * elements associated with the PPDU end are valid.
  3196. * Specifically, the following fields are valid only if EV is set:
  3197. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  3198. * - L - Legacy rate selector - if legacy rates are used, this flag
  3199. * indicates whether the rate is from a CCK (L == 1) or OFDM
  3200. * (L == 0) PHY.
  3201. * - P - PHY error flag - boolean indication of whether the rx frame had
  3202. * a PHY error
  3203. *
  3204. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  3205. * |----------------+-------------------+---------------------+---------------|
  3206. * | peer ID | |RV|FV| ext TID | msg type |
  3207. * |--------------------------------------------------------------------------|
  3208. * | num | release | release | flush | flush |
  3209. * | MPDU | end | start | end | start |
  3210. * | ranges | seq num | seq num | seq num | seq num |
  3211. * |==========================================================================|
  3212. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  3213. * |V|V| | rate | | | timestamp | RSSI |
  3214. * |--------------------------------------------------------------------------|
  3215. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  3216. * |--------------------------------------------------------------------------|
  3217. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  3218. * |--------------------------------------------------------------------------|
  3219. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  3220. * |--------------------------------------------------------------------------|
  3221. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  3222. * |--------------------------------------------------------------------------|
  3223. * | TSF LSBs |
  3224. * |--------------------------------------------------------------------------|
  3225. * | microsec timestamp |
  3226. * |--------------------------------------------------------------------------|
  3227. * | preamble type | HT-SIG / VHT-SIG-A1 |
  3228. * |--------------------------------------------------------------------------|
  3229. * | service | HT-SIG / VHT-SIG-A2 |
  3230. * |==========================================================================|
  3231. * | reserved | FW rx desc bytes |
  3232. * |--------------------------------------------------------------------------|
  3233. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  3234. * | desc B3 | desc B2 | desc B1 | desc B0 |
  3235. * |--------------------------------------------------------------------------|
  3236. * : : :
  3237. * |--------------------------------------------------------------------------|
  3238. * | alignment | MSDU Rx |
  3239. * | padding | desc Bn |
  3240. * |--------------------------------------------------------------------------|
  3241. * | reserved | MPDU range status | MPDU count |
  3242. * |--------------------------------------------------------------------------|
  3243. * : reserved : MPDU range status : MPDU count :
  3244. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  3245. *
  3246. * Header fields:
  3247. * - MSG_TYPE
  3248. * Bits 7:0
  3249. * Purpose: identifies this as an rx indication message
  3250. * Value: 0x1
  3251. * - EXT_TID
  3252. * Bits 12:8
  3253. * Purpose: identify the traffic ID of the rx data, including
  3254. * special "extended" TID values for multicast, broadcast, and
  3255. * non-QoS data frames
  3256. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  3257. * - FLUSH_VALID (FV)
  3258. * Bit 13
  3259. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  3260. * is valid
  3261. * Value:
  3262. * 1 -> flush IE is valid and needs to be processed
  3263. * 0 -> flush IE is not valid and should be ignored
  3264. * - REL_VALID (RV)
  3265. * Bit 13
  3266. * Purpose: indicate whether the release IE (start/end sequence numbers)
  3267. * is valid
  3268. * Value:
  3269. * 1 -> release IE is valid and needs to be processed
  3270. * 0 -> release IE is not valid and should be ignored
  3271. * - PEER_ID
  3272. * Bits 31:16
  3273. * Purpose: Identify, by ID, which peer sent the rx data
  3274. * Value: ID of the peer who sent the rx data
  3275. * - FLUSH_SEQ_NUM_START
  3276. * Bits 5:0
  3277. * Purpose: Indicate the start of a series of MPDUs to flush
  3278. * Not all MPDUs within this series are necessarily valid - the host
  3279. * must check each sequence number within this range to see if the
  3280. * corresponding MPDU is actually present.
  3281. * This field is only valid if the FV bit is set.
  3282. * Value:
  3283. * The sequence number for the first MPDUs to check to flush.
  3284. * The sequence number is masked by 0x3f.
  3285. * - FLUSH_SEQ_NUM_END
  3286. * Bits 11:6
  3287. * Purpose: Indicate the end of a series of MPDUs to flush
  3288. * Value:
  3289. * The sequence number one larger than the sequence number of the
  3290. * last MPDU to check to flush.
  3291. * The sequence number is masked by 0x3f.
  3292. * Not all MPDUs within this series are necessarily valid - the host
  3293. * must check each sequence number within this range to see if the
  3294. * corresponding MPDU is actually present.
  3295. * This field is only valid if the FV bit is set.
  3296. * - REL_SEQ_NUM_START
  3297. * Bits 17:12
  3298. * Purpose: Indicate the start of a series of MPDUs to release.
  3299. * All MPDUs within this series are present and valid - the host
  3300. * need not check each sequence number within this range to see if
  3301. * the corresponding MPDU is actually present.
  3302. * This field is only valid if the RV bit is set.
  3303. * Value:
  3304. * The sequence number for the first MPDUs to check to release.
  3305. * The sequence number is masked by 0x3f.
  3306. * - REL_SEQ_NUM_END
  3307. * Bits 23:18
  3308. * Purpose: Indicate the end of a series of MPDUs to release.
  3309. * Value:
  3310. * The sequence number one larger than the sequence number of the
  3311. * last MPDU to check to release.
  3312. * The sequence number is masked by 0x3f.
  3313. * All MPDUs within this series are present and valid - the host
  3314. * need not check each sequence number within this range to see if
  3315. * the corresponding MPDU is actually present.
  3316. * This field is only valid if the RV bit is set.
  3317. * - NUM_MPDU_RANGES
  3318. * Bits 31:24
  3319. * Purpose: Indicate how many ranges of MPDUs are present.
  3320. * Each MPDU range consists of a series of contiguous MPDUs within the
  3321. * rx frame sequence which all have the same MPDU status.
  3322. * Value: 1-63 (typically a small number, like 1-3)
  3323. *
  3324. * Rx PPDU descriptor fields:
  3325. * - RSSI_CMB
  3326. * Bits 7:0
  3327. * Purpose: Combined RSSI from all active rx chains, across the active
  3328. * bandwidth.
  3329. * Value: RSSI dB units w.r.t. noise floor
  3330. * - TIMESTAMP_SUBMICROSEC
  3331. * Bits 15:8
  3332. * Purpose: high-resolution timestamp
  3333. * Value:
  3334. * Sub-microsecond time of PPDU reception.
  3335. * This timestamp ranges from [0,MAC clock MHz).
  3336. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  3337. * to form a high-resolution, large range rx timestamp.
  3338. * - PHY_ERR_CODE
  3339. * Bits 23:16
  3340. * Purpose:
  3341. * If the rx frame processing resulted in a PHY error, indicate what
  3342. * type of rx PHY error occurred.
  3343. * Value:
  3344. * This field is valid if the "P" (PHY_ERR) flag is set.
  3345. * TBD: document/specify the values for this field
  3346. * - PHY_ERR
  3347. * Bit 24
  3348. * Purpose: indicate whether the rx PPDU had a PHY error
  3349. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  3350. * - LEGACY_RATE
  3351. * Bits 28:25
  3352. * Purpose:
  3353. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  3354. * specify which rate was used.
  3355. * Value:
  3356. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  3357. * flag.
  3358. * If LEGACY_RATE_SEL is 0:
  3359. * 0x8: OFDM 48 Mbps
  3360. * 0x9: OFDM 24 Mbps
  3361. * 0xA: OFDM 12 Mbps
  3362. * 0xB: OFDM 6 Mbps
  3363. * 0xC: OFDM 54 Mbps
  3364. * 0xD: OFDM 36 Mbps
  3365. * 0xE: OFDM 18 Mbps
  3366. * 0xF: OFDM 9 Mbps
  3367. * If LEGACY_RATE_SEL is 1:
  3368. * 0x8: CCK 11 Mbps long preamble
  3369. * 0x9: CCK 5.5 Mbps long preamble
  3370. * 0xA: CCK 2 Mbps long preamble
  3371. * 0xB: CCK 1 Mbps long preamble
  3372. * 0xC: CCK 11 Mbps short preamble
  3373. * 0xD: CCK 5.5 Mbps short preamble
  3374. * 0xE: CCK 2 Mbps short preamble
  3375. * - LEGACY_RATE_SEL
  3376. * Bit 29
  3377. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  3378. * Value:
  3379. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  3380. * used a legacy rate.
  3381. * 0 -> OFDM, 1 -> CCK
  3382. * - END_VALID
  3383. * Bit 30
  3384. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  3385. * the start of the PPDU are valid. Specifically, the following
  3386. * fields are only valid if END_VALID is set:
  3387. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  3388. * TIMESTAMP_SUBMICROSEC
  3389. * Value:
  3390. * 0 -> rx PPDU desc end fields are not valid
  3391. * 1 -> rx PPDU desc end fields are valid
  3392. * - START_VALID
  3393. * Bit 31
  3394. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  3395. * the end of the PPDU are valid. Specifically, the following
  3396. * fields are only valid if START_VALID is set:
  3397. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  3398. * VHT-SIG-A
  3399. * Value:
  3400. * 0 -> rx PPDU desc start fields are not valid
  3401. * 1 -> rx PPDU desc start fields are valid
  3402. * - RSSI0_PRI20
  3403. * Bits 7:0
  3404. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  3405. * Value: RSSI dB units w.r.t. noise floor
  3406. *
  3407. * - RSSI0_EXT20
  3408. * Bits 7:0
  3409. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  3410. * (if the rx bandwidth was >= 40 MHz)
  3411. * Value: RSSI dB units w.r.t. noise floor
  3412. * - RSSI0_EXT40
  3413. * Bits 7:0
  3414. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  3415. * (if the rx bandwidth was >= 80 MHz)
  3416. * Value: RSSI dB units w.r.t. noise floor
  3417. * - RSSI0_EXT80
  3418. * Bits 7:0
  3419. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  3420. * (if the rx bandwidth was >= 160 MHz)
  3421. * Value: RSSI dB units w.r.t. noise floor
  3422. *
  3423. * - RSSI1_PRI20
  3424. * Bits 7:0
  3425. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  3426. * Value: RSSI dB units w.r.t. noise floor
  3427. * - RSSI1_EXT20
  3428. * Bits 7:0
  3429. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  3430. * (if the rx bandwidth was >= 40 MHz)
  3431. * Value: RSSI dB units w.r.t. noise floor
  3432. * - RSSI1_EXT40
  3433. * Bits 7:0
  3434. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  3435. * (if the rx bandwidth was >= 80 MHz)
  3436. * Value: RSSI dB units w.r.t. noise floor
  3437. * - RSSI1_EXT80
  3438. * Bits 7:0
  3439. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  3440. * (if the rx bandwidth was >= 160 MHz)
  3441. * Value: RSSI dB units w.r.t. noise floor
  3442. *
  3443. * - RSSI2_PRI20
  3444. * Bits 7:0
  3445. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  3446. * Value: RSSI dB units w.r.t. noise floor
  3447. * - RSSI2_EXT20
  3448. * Bits 7:0
  3449. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  3450. * (if the rx bandwidth was >= 40 MHz)
  3451. * Value: RSSI dB units w.r.t. noise floor
  3452. * - RSSI2_EXT40
  3453. * Bits 7:0
  3454. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  3455. * (if the rx bandwidth was >= 80 MHz)
  3456. * Value: RSSI dB units w.r.t. noise floor
  3457. * - RSSI2_EXT80
  3458. * Bits 7:0
  3459. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  3460. * (if the rx bandwidth was >= 160 MHz)
  3461. * Value: RSSI dB units w.r.t. noise floor
  3462. *
  3463. * - RSSI3_PRI20
  3464. * Bits 7:0
  3465. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  3466. * Value: RSSI dB units w.r.t. noise floor
  3467. * - RSSI3_EXT20
  3468. * Bits 7:0
  3469. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  3470. * (if the rx bandwidth was >= 40 MHz)
  3471. * Value: RSSI dB units w.r.t. noise floor
  3472. * - RSSI3_EXT40
  3473. * Bits 7:0
  3474. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  3475. * (if the rx bandwidth was >= 80 MHz)
  3476. * Value: RSSI dB units w.r.t. noise floor
  3477. * - RSSI3_EXT80
  3478. * Bits 7:0
  3479. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  3480. * (if the rx bandwidth was >= 160 MHz)
  3481. * Value: RSSI dB units w.r.t. noise floor
  3482. *
  3483. * - TSF32
  3484. * Bits 31:0
  3485. * Purpose: specify the time the rx PPDU was received, in TSF units
  3486. * Value: 32 LSBs of the TSF
  3487. * - TIMESTAMP_MICROSEC
  3488. * Bits 31:0
  3489. * Purpose: specify the time the rx PPDU was received, in microsecond units
  3490. * Value: PPDU rx time, in microseconds
  3491. * - VHT_SIG_A1
  3492. * Bits 23:0
  3493. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  3494. * from the rx PPDU
  3495. * Value:
  3496. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  3497. * VHT-SIG-A1 data.
  3498. * If PREAMBLE_TYPE specifies HT, then this field contains the
  3499. * first 24 bits of the HT-SIG data.
  3500. * Otherwise, this field is invalid.
  3501. * Refer to the the 802.11 protocol for the definition of the
  3502. * HT-SIG and VHT-SIG-A1 fields
  3503. * - VHT_SIG_A2
  3504. * Bits 23:0
  3505. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  3506. * from the rx PPDU
  3507. * Value:
  3508. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  3509. * VHT-SIG-A2 data.
  3510. * If PREAMBLE_TYPE specifies HT, then this field contains the
  3511. * last 24 bits of the HT-SIG data.
  3512. * Otherwise, this field is invalid.
  3513. * Refer to the the 802.11 protocol for the definition of the
  3514. * HT-SIG and VHT-SIG-A2 fields
  3515. * - PREAMBLE_TYPE
  3516. * Bits 31:24
  3517. * Purpose: indicate the PHY format of the received burst
  3518. * Value:
  3519. * 0x4: Legacy (OFDM/CCK)
  3520. * 0x8: HT
  3521. * 0x9: HT with TxBF
  3522. * 0xC: VHT
  3523. * 0xD: VHT with TxBF
  3524. * - SERVICE
  3525. * Bits 31:24
  3526. * Purpose: TBD
  3527. * Value: TBD
  3528. *
  3529. * Rx MSDU descriptor fields:
  3530. * - FW_RX_DESC_BYTES
  3531. * Bits 15:0
  3532. * Purpose: Indicate how many bytes in the Rx indication are used for
  3533. * FW Rx descriptors
  3534. *
  3535. * Payload fields:
  3536. * - MPDU_COUNT
  3537. * Bits 7:0
  3538. * Purpose: Indicate how many sequential MPDUs share the same status.
  3539. * All MPDUs within the indicated list are from the same RA-TA-TID.
  3540. * - MPDU_STATUS
  3541. * Bits 15:8
  3542. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  3543. * received successfully.
  3544. * Value:
  3545. * 0x1: success
  3546. * 0x2: FCS error
  3547. * 0x3: duplicate error
  3548. * 0x4: replay error
  3549. * 0x5: invalid peer
  3550. */
  3551. /* header fields */
  3552. #define HTT_RX_IND_EXT_TID_M 0x1f00
  3553. #define HTT_RX_IND_EXT_TID_S 8
  3554. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  3555. #define HTT_RX_IND_FLUSH_VALID_S 13
  3556. #define HTT_RX_IND_REL_VALID_M 0x4000
  3557. #define HTT_RX_IND_REL_VALID_S 14
  3558. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  3559. #define HTT_RX_IND_PEER_ID_S 16
  3560. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  3561. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  3562. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  3563. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  3564. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  3565. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  3566. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  3567. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  3568. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  3569. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  3570. /* rx PPDU descriptor fields */
  3571. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  3572. #define HTT_RX_IND_RSSI_CMB_S 0
  3573. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  3574. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  3575. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  3576. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  3577. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  3578. #define HTT_RX_IND_PHY_ERR_S 24
  3579. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  3580. #define HTT_RX_IND_LEGACY_RATE_S 25
  3581. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  3582. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  3583. #define HTT_RX_IND_END_VALID_M 0x40000000
  3584. #define HTT_RX_IND_END_VALID_S 30
  3585. #define HTT_RX_IND_START_VALID_M 0x80000000
  3586. #define HTT_RX_IND_START_VALID_S 31
  3587. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  3588. #define HTT_RX_IND_RSSI_PRI20_S 0
  3589. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  3590. #define HTT_RX_IND_RSSI_EXT20_S 8
  3591. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  3592. #define HTT_RX_IND_RSSI_EXT40_S 16
  3593. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  3594. #define HTT_RX_IND_RSSI_EXT80_S 24
  3595. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  3596. #define HTT_RX_IND_VHT_SIG_A1_S 0
  3597. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  3598. #define HTT_RX_IND_VHT_SIG_A2_S 0
  3599. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  3600. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  3601. #define HTT_RX_IND_SERVICE_M 0xff000000
  3602. #define HTT_RX_IND_SERVICE_S 24
  3603. /* rx MSDU descriptor fields */
  3604. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  3605. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  3606. /* payload fields */
  3607. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  3608. #define HTT_RX_IND_MPDU_COUNT_S 0
  3609. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  3610. #define HTT_RX_IND_MPDU_STATUS_S 8
  3611. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  3612. do { \
  3613. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  3614. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  3615. } while (0)
  3616. #define HTT_RX_IND_EXT_TID_GET(word) \
  3617. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  3618. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  3619. do { \
  3620. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  3621. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  3622. } while (0)
  3623. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  3624. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  3625. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  3626. do { \
  3627. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  3628. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  3629. } while (0)
  3630. #define HTT_RX_IND_REL_VALID_GET(word) \
  3631. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  3632. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  3633. do { \
  3634. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  3635. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  3636. } while (0)
  3637. #define HTT_RX_IND_PEER_ID_GET(word) \
  3638. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  3639. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  3640. do { \
  3641. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  3642. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  3643. } while (0)
  3644. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  3645. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> \
  3646. HTT_RX_IND_FW_RX_DESC_BYTES_S)
  3647. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  3648. do { \
  3649. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  3650. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  3651. } while (0)
  3652. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  3653. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  3654. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  3655. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  3656. do { \
  3657. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  3658. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  3659. } while (0)
  3660. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  3661. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  3662. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  3663. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  3664. do { \
  3665. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  3666. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  3667. } while (0)
  3668. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  3669. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  3670. HTT_RX_IND_REL_SEQ_NUM_START_S)
  3671. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  3672. do { \
  3673. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  3674. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  3675. } while (0)
  3676. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  3677. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  3678. HTT_RX_IND_REL_SEQ_NUM_END_S)
  3679. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  3680. do { \
  3681. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  3682. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  3683. } while (0)
  3684. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  3685. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  3686. HTT_RX_IND_NUM_MPDU_RANGES_S)
  3687. /* FW rx PPDU descriptor fields */
  3688. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  3689. do { \
  3690. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  3691. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  3692. } while (0)
  3693. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  3694. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  3695. HTT_RX_IND_RSSI_CMB_S)
  3696. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  3697. do { \
  3698. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  3699. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  3700. } while (0)
  3701. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  3702. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  3703. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  3704. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  3705. do { \
  3706. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  3707. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  3708. } while (0)
  3709. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  3710. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  3711. HTT_RX_IND_PHY_ERR_CODE_S)
  3712. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  3713. do { \
  3714. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  3715. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  3716. } while (0)
  3717. #define HTT_RX_IND_PHY_ERR_GET(word) \
  3718. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  3719. HTT_RX_IND_PHY_ERR_S)
  3720. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  3721. do { \
  3722. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  3723. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  3724. } while (0)
  3725. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  3726. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  3727. HTT_RX_IND_LEGACY_RATE_S)
  3728. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  3729. do { \
  3730. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  3731. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  3732. } while (0)
  3733. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  3734. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  3735. HTT_RX_IND_LEGACY_RATE_SEL_S)
  3736. #define HTT_RX_IND_END_VALID_SET(word, value) \
  3737. do { \
  3738. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  3739. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  3740. } while (0)
  3741. #define HTT_RX_IND_END_VALID_GET(word) \
  3742. (((word) & HTT_RX_IND_END_VALID_M) >> \
  3743. HTT_RX_IND_END_VALID_S)
  3744. #define HTT_RX_IND_START_VALID_SET(word, value) \
  3745. do { \
  3746. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  3747. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  3748. } while (0)
  3749. #define HTT_RX_IND_START_VALID_GET(word) \
  3750. (((word) & HTT_RX_IND_START_VALID_M) >> \
  3751. HTT_RX_IND_START_VALID_S)
  3752. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  3753. do { \
  3754. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  3755. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  3756. } while (0)
  3757. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  3758. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  3759. HTT_RX_IND_RSSI_PRI20_S)
  3760. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  3761. do { \
  3762. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  3763. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  3764. } while (0)
  3765. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  3766. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  3767. HTT_RX_IND_RSSI_EXT20_S)
  3768. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  3769. do { \
  3770. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  3771. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  3772. } while (0)
  3773. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  3774. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  3775. HTT_RX_IND_RSSI_EXT40_S)
  3776. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  3777. do { \
  3778. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  3779. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  3780. } while (0)
  3781. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  3782. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  3783. HTT_RX_IND_RSSI_EXT80_S)
  3784. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  3785. do { \
  3786. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  3787. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  3788. } while (0)
  3789. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  3790. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  3791. HTT_RX_IND_VHT_SIG_A1_S)
  3792. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  3793. do { \
  3794. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  3795. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  3796. } while (0)
  3797. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  3798. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  3799. HTT_RX_IND_VHT_SIG_A2_S)
  3800. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  3801. do { \
  3802. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  3803. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  3804. } while (0)
  3805. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  3806. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  3807. HTT_RX_IND_PREAMBLE_TYPE_S)
  3808. #define HTT_RX_IND_SERVICE_SET(word, value) \
  3809. do { \
  3810. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  3811. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  3812. } while (0)
  3813. #define HTT_RX_IND_SERVICE_GET(word) \
  3814. (((word) & HTT_RX_IND_SERVICE_M) >> \
  3815. HTT_RX_IND_SERVICE_S)
  3816. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  3817. do { \
  3818. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  3819. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  3820. } while (0)
  3821. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  3822. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  3823. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  3824. do { \
  3825. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  3826. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  3827. } while (0)
  3828. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  3829. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  3830. #define HTT_RX_IND_HL_BYTES \
  3831. (HTT_RX_IND_HDR_BYTES + \
  3832. 4 /* single FW rx MSDU descriptor, plus padding */ + \
  3833. 4 /* single MPDU range information element */)
  3834. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  3835. /* Could we use one macro entry? */
  3836. #define HTT_WORD_SET(word, field, value) \
  3837. do { \
  3838. HTT_CHECK_SET_VAL(field, value); \
  3839. (word) |= ((value) << field ## _S); \
  3840. } while (0)
  3841. #define HTT_WORD_GET(word, field) \
  3842. (((word) & field ## _M) >> field ## _S)
  3843. PREPACK struct hl_htt_rx_ind_base {
  3844. /*
  3845. * align with LL case rx indication message,but
  3846. * reduced to 5 words
  3847. */
  3848. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32];
  3849. } POSTPACK;
  3850. /*
  3851. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  3852. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  3853. * HL host needed info. The field is just after the msdu fw rx desc.
  3854. */
  3855. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  3856. (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  3857. struct htt_rx_ind_hl_rx_desc_t {
  3858. A_UINT8 ver;
  3859. A_UINT8 len;
  3860. struct {
  3861. A_UINT8
  3862. first_msdu:1,
  3863. last_msdu:1,
  3864. c3_failed:1,
  3865. c4_failed:1,
  3866. ipv6:1,
  3867. tcp:1,
  3868. udp:1,
  3869. reserved:1;
  3870. } flags;
  3871. };
  3872. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  3873. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  3874. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  3875. #define HTT_RX_IND_HL_RX_DESC_VER 0
  3876. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  3877. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  3878. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  3879. #define HTT_RX_IND_HL_FLAG_OFFSET \
  3880. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  3881. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  3882. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  3883. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  3884. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  3885. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  3886. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or ipv4 */
  3887. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  3888. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  3889. /* This structure is used in HL, the basic descriptor information
  3890. * used by host. the structure is translated by FW from HW desc
  3891. * or generated by FW. But in HL monitor mode, the host would use
  3892. * the same structure with LL.
  3893. */
  3894. PREPACK struct hl_htt_rx_desc_base {
  3895. A_UINT32
  3896. seq_num:12,
  3897. encrypted:1,
  3898. chan_info_present:1,
  3899. resv0:2,
  3900. mcast_bcast:1,
  3901. fragment:1,
  3902. key_id_oct:8,
  3903. resv1:6;
  3904. A_UINT32 pn_31_0;
  3905. union {
  3906. struct {
  3907. A_UINT16 pn_47_32;
  3908. A_UINT16 pn_63_48;
  3909. } pn16;
  3910. A_UINT32 pn_63_32;
  3911. } u0;
  3912. A_UINT32 pn_95_64;
  3913. A_UINT32 pn_127_96;
  3914. } POSTPACK;
  3915. /*
  3916. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  3917. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  3918. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  3919. * Please see htt_chan_change_t for description of the fields.
  3920. */
  3921. PREPACK struct htt_chan_info_t
  3922. {
  3923. A_UINT32
  3924. primary_chan_center_freq_mhz:16,
  3925. contig_chan1_center_freq_mhz:16;
  3926. A_UINT32
  3927. contig_chan2_center_freq_mhz:16,
  3928. phy_mode:8,
  3929. reserved:8;
  3930. } POSTPACK;
  3931. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  3932. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  3933. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  3934. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  3935. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  3936. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  3937. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  3938. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  3939. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  3940. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  3941. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  3942. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  3943. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  3944. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  3945. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  3946. #define HTT_HL_RX_DESC_PN_OFFSET \
  3947. offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  3948. #define HTT_HL_RX_DESC_PN_WORD_OFFSET \
  3949. (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  3950. /* Channel information */
  3951. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  3952. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  3953. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  3954. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  3955. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  3956. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  3957. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  3958. #define HTT_CHAN_INFO_PHY_MODE_S 16
  3959. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  3960. do { \
  3961. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  3962. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  3963. } while (0)
  3964. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  3965. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) \
  3966. >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  3967. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  3968. do { \
  3969. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  3970. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  3971. } while (0)
  3972. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  3973. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) \
  3974. >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  3975. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  3976. do { \
  3977. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  3978. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  3979. } while (0)
  3980. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  3981. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) \
  3982. >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  3983. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  3984. do { \
  3985. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  3986. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  3987. } while (0)
  3988. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  3989. (((word) & HTT_CHAN_INFO_PHY_MODE_M) \
  3990. >> HTT_CHAN_INFO_PHY_MODE_S)
  3991. /*
  3992. * @brief target -> host rx reorder flush message definition
  3993. *
  3994. * @details
  3995. * The following field definitions describe the format of the rx flush
  3996. * message sent from the target to the host.
  3997. * The message consists of a 4-octet header, followed by one or more
  3998. * 4-octet payload information elements.
  3999. *
  4000. * |31 24|23 8|7 0|
  4001. * |--------------------------------------------------------------|
  4002. * | TID | peer ID | msg type |
  4003. * |--------------------------------------------------------------|
  4004. * | seq num end | seq num start | MPDU status | reserved |
  4005. * |--------------------------------------------------------------|
  4006. * First DWORD:
  4007. * - MSG_TYPE
  4008. * Bits 7:0
  4009. * Purpose: identifies this as an rx flush message
  4010. * Value: 0x2
  4011. * - PEER_ID
  4012. * Bits 23:8 (only bits 18:8 actually used)
  4013. * Purpose: identify which peer's rx data is being flushed
  4014. * Value: (rx) peer ID
  4015. * - TID
  4016. * Bits 31:24 (only bits 27:24 actually used)
  4017. * Purpose: Specifies which traffic identifier's rx data is being flushed
  4018. * Value: traffic identifier
  4019. * Second DWORD:
  4020. * - MPDU_STATUS
  4021. * Bits 15:8
  4022. * Purpose:
  4023. * Indicate whether the flushed MPDUs should be discarded or processed.
  4024. * Value:
  4025. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  4026. * stages of rx processing
  4027. * other: discard the MPDUs
  4028. * It is anticipated that flush messages will always have
  4029. * MPDU status == 1, but the status flag is included for
  4030. * flexibility.
  4031. * - SEQ_NUM_START
  4032. * Bits 23:16
  4033. * Purpose:
  4034. * Indicate the start of a series of consecutive MPDUs being flushed.
  4035. * Not all MPDUs within this range are necessarily valid - the host
  4036. * must check each sequence number within this range to see if the
  4037. * corresponding MPDU is actually present.
  4038. * Value:
  4039. * The sequence number for the first MPDU in the sequence.
  4040. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  4041. * - SEQ_NUM_END
  4042. * Bits 30:24
  4043. * Purpose:
  4044. * Indicate the end of a series of consecutive MPDUs being flushed.
  4045. * Value:
  4046. * The sequence number one larger than the sequence number of the
  4047. * last MPDU being flushed.
  4048. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  4049. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  4050. * are to be released for further rx processing.
  4051. * Not all MPDUs within this range are necessarily valid - the host
  4052. * must check each sequence number within this range to see if the
  4053. * corresponding MPDU is actually present.
  4054. */
  4055. /* first DWORD */
  4056. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  4057. #define HTT_RX_FLUSH_PEER_ID_S 8
  4058. #define HTT_RX_FLUSH_TID_M 0xff000000
  4059. #define HTT_RX_FLUSH_TID_S 24
  4060. /* second DWORD */
  4061. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  4062. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  4063. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  4064. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  4065. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  4066. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  4067. #define HTT_RX_FLUSH_BYTES 8
  4068. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  4069. do { \
  4070. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  4071. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  4072. } while (0)
  4073. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  4074. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  4075. #define HTT_RX_FLUSH_TID_SET(word, value) \
  4076. do { \
  4077. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  4078. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  4079. } while (0)
  4080. #define HTT_RX_FLUSH_TID_GET(word) \
  4081. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  4082. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  4083. do { \
  4084. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  4085. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  4086. } while (0)
  4087. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  4088. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  4089. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  4090. do { \
  4091. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  4092. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  4093. } while (0)
  4094. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  4095. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> \
  4096. HTT_RX_FLUSH_SEQ_NUM_START_S)
  4097. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  4098. do { \
  4099. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  4100. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  4101. } while (0)
  4102. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  4103. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  4104. /*
  4105. * @brief target -> host rx pn check indication message
  4106. *
  4107. * @details
  4108. * The following field definitions describe the format of the Rx PN check
  4109. * indication message sent from the target to the host.
  4110. * The message consists of a 4-octet header, followed by the start and
  4111. * end sequence numbers to be released, followed by the PN IEs. Each PN
  4112. * IE is one octet containing the sequence number that failed the PN
  4113. * check.
  4114. *
  4115. * |31 24|23 8|7 0|
  4116. * |--------------------------------------------------------------|
  4117. * | TID | peer ID | msg type |
  4118. * |--------------------------------------------------------------|
  4119. * | Reserved | PN IE count | seq num end | seq num start|
  4120. * |--------------------------------------------------------------|
  4121. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  4122. * |--------------------------------------------------------------|
  4123. * First DWORD:
  4124. * - MSG_TYPE
  4125. * Bits 7:0
  4126. * Purpose: Identifies this as an rx pn check indication message
  4127. * Value: 0x2
  4128. * - PEER_ID
  4129. * Bits 23:8 (only bits 18:8 actually used)
  4130. * Purpose: identify which peer
  4131. * Value: (rx) peer ID
  4132. * - TID
  4133. * Bits 31:24 (only bits 27:24 actually used)
  4134. * Purpose: identify traffic identifier
  4135. * Value: traffic identifier
  4136. * Second DWORD:
  4137. * - SEQ_NUM_START
  4138. * Bits 7:0
  4139. * Purpose:
  4140. * Indicates the starting sequence number of the MPDU in this
  4141. * series of MPDUs that went though PN check.
  4142. * Value:
  4143. * The sequence number for the first MPDU in the sequence.
  4144. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  4145. * - SEQ_NUM_END
  4146. * Bits 15:8
  4147. * Purpose:
  4148. * Indicates the ending sequence number of the MPDU in this
  4149. * series of MPDUs that went though PN check.
  4150. * Value:
  4151. * The sequence number one larger then the sequence number of the last
  4152. * MPDU being flushed.
  4153. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  4154. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1]
  4155. * have been checked for invalid PN numbers and are ready
  4156. * to be released for further processing.
  4157. * Not all MPDUs within this range are necessarily valid - the host
  4158. * must check each sequence number within this range to see if the
  4159. * corresponding MPDU is actually present.
  4160. * - PN_IE_COUNT
  4161. * Bits 23:16
  4162. * Purpose:
  4163. * Used to determine the variable number of PN information
  4164. * elements in this message
  4165. *
  4166. * PN information elements:
  4167. * - PN_IE_x-
  4168. * Purpose:
  4169. * Each PN information element contains the sequence number
  4170. * of the MPDU that has failed the target PN check.
  4171. * Value:
  4172. * Contains the 6 LSBs of the 802.11 sequence number
  4173. * corresponding to the MPDU that failed the PN check.
  4174. */
  4175. /* first DWORD */
  4176. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  4177. #define HTT_RX_PN_IND_PEER_ID_S 8
  4178. #define HTT_RX_PN_IND_TID_M 0xff000000
  4179. #define HTT_RX_PN_IND_TID_S 24
  4180. /* second DWORD */
  4181. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  4182. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  4183. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  4184. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  4185. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  4186. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  4187. #define HTT_RX_PN_IND_BYTES 8
  4188. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  4189. do { \
  4190. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  4191. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  4192. } while (0)
  4193. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  4194. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  4195. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  4196. do { \
  4197. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  4198. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  4199. } while (0)
  4200. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  4201. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  4202. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  4203. do { \
  4204. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  4205. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  4206. } while (0)
  4207. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  4208. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> \
  4209. HTT_RX_PN_IND_SEQ_NUM_START_S)
  4210. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  4211. do { \
  4212. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  4213. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  4214. } while (0)
  4215. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  4216. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  4217. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  4218. do { \
  4219. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  4220. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  4221. } while (0)
  4222. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  4223. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  4224. /*
  4225. * @brief target -> host rx offload deliver message for LL system
  4226. *
  4227. * @details
  4228. * In a low latency system this message is sent whenever the offload
  4229. * manager flushes out the packets it has coalesced in its coalescing buffer.
  4230. * The DMA of the actual packets into host memory is done before sending out
  4231. * this message. This message indicates only how many MSDUs to reap. The
  4232. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  4233. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  4234. * DMA'd by the MAC directly into host memory these packets do not contain
  4235. * the MAC descriptors in the header portion of the packet. Instead they contain
  4236. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  4237. * message, the packets are delivered directly to the NW stack without going
  4238. * through the regular reorder buffering and PN checking path since it has
  4239. * already been done in target.
  4240. *
  4241. * |31 24|23 16|15 8|7 0|
  4242. * |-----------------------------------------------------------------------|
  4243. * | Total MSDU count | reserved | msg type |
  4244. * |-----------------------------------------------------------------------|
  4245. *
  4246. * @brief target -> host rx offload deliver message for HL system
  4247. *
  4248. * @details
  4249. * In a high latency system this message is sent whenever the offload manager
  4250. * flushes out the packets it has coalesced in its coalescing buffer. The
  4251. * actual packets are also carried along with this message. When the host
  4252. * receives this message, it is expected to deliver these packets to the NW
  4253. * stack directly instead of routing them through the reorder buffering and
  4254. * PN checking path since it has already been done in target.
  4255. *
  4256. * |31 24|23 16|15 8|7 0|
  4257. * |-----------------------------------------------------------------------|
  4258. * | Total MSDU count | reserved | msg type |
  4259. * |-----------------------------------------------------------------------|
  4260. * | peer ID | MSDU length |
  4261. * |-----------------------------------------------------------------------|
  4262. * | MSDU payload | FW Desc | tid | vdev ID |
  4263. * |-----------------------------------------------------------------------|
  4264. * | MSDU payload contd. |
  4265. * |-----------------------------------------------------------------------|
  4266. * | peer ID | MSDU length |
  4267. * |-----------------------------------------------------------------------|
  4268. * | MSDU payload | FW Desc | tid | vdev ID |
  4269. * |-----------------------------------------------------------------------|
  4270. * | MSDU payload contd. |
  4271. * |-----------------------------------------------------------------------|
  4272. *
  4273. */
  4274. /* first DWORD */
  4275. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  4276. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  4277. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  4278. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  4279. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  4280. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  4281. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  4282. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  4283. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  4284. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  4285. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  4286. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  4287. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  4288. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  4289. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  4290. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> \
  4291. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  4292. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  4293. do { \
  4294. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  4295. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  4296. } while (0) \
  4297. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  4298. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> \
  4299. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  4300. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  4301. do { \
  4302. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  4303. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  4304. } while (0) \
  4305. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  4306. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> \
  4307. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  4308. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  4309. do { \
  4310. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  4311. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  4312. } while (0) \
  4313. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  4314. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> \
  4315. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  4316. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  4317. do { \
  4318. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  4319. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  4320. } while (0) \
  4321. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  4322. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> \
  4323. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  4324. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  4325. do { \
  4326. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  4327. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  4328. } while (0) \
  4329. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  4330. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> \
  4331. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  4332. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  4333. do { \
  4334. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  4335. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  4336. } while (0) \
  4337. /**
  4338. * @brief target -> host rx peer map/unmap message definition
  4339. *
  4340. * @details
  4341. * The following diagram shows the format of the rx peer map message sent
  4342. * from the target to the host. This layout assumes the target operates
  4343. * as little-endian.
  4344. *
  4345. * |31 24|23 16|15 8|7 0|
  4346. * |-----------------------------------------------------------------------|
  4347. * | peer ID | VDEV ID | msg type |
  4348. * |-----------------------------------------------------------------------|
  4349. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  4350. * |-----------------------------------------------------------------------|
  4351. * | reserved | MAC addr 5 | MAC addr 4 |
  4352. * |-----------------------------------------------------------------------|
  4353. *
  4354. *
  4355. * The following diagram shows the format of the rx peer unmap message sent
  4356. * from the target to the host.
  4357. *
  4358. * |31 24|23 16|15 8|7 0|
  4359. * |-----------------------------------------------------------------------|
  4360. * | peer ID | VDEV ID | msg type |
  4361. * |-----------------------------------------------------------------------|
  4362. *
  4363. * The following field definitions describe the format of the rx peer map
  4364. * and peer unmap messages sent from the target to the host.
  4365. * - MSG_TYPE
  4366. * Bits 7:0
  4367. * Purpose: identifies this as an rx peer map or peer unmap message
  4368. * Value: peer map -> 0x3, peer unmap -> 0x4
  4369. * - VDEV_ID
  4370. * Bits 15:8
  4371. * Purpose: Indicates which virtual device the peer is associated
  4372. * with.
  4373. * Value: vdev ID (used in the host to look up the vdev object)
  4374. * - PEER_ID
  4375. * Bits 31:16
  4376. * Purpose: The peer ID (index) that WAL is allocating (map) or
  4377. * freeing (unmap)
  4378. * Value: (rx) peer ID
  4379. * - MAC_ADDR_L32 (peer map only)
  4380. * Bits 31:0
  4381. * Purpose: Identifies which peer node the peer ID is for.
  4382. * Value: lower 4 bytes of peer node's MAC address
  4383. * - MAC_ADDR_U16 (peer map only)
  4384. * Bits 15:0
  4385. * Purpose: Identifies which peer node the peer ID is for.
  4386. * Value: upper 2 bytes of peer node's MAC address
  4387. */
  4388. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  4389. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  4390. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  4391. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  4392. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  4393. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  4394. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  4395. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  4396. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  4397. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  4398. do { \
  4399. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  4400. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  4401. } while (0)
  4402. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  4403. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  4404. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  4405. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  4406. do { \
  4407. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  4408. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  4409. } while (0)
  4410. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  4411. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  4412. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  4413. #define HTT_RX_PEER_MAP_BYTES 12
  4414. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  4415. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  4416. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  4417. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  4418. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  4419. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  4420. #define HTT_RX_PEER_UNMAP_BYTES 4
  4421. /**
  4422. * @brief target -> host message specifying security parameters
  4423. *
  4424. * @details
  4425. * The following diagram shows the format of the security specification
  4426. * message sent from the target to the host.
  4427. * This security specification message tells the host whether a PN check is
  4428. * necessary on rx data frames, and if so, how large the PN counter is.
  4429. * This message also tells the host about the security processing to apply
  4430. * to defragmented rx frames - specifically, whether a Message Integrity
  4431. * Check is required, and the Michael key to use.
  4432. *
  4433. * |31 24|23 16|15|14 8|7 0|
  4434. * |-----------------------------------------------------------------------|
  4435. * | peer ID | U| security type | msg type |
  4436. * |-----------------------------------------------------------------------|
  4437. * | Michael Key K0 |
  4438. * |-----------------------------------------------------------------------|
  4439. * | Michael Key K1 |
  4440. * |-----------------------------------------------------------------------|
  4441. * | WAPI RSC Low0 |
  4442. * |-----------------------------------------------------------------------|
  4443. * | WAPI RSC Low1 |
  4444. * |-----------------------------------------------------------------------|
  4445. * | WAPI RSC Hi0 |
  4446. * |-----------------------------------------------------------------------|
  4447. * | WAPI RSC Hi1 |
  4448. * |-----------------------------------------------------------------------|
  4449. *
  4450. * The following field definitions describe the format of the security
  4451. * indication message sent from the target to the host.
  4452. * - MSG_TYPE
  4453. * Bits 7:0
  4454. * Purpose: identifies this as a security specification message
  4455. * Value: 0xb
  4456. * - SEC_TYPE
  4457. * Bits 14:8
  4458. * Purpose: specifies which type of security applies to the peer
  4459. * Value: htt_sec_type enum value
  4460. * - UNICAST
  4461. * Bit 15
  4462. * Purpose: whether this security is applied to unicast or multicast data
  4463. * Value: 1 -> unicast, 0 -> multicast
  4464. * - PEER_ID
  4465. * Bits 31:16
  4466. * Purpose: The ID number for the peer the security specification is for
  4467. * Value: peer ID
  4468. * - MICHAEL_KEY_K0
  4469. * Bits 31:0
  4470. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  4471. * Value: Michael Key K0 (if security type is TKIP)
  4472. * - MICHAEL_KEY_K1
  4473. * Bits 31:0
  4474. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  4475. * Value: Michael Key K1 (if security type is TKIP)
  4476. * - WAPI_RSC_LOW0
  4477. * Bits 31:0
  4478. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  4479. * Value: WAPI RSC Low0 (if security type is WAPI)
  4480. * - WAPI_RSC_LOW1
  4481. * Bits 31:0
  4482. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  4483. * Value: WAPI RSC Low1 (if security type is WAPI)
  4484. * - WAPI_RSC_HI0
  4485. * Bits 31:0
  4486. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  4487. * Value: WAPI RSC Hi0 (if security type is WAPI)
  4488. * - WAPI_RSC_HI1
  4489. * Bits 31:0
  4490. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  4491. * Value: WAPI RSC Hi1 (if security type is WAPI)
  4492. */
  4493. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  4494. #define HTT_SEC_IND_SEC_TYPE_S 8
  4495. #define HTT_SEC_IND_UNICAST_M 0x00008000
  4496. #define HTT_SEC_IND_UNICAST_S 15
  4497. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  4498. #define HTT_SEC_IND_PEER_ID_S 16
  4499. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  4500. do { \
  4501. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  4502. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  4503. } while (0)
  4504. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  4505. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  4506. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  4507. do { \
  4508. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  4509. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  4510. } while (0)
  4511. #define HTT_SEC_IND_UNICAST_GET(word) \
  4512. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  4513. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  4514. do { \
  4515. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  4516. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  4517. } while (0)
  4518. #define HTT_SEC_IND_PEER_ID_GET(word) \
  4519. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  4520. #define HTT_SEC_IND_BYTES 28
  4521. /**
  4522. * @brief target -> host rx ADDBA / DELBA message definitions
  4523. *
  4524. * @details
  4525. * The following diagram shows the format of the rx ADDBA message sent
  4526. * from the target to the host:
  4527. *
  4528. * |31 20|19 16|15 8|7 0|
  4529. * |---------------------------------------------------------------------|
  4530. * | peer ID | TID | window size | msg type |
  4531. * |---------------------------------------------------------------------|
  4532. *
  4533. * The following diagram shows the format of the rx DELBA message sent
  4534. * from the target to the host:
  4535. *
  4536. * |31 20|19 16|15 8|7 0|
  4537. * |---------------------------------------------------------------------|
  4538. * | peer ID | TID | reserved | msg type |
  4539. * |---------------------------------------------------------------------|
  4540. *
  4541. * The following field definitions describe the format of the rx ADDBA
  4542. * and DELBA messages sent from the target to the host.
  4543. * - MSG_TYPE
  4544. * Bits 7:0
  4545. * Purpose: identifies this as an rx ADDBA or DELBA message
  4546. * Value: ADDBA -> 0x5, DELBA -> 0x6
  4547. * - WIN_SIZE
  4548. * Bits 15:8 (ADDBA only)
  4549. * Purpose: Specifies the length of the block ack window (max = 64).
  4550. * Value:
  4551. * block ack window length specified by the received ADDBA
  4552. * management message.
  4553. * - TID
  4554. * Bits 19:16
  4555. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  4556. * Value:
  4557. * TID specified by the received ADDBA or DELBA management message.
  4558. * - PEER_ID
  4559. * Bits 31:20
  4560. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  4561. * Value:
  4562. * ID (hash value) used by the host for fast, direct lookup of
  4563. * host SW peer info, including rx reorder states.
  4564. */
  4565. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  4566. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  4567. #define HTT_RX_ADDBA_TID_M 0xf0000
  4568. #define HTT_RX_ADDBA_TID_S 16
  4569. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  4570. #define HTT_RX_ADDBA_PEER_ID_S 20
  4571. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  4572. do { \
  4573. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  4574. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  4575. } while (0)
  4576. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  4577. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  4578. #define HTT_RX_ADDBA_TID_SET(word, value) \
  4579. do { \
  4580. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  4581. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  4582. } while (0)
  4583. #define HTT_RX_ADDBA_TID_GET(word) \
  4584. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  4585. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  4586. do { \
  4587. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  4588. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  4589. } while (0)
  4590. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  4591. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  4592. #define HTT_RX_ADDBA_BYTES 4
  4593. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  4594. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  4595. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  4596. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  4597. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  4598. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  4599. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  4600. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  4601. #define HTT_RX_DELBA_BYTES 4
  4602. /**
  4603. * @brief tx queue group information element definition
  4604. *
  4605. * @details
  4606. * The following diagram shows the format of the tx queue group
  4607. * information element, which can be included in target --> host
  4608. * messages to specify the number of tx "credits" (tx descriptors
  4609. * for LL, or tx buffers for HL) available to a particular group
  4610. * of host-side tx queues, and which host-side tx queues belong to
  4611. * the group.
  4612. *
  4613. * |31|30 24|23 16|15|14|13 0|
  4614. * |------------------------------------------------------------------------|
  4615. * | X| reserved | tx queue grp ID | A| S| credit count |
  4616. * |------------------------------------------------------------------------|
  4617. * | vdev ID mask | AC mask |
  4618. * |------------------------------------------------------------------------|
  4619. *
  4620. * The following definitions describe the fields within the tx queue group
  4621. * information element:
  4622. * - credit_count
  4623. * Bits 13:1
  4624. * Purpose: specify how many tx credits are available to the tx queue group
  4625. * Value: An absolute or relative, positive or negative credit value
  4626. * The 'A' bit specifies whether the value is absolute or relative.
  4627. * The 'S' bit specifies whether the value is positive or negative.
  4628. * A negative value can only be relative, not absolute.
  4629. * An absolute value replaces any prior credit value the host has for
  4630. * the tx queue group in question.
  4631. * A relative value is added to the prior credit value the host has for
  4632. * the tx queue group in question.
  4633. * - sign
  4634. * Bit 14
  4635. * Purpose: specify whether the credit count is positive or negative
  4636. * Value: 0 -> positive, 1 -> negative
  4637. * - absolute
  4638. * Bit 15
  4639. * Purpose: specify whether the credit count is absolute or relative
  4640. * Value: 0 -> relative, 1 -> absolute
  4641. * - txq_group_id
  4642. * Bits 23:16
  4643. * Purpose: indicate which tx queue group's credit and/or membership are
  4644. * being specified
  4645. * Value: 0 to max_tx_queue_groups-1
  4646. * - reserved
  4647. * Bits 30:16
  4648. * Value: 0x0
  4649. * - eXtension
  4650. * Bit 31
  4651. * Purpose: specify whether another tx queue group info element follows
  4652. * Value: 0 -> no more tx queue group information elements
  4653. * 1 -> another tx queue group information element immediately follows
  4654. * - ac_mask
  4655. * Bits 15:0
  4656. * Purpose: specify which Access Categories belong to the tx queue group
  4657. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  4658. * the tx queue group.
  4659. * The AC bit-mask values are obtained by left-shifting by the
  4660. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  4661. * - vdev_id_mask
  4662. * Bits 31:16
  4663. * Purpose: specify which vdev's tx queues belong to the tx queue group
  4664. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  4665. * belong to the tx queue group.
  4666. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  4667. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  4668. */
  4669. PREPACK struct htt_txq_group {
  4670. A_UINT32
  4671. credit_count:14,
  4672. sign:1,
  4673. absolute:1,
  4674. tx_queue_group_id:8,
  4675. reserved0:7,
  4676. extension:1;
  4677. A_UINT32
  4678. ac_mask:16,
  4679. vdev_id_mask:16;
  4680. } POSTPACK;
  4681. /* first word */
  4682. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  4683. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  4684. #define HTT_TXQ_GROUP_SIGN_S 14
  4685. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  4686. #define HTT_TXQ_GROUP_ABS_S 15
  4687. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  4688. #define HTT_TXQ_GROUP_ID_S 16
  4689. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  4690. #define HTT_TXQ_GROUP_EXT_S 31
  4691. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  4692. /* second word */
  4693. #define HTT_TXQ_GROUP_AC_MASK_S 0
  4694. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  4695. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  4696. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  4697. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  4698. do { \
  4699. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  4700. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  4701. } while (0)
  4702. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  4703. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> \
  4704. HTT_TXQ_GROUP_CREDIT_COUNT_S)
  4705. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  4706. do { \
  4707. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  4708. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  4709. } while (0)
  4710. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  4711. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  4712. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  4713. do { \
  4714. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  4715. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  4716. } while (0)
  4717. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  4718. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  4719. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  4720. do { \
  4721. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  4722. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  4723. } while (0)
  4724. #define HTT_TXQ_GROUP_ID_GET(_info) \
  4725. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  4726. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  4727. do { \
  4728. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  4729. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  4730. } while (0)
  4731. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  4732. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  4733. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  4734. do { \
  4735. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  4736. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  4737. } while (0)
  4738. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  4739. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  4740. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  4741. do { \
  4742. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  4743. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  4744. } while (0)
  4745. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  4746. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> \
  4747. HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  4748. /**
  4749. * @brief target -> host TX completion indication message definition
  4750. *
  4751. * @details
  4752. * The following diagram shows the format of the TX completion indication sent
  4753. * from the target to the host
  4754. *
  4755. * |31 25| 24|23 16| 15 |14 11|10 8|7 0|
  4756. * |-------------------------------------------------------------|
  4757. * header: | reserved |append| num | t_i| tid |status| msg_type |
  4758. * |-------------------------------------------------------------|
  4759. * payload: | MSDU1 ID | MSDU0 ID |
  4760. * |-------------------------------------------------------------|
  4761. * : MSDU3 ID : MSDU2 ID :
  4762. * |-------------------------------------------------------------|
  4763. * | struct htt_tx_compl_ind_append_retries |
  4764. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  4765. *
  4766. * The following field definitions describe the format of the TX completion
  4767. * indication sent from the target to the host
  4768. * Header fields:
  4769. * - msg_type
  4770. * Bits 7:0
  4771. * Purpose: identifies this as HTT TX completion indication
  4772. * Value: 0x7
  4773. * - status
  4774. * Bits 10:8
  4775. * Purpose: the TX completion status of payload fragmentations descriptors
  4776. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  4777. * - tid
  4778. * Bits 14:11
  4779. * Purpose: the tid associated with those fragmentation descriptors. It is
  4780. * valid or not, depending on the tid_invalid bit.
  4781. * Value: 0 to 15
  4782. * - tid_invalid
  4783. * Bits 15:15
  4784. * Purpose: this bit indicates whether the tid field is valid or not
  4785. * Value: 0 indicates valid; 1 indicates invalid
  4786. * - num
  4787. * Bits 23:16
  4788. * Purpose: the number of payload in this indication
  4789. * Value: 1 to 255
  4790. * - append
  4791. * Bits 24:24
  4792. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  4793. * the number of tx retries for one MSDU at the end of this message
  4794. * Value: 0 indicates no appending; 1 indicates appending
  4795. * Payload fields:
  4796. * - hmsdu_id
  4797. * Bits 15:0
  4798. * Purpose: this ID is used to track the Tx buffer in host
  4799. * Value: 0 to "size of host MSDU descriptor pool - 1"
  4800. */
  4801. #define HTT_TX_COMPL_IND_STATUS_S 8
  4802. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  4803. #define HTT_TX_COMPL_IND_TID_S 11
  4804. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  4805. #define HTT_TX_COMPL_IND_TID_INV_S 15
  4806. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  4807. #define HTT_TX_COMPL_IND_NUM_S 16
  4808. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  4809. #define HTT_TX_COMPL_IND_APPEND_S 24
  4810. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  4811. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  4812. do { \
  4813. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  4814. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  4815. } while (0)
  4816. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  4817. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  4818. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  4819. do { \
  4820. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  4821. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  4822. } while (0)
  4823. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  4824. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  4825. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  4826. do { \
  4827. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  4828. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  4829. } while (0)
  4830. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  4831. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  4832. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  4833. do { \
  4834. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  4835. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  4836. } while (0)
  4837. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  4838. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  4839. HTT_TX_COMPL_IND_TID_INV_S)
  4840. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  4841. do { \
  4842. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  4843. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  4844. } while (0)
  4845. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  4846. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  4847. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  4848. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  4849. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  4850. #define HTT_TX_COMPL_IND_STAT_OK 0
  4851. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  4852. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  4853. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  4854. /*
  4855. * The PEER_DEL tx completion status is used for HL cases
  4856. * where the peer the frame is for has been deleted.
  4857. * The host has already discarded its copy of the frame, but
  4858. * it still needs the tx completion to restore its credit.
  4859. */
  4860. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  4861. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  4862. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  4863. PREPACK struct htt_tx_compl_ind_base {
  4864. A_UINT32 hdr;
  4865. A_UINT16 payload[1 /*or more */];
  4866. } POSTPACK;
  4867. PREPACK struct htt_tx_compl_ind_append_retries {
  4868. A_UINT16 msdu_id;
  4869. A_UINT8 tx_retries;
  4870. A_UINT8 flag;/* Bit 0, 1: another append_retries struct is appended
  4871. 0: this is the last append_retries struct */
  4872. } POSTPACK;
  4873. /**
  4874. * @brief target -> host rate-control update indication message
  4875. *
  4876. * @details
  4877. * The following diagram shows the format of the RC Update message
  4878. * sent from the target to the host, while processing the tx-completion
  4879. * of a transmitted PPDU.
  4880. *
  4881. * |31 24|23 16|15 8|7 0|
  4882. * |-------------------------------------------------------------|
  4883. * | peer ID | vdev ID | msg_type |
  4884. * |-------------------------------------------------------------|
  4885. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  4886. * |-------------------------------------------------------------|
  4887. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  4888. * |-------------------------------------------------------------|
  4889. * | : |
  4890. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  4891. * | : |
  4892. * |-------------------------------------------------------------|
  4893. * | : |
  4894. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  4895. * | : |
  4896. * |-------------------------------------------------------------|
  4897. * : :
  4898. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  4899. *
  4900. */
  4901. typedef struct {
  4902. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  4903. A_UINT32 rate_code_flags;
  4904. A_UINT32 flags; /* Encodes information such as excessive
  4905. retransmission, aggregate, some info
  4906. from .11 frame control,
  4907. STBC, LDPC, (SGI and Tx Chain Mask
  4908. are encoded in ptx_rc->flags field),
  4909. AMPDU truncation (BT/time based etc.),
  4910. RTS/CTS attempt */
  4911. A_UINT32 num_enqued;/* # of MPDUs (for non-AMPDU 1) for this rate */
  4912. A_UINT32 num_retries;/* Total # of transmission attempt for this rate */
  4913. A_UINT32 num_failed;/* # of failed MPDUs in A-MPDU, 0 otherwise */
  4914. A_UINT32 ack_rssi;/* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  4915. A_UINT32 time_stamp; /* ACK timestamp (helps determine age) */
  4916. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  4917. } HTT_RC_TX_DONE_PARAMS;
  4918. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS))/* bytes */
  4919. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  4920. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  4921. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  4922. #define HTT_RC_UPDATE_VDEVID_S 8
  4923. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  4924. #define HTT_RC_UPDATE_PEERID_S 16
  4925. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  4926. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  4927. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  4928. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  4929. do { \
  4930. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  4931. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  4932. } while (0)
  4933. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  4934. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  4935. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  4936. do { \
  4937. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  4938. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  4939. } while (0)
  4940. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  4941. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  4942. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  4943. do { \
  4944. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  4945. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  4946. } while (0)
  4947. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  4948. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  4949. /**
  4950. * @brief target -> host rx fragment indication message definition
  4951. *
  4952. * @details
  4953. * The following field definitions describe the format of the rx fragment
  4954. * indication message sent from the target to the host.
  4955. * The rx fragment indication message shares the format of the
  4956. * rx indication message, but not all fields from the rx indication message
  4957. * are relevant to the rx fragment indication message.
  4958. *
  4959. *
  4960. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  4961. * |-----------+-------------------+---------------------+-------------|
  4962. * | peer ID | |FV| ext TID | msg type |
  4963. * |-------------------------------------------------------------------|
  4964. * | | flush | flush |
  4965. * | | end | start |
  4966. * | | seq num | seq num |
  4967. * |-------------------------------------------------------------------|
  4968. * | reserved | FW rx desc bytes |
  4969. * |-------------------------------------------------------------------|
  4970. * | | FW MSDU Rx |
  4971. * | | desc B0 |
  4972. * |-------------------------------------------------------------------|
  4973. * Header fields:
  4974. * - MSG_TYPE
  4975. * Bits 7:0
  4976. * Purpose: identifies this as an rx fragment indication message
  4977. * Value: 0xa
  4978. * - EXT_TID
  4979. * Bits 12:8
  4980. * Purpose: identify the traffic ID of the rx data, including
  4981. * special "extended" TID values for multicast, broadcast, and
  4982. * non-QoS data frames
  4983. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  4984. * - FLUSH_VALID (FV)
  4985. * Bit 13
  4986. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  4987. * is valid
  4988. * Value:
  4989. * 1 -> flush IE is valid and needs to be processed
  4990. * 0 -> flush IE is not valid and should be ignored
  4991. * - PEER_ID
  4992. * Bits 31:16
  4993. * Purpose: Identify, by ID, which peer sent the rx data
  4994. * Value: ID of the peer who sent the rx data
  4995. * - FLUSH_SEQ_NUM_START
  4996. * Bits 5:0
  4997. * Purpose: Indicate the start of a series of MPDUs to flush
  4998. * Not all MPDUs within this series are necessarily valid - the host
  4999. * must check each sequence number within this range to see if the
  5000. * corresponding MPDU is actually present.
  5001. * This field is only valid if the FV bit is set.
  5002. * Value:
  5003. * The sequence number for the first MPDUs to check to flush.
  5004. * The sequence number is masked by 0x3f.
  5005. * - FLUSH_SEQ_NUM_END
  5006. * Bits 11:6
  5007. * Purpose: Indicate the end of a series of MPDUs to flush
  5008. * Value:
  5009. * The sequence number one larger than the sequence number of the
  5010. * last MPDU to check to flush.
  5011. * The sequence number is masked by 0x3f.
  5012. * Not all MPDUs within this series are necessarily valid - the host
  5013. * must check each sequence number within this range to see if the
  5014. * corresponding MPDU is actually present.
  5015. * This field is only valid if the FV bit is set.
  5016. * Rx descriptor fields:
  5017. * - FW_RX_DESC_BYTES
  5018. * Bits 15:0
  5019. * Purpose: Indicate how many bytes in the Rx indication are used for
  5020. * FW Rx descriptors
  5021. * Value: 1
  5022. */
  5023. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  5024. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  5025. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  5026. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  5027. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  5028. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  5029. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  5030. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  5031. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  5032. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  5033. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  5034. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  5035. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  5036. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  5037. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  5038. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  5039. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  5040. #define HTT_RX_FRAG_IND_BYTES \
  5041. (4 /* msg hdr */ + \
  5042. 4 /* flush spec */ + \
  5043. 4 /* (unused) FW rx desc bytes spec */ + \
  5044. 4 /* FW rx desc */)
  5045. /**
  5046. * @brief target -> host test message definition
  5047. *
  5048. * @details
  5049. * The following field definitions describe the format of the test
  5050. * message sent from the target to the host.
  5051. * The message consists of a 4-octet header, followed by a variable
  5052. * number of 32-bit integer values, followed by a variable number
  5053. * of 8-bit character values.
  5054. *
  5055. * |31 16|15 8|7 0|
  5056. * |-----------------------------------------------------------|
  5057. * | num chars | num ints | msg type |
  5058. * |-----------------------------------------------------------|
  5059. * | int 0 |
  5060. * |-----------------------------------------------------------|
  5061. * | int 1 |
  5062. * |-----------------------------------------------------------|
  5063. * | ... |
  5064. * |-----------------------------------------------------------|
  5065. * | char 3 | char 2 | char 1 | char 0 |
  5066. * |-----------------------------------------------------------|
  5067. * | | | ... | char 4 |
  5068. * |-----------------------------------------------------------|
  5069. * - MSG_TYPE
  5070. * Bits 7:0
  5071. * Purpose: identifies this as a test message
  5072. * Value: HTT_MSG_TYPE_TEST
  5073. * - NUM_INTS
  5074. * Bits 15:8
  5075. * Purpose: indicate how many 32-bit integers follow the message header
  5076. * - NUM_CHARS
  5077. * Bits 31:16
  5078. * Purpose: indicate how many 8-bit charaters follow the series of integers
  5079. */
  5080. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  5081. #define HTT_RX_TEST_NUM_INTS_S 8
  5082. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  5083. #define HTT_RX_TEST_NUM_CHARS_S 16
  5084. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  5085. do { \
  5086. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  5087. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  5088. } while (0)
  5089. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  5090. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  5091. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  5092. do { \
  5093. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  5094. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  5095. } while (0)
  5096. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  5097. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  5098. /**
  5099. * @brief target -> host packet log message
  5100. *
  5101. * @details
  5102. * The following field definitions describe the format of the packet log
  5103. * message sent from the target to the host.
  5104. * The message consists of a 4-octet header,followed by a variable number
  5105. * of 32-bit character values.
  5106. *
  5107. * |31 24|23 16|15 8|7 0|
  5108. * |-----------------------------------------------------------|
  5109. * | | | | msg type |
  5110. * |-----------------------------------------------------------|
  5111. * | payload |
  5112. * |-----------------------------------------------------------|
  5113. * - MSG_TYPE
  5114. * Bits 7:0
  5115. * Purpose: identifies this as a test message
  5116. * Value: HTT_MSG_TYPE_PACKETLOG
  5117. */
  5118. PREPACK struct htt_pktlog_msg {
  5119. A_UINT32 header;
  5120. A_UINT32 payload[1 /* or more */];
  5121. } POSTPACK;
  5122. /*
  5123. * Rx reorder statistics
  5124. * NB: all the fields must be defined in 4 octets size.
  5125. */
  5126. struct rx_reorder_stats {
  5127. /* Non QoS MPDUs received */
  5128. A_UINT32 deliver_non_qos;
  5129. /* MPDUs received in-order */
  5130. A_UINT32 deliver_in_order;
  5131. /* Flush due to reorder timer expired */
  5132. A_UINT32 deliver_flush_timeout;
  5133. /* Flush due to move out of window */
  5134. A_UINT32 deliver_flush_oow;
  5135. /* Flush due to DELBA */
  5136. A_UINT32 deliver_flush_delba;
  5137. /* MPDUs dropped due to FCS error */
  5138. A_UINT32 fcs_error;
  5139. /* MPDUs dropped due to monitor mode non-data packet */
  5140. A_UINT32 mgmt_ctrl;
  5141. /* Unicast-data MPDUs dropped due to invalid peer */
  5142. A_UINT32 invalid_peer;
  5143. /* MPDUs dropped due to duplication (non aggregation) */
  5144. A_UINT32 dup_non_aggr;
  5145. /* MPDUs dropped due to processed before */
  5146. A_UINT32 dup_past;
  5147. /* MPDUs dropped due to duplicate in reorder queue */
  5148. A_UINT32 dup_in_reorder;
  5149. /* Reorder timeout happened */
  5150. A_UINT32 reorder_timeout;
  5151. /* invalid bar ssn */
  5152. A_UINT32 invalid_bar_ssn;
  5153. /* reorder reset due to bar ssn */
  5154. A_UINT32 ssn_reset;
  5155. /* Flush due to delete peer */
  5156. A_UINT32 deliver_flush_delpeer;
  5157. /* Flush due to offload */
  5158. A_UINT32 deliver_flush_offload;
  5159. /* Flush due to out of buffer */
  5160. A_UINT32 deliver_flush_oob;
  5161. /* MPDUs dropped due to PN check fail */
  5162. A_UINT32 pn_fail;
  5163. /* MPDUs dropped due to unable to allocate memory */
  5164. A_UINT32 store_fail;
  5165. /* Number of times the tid pool alloc succeeded */
  5166. A_UINT32 tid_pool_alloc_succ;
  5167. /* Number of times the MPDU pool alloc succeeded */
  5168. A_UINT32 mpdu_pool_alloc_succ;
  5169. /* Number of times the MSDU pool alloc succeeded */
  5170. A_UINT32 msdu_pool_alloc_succ;
  5171. /* Number of times the tid pool alloc failed */
  5172. A_UINT32 tid_pool_alloc_fail;
  5173. /* Number of times the MPDU pool alloc failed */
  5174. A_UINT32 mpdu_pool_alloc_fail;
  5175. /* Number of times the MSDU pool alloc failed */
  5176. A_UINT32 msdu_pool_alloc_fail;
  5177. /* Number of times the tid pool freed */
  5178. A_UINT32 tid_pool_free;
  5179. /* Number of times the MPDU pool freed */
  5180. A_UINT32 mpdu_pool_free;
  5181. /* Number of times the MSDU pool freed */
  5182. A_UINT32 msdu_pool_free;
  5183. /* number of MSDUs undelivered to HTT and queued
  5184. * to Data Rx MSDU free list */
  5185. A_UINT32 msdu_queued;
  5186. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  5187. A_UINT32 msdu_recycled;
  5188. /* Number of MPDUs with invalid peer but A2 found in AST */
  5189. A_UINT32 invalid_peer_a2_in_ast;
  5190. /* Number of MPDUs with invalid peer but A3 found in AST */
  5191. A_UINT32 invalid_peer_a3_in_ast;
  5192. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  5193. A_UINT32 invalid_peer_bmc_mpdus;
  5194. /* Number of MSDUs with err attention word */
  5195. A_UINT32 rxdesc_err_att;
  5196. /* Number of MSDUs with flag of peer_idx_invalid */
  5197. A_UINT32 rxdesc_err_peer_idx_inv;
  5198. /* Number of MSDUs with flag of peer_idx_timeout */
  5199. A_UINT32 rxdesc_err_peer_idx_to;
  5200. /* Number of MSDUs with flag of overflow */
  5201. A_UINT32 rxdesc_err_ov;
  5202. /* Number of MSDUs with flag of msdu_length_err */
  5203. A_UINT32 rxdesc_err_msdu_len;
  5204. /* Number of MSDUs with flag of mpdu_length_err */
  5205. A_UINT32 rxdesc_err_mpdu_len;
  5206. /* Number of MSDUs with flag of tkip_mic_err */
  5207. A_UINT32 rxdesc_err_tkip_mic;
  5208. /* Number of MSDUs with flag of decrypt_err */
  5209. A_UINT32 rxdesc_err_decrypt;
  5210. /* Number of MSDUs with flag of fcs_err */
  5211. A_UINT32 rxdesc_err_fcs;
  5212. /* Number of Unicast (bc_mc bit is not set in attention word)
  5213. * frames with invalid peer handler
  5214. */
  5215. A_UINT32 rxdesc_uc_msdus_inv_peer;
  5216. /* Number of unicast frame directly (direct bit is set in attention word)
  5217. * to DUT with invalid peer handler
  5218. */
  5219. A_UINT32 rxdesc_direct_msdus_inv_peer;
  5220. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  5221. * frames with invalid peer handler
  5222. */
  5223. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  5224. /* Number of MSDUs dropped due to no first MSDU flag */
  5225. A_UINT32 rxdesc_no_1st_msdu;
  5226. /* Number of MSDUs droped due to ring overflow */
  5227. A_UINT32 msdu_drop_ring_ov;
  5228. /* Number of MSDUs dropped due to FC mismatch */
  5229. A_UINT32 msdu_drop_fc_mismatch;
  5230. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  5231. A_UINT32 msdu_drop_mgmt_remote_ring;
  5232. /* Number of MSDUs dropped due to errors not reported in attention word */
  5233. A_UINT32 msdu_drop_misc;
  5234. /* Number of MSDUs go to offload before reorder */
  5235. A_UINT32 offload_msdu_wal;
  5236. /* Number of data frame dropped by offload after reorder */
  5237. A_UINT32 offload_msdu_reorder;
  5238. /* Number of MPDUs with sequence number in the past and within
  5239. the BA window */
  5240. A_UINT32 dup_past_within_window;
  5241. /* Number of MPDUs with sequence number in the past and
  5242. * outside the BA window */
  5243. A_UINT32 dup_past_outside_window;
  5244. /* Number of MSDUs with decrypt/MIC error */
  5245. A_UINT32 rxdesc_err_decrypt_mic;
  5246. /* Number of data MSDUs received on both local and remote rings */
  5247. A_UINT32 data_msdus_on_both_rings;
  5248. };
  5249. /*
  5250. * Rx Remote buffer statistics
  5251. * NB: all the fields must be defined in 4 octets size.
  5252. */
  5253. struct rx_remote_buffer_mgmt_stats {
  5254. /* Total number of MSDUs reaped for Rx processing */
  5255. A_UINT32 remote_reaped;
  5256. /* MSDUs recycled within firmware */
  5257. A_UINT32 remote_recycled;
  5258. /* MSDUs stored by Data Rx */
  5259. A_UINT32 data_rx_msdus_stored;
  5260. /* Number of HTT indications from WAL Rx MSDU */
  5261. A_UINT32 wal_rx_ind;
  5262. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  5263. A_UINT32 wal_rx_ind_unconsumed;
  5264. /* Number of HTT indications from Data Rx MSDU */
  5265. A_UINT32 data_rx_ind;
  5266. /* Number of unconsumed HTT indications from Data Rx MSDU */
  5267. A_UINT32 data_rx_ind_unconsumed;
  5268. /* Number of HTT indications from ATHBUF */
  5269. A_UINT32 athbuf_rx_ind;
  5270. /* Number of remote buffers requested for refill */
  5271. A_UINT32 refill_buf_req;
  5272. /* Number of remote buffers filled by the host */
  5273. A_UINT32 refill_buf_rsp;
  5274. /* Number of times MAC hw_index = f/w write_index */
  5275. A_INT32 mac_no_bufs;
  5276. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  5277. A_INT32 fw_indices_equal;
  5278. /* Number of times f/w finds no buffers to post */
  5279. A_INT32 host_no_bufs;
  5280. };
  5281. /*
  5282. * TXBF MU/SU packets and NDPA statistics
  5283. * NB: all the fields must be defined in 4 octets size.
  5284. */
  5285. struct rx_txbf_musu_ndpa_pkts_stats {
  5286. /* number of TXBF MU packets received */
  5287. A_UINT32 number_mu_pkts;
  5288. /* number of TXBF SU packets received */
  5289. A_UINT32 number_su_pkts;
  5290. /* number of TXBF directed NDPA */
  5291. A_UINT32 txbf_directed_ndpa_count;
  5292. /* number of TXBF retried NDPA */
  5293. A_UINT32 txbf_ndpa_retry_count;
  5294. /* total number of TXBF NDPA */
  5295. A_UINT32 txbf_total_ndpa_count;
  5296. /* must be set to 0x0 */
  5297. A_UINT32 reserved[3];
  5298. };
  5299. /*
  5300. * htt_dbg_stats_status -
  5301. * present - The requested stats have been delivered in full.
  5302. * This indicates that either the stats information was contained
  5303. * in its entirety within this message, or else this message
  5304. * completes the delivery of the requested stats info that was
  5305. * partially delivered through earlier STATS_CONF messages.
  5306. * partial - The requested stats have been delivered in part.
  5307. * One or more subsequent STATS_CONF messages with the same
  5308. * cookie value will be sent to deliver the remainder of the
  5309. * information.
  5310. * error - The requested stats could not be delivered, for example due
  5311. * to a shortage of memory to construct a message holding the
  5312. * requested stats.
  5313. * invalid - The requested stat type is either not recognized, or the
  5314. * target is configured to not gather the stats type in question.
  5315. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  5316. * series_done - This special value indicates that no further stats info
  5317. * elements are present within a series of stats info elems
  5318. * (within a stats upload confirmation message).
  5319. */
  5320. enum htt_dbg_stats_status {
  5321. HTT_DBG_STATS_STATUS_PRESENT = 0,
  5322. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  5323. HTT_DBG_STATS_STATUS_ERROR = 2,
  5324. HTT_DBG_STATS_STATUS_INVALID = 3,
  5325. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  5326. };
  5327. /**
  5328. * @brief target -> host statistics upload
  5329. *
  5330. * @details
  5331. * The following field definitions describe the format of the HTT target
  5332. * to host stats upload confirmation message.
  5333. * The message contains a cookie echoed from the HTT host->target stats
  5334. * upload request, which identifies which request the confirmation is
  5335. * for, and a series of tag-length-value stats information elements.
  5336. * The tag-length header for each stats info element also includes a
  5337. * status field, to indicate whether the request for the stat type in
  5338. * question was fully met, partially met, unable to be met, or invalid
  5339. * (if the stat type in question is disabled in the target).
  5340. * A special value of all 1's in this status field is used to indicate
  5341. * the end of the series of stats info elements.
  5342. *
  5343. *
  5344. * |31 16|15 8|7 5|4 0|
  5345. * |------------------------------------------------------------|
  5346. * | reserved | msg type |
  5347. * |------------------------------------------------------------|
  5348. * | cookie LSBs |
  5349. * |------------------------------------------------------------|
  5350. * | cookie MSBs |
  5351. * |------------------------------------------------------------|
  5352. * | stats entry length | reserved | S |stat type|
  5353. * |------------------------------------------------------------|
  5354. * | |
  5355. * | type-specific stats info |
  5356. * | |
  5357. * |------------------------------------------------------------|
  5358. * | stats entry length | reserved | S |stat type|
  5359. * |------------------------------------------------------------|
  5360. * | |
  5361. * | type-specific stats info |
  5362. * | |
  5363. * |------------------------------------------------------------|
  5364. * | n/a | reserved | 111 | n/a |
  5365. * |------------------------------------------------------------|
  5366. * Header fields:
  5367. * - MSG_TYPE
  5368. * Bits 7:0
  5369. * Purpose: identifies this is a statistics upload confirmation message
  5370. * Value: 0x9
  5371. * - COOKIE_LSBS
  5372. * Bits 31:0
  5373. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5374. * message with its preceding host->target stats request message.
  5375. * Value: LSBs of the opaque cookie specified by the host-side requestor
  5376. * - COOKIE_MSBS
  5377. * Bits 31:0
  5378. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5379. * message with its preceding host->target stats request message.
  5380. * Value: MSBs of the opaque cookie specified by the host-side requestor
  5381. *
  5382. * Stats Information Element tag-length header fields:
  5383. * - STAT_TYPE
  5384. * Bits 4:0
  5385. * Purpose: identifies the type of statistics info held in the
  5386. * following information element
  5387. * Value: htt_dbg_stats_type
  5388. * - STATUS
  5389. * Bits 7:5
  5390. * Purpose: indicate whether the requested stats are present
  5391. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  5392. * the completion of the stats entry series
  5393. * - LENGTH
  5394. * Bits 31:16
  5395. * Purpose: indicate the stats information size
  5396. * Value: This field specifies the number of bytes of stats information
  5397. * that follows the element tag-length header.
  5398. * It is expected but not required that this length is a multiple of
  5399. * 4 bytes. Even if the length is not an integer multiple of 4, the
  5400. * subsequent stats entry header will begin on a 4-byte aligned
  5401. * boundary.
  5402. */
  5403. #define HTT_T2H_STATS_COOKIE_SIZE 8
  5404. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  5405. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  5406. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  5407. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  5408. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  5409. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  5410. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  5411. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  5412. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  5413. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  5414. do { \
  5415. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  5416. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  5417. } while (0)
  5418. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  5419. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  5420. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  5421. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  5422. do { \
  5423. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  5424. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  5425. } while (0)
  5426. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  5427. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  5428. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  5429. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  5430. do { \
  5431. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  5432. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  5433. } while (0)
  5434. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  5435. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  5436. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  5437. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  5438. #define HTT_MAX_AGGR 64
  5439. #define HTT_HL_MAX_AGGR 18
  5440. /**
  5441. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  5442. *
  5443. * @details
  5444. * The following field definitions describe the format of the HTT host
  5445. * to target frag_desc/msdu_ext bank configuration message.
  5446. * The message contains the based address and the min and max id of the
  5447. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  5448. * MSDU_EXT/FRAG_DESC.
  5449. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  5450. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  5451. * the hardware does the mapping/translation.
  5452. *
  5453. * Total banks that can be configured is configured to 16.
  5454. *
  5455. * This should be called before any TX has be initiated by the HTT
  5456. *
  5457. * |31 16|15 8|7 5|4 0|
  5458. * |------------------------------------------------------------|
  5459. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  5460. * |------------------------------------------------------------|
  5461. * | BANK0_BASE_ADDRESS (bits 31:0) |
  5462. #if HTT_PADDR64
  5463. * | BANK0_BASE_ADDRESS (bits 63:32) |
  5464. #endif
  5465. * |------------------------------------------------------------|
  5466. * | ... |
  5467. * |------------------------------------------------------------|
  5468. * | BANK15_BASE_ADDRESS (bits 31:0) |
  5469. #if HTT_PADDR64
  5470. * | BANK15_BASE_ADDRESS (bits 63:32) |
  5471. #endif
  5472. * |------------------------------------------------------------|
  5473. * | BANK0_MAX_ID | BANK0_MIN_ID |
  5474. * |------------------------------------------------------------|
  5475. * | ... |
  5476. * |------------------------------------------------------------|
  5477. * | BANK15_MAX_ID | BANK15_MIN_ID |
  5478. * |------------------------------------------------------------|
  5479. * Header fields:
  5480. * - MSG_TYPE
  5481. * Bits 7:0
  5482. * Value: 0x6
  5483. * for systems with 64-bit format for bus addresses:
  5484. * - BANKx_BASE_ADDRESS_LO
  5485. * Bits 31:0
  5486. * Purpose: Provide a mechanism to specify the base address of the
  5487. * MSDU_EXT bank physical/bus address.
  5488. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  5489. * - BANKx_BASE_ADDRESS_HI
  5490. * Bits 31:0
  5491. * Purpose: Provide a mechanism to specify the base address of the
  5492. * MSDU_EXT bank physical/bus address.
  5493. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  5494. * for systems with 32-bit format for bus addresses:
  5495. * - BANKx_BASE_ADDRESS
  5496. * Bits 31:0
  5497. * Purpose: Provide a mechanism to specify the base address of the
  5498. * MSDU_EXT bank physical/bus address.
  5499. * Value: MSDU_EXT bank physical / bus address
  5500. * - BANKx_MIN_ID
  5501. * Bits 15:0
  5502. * Purpose: Provide a mechanism to specify the min index that needs to
  5503. * mapped.
  5504. * - BANKx_MAX_ID
  5505. * Bits 31:16
  5506. * Purpose: Provide a mechanism to specify the max index that needs to
  5507. * mapped.
  5508. *
  5509. */
  5510. /** @todo Compress the fields to fit MAX HTT Message size, until then
  5511. * configure to a safe value.
  5512. * @note MAX supported banks is 16.
  5513. */
  5514. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  5515. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  5516. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  5517. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  5518. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  5519. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  5520. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  5521. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  5522. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  5523. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  5524. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  5525. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  5526. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  5527. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  5528. do { \
  5529. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  5530. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  5531. } while (0)
  5532. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  5533. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> \
  5534. HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  5535. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  5536. do { \
  5537. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value);\
  5538. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S);\
  5539. } while (0)
  5540. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  5541. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> \
  5542. HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  5543. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  5544. do { \
  5545. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  5546. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  5547. } while (0)
  5548. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  5549. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> \
  5550. HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  5551. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  5552. do { \
  5553. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  5554. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  5555. } while (0)
  5556. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  5557. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> \
  5558. HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  5559. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  5560. do { \
  5561. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  5562. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  5563. } while (0)
  5564. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  5565. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> \
  5566. HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  5567. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  5568. do { \
  5569. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  5570. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  5571. } while (0)
  5572. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  5573. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> \
  5574. HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  5575. /*
  5576. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  5577. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  5578. * addresses are stored in a XXX-bit field.
  5579. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  5580. * htt_tx_frag_desc64_bank_cfg_t structs.
  5581. */
  5582. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  5583. _paddr_bits_, \
  5584. _paddr__bank_base_address_) \
  5585. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  5586. /** word 0 \
  5587. * msg_type: 8, \
  5588. * pdev_id: 2, \
  5589. * swap: 1, \
  5590. * reserved0: 5, \
  5591. * num_banks: 8, \
  5592. * desc_size: 8; \
  5593. */ \
  5594. A_UINT32 word0; \
  5595. /* \
  5596. * If bank_base_address is 64 bits, the upper / lower
  5597. * halves are stored \
  5598. * in little-endian order (bytes 0-3 in the first A_UINT32,
  5599. * bytes 4-7 in the second A_UINT32). \
  5600. */ \
  5601. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  5602. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  5603. } POSTPACK
  5604. /* define htt_tx_frag_desc32_bank_cfg_t */
  5605. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  5606. /* define htt_tx_frag_desc64_bank_cfg_t */
  5607. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  5608. /*
  5609. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  5610. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  5611. */
  5612. #if HTT_PADDR64
  5613. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  5614. #else
  5615. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  5616. #endif
  5617. /**
  5618. * @brief target -> host HTT TX Credit total count update message definition
  5619. *
  5620. *|31 16|15|14 9| 8 |7 0 |
  5621. *|---------------------+--+----------+-------+----------|
  5622. *|cur htt credit delta | Q| reserved | sign | msg type |
  5623. *|------------------------------------------------------|
  5624. *
  5625. * Header fields:
  5626. * - MSG_TYPE
  5627. * Bits 7:0
  5628. * Purpose: identifies this as a htt tx credit delta update message
  5629. * Value: 0xe
  5630. * - SIGN
  5631. * Bits 8
  5632. * identifies whether credit delta is positive or negative
  5633. * Value:
  5634. * - 0x0: credit delta is positive, rebalance in some buffers
  5635. * - 0x1: credit delta is negative, rebalance out some buffers
  5636. * - reserved
  5637. * Bits 14:9
  5638. * Value: 0x0
  5639. * - TXQ_GRP
  5640. * Bit 15
  5641. * Purpose: indicates whether any tx queue group information elements
  5642. * are appended to the tx credit update message
  5643. * Value: 0 -> no tx queue group information element is present
  5644. * 1 -> a tx queue group information element immediately follows
  5645. * - DELTA_COUNT
  5646. * Bits 31:16
  5647. * Purpose: Specify current htt credit delta absolute count
  5648. */
  5649. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  5650. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  5651. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  5652. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  5653. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  5654. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  5655. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  5656. do { \
  5657. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  5658. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  5659. } while (0)
  5660. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  5661. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  5662. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  5663. do { \
  5664. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  5665. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  5666. } while (0)
  5667. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  5668. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  5669. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  5670. do { \
  5671. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  5672. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  5673. } while (0)
  5674. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  5675. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  5676. #define HTT_TX_CREDIT_MSG_BYTES 4
  5677. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  5678. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  5679. /**
  5680. * @brief HTT WDI_IPA Operation Response Message
  5681. *
  5682. * @details
  5683. * HTT WDI_IPA Operation Response message is sent by target
  5684. * to host confirming suspend or resume operation.
  5685. * |31 24|23 16|15 8|7 0|
  5686. * |----------------+----------------+----------------+----------------|
  5687. * | op_code | Rsvd | msg_type |
  5688. * |-------------------------------------------------------------------|
  5689. * | Rsvd | Response len |
  5690. * |-------------------------------------------------------------------|
  5691. * | |
  5692. * | Response-type specific info |
  5693. * | |
  5694. * | |
  5695. * |-------------------------------------------------------------------|
  5696. * Header fields:
  5697. * - MSG_TYPE
  5698. * Bits 7:0
  5699. * Purpose: Identifies this as WDI_IPA Operation Response message
  5700. * value: = 0x13
  5701. * - OP_CODE
  5702. * Bits 31:16
  5703. * Purpose: Identifies the operation target is responding to
  5704. * (e.g. TX suspend)
  5705. * value: = enum htt_wdi_ipa_op_code
  5706. * - RSP_LEN
  5707. * Bits 16:0
  5708. * Purpose: length for the response-type specific info
  5709. * value: = length in bytes for response-type specific info
  5710. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  5711. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  5712. */
  5713. PREPACK struct htt_wdi_ipa_op_response_t {
  5714. /* DWORD 0: flags and meta-data */
  5715. A_UINT32
  5716. msg_type:8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  5717. reserved1:8,
  5718. op_code:16;
  5719. A_UINT32
  5720. rsp_len:16,
  5721. reserved2:16;
  5722. } POSTPACK;
  5723. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  5724. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  5725. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  5726. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  5727. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  5728. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  5729. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> \
  5730. HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  5731. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  5732. do { \
  5733. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  5734. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  5735. } while (0)
  5736. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  5737. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> \
  5738. HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  5739. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  5740. do { \
  5741. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  5742. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  5743. } while (0)
  5744. enum htt_phy_mode {
  5745. htt_phy_mode_11a = 0,
  5746. htt_phy_mode_11g = 1,
  5747. htt_phy_mode_11b = 2,
  5748. htt_phy_mode_11g_only = 3,
  5749. htt_phy_mode_11na_ht20 = 4,
  5750. htt_phy_mode_11ng_ht20 = 5,
  5751. htt_phy_mode_11na_ht40 = 6,
  5752. htt_phy_mode_11ng_ht40 = 7,
  5753. htt_phy_mode_11ac_vht20 = 8,
  5754. htt_phy_mode_11ac_vht40 = 9,
  5755. htt_phy_mode_11ac_vht80 = 10,
  5756. htt_phy_mode_11ac_vht20_2g = 11,
  5757. htt_phy_mode_11ac_vht40_2g = 12,
  5758. htt_phy_mode_11ac_vht80_2g = 13,
  5759. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  5760. htt_phy_mode_11ac_vht160 = 15,
  5761. htt_phy_mode_max,
  5762. };
  5763. /**
  5764. * @brief target -> host HTT channel change indication
  5765. * @details
  5766. * Specify when a channel change occurs.
  5767. * This allows the host to precisely determine which rx frames arrived
  5768. * on the old channel and which rx frames arrived on the new channel.
  5769. *
  5770. *|31 |7 0 |
  5771. *|-------------------------------------------+----------|
  5772. *| reserved | msg type |
  5773. *|------------------------------------------------------|
  5774. *| primary_chan_center_freq_mhz |
  5775. *|------------------------------------------------------|
  5776. *| contiguous_chan1_center_freq_mhz |
  5777. *|------------------------------------------------------|
  5778. *| contiguous_chan2_center_freq_mhz |
  5779. *|------------------------------------------------------|
  5780. *| phy_mode |
  5781. *|------------------------------------------------------|
  5782. *
  5783. * Header fields:
  5784. * - MSG_TYPE
  5785. * Bits 7:0
  5786. * Purpose: identifies this as a htt channel change indication message
  5787. * Value: 0x15
  5788. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  5789. * Bits 31:0
  5790. * Purpose: identify the (center of the) new 20 MHz primary channel
  5791. * Value: center frequency of the 20 MHz primary channel, in MHz units
  5792. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  5793. * Bits 31:0
  5794. * Purpose: identify the (center of the) contiguous frequency range
  5795. * comprising the new channel.
  5796. * For example, if the new channel is a 80 MHz channel extending
  5797. * 60 MHz beyond the primary channel, this field would be 30 larger
  5798. * than the primary channel center frequency field.
  5799. * Value: center frequency of the contiguous frequency range comprising
  5800. * the full channel in MHz units
  5801. * (80+80 channels also use the CONTIG_CHAN2 field)
  5802. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  5803. * Bits 31:0
  5804. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  5805. * within a VHT 80+80 channel.
  5806. * This field is only relevant for VHT 80+80 channels.
  5807. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  5808. * channel (arbitrary value for cases besides VHT 80+80)
  5809. * - PHY_MODE
  5810. * Bits 31:0
  5811. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  5812. * and band
  5813. * Value: htt_phy_mode enum value
  5814. */
  5815. PREPACK struct htt_chan_change_t {
  5816. /* DWORD 0: flags and meta-data */
  5817. A_UINT32 msg_type:8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  5818. reserved1:24;
  5819. A_UINT32 primary_chan_center_freq_mhz;
  5820. A_UINT32 contig_chan1_center_freq_mhz;
  5821. A_UINT32 contig_chan2_center_freq_mhz;
  5822. A_UINT32 phy_mode;
  5823. } POSTPACK;
  5824. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  5825. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  5826. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  5827. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  5828. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  5829. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  5830. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  5831. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  5832. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  5833. do { \
  5834. HTT_CHECK_SET_VAL( \
  5835. HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value); \
  5836. (word) |= (value) << \
  5837. HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  5838. } while (0)
  5839. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  5840. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  5841. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  5842. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  5843. do { \
  5844. HTT_CHECK_SET_VAL( \
  5845. HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value); \
  5846. (word) |= (value) << \
  5847. HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  5848. } while (0)
  5849. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  5850. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  5851. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  5852. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  5853. do { \
  5854. HTT_CHECK_SET_VAL( \
  5855. HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value); \
  5856. (word) |= (value) << \
  5857. HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  5858. } while (0)
  5859. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  5860. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  5861. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  5862. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  5863. do { \
  5864. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value); \
  5865. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  5866. } while (0)
  5867. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  5868. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  5869. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  5870. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  5871. /**
  5872. * @brief rx offload packet error message
  5873. *
  5874. * @details
  5875. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  5876. * of target payload like mic err.
  5877. *
  5878. * |31 24|23 16|15 8|7 0|
  5879. * |----------------+----------------+----------------+----------------|
  5880. * | tid | vdev_id | msg_sub_type | msg_type |
  5881. * |-------------------------------------------------------------------|
  5882. * : (sub-type dependent content) :
  5883. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  5884. * Header fields:
  5885. * - msg_type
  5886. * Bits 7:0
  5887. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  5888. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  5889. * - msg_sub_type
  5890. * Bits 15:8
  5891. * Purpose: Identifies which type of rx error is reported by this message
  5892. * value: htt_rx_ofld_pkt_err_type
  5893. * - vdev_id
  5894. * Bits 23:16
  5895. * Purpose: Identifies which vdev received the erroneous rx frame
  5896. * value:
  5897. * - tid
  5898. * Bits 31:24
  5899. * Purpose: Identifies the traffic type of the rx frame
  5900. * value:
  5901. *
  5902. * - The payload fields used if the sub-type == MIC error are shown below.
  5903. * Note - MIC err is per MSDU, while PN is per MPDU.
  5904. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  5905. * with MIC err in A-MSDU case, so FW will send only one HTT message
  5906. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  5907. * instead of sending separate HTT messages for each wrong MSDU within
  5908. * the MPDU.
  5909. *
  5910. * |31 24|23 16|15 8|7 0|
  5911. * |----------------+----------------+----------------+----------------|
  5912. * | Rsvd | key_id | peer_id |
  5913. * |-------------------------------------------------------------------|
  5914. * | receiver MAC addr 31:0 |
  5915. * |-------------------------------------------------------------------|
  5916. * | Rsvd | receiver MAC addr 47:32 |
  5917. * |-------------------------------------------------------------------|
  5918. * | transmitter MAC addr 31:0 |
  5919. * |-------------------------------------------------------------------|
  5920. * | Rsvd | transmitter MAC addr 47:32 |
  5921. * |-------------------------------------------------------------------|
  5922. * | PN 31:0 |
  5923. * |-------------------------------------------------------------------|
  5924. * | Rsvd | PN 47:32 |
  5925. * |-------------------------------------------------------------------|
  5926. * - peer_id
  5927. * Bits 15:0
  5928. * Purpose: identifies which peer is frame is from
  5929. * value:
  5930. * - key_id
  5931. * Bits 23:16
  5932. * Purpose: identifies key_id of rx frame
  5933. * value:
  5934. * - RA_31_0 (receiver MAC addr 31:0)
  5935. * Bits 31:0
  5936. * Purpose: identifies by MAC address which vdev received the frame
  5937. * value: MAC address lower 4 bytes
  5938. * - RA_47_32 (receiver MAC addr 47:32)
  5939. * Bits 15:0
  5940. * Purpose: identifies by MAC address which vdev received the frame
  5941. * value: MAC address upper 2 bytes
  5942. * - TA_31_0 (transmitter MAC addr 31:0)
  5943. * Bits 31:0
  5944. * Purpose: identifies by MAC address which peer transmitted the frame
  5945. * value: MAC address lower 4 bytes
  5946. * - TA_47_32 (transmitter MAC addr 47:32)
  5947. * Bits 15:0
  5948. * Purpose: identifies by MAC address which peer transmitted the frame
  5949. * value: MAC address upper 2 bytes
  5950. * - PN_31_0
  5951. * Bits 31:0
  5952. * Purpose: Identifies pn of rx frame
  5953. * value: PN lower 4 bytes
  5954. * - PN_47_32
  5955. * Bits 15:0
  5956. * Purpose: Identifies pn of rx frame
  5957. * value:
  5958. * TKIP or CCMP: PN upper 2 bytes
  5959. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  5960. */
  5961. enum htt_rx_ofld_pkt_err_type {
  5962. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  5963. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  5964. };
  5965. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  5966. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  5967. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  5968. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  5969. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  5970. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  5971. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  5972. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  5973. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  5974. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  5975. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  5976. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  5977. do { \
  5978. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  5979. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  5980. } while (0)
  5981. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  5982. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> \
  5983. HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  5984. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  5985. do { \
  5986. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  5987. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  5988. } while (0)
  5989. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  5990. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  5991. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  5992. do { \
  5993. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  5994. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  5995. } while (0)
  5996. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  5997. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  5998. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  5999. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  6000. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  6001. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  6002. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  6003. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  6004. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  6005. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  6006. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  6007. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  6008. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  6009. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  6010. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  6011. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  6012. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  6013. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  6014. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  6015. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  6016. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  6017. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  6018. do { \
  6019. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  6020. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  6021. } while (0)
  6022. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  6023. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  6024. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  6025. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  6026. do { \
  6027. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  6028. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  6029. } while (0)
  6030. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  6031. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  6032. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  6033. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  6034. do { \
  6035. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  6036. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  6037. } while (0)
  6038. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  6039. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  6040. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  6041. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  6042. do { \
  6043. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  6044. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  6045. } while (0)
  6046. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  6047. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  6048. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  6049. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  6050. do { \
  6051. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  6052. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  6053. } while (0)
  6054. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  6055. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  6056. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  6057. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  6058. do { \
  6059. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  6060. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  6061. } while (0)
  6062. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  6063. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  6064. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  6065. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  6066. do { \
  6067. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  6068. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  6069. } while (0)
  6070. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  6071. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  6072. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  6073. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  6074. do { \
  6075. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  6076. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  6077. } while (0)
  6078. /**
  6079. * @brief peer rate report message
  6080. *
  6081. * @details
  6082. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  6083. * justified rate of all the peers.
  6084. *
  6085. * |31 24|23 16|15 8|7 0|
  6086. * |----------------+----------------+----------------+----------------|
  6087. * | peer_count | | msg_type |
  6088. * |-------------------------------------------------------------------|
  6089. * : Payload (variant number of peer rate report) :
  6090. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  6091. * Header fields:
  6092. * - msg_type
  6093. * Bits 7:0
  6094. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  6095. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  6096. * - reserved
  6097. * Bits 15:8
  6098. * Purpose:
  6099. * value:
  6100. * - peer_count
  6101. * Bits 31:16
  6102. * Purpose: Specify how many peer rate report elements are present in the payload.
  6103. * value:
  6104. *
  6105. * Payload:
  6106. * There are variant number of peer rate report follow the first 32 bits.
  6107. * The peer rate report is defined as follows.
  6108. *
  6109. * |31 20|19 16|15 0|
  6110. * |-----------------------+---------+---------------------------------|-
  6111. * | reserved | phy | peer_id | \
  6112. * |-------------------------------------------------------------------| -> report #0
  6113. * | rate | /
  6114. * |-----------------------+---------+---------------------------------|-
  6115. * | reserved | phy | peer_id | \
  6116. * |-------------------------------------------------------------------| -> report #1
  6117. * | rate | /
  6118. * |-----------------------+---------+---------------------------------|-
  6119. * | reserved | phy | peer_id | \
  6120. * |-------------------------------------------------------------------| -> report #2
  6121. * | rate | /
  6122. * |-------------------------------------------------------------------|-
  6123. * : :
  6124. * : :
  6125. * : :
  6126. * :-------------------------------------------------------------------:
  6127. *
  6128. * - peer_id
  6129. * Bits 15:0
  6130. * Purpose: identify the peer
  6131. * value:
  6132. * - phy
  6133. * Bits 19:16
  6134. * Purpose: identify which phy is in use
  6135. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  6136. * Please see enum htt_peer_report_phy_type for detail.
  6137. * - reserved
  6138. * Bits 31:20
  6139. * Purpose:
  6140. * value:
  6141. * - rate
  6142. * Bits 31:0
  6143. * Purpose: represent the justified rate of the peer specified by peer_id
  6144. * value:
  6145. */
  6146. enum htt_peer_rate_report_phy_type {
  6147. HTT_PEER_RATE_REPORT_11B = 0,
  6148. HTT_PEER_RATE_REPORT_11A_G,
  6149. HTT_PEER_RATE_REPORT_11N,
  6150. HTT_PEER_RATE_REPORT_11AC,
  6151. };
  6152. #define HTT_PEER_RATE_REPORT_SIZE 8
  6153. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  6154. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  6155. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  6156. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  6157. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  6158. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  6159. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  6160. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  6161. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  6162. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  6163. do { \
  6164. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  6165. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  6166. } while (0)
  6167. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  6168. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  6169. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  6170. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  6171. do { \
  6172. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  6173. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  6174. } while (0)
  6175. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  6176. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  6177. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  6178. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  6179. do { \
  6180. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  6181. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  6182. } while (0)
  6183. /**
  6184. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  6185. *
  6186. * @details
  6187. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  6188. * a flow of descriptors.
  6189. *
  6190. * This message is in TLV format and indicates the parameters to be setup a
  6191. * flow in the host. Each entry indicates that a particular flow ID is ready to
  6192. * receive descriptors from a specified pool.
  6193. *
  6194. * The message would appear as follows:
  6195. *
  6196. * |31 24|23 16|15 8|7 0|
  6197. * |----------------+----------------+----------------+----------------|
  6198. * header | reserved | num_flows | msg_type |
  6199. * |-------------------------------------------------------------------|
  6200. * | |
  6201. * : payload :
  6202. * | |
  6203. * |-------------------------------------------------------------------|
  6204. *
  6205. * The header field is one DWORD long and is interpreted as follows:
  6206. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  6207. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  6208. * this message
  6209. * b'16-31 - reserved: These bits are reserved for future use
  6210. *
  6211. * Payload:
  6212. * The payload would contain multiple objects of the following structure. Each
  6213. * object represents a flow.
  6214. *
  6215. * |31 24|23 16|15 8|7 0|
  6216. * |----------------+----------------+----------------+----------------|
  6217. * header | reserved | num_flows | msg_type |
  6218. * |-------------------------------------------------------------------|
  6219. * payload0| flow_type |
  6220. * |-------------------------------------------------------------------|
  6221. * | flow_id |
  6222. * |-------------------------------------------------------------------|
  6223. * | reserved0 | flow_pool_id |
  6224. * |-------------------------------------------------------------------|
  6225. * | reserved1 | flow_pool_size |
  6226. * |-------------------------------------------------------------------|
  6227. * | reserved2 |
  6228. * |-------------------------------------------------------------------|
  6229. * payload1| flow_type |
  6230. * |-------------------------------------------------------------------|
  6231. * | flow_id |
  6232. * |-------------------------------------------------------------------|
  6233. * | reserved0 | flow_pool_id |
  6234. * |-------------------------------------------------------------------|
  6235. * | reserved1 | flow_pool_size |
  6236. * |-------------------------------------------------------------------|
  6237. * | reserved2 |
  6238. * |-------------------------------------------------------------------|
  6239. * | . |
  6240. * | . |
  6241. * | . |
  6242. * |-------------------------------------------------------------------|
  6243. *
  6244. * Each payload is 5 DWORDS long and is interpreted as follows:
  6245. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  6246. * this flow is associated. It can be VDEV, peer,
  6247. * or tid (AC). Based on enum htt_flow_type.
  6248. *
  6249. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  6250. * object. For flow_type vdev it is set to the
  6251. * vdevid, for peer it is peerid and for tid, it is
  6252. * tid_num.
  6253. *
  6254. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  6255. * in the host for this flow
  6256. * b'16:31 - reserved0: This field in reserved for the future. In case
  6257. * we have a hierarchical implementation (HCM) of
  6258. * pools, it can be used to indicate the ID of the
  6259. * parent-pool.
  6260. *
  6261. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  6262. * Descriptors for this flow will be
  6263. * allocated from this pool in the host.
  6264. * b'16:31 - reserved1: This field in reserved for the future. In case
  6265. * we have a hierarchical implementation of pools,
  6266. * it can be used to indicate the max number of
  6267. * descriptors in the pool. The b'0:15 can be used
  6268. * to indicate min number of descriptors in the
  6269. * HCM scheme.
  6270. *
  6271. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  6272. * we have a hierarchical implementation of pools,
  6273. * b'0:15 can be used to indicate the
  6274. * priority-based borrowing (PBB) threshold of
  6275. * the flow's pool. The b'16:31 are still left
  6276. * reserved.
  6277. */
  6278. enum htt_flow_type {
  6279. FLOW_TYPE_VDEV = 0,
  6280. /* Insert new flow types above this line */
  6281. };
  6282. PREPACK struct htt_flow_pool_map_payload_t {
  6283. A_UINT32 flow_type;
  6284. A_UINT32 flow_id;
  6285. A_UINT32 flow_pool_id:16,
  6286. reserved0:16;
  6287. A_UINT32 flow_pool_size:16,
  6288. reserved1:16;
  6289. A_UINT32 reserved2;
  6290. } POSTPACK;
  6291. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  6292. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  6293. (sizeof(struct htt_flow_pool_map_payload_t))
  6294. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  6295. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  6296. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  6297. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  6298. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  6299. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  6300. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  6301. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  6302. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  6303. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  6304. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  6305. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  6306. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  6307. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  6308. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  6309. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  6310. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  6311. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  6312. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  6313. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  6314. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  6315. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  6316. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  6317. do { \
  6318. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  6319. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  6320. } while (0)
  6321. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  6322. do { \
  6323. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  6324. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  6325. } while (0)
  6326. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  6327. do { \
  6328. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  6329. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  6330. } while (0)
  6331. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  6332. do { \
  6333. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  6334. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  6335. } while (0)
  6336. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  6337. do { \
  6338. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  6339. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  6340. } while (0)
  6341. /**
  6342. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  6343. *
  6344. * @details
  6345. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  6346. * down a flow of descriptors.
  6347. * This message indicates that for the flow (whose ID is provided) is wanting
  6348. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  6349. * pool of descriptors from where descriptors are being allocated for this
  6350. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  6351. * be unmapped by the host.
  6352. *
  6353. * The message would appear as follows:
  6354. *
  6355. * |31 24|23 16|15 8|7 0|
  6356. * |----------------+----------------+----------------+----------------|
  6357. * | reserved0 | msg_type |
  6358. * |-------------------------------------------------------------------|
  6359. * | flow_type |
  6360. * |-------------------------------------------------------------------|
  6361. * | flow_id |
  6362. * |-------------------------------------------------------------------|
  6363. * | reserved1 | flow_pool_id |
  6364. * |-------------------------------------------------------------------|
  6365. *
  6366. * The message is interpreted as follows:
  6367. * dword0 - b'0:7 - msg_type: This will be set to
  6368. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  6369. * b'8:31 - reserved0: Reserved for future use
  6370. *
  6371. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  6372. * this flow is associated. It can be VDEV, peer,
  6373. * or tid (AC). Based on enum htt_flow_type.
  6374. *
  6375. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  6376. * object. For flow_type vdev it is set to the
  6377. * vdevid, for peer it is peerid and for tid, it is
  6378. * tid_num.
  6379. *
  6380. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  6381. * used in the host for this flow
  6382. * b'16:31 - reserved0: This field in reserved for the future.
  6383. *
  6384. */
  6385. PREPACK struct htt_flow_pool_unmap_t {
  6386. A_UINT32 msg_type:8,
  6387. reserved0:24;
  6388. A_UINT32 flow_type;
  6389. A_UINT32 flow_id;
  6390. A_UINT32 flow_pool_id:16,
  6391. reserved1:16;
  6392. } POSTPACK;
  6393. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  6394. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  6395. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  6396. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  6397. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  6398. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  6399. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  6400. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  6401. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  6402. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  6403. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  6404. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  6405. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  6406. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  6407. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  6408. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  6409. do { \
  6410. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  6411. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  6412. } while (0)
  6413. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  6414. do { \
  6415. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  6416. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  6417. } while (0)
  6418. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  6419. do { \
  6420. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  6421. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  6422. } while (0)
  6423. #endif