htt.h 282 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040
  1. /*
  2. * Copyright (c) 2011-2016 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. pktlog: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_PKTLOG_M 0x00008000
  2926. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  2927. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  2928. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  2929. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  2930. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  2931. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  2932. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  2933. /* for systems using 64-bit format for bus addresses */
  2934. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  2935. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  2936. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  2937. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  2938. /* for systems using 32-bit format for bus addresses */
  2939. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  2940. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  2941. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  2942. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  2943. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  2944. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  2945. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  2946. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  2947. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  2948. do { \
  2949. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  2950. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  2951. } while (0)
  2952. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  2953. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> \
  2954. HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  2955. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  2956. do { \
  2957. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  2958. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  2959. } while (0)
  2960. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  2961. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> \
  2962. HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  2963. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  2964. do { \
  2965. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  2966. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  2967. } while (0)
  2968. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  2969. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> \
  2970. HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  2971. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  2972. do { \
  2973. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  2974. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  2975. } while (0)
  2976. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  2977. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> \
  2978. HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  2979. /* for systems using 64-bit format for bus addresses */
  2980. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  2981. do { \
  2982. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  2983. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  2984. } while (0)
  2985. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  2986. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> \
  2987. HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  2988. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  2989. do { \
  2990. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  2991. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  2992. } while (0)
  2993. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  2994. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> \
  2995. HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  2996. /* for systems using 32-bit format for bus addresses */
  2997. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  2998. do { \
  2999. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  3000. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  3001. } while (0)
  3002. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  3003. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> \
  3004. HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  3005. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  3006. do { \
  3007. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value);\
  3008. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  3009. } while (0)
  3010. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  3011. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> \
  3012. HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  3013. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  3014. do { \
  3015. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  3016. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  3017. } while (0)
  3018. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  3019. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> \
  3020. HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  3021. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  3022. do { \
  3023. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value);\
  3024. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S;\
  3025. } while (0)
  3026. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  3027. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> \
  3028. HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  3029. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  3030. do { \
  3031. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value);\
  3032. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  3033. } while (0)
  3034. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  3035. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> \
  3036. HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  3037. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  3038. do { \
  3039. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  3040. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  3041. } while (0)
  3042. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  3043. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> \
  3044. HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  3045. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  3046. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> \
  3047. HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  3048. /* definitions used within target -> host rx indication message */
  3049. PREPACK struct htt_rx_ind_hdr_prefix_t {
  3050. A_UINT32 /* word 0 */
  3051. msg_type:8,
  3052. ext_tid:5,
  3053. release_valid:1,
  3054. flush_valid:1,
  3055. reserved0:1,
  3056. peer_id:16;
  3057. A_UINT32 /* word 1 */
  3058. flush_start_seq_num:6,
  3059. flush_end_seq_num:6,
  3060. release_start_seq_num:6,
  3061. release_end_seq_num:6,
  3062. num_mpdu_ranges:8;
  3063. } POSTPACK;
  3064. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  3065. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  3066. #define HTT_TGT_RSSI_INVALID 0x80
  3067. PREPACK struct htt_rx_ppdu_desc_t {
  3068. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  3069. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  3070. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  3071. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  3072. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  3073. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  3074. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  3075. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  3076. A_UINT32 /* word 0 */
  3077. rssi_cmb:8,
  3078. timestamp_submicrosec:8,
  3079. phy_err_code:8,
  3080. phy_err:1,
  3081. legacy_rate:4,
  3082. legacy_rate_sel:1,
  3083. end_valid:1,
  3084. start_valid:1;
  3085. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  3086. union {
  3087. A_UINT32 /* word 1 */
  3088. rssi0_pri20:8,
  3089. rssi0_ext20:8,
  3090. rssi0_ext40:8,
  3091. rssi0_ext80:8;
  3092. A_UINT32 rssi0; /* access all 20/40/80 per-b/w RSSIs together */
  3093. } u0;
  3094. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  3095. union {
  3096. A_UINT32 /* word 2 */
  3097. rssi1_pri20:8,
  3098. rssi1_ext20:8,
  3099. rssi1_ext40:8,
  3100. rssi1_ext80:8;
  3101. A_UINT32 rssi1; /* access all 20/40/80 per-b/w RSSIs together */
  3102. } u1;
  3103. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  3104. union {
  3105. A_UINT32 /* word 3 */
  3106. rssi2_pri20:8,
  3107. rssi2_ext20:8,
  3108. rssi2_ext40:8,
  3109. rssi2_ext80:8;
  3110. A_UINT32 rssi2; /* access all 20/40/80 per-b/w RSSIs together */
  3111. } u2;
  3112. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  3113. union {
  3114. A_UINT32 /* word 4 */
  3115. rssi3_pri20:8,
  3116. rssi3_ext20:8,
  3117. rssi3_ext40:8,
  3118. rssi3_ext80:8;
  3119. A_UINT32 rssi3; /* access all 20/40/80 per-b/w RSSIs together */
  3120. } u3;
  3121. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  3122. A_UINT32 tsf32; /* word 5 */
  3123. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  3124. A_UINT32 timestamp_microsec; /* word 6 */
  3125. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  3126. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  3127. A_UINT32 /* word 7 */
  3128. vht_sig_a1:24,
  3129. preamble_type:8;
  3130. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  3131. A_UINT32 /* word 8 */
  3132. vht_sig_a2:24,
  3133. reserved0:8;
  3134. } POSTPACK;
  3135. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  3136. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  3137. PREPACK struct htt_rx_ind_hdr_suffix_t {
  3138. A_UINT32 /* word 0 */
  3139. fw_rx_desc_bytes:16,
  3140. reserved0:16;
  3141. } POSTPACK;
  3142. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  3143. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  3144. PREPACK struct htt_rx_ind_hdr_t {
  3145. struct htt_rx_ind_hdr_prefix_t prefix;
  3146. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  3147. struct htt_rx_ind_hdr_suffix_t suffix;
  3148. } POSTPACK;
  3149. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  3150. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  3151. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  3152. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  3153. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  3154. /*
  3155. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  3156. * the offset into the HTT rx indication message at which the
  3157. * FW rx PPDU descriptor resides
  3158. */
  3159. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  3160. /*
  3161. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  3162. * the offset into the HTT rx indication message at which the
  3163. * header suffix (FW rx MSDU byte count) resides
  3164. */
  3165. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  3166. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  3167. /*
  3168. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  3169. * the offset into the HTT rx indication message at which the per-MSDU
  3170. * information starts
  3171. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  3172. * per-MSDU information portion of the message. The per-MSDU info itself
  3173. * starts at byte 12.
  3174. */
  3175. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  3176. /**
  3177. * @brief target -> host rx indication message definition
  3178. *
  3179. * @details
  3180. * The following field definitions describe the format of the rx indication
  3181. * message sent from the target to the host.
  3182. * The message consists of three major sections:
  3183. * 1. a fixed-length header
  3184. * 2. a variable-length list of firmware rx MSDU descriptors
  3185. * 3. one or more 4-octet MPDU range information elements
  3186. * The fixed length header itself has two sub-sections
  3187. * 1. the message meta-information, including identification of the
  3188. * sender and type of the received data, and a 4-octet flush/release IE
  3189. * 2. the firmware rx PPDU descriptor
  3190. *
  3191. * The format of the message is depicted below.
  3192. * in this depiction, the following abbreviations are used for information
  3193. * elements within the message:
  3194. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  3195. * elements associated with the PPDU start are valid.
  3196. * Specifically, the following fields are valid only if SV is set:
  3197. * RSSI (all variants), L, legacy rate, preamble type, service,
  3198. * VHT-SIG-A
  3199. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  3200. * elements associated with the PPDU end are valid.
  3201. * Specifically, the following fields are valid only if EV is set:
  3202. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  3203. * - L - Legacy rate selector - if legacy rates are used, this flag
  3204. * indicates whether the rate is from a CCK (L == 1) or OFDM
  3205. * (L == 0) PHY.
  3206. * - P - PHY error flag - boolean indication of whether the rx frame had
  3207. * a PHY error
  3208. *
  3209. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  3210. * |----------------+-------------------+---------------------+---------------|
  3211. * | peer ID | |RV|FV| ext TID | msg type |
  3212. * |--------------------------------------------------------------------------|
  3213. * | num | release | release | flush | flush |
  3214. * | MPDU | end | start | end | start |
  3215. * | ranges | seq num | seq num | seq num | seq num |
  3216. * |==========================================================================|
  3217. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  3218. * |V|V| | rate | | | timestamp | RSSI |
  3219. * |--------------------------------------------------------------------------|
  3220. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  3221. * |--------------------------------------------------------------------------|
  3222. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  3223. * |--------------------------------------------------------------------------|
  3224. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  3225. * |--------------------------------------------------------------------------|
  3226. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  3227. * |--------------------------------------------------------------------------|
  3228. * | TSF LSBs |
  3229. * |--------------------------------------------------------------------------|
  3230. * | microsec timestamp |
  3231. * |--------------------------------------------------------------------------|
  3232. * | preamble type | HT-SIG / VHT-SIG-A1 |
  3233. * |--------------------------------------------------------------------------|
  3234. * | service | HT-SIG / VHT-SIG-A2 |
  3235. * |==========================================================================|
  3236. * | reserved | FW rx desc bytes |
  3237. * |--------------------------------------------------------------------------|
  3238. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  3239. * | desc B3 | desc B2 | desc B1 | desc B0 |
  3240. * |--------------------------------------------------------------------------|
  3241. * : : :
  3242. * |--------------------------------------------------------------------------|
  3243. * | alignment | MSDU Rx |
  3244. * | padding | desc Bn |
  3245. * |--------------------------------------------------------------------------|
  3246. * | reserved | MPDU range status | MPDU count |
  3247. * |--------------------------------------------------------------------------|
  3248. * : reserved : MPDU range status : MPDU count :
  3249. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  3250. *
  3251. * Header fields:
  3252. * - MSG_TYPE
  3253. * Bits 7:0
  3254. * Purpose: identifies this as an rx indication message
  3255. * Value: 0x1
  3256. * - EXT_TID
  3257. * Bits 12:8
  3258. * Purpose: identify the traffic ID of the rx data, including
  3259. * special "extended" TID values for multicast, broadcast, and
  3260. * non-QoS data frames
  3261. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  3262. * - FLUSH_VALID (FV)
  3263. * Bit 13
  3264. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  3265. * is valid
  3266. * Value:
  3267. * 1 -> flush IE is valid and needs to be processed
  3268. * 0 -> flush IE is not valid and should be ignored
  3269. * - REL_VALID (RV)
  3270. * Bit 13
  3271. * Purpose: indicate whether the release IE (start/end sequence numbers)
  3272. * is valid
  3273. * Value:
  3274. * 1 -> release IE is valid and needs to be processed
  3275. * 0 -> release IE is not valid and should be ignored
  3276. * - PEER_ID
  3277. * Bits 31:16
  3278. * Purpose: Identify, by ID, which peer sent the rx data
  3279. * Value: ID of the peer who sent the rx data
  3280. * - FLUSH_SEQ_NUM_START
  3281. * Bits 5:0
  3282. * Purpose: Indicate the start of a series of MPDUs to flush
  3283. * Not all MPDUs within this series are necessarily valid - the host
  3284. * must check each sequence number within this range to see if the
  3285. * corresponding MPDU is actually present.
  3286. * This field is only valid if the FV bit is set.
  3287. * Value:
  3288. * The sequence number for the first MPDUs to check to flush.
  3289. * The sequence number is masked by 0x3f.
  3290. * - FLUSH_SEQ_NUM_END
  3291. * Bits 11:6
  3292. * Purpose: Indicate the end of a series of MPDUs to flush
  3293. * Value:
  3294. * The sequence number one larger than the sequence number of the
  3295. * last MPDU to check to flush.
  3296. * The sequence number is masked by 0x3f.
  3297. * Not all MPDUs within this series are necessarily valid - the host
  3298. * must check each sequence number within this range to see if the
  3299. * corresponding MPDU is actually present.
  3300. * This field is only valid if the FV bit is set.
  3301. * - REL_SEQ_NUM_START
  3302. * Bits 17:12
  3303. * Purpose: Indicate the start of a series of MPDUs to release.
  3304. * All MPDUs within this series are present and valid - the host
  3305. * need not check each sequence number within this range to see if
  3306. * the corresponding MPDU is actually present.
  3307. * This field is only valid if the RV bit is set.
  3308. * Value:
  3309. * The sequence number for the first MPDUs to check to release.
  3310. * The sequence number is masked by 0x3f.
  3311. * - REL_SEQ_NUM_END
  3312. * Bits 23:18
  3313. * Purpose: Indicate the end of a series of MPDUs to release.
  3314. * Value:
  3315. * The sequence number one larger than the sequence number of the
  3316. * last MPDU to check to release.
  3317. * The sequence number is masked by 0x3f.
  3318. * All MPDUs within this series are present and valid - the host
  3319. * need not check each sequence number within this range to see if
  3320. * the corresponding MPDU is actually present.
  3321. * This field is only valid if the RV bit is set.
  3322. * - NUM_MPDU_RANGES
  3323. * Bits 31:24
  3324. * Purpose: Indicate how many ranges of MPDUs are present.
  3325. * Each MPDU range consists of a series of contiguous MPDUs within the
  3326. * rx frame sequence which all have the same MPDU status.
  3327. * Value: 1-63 (typically a small number, like 1-3)
  3328. *
  3329. * Rx PPDU descriptor fields:
  3330. * - RSSI_CMB
  3331. * Bits 7:0
  3332. * Purpose: Combined RSSI from all active rx chains, across the active
  3333. * bandwidth.
  3334. * Value: RSSI dB units w.r.t. noise floor
  3335. * - TIMESTAMP_SUBMICROSEC
  3336. * Bits 15:8
  3337. * Purpose: high-resolution timestamp
  3338. * Value:
  3339. * Sub-microsecond time of PPDU reception.
  3340. * This timestamp ranges from [0,MAC clock MHz).
  3341. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  3342. * to form a high-resolution, large range rx timestamp.
  3343. * - PHY_ERR_CODE
  3344. * Bits 23:16
  3345. * Purpose:
  3346. * If the rx frame processing resulted in a PHY error, indicate what
  3347. * type of rx PHY error occurred.
  3348. * Value:
  3349. * This field is valid if the "P" (PHY_ERR) flag is set.
  3350. * TBD: document/specify the values for this field
  3351. * - PHY_ERR
  3352. * Bit 24
  3353. * Purpose: indicate whether the rx PPDU had a PHY error
  3354. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  3355. * - LEGACY_RATE
  3356. * Bits 28:25
  3357. * Purpose:
  3358. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  3359. * specify which rate was used.
  3360. * Value:
  3361. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  3362. * flag.
  3363. * If LEGACY_RATE_SEL is 0:
  3364. * 0x8: OFDM 48 Mbps
  3365. * 0x9: OFDM 24 Mbps
  3366. * 0xA: OFDM 12 Mbps
  3367. * 0xB: OFDM 6 Mbps
  3368. * 0xC: OFDM 54 Mbps
  3369. * 0xD: OFDM 36 Mbps
  3370. * 0xE: OFDM 18 Mbps
  3371. * 0xF: OFDM 9 Mbps
  3372. * If LEGACY_RATE_SEL is 1:
  3373. * 0x8: CCK 11 Mbps long preamble
  3374. * 0x9: CCK 5.5 Mbps long preamble
  3375. * 0xA: CCK 2 Mbps long preamble
  3376. * 0xB: CCK 1 Mbps long preamble
  3377. * 0xC: CCK 11 Mbps short preamble
  3378. * 0xD: CCK 5.5 Mbps short preamble
  3379. * 0xE: CCK 2 Mbps short preamble
  3380. * - LEGACY_RATE_SEL
  3381. * Bit 29
  3382. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  3383. * Value:
  3384. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  3385. * used a legacy rate.
  3386. * 0 -> OFDM, 1 -> CCK
  3387. * - END_VALID
  3388. * Bit 30
  3389. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  3390. * the start of the PPDU are valid. Specifically, the following
  3391. * fields are only valid if END_VALID is set:
  3392. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  3393. * TIMESTAMP_SUBMICROSEC
  3394. * Value:
  3395. * 0 -> rx PPDU desc end fields are not valid
  3396. * 1 -> rx PPDU desc end fields are valid
  3397. * - START_VALID
  3398. * Bit 31
  3399. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  3400. * the end of the PPDU are valid. Specifically, the following
  3401. * fields are only valid if START_VALID is set:
  3402. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  3403. * VHT-SIG-A
  3404. * Value:
  3405. * 0 -> rx PPDU desc start fields are not valid
  3406. * 1 -> rx PPDU desc start fields are valid
  3407. * - RSSI0_PRI20
  3408. * Bits 7:0
  3409. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  3410. * Value: RSSI dB units w.r.t. noise floor
  3411. *
  3412. * - RSSI0_EXT20
  3413. * Bits 7:0
  3414. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  3415. * (if the rx bandwidth was >= 40 MHz)
  3416. * Value: RSSI dB units w.r.t. noise floor
  3417. * - RSSI0_EXT40
  3418. * Bits 7:0
  3419. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  3420. * (if the rx bandwidth was >= 80 MHz)
  3421. * Value: RSSI dB units w.r.t. noise floor
  3422. * - RSSI0_EXT80
  3423. * Bits 7:0
  3424. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  3425. * (if the rx bandwidth was >= 160 MHz)
  3426. * Value: RSSI dB units w.r.t. noise floor
  3427. *
  3428. * - RSSI1_PRI20
  3429. * Bits 7:0
  3430. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  3431. * Value: RSSI dB units w.r.t. noise floor
  3432. * - RSSI1_EXT20
  3433. * Bits 7:0
  3434. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  3435. * (if the rx bandwidth was >= 40 MHz)
  3436. * Value: RSSI dB units w.r.t. noise floor
  3437. * - RSSI1_EXT40
  3438. * Bits 7:0
  3439. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  3440. * (if the rx bandwidth was >= 80 MHz)
  3441. * Value: RSSI dB units w.r.t. noise floor
  3442. * - RSSI1_EXT80
  3443. * Bits 7:0
  3444. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  3445. * (if the rx bandwidth was >= 160 MHz)
  3446. * Value: RSSI dB units w.r.t. noise floor
  3447. *
  3448. * - RSSI2_PRI20
  3449. * Bits 7:0
  3450. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  3451. * Value: RSSI dB units w.r.t. noise floor
  3452. * - RSSI2_EXT20
  3453. * Bits 7:0
  3454. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  3455. * (if the rx bandwidth was >= 40 MHz)
  3456. * Value: RSSI dB units w.r.t. noise floor
  3457. * - RSSI2_EXT40
  3458. * Bits 7:0
  3459. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  3460. * (if the rx bandwidth was >= 80 MHz)
  3461. * Value: RSSI dB units w.r.t. noise floor
  3462. * - RSSI2_EXT80
  3463. * Bits 7:0
  3464. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  3465. * (if the rx bandwidth was >= 160 MHz)
  3466. * Value: RSSI dB units w.r.t. noise floor
  3467. *
  3468. * - RSSI3_PRI20
  3469. * Bits 7:0
  3470. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  3471. * Value: RSSI dB units w.r.t. noise floor
  3472. * - RSSI3_EXT20
  3473. * Bits 7:0
  3474. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  3475. * (if the rx bandwidth was >= 40 MHz)
  3476. * Value: RSSI dB units w.r.t. noise floor
  3477. * - RSSI3_EXT40
  3478. * Bits 7:0
  3479. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  3480. * (if the rx bandwidth was >= 80 MHz)
  3481. * Value: RSSI dB units w.r.t. noise floor
  3482. * - RSSI3_EXT80
  3483. * Bits 7:0
  3484. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  3485. * (if the rx bandwidth was >= 160 MHz)
  3486. * Value: RSSI dB units w.r.t. noise floor
  3487. *
  3488. * - TSF32
  3489. * Bits 31:0
  3490. * Purpose: specify the time the rx PPDU was received, in TSF units
  3491. * Value: 32 LSBs of the TSF
  3492. * - TIMESTAMP_MICROSEC
  3493. * Bits 31:0
  3494. * Purpose: specify the time the rx PPDU was received, in microsecond units
  3495. * Value: PPDU rx time, in microseconds
  3496. * - VHT_SIG_A1
  3497. * Bits 23:0
  3498. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  3499. * from the rx PPDU
  3500. * Value:
  3501. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  3502. * VHT-SIG-A1 data.
  3503. * If PREAMBLE_TYPE specifies HT, then this field contains the
  3504. * first 24 bits of the HT-SIG data.
  3505. * Otherwise, this field is invalid.
  3506. * Refer to the the 802.11 protocol for the definition of the
  3507. * HT-SIG and VHT-SIG-A1 fields
  3508. * - VHT_SIG_A2
  3509. * Bits 23:0
  3510. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  3511. * from the rx PPDU
  3512. * Value:
  3513. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  3514. * VHT-SIG-A2 data.
  3515. * If PREAMBLE_TYPE specifies HT, then this field contains the
  3516. * last 24 bits of the HT-SIG data.
  3517. * Otherwise, this field is invalid.
  3518. * Refer to the the 802.11 protocol for the definition of the
  3519. * HT-SIG and VHT-SIG-A2 fields
  3520. * - PREAMBLE_TYPE
  3521. * Bits 31:24
  3522. * Purpose: indicate the PHY format of the received burst
  3523. * Value:
  3524. * 0x4: Legacy (OFDM/CCK)
  3525. * 0x8: HT
  3526. * 0x9: HT with TxBF
  3527. * 0xC: VHT
  3528. * 0xD: VHT with TxBF
  3529. * - SERVICE
  3530. * Bits 31:24
  3531. * Purpose: TBD
  3532. * Value: TBD
  3533. *
  3534. * Rx MSDU descriptor fields:
  3535. * - FW_RX_DESC_BYTES
  3536. * Bits 15:0
  3537. * Purpose: Indicate how many bytes in the Rx indication are used for
  3538. * FW Rx descriptors
  3539. *
  3540. * Payload fields:
  3541. * - MPDU_COUNT
  3542. * Bits 7:0
  3543. * Purpose: Indicate how many sequential MPDUs share the same status.
  3544. * All MPDUs within the indicated list are from the same RA-TA-TID.
  3545. * - MPDU_STATUS
  3546. * Bits 15:8
  3547. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  3548. * received successfully.
  3549. * Value:
  3550. * 0x1: success
  3551. * 0x2: FCS error
  3552. * 0x3: duplicate error
  3553. * 0x4: replay error
  3554. * 0x5: invalid peer
  3555. */
  3556. /* header fields */
  3557. #define HTT_RX_IND_EXT_TID_M 0x1f00
  3558. #define HTT_RX_IND_EXT_TID_S 8
  3559. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  3560. #define HTT_RX_IND_FLUSH_VALID_S 13
  3561. #define HTT_RX_IND_REL_VALID_M 0x4000
  3562. #define HTT_RX_IND_REL_VALID_S 14
  3563. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  3564. #define HTT_RX_IND_PEER_ID_S 16
  3565. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  3566. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  3567. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  3568. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  3569. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  3570. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  3571. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  3572. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  3573. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  3574. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  3575. /* rx PPDU descriptor fields */
  3576. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  3577. #define HTT_RX_IND_RSSI_CMB_S 0
  3578. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  3579. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  3580. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  3581. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  3582. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  3583. #define HTT_RX_IND_PHY_ERR_S 24
  3584. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  3585. #define HTT_RX_IND_LEGACY_RATE_S 25
  3586. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  3587. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  3588. #define HTT_RX_IND_END_VALID_M 0x40000000
  3589. #define HTT_RX_IND_END_VALID_S 30
  3590. #define HTT_RX_IND_START_VALID_M 0x80000000
  3591. #define HTT_RX_IND_START_VALID_S 31
  3592. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  3593. #define HTT_RX_IND_RSSI_PRI20_S 0
  3594. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  3595. #define HTT_RX_IND_RSSI_EXT20_S 8
  3596. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  3597. #define HTT_RX_IND_RSSI_EXT40_S 16
  3598. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  3599. #define HTT_RX_IND_RSSI_EXT80_S 24
  3600. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  3601. #define HTT_RX_IND_VHT_SIG_A1_S 0
  3602. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  3603. #define HTT_RX_IND_VHT_SIG_A2_S 0
  3604. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  3605. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  3606. #define HTT_RX_IND_SERVICE_M 0xff000000
  3607. #define HTT_RX_IND_SERVICE_S 24
  3608. /* rx MSDU descriptor fields */
  3609. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  3610. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  3611. /* payload fields */
  3612. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  3613. #define HTT_RX_IND_MPDU_COUNT_S 0
  3614. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  3615. #define HTT_RX_IND_MPDU_STATUS_S 8
  3616. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  3617. do { \
  3618. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  3619. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  3620. } while (0)
  3621. #define HTT_RX_IND_EXT_TID_GET(word) \
  3622. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  3623. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  3624. do { \
  3625. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  3626. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  3627. } while (0)
  3628. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  3629. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  3630. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  3631. do { \
  3632. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  3633. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  3634. } while (0)
  3635. #define HTT_RX_IND_REL_VALID_GET(word) \
  3636. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  3637. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  3638. do { \
  3639. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  3640. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  3641. } while (0)
  3642. #define HTT_RX_IND_PEER_ID_GET(word) \
  3643. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  3644. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  3645. do { \
  3646. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  3647. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  3648. } while (0)
  3649. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  3650. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> \
  3651. HTT_RX_IND_FW_RX_DESC_BYTES_S)
  3652. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  3653. do { \
  3654. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  3655. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  3656. } while (0)
  3657. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  3658. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  3659. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  3660. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  3661. do { \
  3662. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  3663. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  3664. } while (0)
  3665. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  3666. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  3667. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  3668. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  3669. do { \
  3670. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  3671. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  3672. } while (0)
  3673. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  3674. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  3675. HTT_RX_IND_REL_SEQ_NUM_START_S)
  3676. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  3677. do { \
  3678. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  3679. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  3680. } while (0)
  3681. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  3682. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  3683. HTT_RX_IND_REL_SEQ_NUM_END_S)
  3684. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  3685. do { \
  3686. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  3687. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  3688. } while (0)
  3689. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  3690. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  3691. HTT_RX_IND_NUM_MPDU_RANGES_S)
  3692. /* FW rx PPDU descriptor fields */
  3693. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  3694. do { \
  3695. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  3696. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  3697. } while (0)
  3698. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  3699. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  3700. HTT_RX_IND_RSSI_CMB_S)
  3701. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  3702. do { \
  3703. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  3704. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  3705. } while (0)
  3706. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  3707. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  3708. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  3709. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  3710. do { \
  3711. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  3712. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  3713. } while (0)
  3714. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  3715. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  3716. HTT_RX_IND_PHY_ERR_CODE_S)
  3717. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  3718. do { \
  3719. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  3720. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  3721. } while (0)
  3722. #define HTT_RX_IND_PHY_ERR_GET(word) \
  3723. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  3724. HTT_RX_IND_PHY_ERR_S)
  3725. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  3726. do { \
  3727. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  3728. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  3729. } while (0)
  3730. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  3731. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  3732. HTT_RX_IND_LEGACY_RATE_S)
  3733. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  3734. do { \
  3735. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  3736. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  3737. } while (0)
  3738. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  3739. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  3740. HTT_RX_IND_LEGACY_RATE_SEL_S)
  3741. #define HTT_RX_IND_END_VALID_SET(word, value) \
  3742. do { \
  3743. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  3744. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  3745. } while (0)
  3746. #define HTT_RX_IND_END_VALID_GET(word) \
  3747. (((word) & HTT_RX_IND_END_VALID_M) >> \
  3748. HTT_RX_IND_END_VALID_S)
  3749. #define HTT_RX_IND_START_VALID_SET(word, value) \
  3750. do { \
  3751. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  3752. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  3753. } while (0)
  3754. #define HTT_RX_IND_START_VALID_GET(word) \
  3755. (((word) & HTT_RX_IND_START_VALID_M) >> \
  3756. HTT_RX_IND_START_VALID_S)
  3757. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  3758. do { \
  3759. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  3760. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  3761. } while (0)
  3762. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  3763. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  3764. HTT_RX_IND_RSSI_PRI20_S)
  3765. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  3766. do { \
  3767. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  3768. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  3769. } while (0)
  3770. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  3771. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  3772. HTT_RX_IND_RSSI_EXT20_S)
  3773. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  3774. do { \
  3775. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  3776. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  3777. } while (0)
  3778. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  3779. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  3780. HTT_RX_IND_RSSI_EXT40_S)
  3781. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  3782. do { \
  3783. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  3784. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  3785. } while (0)
  3786. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  3787. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  3788. HTT_RX_IND_RSSI_EXT80_S)
  3789. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  3790. do { \
  3791. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  3792. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  3793. } while (0)
  3794. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  3795. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  3796. HTT_RX_IND_VHT_SIG_A1_S)
  3797. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  3798. do { \
  3799. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  3800. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  3801. } while (0)
  3802. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  3803. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  3804. HTT_RX_IND_VHT_SIG_A2_S)
  3805. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  3806. do { \
  3807. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  3808. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  3809. } while (0)
  3810. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  3811. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  3812. HTT_RX_IND_PREAMBLE_TYPE_S)
  3813. #define HTT_RX_IND_SERVICE_SET(word, value) \
  3814. do { \
  3815. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  3816. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  3817. } while (0)
  3818. #define HTT_RX_IND_SERVICE_GET(word) \
  3819. (((word) & HTT_RX_IND_SERVICE_M) >> \
  3820. HTT_RX_IND_SERVICE_S)
  3821. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  3822. do { \
  3823. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  3824. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  3825. } while (0)
  3826. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  3827. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  3828. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  3829. do { \
  3830. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  3831. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  3832. } while (0)
  3833. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  3834. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  3835. #define HTT_RX_IND_HL_BYTES \
  3836. (HTT_RX_IND_HDR_BYTES + \
  3837. 4 /* single FW rx MSDU descriptor, plus padding */ + \
  3838. 4 /* single MPDU range information element */)
  3839. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  3840. /* Could we use one macro entry? */
  3841. #define HTT_WORD_SET(word, field, value) \
  3842. do { \
  3843. HTT_CHECK_SET_VAL(field, value); \
  3844. (word) |= ((value) << field ## _S); \
  3845. } while (0)
  3846. #define HTT_WORD_GET(word, field) \
  3847. (((word) & field ## _M) >> field ## _S)
  3848. PREPACK struct hl_htt_rx_ind_base {
  3849. /*
  3850. * align with LL case rx indication message,but
  3851. * reduced to 5 words
  3852. */
  3853. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32];
  3854. } POSTPACK;
  3855. /*
  3856. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  3857. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  3858. * HL host needed info. The field is just after the msdu fw rx desc.
  3859. */
  3860. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  3861. (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  3862. struct htt_rx_ind_hl_rx_desc_t {
  3863. A_UINT8 ver;
  3864. A_UINT8 len;
  3865. struct {
  3866. A_UINT8
  3867. first_msdu:1,
  3868. last_msdu:1,
  3869. c3_failed:1,
  3870. c4_failed:1,
  3871. ipv6:1,
  3872. tcp:1,
  3873. udp:1,
  3874. reserved:1;
  3875. } flags;
  3876. };
  3877. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  3878. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  3879. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  3880. #define HTT_RX_IND_HL_RX_DESC_VER 0
  3881. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  3882. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  3883. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  3884. #define HTT_RX_IND_HL_FLAG_OFFSET \
  3885. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  3886. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  3887. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  3888. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  3889. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  3890. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  3891. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or ipv4 */
  3892. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  3893. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  3894. /* This structure is used in HL, the basic descriptor information
  3895. * used by host. the structure is translated by FW from HW desc
  3896. * or generated by FW. But in HL monitor mode, the host would use
  3897. * the same structure with LL.
  3898. */
  3899. PREPACK struct hl_htt_rx_desc_base {
  3900. A_UINT32
  3901. seq_num:12,
  3902. encrypted:1,
  3903. chan_info_present:1,
  3904. resv0:2,
  3905. mcast_bcast:1,
  3906. fragment:1,
  3907. key_id_oct:8,
  3908. resv1:6;
  3909. A_UINT32 pn_31_0;
  3910. union {
  3911. struct {
  3912. A_UINT16 pn_47_32;
  3913. A_UINT16 pn_63_48;
  3914. } pn16;
  3915. A_UINT32 pn_63_32;
  3916. } u0;
  3917. A_UINT32 pn_95_64;
  3918. A_UINT32 pn_127_96;
  3919. } POSTPACK;
  3920. /*
  3921. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  3922. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  3923. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  3924. * Please see htt_chan_change_t for description of the fields.
  3925. */
  3926. PREPACK struct htt_chan_info_t
  3927. {
  3928. A_UINT32
  3929. primary_chan_center_freq_mhz:16,
  3930. contig_chan1_center_freq_mhz:16;
  3931. A_UINT32
  3932. contig_chan2_center_freq_mhz:16,
  3933. phy_mode:8,
  3934. reserved:8;
  3935. } POSTPACK;
  3936. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  3937. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  3938. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  3939. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  3940. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  3941. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  3942. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  3943. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  3944. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  3945. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  3946. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  3947. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  3948. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  3949. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  3950. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  3951. #define HTT_HL_RX_DESC_PN_OFFSET \
  3952. offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  3953. #define HTT_HL_RX_DESC_PN_WORD_OFFSET \
  3954. (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  3955. /* Channel information */
  3956. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  3957. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  3958. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  3959. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  3960. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  3961. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  3962. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  3963. #define HTT_CHAN_INFO_PHY_MODE_S 16
  3964. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  3965. do { \
  3966. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  3967. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  3968. } while (0)
  3969. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  3970. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) \
  3971. >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  3972. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  3973. do { \
  3974. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  3975. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  3976. } while (0)
  3977. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  3978. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) \
  3979. >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  3980. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  3981. do { \
  3982. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  3983. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  3984. } while (0)
  3985. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  3986. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) \
  3987. >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  3988. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  3989. do { \
  3990. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  3991. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  3992. } while (0)
  3993. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  3994. (((word) & HTT_CHAN_INFO_PHY_MODE_M) \
  3995. >> HTT_CHAN_INFO_PHY_MODE_S)
  3996. /*
  3997. * @brief target -> host rx reorder flush message definition
  3998. *
  3999. * @details
  4000. * The following field definitions describe the format of the rx flush
  4001. * message sent from the target to the host.
  4002. * The message consists of a 4-octet header, followed by one or more
  4003. * 4-octet payload information elements.
  4004. *
  4005. * |31 24|23 8|7 0|
  4006. * |--------------------------------------------------------------|
  4007. * | TID | peer ID | msg type |
  4008. * |--------------------------------------------------------------|
  4009. * | seq num end | seq num start | MPDU status | reserved |
  4010. * |--------------------------------------------------------------|
  4011. * First DWORD:
  4012. * - MSG_TYPE
  4013. * Bits 7:0
  4014. * Purpose: identifies this as an rx flush message
  4015. * Value: 0x2
  4016. * - PEER_ID
  4017. * Bits 23:8 (only bits 18:8 actually used)
  4018. * Purpose: identify which peer's rx data is being flushed
  4019. * Value: (rx) peer ID
  4020. * - TID
  4021. * Bits 31:24 (only bits 27:24 actually used)
  4022. * Purpose: Specifies which traffic identifier's rx data is being flushed
  4023. * Value: traffic identifier
  4024. * Second DWORD:
  4025. * - MPDU_STATUS
  4026. * Bits 15:8
  4027. * Purpose:
  4028. * Indicate whether the flushed MPDUs should be discarded or processed.
  4029. * Value:
  4030. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  4031. * stages of rx processing
  4032. * other: discard the MPDUs
  4033. * It is anticipated that flush messages will always have
  4034. * MPDU status == 1, but the status flag is included for
  4035. * flexibility.
  4036. * - SEQ_NUM_START
  4037. * Bits 23:16
  4038. * Purpose:
  4039. * Indicate the start of a series of consecutive MPDUs being flushed.
  4040. * Not all MPDUs within this range are necessarily valid - the host
  4041. * must check each sequence number within this range to see if the
  4042. * corresponding MPDU is actually present.
  4043. * Value:
  4044. * The sequence number for the first MPDU in the sequence.
  4045. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  4046. * - SEQ_NUM_END
  4047. * Bits 30:24
  4048. * Purpose:
  4049. * Indicate the end of a series of consecutive MPDUs being flushed.
  4050. * Value:
  4051. * The sequence number one larger than the sequence number of the
  4052. * last MPDU being flushed.
  4053. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  4054. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  4055. * are to be released for further rx processing.
  4056. * Not all MPDUs within this range are necessarily valid - the host
  4057. * must check each sequence number within this range to see if the
  4058. * corresponding MPDU is actually present.
  4059. */
  4060. /* first DWORD */
  4061. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  4062. #define HTT_RX_FLUSH_PEER_ID_S 8
  4063. #define HTT_RX_FLUSH_TID_M 0xff000000
  4064. #define HTT_RX_FLUSH_TID_S 24
  4065. /* second DWORD */
  4066. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  4067. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  4068. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  4069. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  4070. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  4071. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  4072. #define HTT_RX_FLUSH_BYTES 8
  4073. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  4074. do { \
  4075. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  4076. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  4077. } while (0)
  4078. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  4079. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  4080. #define HTT_RX_FLUSH_TID_SET(word, value) \
  4081. do { \
  4082. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  4083. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  4084. } while (0)
  4085. #define HTT_RX_FLUSH_TID_GET(word) \
  4086. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  4087. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  4088. do { \
  4089. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  4090. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  4091. } while (0)
  4092. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  4093. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  4094. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  4095. do { \
  4096. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  4097. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  4098. } while (0)
  4099. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  4100. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> \
  4101. HTT_RX_FLUSH_SEQ_NUM_START_S)
  4102. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  4103. do { \
  4104. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  4105. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  4106. } while (0)
  4107. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  4108. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  4109. /*
  4110. * @brief target -> host rx pn check indication message
  4111. *
  4112. * @details
  4113. * The following field definitions describe the format of the Rx PN check
  4114. * indication message sent from the target to the host.
  4115. * The message consists of a 4-octet header, followed by the start and
  4116. * end sequence numbers to be released, followed by the PN IEs. Each PN
  4117. * IE is one octet containing the sequence number that failed the PN
  4118. * check.
  4119. *
  4120. * |31 24|23 8|7 0|
  4121. * |--------------------------------------------------------------|
  4122. * | TID | peer ID | msg type |
  4123. * |--------------------------------------------------------------|
  4124. * | Reserved | PN IE count | seq num end | seq num start|
  4125. * |--------------------------------------------------------------|
  4126. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  4127. * |--------------------------------------------------------------|
  4128. * First DWORD:
  4129. * - MSG_TYPE
  4130. * Bits 7:0
  4131. * Purpose: Identifies this as an rx pn check indication message
  4132. * Value: 0x2
  4133. * - PEER_ID
  4134. * Bits 23:8 (only bits 18:8 actually used)
  4135. * Purpose: identify which peer
  4136. * Value: (rx) peer ID
  4137. * - TID
  4138. * Bits 31:24 (only bits 27:24 actually used)
  4139. * Purpose: identify traffic identifier
  4140. * Value: traffic identifier
  4141. * Second DWORD:
  4142. * - SEQ_NUM_START
  4143. * Bits 7:0
  4144. * Purpose:
  4145. * Indicates the starting sequence number of the MPDU in this
  4146. * series of MPDUs that went though PN check.
  4147. * Value:
  4148. * The sequence number for the first MPDU in the sequence.
  4149. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  4150. * - SEQ_NUM_END
  4151. * Bits 15:8
  4152. * Purpose:
  4153. * Indicates the ending sequence number of the MPDU in this
  4154. * series of MPDUs that went though PN check.
  4155. * Value:
  4156. * The sequence number one larger then the sequence number of the last
  4157. * MPDU being flushed.
  4158. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  4159. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1]
  4160. * have been checked for invalid PN numbers and are ready
  4161. * to be released for further processing.
  4162. * Not all MPDUs within this range are necessarily valid - the host
  4163. * must check each sequence number within this range to see if the
  4164. * corresponding MPDU is actually present.
  4165. * - PN_IE_COUNT
  4166. * Bits 23:16
  4167. * Purpose:
  4168. * Used to determine the variable number of PN information
  4169. * elements in this message
  4170. *
  4171. * PN information elements:
  4172. * - PN_IE_x-
  4173. * Purpose:
  4174. * Each PN information element contains the sequence number
  4175. * of the MPDU that has failed the target PN check.
  4176. * Value:
  4177. * Contains the 6 LSBs of the 802.11 sequence number
  4178. * corresponding to the MPDU that failed the PN check.
  4179. */
  4180. /* first DWORD */
  4181. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  4182. #define HTT_RX_PN_IND_PEER_ID_S 8
  4183. #define HTT_RX_PN_IND_TID_M 0xff000000
  4184. #define HTT_RX_PN_IND_TID_S 24
  4185. /* second DWORD */
  4186. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  4187. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  4188. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  4189. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  4190. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  4191. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  4192. #define HTT_RX_PN_IND_BYTES 8
  4193. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  4194. do { \
  4195. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  4196. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  4197. } while (0)
  4198. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  4199. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  4200. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  4201. do { \
  4202. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  4203. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  4204. } while (0)
  4205. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  4206. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  4207. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  4208. do { \
  4209. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  4210. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  4211. } while (0)
  4212. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  4213. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> \
  4214. HTT_RX_PN_IND_SEQ_NUM_START_S)
  4215. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  4216. do { \
  4217. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  4218. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  4219. } while (0)
  4220. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  4221. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  4222. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  4223. do { \
  4224. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  4225. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  4226. } while (0)
  4227. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  4228. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  4229. /*
  4230. * @brief target -> host rx offload deliver message for LL system
  4231. *
  4232. * @details
  4233. * In a low latency system this message is sent whenever the offload
  4234. * manager flushes out the packets it has coalesced in its coalescing buffer.
  4235. * The DMA of the actual packets into host memory is done before sending out
  4236. * this message. This message indicates only how many MSDUs to reap. The
  4237. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  4238. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  4239. * DMA'd by the MAC directly into host memory these packets do not contain
  4240. * the MAC descriptors in the header portion of the packet. Instead they contain
  4241. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  4242. * message, the packets are delivered directly to the NW stack without going
  4243. * through the regular reorder buffering and PN checking path since it has
  4244. * already been done in target.
  4245. *
  4246. * |31 24|23 16|15 8|7 0|
  4247. * |-----------------------------------------------------------------------|
  4248. * | Total MSDU count | reserved | msg type |
  4249. * |-----------------------------------------------------------------------|
  4250. *
  4251. * @brief target -> host rx offload deliver message for HL system
  4252. *
  4253. * @details
  4254. * In a high latency system this message is sent whenever the offload manager
  4255. * flushes out the packets it has coalesced in its coalescing buffer. The
  4256. * actual packets are also carried along with this message. When the host
  4257. * receives this message, it is expected to deliver these packets to the NW
  4258. * stack directly instead of routing them through the reorder buffering and
  4259. * PN checking path since it has already been done in target.
  4260. *
  4261. * |31 24|23 16|15 8|7 0|
  4262. * |-----------------------------------------------------------------------|
  4263. * | Total MSDU count | reserved | msg type |
  4264. * |-----------------------------------------------------------------------|
  4265. * | peer ID | MSDU length |
  4266. * |-----------------------------------------------------------------------|
  4267. * | MSDU payload | FW Desc | tid | vdev ID |
  4268. * |-----------------------------------------------------------------------|
  4269. * | MSDU payload contd. |
  4270. * |-----------------------------------------------------------------------|
  4271. * | peer ID | MSDU length |
  4272. * |-----------------------------------------------------------------------|
  4273. * | MSDU payload | FW Desc | tid | vdev ID |
  4274. * |-----------------------------------------------------------------------|
  4275. * | MSDU payload contd. |
  4276. * |-----------------------------------------------------------------------|
  4277. *
  4278. */
  4279. /* first DWORD */
  4280. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  4281. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  4282. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  4283. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  4284. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  4285. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  4286. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  4287. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  4288. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  4289. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  4290. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  4291. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  4292. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  4293. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  4294. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  4295. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> \
  4296. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  4297. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  4298. do { \
  4299. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  4300. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  4301. } while (0) \
  4302. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  4303. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> \
  4304. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  4305. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  4306. do { \
  4307. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  4308. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  4309. } while (0) \
  4310. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  4311. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> \
  4312. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  4313. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  4314. do { \
  4315. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  4316. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  4317. } while (0) \
  4318. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  4319. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> \
  4320. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  4321. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  4322. do { \
  4323. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  4324. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  4325. } while (0) \
  4326. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  4327. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> \
  4328. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  4329. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  4330. do { \
  4331. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  4332. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  4333. } while (0) \
  4334. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  4335. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> \
  4336. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  4337. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  4338. do { \
  4339. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  4340. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  4341. } while (0) \
  4342. /**
  4343. * @brief target -> host rx peer map/unmap message definition
  4344. *
  4345. * @details
  4346. * The following diagram shows the format of the rx peer map message sent
  4347. * from the target to the host. This layout assumes the target operates
  4348. * as little-endian.
  4349. *
  4350. * |31 24|23 16|15 8|7 0|
  4351. * |-----------------------------------------------------------------------|
  4352. * | peer ID | VDEV ID | msg type |
  4353. * |-----------------------------------------------------------------------|
  4354. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  4355. * |-----------------------------------------------------------------------|
  4356. * | reserved | MAC addr 5 | MAC addr 4 |
  4357. * |-----------------------------------------------------------------------|
  4358. *
  4359. *
  4360. * The following diagram shows the format of the rx peer unmap message sent
  4361. * from the target to the host.
  4362. *
  4363. * |31 24|23 16|15 8|7 0|
  4364. * |-----------------------------------------------------------------------|
  4365. * | peer ID | VDEV ID | msg type |
  4366. * |-----------------------------------------------------------------------|
  4367. *
  4368. * The following field definitions describe the format of the rx peer map
  4369. * and peer unmap messages sent from the target to the host.
  4370. * - MSG_TYPE
  4371. * Bits 7:0
  4372. * Purpose: identifies this as an rx peer map or peer unmap message
  4373. * Value: peer map -> 0x3, peer unmap -> 0x4
  4374. * - VDEV_ID
  4375. * Bits 15:8
  4376. * Purpose: Indicates which virtual device the peer is associated
  4377. * with.
  4378. * Value: vdev ID (used in the host to look up the vdev object)
  4379. * - PEER_ID
  4380. * Bits 31:16
  4381. * Purpose: The peer ID (index) that WAL is allocating (map) or
  4382. * freeing (unmap)
  4383. * Value: (rx) peer ID
  4384. * - MAC_ADDR_L32 (peer map only)
  4385. * Bits 31:0
  4386. * Purpose: Identifies which peer node the peer ID is for.
  4387. * Value: lower 4 bytes of peer node's MAC address
  4388. * - MAC_ADDR_U16 (peer map only)
  4389. * Bits 15:0
  4390. * Purpose: Identifies which peer node the peer ID is for.
  4391. * Value: upper 2 bytes of peer node's MAC address
  4392. */
  4393. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  4394. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  4395. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  4396. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  4397. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  4398. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  4399. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  4400. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  4401. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  4402. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  4403. do { \
  4404. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  4405. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  4406. } while (0)
  4407. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  4408. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  4409. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  4410. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  4411. do { \
  4412. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  4413. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  4414. } while (0)
  4415. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  4416. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  4417. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  4418. #define HTT_RX_PEER_MAP_BYTES 12
  4419. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  4420. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  4421. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  4422. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  4423. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  4424. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  4425. #define HTT_RX_PEER_UNMAP_BYTES 4
  4426. /**
  4427. * @brief target -> host message specifying security parameters
  4428. *
  4429. * @details
  4430. * The following diagram shows the format of the security specification
  4431. * message sent from the target to the host.
  4432. * This security specification message tells the host whether a PN check is
  4433. * necessary on rx data frames, and if so, how large the PN counter is.
  4434. * This message also tells the host about the security processing to apply
  4435. * to defragmented rx frames - specifically, whether a Message Integrity
  4436. * Check is required, and the Michael key to use.
  4437. *
  4438. * |31 24|23 16|15|14 8|7 0|
  4439. * |-----------------------------------------------------------------------|
  4440. * | peer ID | U| security type | msg type |
  4441. * |-----------------------------------------------------------------------|
  4442. * | Michael Key K0 |
  4443. * |-----------------------------------------------------------------------|
  4444. * | Michael Key K1 |
  4445. * |-----------------------------------------------------------------------|
  4446. * | WAPI RSC Low0 |
  4447. * |-----------------------------------------------------------------------|
  4448. * | WAPI RSC Low1 |
  4449. * |-----------------------------------------------------------------------|
  4450. * | WAPI RSC Hi0 |
  4451. * |-----------------------------------------------------------------------|
  4452. * | WAPI RSC Hi1 |
  4453. * |-----------------------------------------------------------------------|
  4454. *
  4455. * The following field definitions describe the format of the security
  4456. * indication message sent from the target to the host.
  4457. * - MSG_TYPE
  4458. * Bits 7:0
  4459. * Purpose: identifies this as a security specification message
  4460. * Value: 0xb
  4461. * - SEC_TYPE
  4462. * Bits 14:8
  4463. * Purpose: specifies which type of security applies to the peer
  4464. * Value: htt_sec_type enum value
  4465. * - UNICAST
  4466. * Bit 15
  4467. * Purpose: whether this security is applied to unicast or multicast data
  4468. * Value: 1 -> unicast, 0 -> multicast
  4469. * - PEER_ID
  4470. * Bits 31:16
  4471. * Purpose: The ID number for the peer the security specification is for
  4472. * Value: peer ID
  4473. * - MICHAEL_KEY_K0
  4474. * Bits 31:0
  4475. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  4476. * Value: Michael Key K0 (if security type is TKIP)
  4477. * - MICHAEL_KEY_K1
  4478. * Bits 31:0
  4479. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  4480. * Value: Michael Key K1 (if security type is TKIP)
  4481. * - WAPI_RSC_LOW0
  4482. * Bits 31:0
  4483. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  4484. * Value: WAPI RSC Low0 (if security type is WAPI)
  4485. * - WAPI_RSC_LOW1
  4486. * Bits 31:0
  4487. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  4488. * Value: WAPI RSC Low1 (if security type is WAPI)
  4489. * - WAPI_RSC_HI0
  4490. * Bits 31:0
  4491. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  4492. * Value: WAPI RSC Hi0 (if security type is WAPI)
  4493. * - WAPI_RSC_HI1
  4494. * Bits 31:0
  4495. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  4496. * Value: WAPI RSC Hi1 (if security type is WAPI)
  4497. */
  4498. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  4499. #define HTT_SEC_IND_SEC_TYPE_S 8
  4500. #define HTT_SEC_IND_UNICAST_M 0x00008000
  4501. #define HTT_SEC_IND_UNICAST_S 15
  4502. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  4503. #define HTT_SEC_IND_PEER_ID_S 16
  4504. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  4505. do { \
  4506. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  4507. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  4508. } while (0)
  4509. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  4510. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  4511. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  4512. do { \
  4513. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  4514. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  4515. } while (0)
  4516. #define HTT_SEC_IND_UNICAST_GET(word) \
  4517. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  4518. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  4519. do { \
  4520. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  4521. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  4522. } while (0)
  4523. #define HTT_SEC_IND_PEER_ID_GET(word) \
  4524. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  4525. #define HTT_SEC_IND_BYTES 28
  4526. /**
  4527. * @brief target -> host rx ADDBA / DELBA message definitions
  4528. *
  4529. * @details
  4530. * The following diagram shows the format of the rx ADDBA message sent
  4531. * from the target to the host:
  4532. *
  4533. * |31 20|19 16|15 8|7 0|
  4534. * |---------------------------------------------------------------------|
  4535. * | peer ID | TID | window size | msg type |
  4536. * |---------------------------------------------------------------------|
  4537. *
  4538. * The following diagram shows the format of the rx DELBA message sent
  4539. * from the target to the host:
  4540. *
  4541. * |31 20|19 16|15 8|7 0|
  4542. * |---------------------------------------------------------------------|
  4543. * | peer ID | TID | reserved | msg type |
  4544. * |---------------------------------------------------------------------|
  4545. *
  4546. * The following field definitions describe the format of the rx ADDBA
  4547. * and DELBA messages sent from the target to the host.
  4548. * - MSG_TYPE
  4549. * Bits 7:0
  4550. * Purpose: identifies this as an rx ADDBA or DELBA message
  4551. * Value: ADDBA -> 0x5, DELBA -> 0x6
  4552. * - WIN_SIZE
  4553. * Bits 15:8 (ADDBA only)
  4554. * Purpose: Specifies the length of the block ack window (max = 64).
  4555. * Value:
  4556. * block ack window length specified by the received ADDBA
  4557. * management message.
  4558. * - TID
  4559. * Bits 19:16
  4560. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  4561. * Value:
  4562. * TID specified by the received ADDBA or DELBA management message.
  4563. * - PEER_ID
  4564. * Bits 31:20
  4565. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  4566. * Value:
  4567. * ID (hash value) used by the host for fast, direct lookup of
  4568. * host SW peer info, including rx reorder states.
  4569. */
  4570. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  4571. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  4572. #define HTT_RX_ADDBA_TID_M 0xf0000
  4573. #define HTT_RX_ADDBA_TID_S 16
  4574. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  4575. #define HTT_RX_ADDBA_PEER_ID_S 20
  4576. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  4577. do { \
  4578. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  4579. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  4580. } while (0)
  4581. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  4582. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  4583. #define HTT_RX_ADDBA_TID_SET(word, value) \
  4584. do { \
  4585. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  4586. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  4587. } while (0)
  4588. #define HTT_RX_ADDBA_TID_GET(word) \
  4589. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  4590. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  4591. do { \
  4592. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  4593. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  4594. } while (0)
  4595. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  4596. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  4597. #define HTT_RX_ADDBA_BYTES 4
  4598. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  4599. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  4600. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  4601. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  4602. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  4603. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  4604. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  4605. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  4606. #define HTT_RX_DELBA_BYTES 4
  4607. /**
  4608. * @brief tx queue group information element definition
  4609. *
  4610. * @details
  4611. * The following diagram shows the format of the tx queue group
  4612. * information element, which can be included in target --> host
  4613. * messages to specify the number of tx "credits" (tx descriptors
  4614. * for LL, or tx buffers for HL) available to a particular group
  4615. * of host-side tx queues, and which host-side tx queues belong to
  4616. * the group.
  4617. *
  4618. * |31|30 24|23 16|15|14|13 0|
  4619. * |------------------------------------------------------------------------|
  4620. * | X| reserved | tx queue grp ID | A| S| credit count |
  4621. * |------------------------------------------------------------------------|
  4622. * | vdev ID mask | AC mask |
  4623. * |------------------------------------------------------------------------|
  4624. *
  4625. * The following definitions describe the fields within the tx queue group
  4626. * information element:
  4627. * - credit_count
  4628. * Bits 13:1
  4629. * Purpose: specify how many tx credits are available to the tx queue group
  4630. * Value: An absolute or relative, positive or negative credit value
  4631. * The 'A' bit specifies whether the value is absolute or relative.
  4632. * The 'S' bit specifies whether the value is positive or negative.
  4633. * A negative value can only be relative, not absolute.
  4634. * An absolute value replaces any prior credit value the host has for
  4635. * the tx queue group in question.
  4636. * A relative value is added to the prior credit value the host has for
  4637. * the tx queue group in question.
  4638. * - sign
  4639. * Bit 14
  4640. * Purpose: specify whether the credit count is positive or negative
  4641. * Value: 0 -> positive, 1 -> negative
  4642. * - absolute
  4643. * Bit 15
  4644. * Purpose: specify whether the credit count is absolute or relative
  4645. * Value: 0 -> relative, 1 -> absolute
  4646. * - txq_group_id
  4647. * Bits 23:16
  4648. * Purpose: indicate which tx queue group's credit and/or membership are
  4649. * being specified
  4650. * Value: 0 to max_tx_queue_groups-1
  4651. * - reserved
  4652. * Bits 30:16
  4653. * Value: 0x0
  4654. * - eXtension
  4655. * Bit 31
  4656. * Purpose: specify whether another tx queue group info element follows
  4657. * Value: 0 -> no more tx queue group information elements
  4658. * 1 -> another tx queue group information element immediately follows
  4659. * - ac_mask
  4660. * Bits 15:0
  4661. * Purpose: specify which Access Categories belong to the tx queue group
  4662. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  4663. * the tx queue group.
  4664. * The AC bit-mask values are obtained by left-shifting by the
  4665. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  4666. * - vdev_id_mask
  4667. * Bits 31:16
  4668. * Purpose: specify which vdev's tx queues belong to the tx queue group
  4669. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  4670. * belong to the tx queue group.
  4671. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  4672. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  4673. */
  4674. PREPACK struct htt_txq_group {
  4675. A_UINT32
  4676. credit_count:14,
  4677. sign:1,
  4678. absolute:1,
  4679. tx_queue_group_id:8,
  4680. reserved0:7,
  4681. extension:1;
  4682. A_UINT32
  4683. ac_mask:16,
  4684. vdev_id_mask:16;
  4685. } POSTPACK;
  4686. /* first word */
  4687. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  4688. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  4689. #define HTT_TXQ_GROUP_SIGN_S 14
  4690. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  4691. #define HTT_TXQ_GROUP_ABS_S 15
  4692. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  4693. #define HTT_TXQ_GROUP_ID_S 16
  4694. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  4695. #define HTT_TXQ_GROUP_EXT_S 31
  4696. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  4697. /* second word */
  4698. #define HTT_TXQ_GROUP_AC_MASK_S 0
  4699. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  4700. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  4701. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  4702. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  4703. do { \
  4704. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  4705. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  4706. } while (0)
  4707. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  4708. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> \
  4709. HTT_TXQ_GROUP_CREDIT_COUNT_S)
  4710. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  4711. do { \
  4712. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  4713. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  4714. } while (0)
  4715. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  4716. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  4717. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  4718. do { \
  4719. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  4720. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  4721. } while (0)
  4722. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  4723. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  4724. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  4725. do { \
  4726. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  4727. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  4728. } while (0)
  4729. #define HTT_TXQ_GROUP_ID_GET(_info) \
  4730. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  4731. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  4732. do { \
  4733. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  4734. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  4735. } while (0)
  4736. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  4737. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  4738. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  4739. do { \
  4740. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  4741. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  4742. } while (0)
  4743. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  4744. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  4745. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  4746. do { \
  4747. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  4748. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  4749. } while (0)
  4750. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  4751. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> \
  4752. HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  4753. /**
  4754. * @brief target -> host TX completion indication message definition
  4755. *
  4756. * @details
  4757. * The following diagram shows the format of the TX completion indication sent
  4758. * from the target to the host
  4759. *
  4760. * |31 25| 24|23 16| 15 |14 11|10 8|7 0|
  4761. * |-------------------------------------------------------------|
  4762. * header: | reserved |append| num | t_i| tid |status| msg_type |
  4763. * |-------------------------------------------------------------|
  4764. * payload: | MSDU1 ID | MSDU0 ID |
  4765. * |-------------------------------------------------------------|
  4766. * : MSDU3 ID : MSDU2 ID :
  4767. * |-------------------------------------------------------------|
  4768. * | struct htt_tx_compl_ind_append_retries |
  4769. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  4770. *
  4771. * The following field definitions describe the format of the TX completion
  4772. * indication sent from the target to the host
  4773. * Header fields:
  4774. * - msg_type
  4775. * Bits 7:0
  4776. * Purpose: identifies this as HTT TX completion indication
  4777. * Value: 0x7
  4778. * - status
  4779. * Bits 10:8
  4780. * Purpose: the TX completion status of payload fragmentations descriptors
  4781. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  4782. * - tid
  4783. * Bits 14:11
  4784. * Purpose: the tid associated with those fragmentation descriptors. It is
  4785. * valid or not, depending on the tid_invalid bit.
  4786. * Value: 0 to 15
  4787. * - tid_invalid
  4788. * Bits 15:15
  4789. * Purpose: this bit indicates whether the tid field is valid or not
  4790. * Value: 0 indicates valid; 1 indicates invalid
  4791. * - num
  4792. * Bits 23:16
  4793. * Purpose: the number of payload in this indication
  4794. * Value: 1 to 255
  4795. * - append
  4796. * Bits 24:24
  4797. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  4798. * the number of tx retries for one MSDU at the end of this message
  4799. * Value: 0 indicates no appending; 1 indicates appending
  4800. * Payload fields:
  4801. * - hmsdu_id
  4802. * Bits 15:0
  4803. * Purpose: this ID is used to track the Tx buffer in host
  4804. * Value: 0 to "size of host MSDU descriptor pool - 1"
  4805. */
  4806. #define HTT_TX_COMPL_IND_STATUS_S 8
  4807. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  4808. #define HTT_TX_COMPL_IND_TID_S 11
  4809. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  4810. #define HTT_TX_COMPL_IND_TID_INV_S 15
  4811. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  4812. #define HTT_TX_COMPL_IND_NUM_S 16
  4813. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  4814. #define HTT_TX_COMPL_IND_APPEND_S 24
  4815. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  4816. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  4817. do { \
  4818. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  4819. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  4820. } while (0)
  4821. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  4822. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  4823. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  4824. do { \
  4825. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  4826. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  4827. } while (0)
  4828. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  4829. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  4830. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  4831. do { \
  4832. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  4833. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  4834. } while (0)
  4835. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  4836. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  4837. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  4838. do { \
  4839. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  4840. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  4841. } while (0)
  4842. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  4843. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  4844. HTT_TX_COMPL_IND_TID_INV_S)
  4845. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  4846. do { \
  4847. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  4848. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  4849. } while (0)
  4850. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  4851. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  4852. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  4853. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  4854. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  4855. #define HTT_TX_COMPL_IND_STAT_OK 0
  4856. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  4857. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  4858. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  4859. /*
  4860. * The PEER_DEL tx completion status is used for HL cases
  4861. * where the peer the frame is for has been deleted.
  4862. * The host has already discarded its copy of the frame, but
  4863. * it still needs the tx completion to restore its credit.
  4864. */
  4865. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  4866. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  4867. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  4868. PREPACK struct htt_tx_compl_ind_base {
  4869. A_UINT32 hdr;
  4870. A_UINT16 payload[1 /*or more */];
  4871. } POSTPACK;
  4872. PREPACK struct htt_tx_compl_ind_append_retries {
  4873. A_UINT16 msdu_id;
  4874. A_UINT8 tx_retries;
  4875. A_UINT8 flag;/* Bit 0, 1: another append_retries struct is appended
  4876. 0: this is the last append_retries struct */
  4877. } POSTPACK;
  4878. /**
  4879. * @brief target -> host rate-control update indication message
  4880. *
  4881. * @details
  4882. * The following diagram shows the format of the RC Update message
  4883. * sent from the target to the host, while processing the tx-completion
  4884. * of a transmitted PPDU.
  4885. *
  4886. * |31 24|23 16|15 8|7 0|
  4887. * |-------------------------------------------------------------|
  4888. * | peer ID | vdev ID | msg_type |
  4889. * |-------------------------------------------------------------|
  4890. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  4891. * |-------------------------------------------------------------|
  4892. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  4893. * |-------------------------------------------------------------|
  4894. * | : |
  4895. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  4896. * | : |
  4897. * |-------------------------------------------------------------|
  4898. * | : |
  4899. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  4900. * | : |
  4901. * |-------------------------------------------------------------|
  4902. * : :
  4903. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  4904. *
  4905. */
  4906. typedef struct {
  4907. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  4908. A_UINT32 rate_code_flags;
  4909. A_UINT32 flags; /* Encodes information such as excessive
  4910. retransmission, aggregate, some info
  4911. from .11 frame control,
  4912. STBC, LDPC, (SGI and Tx Chain Mask
  4913. are encoded in ptx_rc->flags field),
  4914. AMPDU truncation (BT/time based etc.),
  4915. RTS/CTS attempt */
  4916. A_UINT32 num_enqued;/* # of MPDUs (for non-AMPDU 1) for this rate */
  4917. A_UINT32 num_retries;/* Total # of transmission attempt for this rate */
  4918. A_UINT32 num_failed;/* # of failed MPDUs in A-MPDU, 0 otherwise */
  4919. A_UINT32 ack_rssi;/* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  4920. A_UINT32 time_stamp; /* ACK timestamp (helps determine age) */
  4921. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  4922. } HTT_RC_TX_DONE_PARAMS;
  4923. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS))/* bytes */
  4924. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  4925. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  4926. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  4927. #define HTT_RC_UPDATE_VDEVID_S 8
  4928. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  4929. #define HTT_RC_UPDATE_PEERID_S 16
  4930. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  4931. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  4932. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  4933. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  4934. do { \
  4935. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  4936. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  4937. } while (0)
  4938. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  4939. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  4940. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  4941. do { \
  4942. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  4943. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  4944. } while (0)
  4945. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  4946. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  4947. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  4948. do { \
  4949. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  4950. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  4951. } while (0)
  4952. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  4953. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  4954. /**
  4955. * @brief target -> host rx fragment indication message definition
  4956. *
  4957. * @details
  4958. * The following field definitions describe the format of the rx fragment
  4959. * indication message sent from the target to the host.
  4960. * The rx fragment indication message shares the format of the
  4961. * rx indication message, but not all fields from the rx indication message
  4962. * are relevant to the rx fragment indication message.
  4963. *
  4964. *
  4965. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  4966. * |-----------+-------------------+---------------------+-------------|
  4967. * | peer ID | |FV| ext TID | msg type |
  4968. * |-------------------------------------------------------------------|
  4969. * | | flush | flush |
  4970. * | | end | start |
  4971. * | | seq num | seq num |
  4972. * |-------------------------------------------------------------------|
  4973. * | reserved | FW rx desc bytes |
  4974. * |-------------------------------------------------------------------|
  4975. * | | FW MSDU Rx |
  4976. * | | desc B0 |
  4977. * |-------------------------------------------------------------------|
  4978. * Header fields:
  4979. * - MSG_TYPE
  4980. * Bits 7:0
  4981. * Purpose: identifies this as an rx fragment indication message
  4982. * Value: 0xa
  4983. * - EXT_TID
  4984. * Bits 12:8
  4985. * Purpose: identify the traffic ID of the rx data, including
  4986. * special "extended" TID values for multicast, broadcast, and
  4987. * non-QoS data frames
  4988. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  4989. * - FLUSH_VALID (FV)
  4990. * Bit 13
  4991. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  4992. * is valid
  4993. * Value:
  4994. * 1 -> flush IE is valid and needs to be processed
  4995. * 0 -> flush IE is not valid and should be ignored
  4996. * - PEER_ID
  4997. * Bits 31:16
  4998. * Purpose: Identify, by ID, which peer sent the rx data
  4999. * Value: ID of the peer who sent the rx data
  5000. * - FLUSH_SEQ_NUM_START
  5001. * Bits 5:0
  5002. * Purpose: Indicate the start of a series of MPDUs to flush
  5003. * Not all MPDUs within this series are necessarily valid - the host
  5004. * must check each sequence number within this range to see if the
  5005. * corresponding MPDU is actually present.
  5006. * This field is only valid if the FV bit is set.
  5007. * Value:
  5008. * The sequence number for the first MPDUs to check to flush.
  5009. * The sequence number is masked by 0x3f.
  5010. * - FLUSH_SEQ_NUM_END
  5011. * Bits 11:6
  5012. * Purpose: Indicate the end of a series of MPDUs to flush
  5013. * Value:
  5014. * The sequence number one larger than the sequence number of the
  5015. * last MPDU to check to flush.
  5016. * The sequence number is masked by 0x3f.
  5017. * Not all MPDUs within this series are necessarily valid - the host
  5018. * must check each sequence number within this range to see if the
  5019. * corresponding MPDU is actually present.
  5020. * This field is only valid if the FV bit is set.
  5021. * Rx descriptor fields:
  5022. * - FW_RX_DESC_BYTES
  5023. * Bits 15:0
  5024. * Purpose: Indicate how many bytes in the Rx indication are used for
  5025. * FW Rx descriptors
  5026. * Value: 1
  5027. */
  5028. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  5029. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  5030. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  5031. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  5032. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  5033. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  5034. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  5035. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  5036. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  5037. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  5038. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  5039. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  5040. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  5041. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  5042. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  5043. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  5044. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  5045. #define HTT_RX_FRAG_IND_BYTES \
  5046. (4 /* msg hdr */ + \
  5047. 4 /* flush spec */ + \
  5048. 4 /* (unused) FW rx desc bytes spec */ + \
  5049. 4 /* FW rx desc */)
  5050. /**
  5051. * @brief target -> host test message definition
  5052. *
  5053. * @details
  5054. * The following field definitions describe the format of the test
  5055. * message sent from the target to the host.
  5056. * The message consists of a 4-octet header, followed by a variable
  5057. * number of 32-bit integer values, followed by a variable number
  5058. * of 8-bit character values.
  5059. *
  5060. * |31 16|15 8|7 0|
  5061. * |-----------------------------------------------------------|
  5062. * | num chars | num ints | msg type |
  5063. * |-----------------------------------------------------------|
  5064. * | int 0 |
  5065. * |-----------------------------------------------------------|
  5066. * | int 1 |
  5067. * |-----------------------------------------------------------|
  5068. * | ... |
  5069. * |-----------------------------------------------------------|
  5070. * | char 3 | char 2 | char 1 | char 0 |
  5071. * |-----------------------------------------------------------|
  5072. * | | | ... | char 4 |
  5073. * |-----------------------------------------------------------|
  5074. * - MSG_TYPE
  5075. * Bits 7:0
  5076. * Purpose: identifies this as a test message
  5077. * Value: HTT_MSG_TYPE_TEST
  5078. * - NUM_INTS
  5079. * Bits 15:8
  5080. * Purpose: indicate how many 32-bit integers follow the message header
  5081. * - NUM_CHARS
  5082. * Bits 31:16
  5083. * Purpose: indicate how many 8-bit charaters follow the series of integers
  5084. */
  5085. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  5086. #define HTT_RX_TEST_NUM_INTS_S 8
  5087. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  5088. #define HTT_RX_TEST_NUM_CHARS_S 16
  5089. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  5090. do { \
  5091. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  5092. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  5093. } while (0)
  5094. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  5095. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  5096. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  5097. do { \
  5098. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  5099. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  5100. } while (0)
  5101. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  5102. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  5103. /**
  5104. * @brief target -> host packet log message
  5105. *
  5106. * @details
  5107. * The following field definitions describe the format of the packet log
  5108. * message sent from the target to the host.
  5109. * The message consists of a 4-octet header,followed by a variable number
  5110. * of 32-bit character values.
  5111. *
  5112. * |31 24|23 16|15 8|7 0|
  5113. * |-----------------------------------------------------------|
  5114. * | | | | msg type |
  5115. * |-----------------------------------------------------------|
  5116. * | payload |
  5117. * |-----------------------------------------------------------|
  5118. * - MSG_TYPE
  5119. * Bits 7:0
  5120. * Purpose: identifies this as a test message
  5121. * Value: HTT_MSG_TYPE_PACKETLOG
  5122. */
  5123. PREPACK struct htt_pktlog_msg {
  5124. A_UINT32 header;
  5125. A_UINT32 payload[1 /* or more */];
  5126. } POSTPACK;
  5127. /*
  5128. * Rx reorder statistics
  5129. * NB: all the fields must be defined in 4 octets size.
  5130. */
  5131. struct rx_reorder_stats {
  5132. /* Non QoS MPDUs received */
  5133. A_UINT32 deliver_non_qos;
  5134. /* MPDUs received in-order */
  5135. A_UINT32 deliver_in_order;
  5136. /* Flush due to reorder timer expired */
  5137. A_UINT32 deliver_flush_timeout;
  5138. /* Flush due to move out of window */
  5139. A_UINT32 deliver_flush_oow;
  5140. /* Flush due to DELBA */
  5141. A_UINT32 deliver_flush_delba;
  5142. /* MPDUs dropped due to FCS error */
  5143. A_UINT32 fcs_error;
  5144. /* MPDUs dropped due to monitor mode non-data packet */
  5145. A_UINT32 mgmt_ctrl;
  5146. /* Unicast-data MPDUs dropped due to invalid peer */
  5147. A_UINT32 invalid_peer;
  5148. /* MPDUs dropped due to duplication (non aggregation) */
  5149. A_UINT32 dup_non_aggr;
  5150. /* MPDUs dropped due to processed before */
  5151. A_UINT32 dup_past;
  5152. /* MPDUs dropped due to duplicate in reorder queue */
  5153. A_UINT32 dup_in_reorder;
  5154. /* Reorder timeout happened */
  5155. A_UINT32 reorder_timeout;
  5156. /* invalid bar ssn */
  5157. A_UINT32 invalid_bar_ssn;
  5158. /* reorder reset due to bar ssn */
  5159. A_UINT32 ssn_reset;
  5160. /* Flush due to delete peer */
  5161. A_UINT32 deliver_flush_delpeer;
  5162. /* Flush due to offload */
  5163. A_UINT32 deliver_flush_offload;
  5164. /* Flush due to out of buffer */
  5165. A_UINT32 deliver_flush_oob;
  5166. /* MPDUs dropped due to PN check fail */
  5167. A_UINT32 pn_fail;
  5168. /* MPDUs dropped due to unable to allocate memory */
  5169. A_UINT32 store_fail;
  5170. /* Number of times the tid pool alloc succeeded */
  5171. A_UINT32 tid_pool_alloc_succ;
  5172. /* Number of times the MPDU pool alloc succeeded */
  5173. A_UINT32 mpdu_pool_alloc_succ;
  5174. /* Number of times the MSDU pool alloc succeeded */
  5175. A_UINT32 msdu_pool_alloc_succ;
  5176. /* Number of times the tid pool alloc failed */
  5177. A_UINT32 tid_pool_alloc_fail;
  5178. /* Number of times the MPDU pool alloc failed */
  5179. A_UINT32 mpdu_pool_alloc_fail;
  5180. /* Number of times the MSDU pool alloc failed */
  5181. A_UINT32 msdu_pool_alloc_fail;
  5182. /* Number of times the tid pool freed */
  5183. A_UINT32 tid_pool_free;
  5184. /* Number of times the MPDU pool freed */
  5185. A_UINT32 mpdu_pool_free;
  5186. /* Number of times the MSDU pool freed */
  5187. A_UINT32 msdu_pool_free;
  5188. /* number of MSDUs undelivered to HTT and queued
  5189. * to Data Rx MSDU free list */
  5190. A_UINT32 msdu_queued;
  5191. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  5192. A_UINT32 msdu_recycled;
  5193. /* Number of MPDUs with invalid peer but A2 found in AST */
  5194. A_UINT32 invalid_peer_a2_in_ast;
  5195. /* Number of MPDUs with invalid peer but A3 found in AST */
  5196. A_UINT32 invalid_peer_a3_in_ast;
  5197. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  5198. A_UINT32 invalid_peer_bmc_mpdus;
  5199. /* Number of MSDUs with err attention word */
  5200. A_UINT32 rxdesc_err_att;
  5201. /* Number of MSDUs with flag of peer_idx_invalid */
  5202. A_UINT32 rxdesc_err_peer_idx_inv;
  5203. /* Number of MSDUs with flag of peer_idx_timeout */
  5204. A_UINT32 rxdesc_err_peer_idx_to;
  5205. /* Number of MSDUs with flag of overflow */
  5206. A_UINT32 rxdesc_err_ov;
  5207. /* Number of MSDUs with flag of msdu_length_err */
  5208. A_UINT32 rxdesc_err_msdu_len;
  5209. /* Number of MSDUs with flag of mpdu_length_err */
  5210. A_UINT32 rxdesc_err_mpdu_len;
  5211. /* Number of MSDUs with flag of tkip_mic_err */
  5212. A_UINT32 rxdesc_err_tkip_mic;
  5213. /* Number of MSDUs with flag of decrypt_err */
  5214. A_UINT32 rxdesc_err_decrypt;
  5215. /* Number of MSDUs with flag of fcs_err */
  5216. A_UINT32 rxdesc_err_fcs;
  5217. /* Number of Unicast (bc_mc bit is not set in attention word)
  5218. * frames with invalid peer handler
  5219. */
  5220. A_UINT32 rxdesc_uc_msdus_inv_peer;
  5221. /* Number of unicast frame directly (direct bit is set in attention word)
  5222. * to DUT with invalid peer handler
  5223. */
  5224. A_UINT32 rxdesc_direct_msdus_inv_peer;
  5225. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  5226. * frames with invalid peer handler
  5227. */
  5228. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  5229. /* Number of MSDUs dropped due to no first MSDU flag */
  5230. A_UINT32 rxdesc_no_1st_msdu;
  5231. /* Number of MSDUs droped due to ring overflow */
  5232. A_UINT32 msdu_drop_ring_ov;
  5233. /* Number of MSDUs dropped due to FC mismatch */
  5234. A_UINT32 msdu_drop_fc_mismatch;
  5235. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  5236. A_UINT32 msdu_drop_mgmt_remote_ring;
  5237. /* Number of MSDUs dropped due to errors not reported in attention word */
  5238. A_UINT32 msdu_drop_misc;
  5239. /* Number of MSDUs go to offload before reorder */
  5240. A_UINT32 offload_msdu_wal;
  5241. /* Number of data frame dropped by offload after reorder */
  5242. A_UINT32 offload_msdu_reorder;
  5243. /* Number of MPDUs with sequence number in the past and within
  5244. the BA window */
  5245. A_UINT32 dup_past_within_window;
  5246. /* Number of MPDUs with sequence number in the past and
  5247. * outside the BA window */
  5248. A_UINT32 dup_past_outside_window;
  5249. /* Number of MSDUs with decrypt/MIC error */
  5250. A_UINT32 rxdesc_err_decrypt_mic;
  5251. /* Number of data MSDUs received on both local and remote rings */
  5252. A_UINT32 data_msdus_on_both_rings;
  5253. };
  5254. /*
  5255. * Rx Remote buffer statistics
  5256. * NB: all the fields must be defined in 4 octets size.
  5257. */
  5258. struct rx_remote_buffer_mgmt_stats {
  5259. /* Total number of MSDUs reaped for Rx processing */
  5260. A_UINT32 remote_reaped;
  5261. /* MSDUs recycled within firmware */
  5262. A_UINT32 remote_recycled;
  5263. /* MSDUs stored by Data Rx */
  5264. A_UINT32 data_rx_msdus_stored;
  5265. /* Number of HTT indications from WAL Rx MSDU */
  5266. A_UINT32 wal_rx_ind;
  5267. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  5268. A_UINT32 wal_rx_ind_unconsumed;
  5269. /* Number of HTT indications from Data Rx MSDU */
  5270. A_UINT32 data_rx_ind;
  5271. /* Number of unconsumed HTT indications from Data Rx MSDU */
  5272. A_UINT32 data_rx_ind_unconsumed;
  5273. /* Number of HTT indications from ATHBUF */
  5274. A_UINT32 athbuf_rx_ind;
  5275. /* Number of remote buffers requested for refill */
  5276. A_UINT32 refill_buf_req;
  5277. /* Number of remote buffers filled by the host */
  5278. A_UINT32 refill_buf_rsp;
  5279. /* Number of times MAC hw_index = f/w write_index */
  5280. A_INT32 mac_no_bufs;
  5281. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  5282. A_INT32 fw_indices_equal;
  5283. /* Number of times f/w finds no buffers to post */
  5284. A_INT32 host_no_bufs;
  5285. };
  5286. /*
  5287. * TXBF MU/SU packets and NDPA statistics
  5288. * NB: all the fields must be defined in 4 octets size.
  5289. */
  5290. struct rx_txbf_musu_ndpa_pkts_stats {
  5291. /* number of TXBF MU packets received */
  5292. A_UINT32 number_mu_pkts;
  5293. /* number of TXBF SU packets received */
  5294. A_UINT32 number_su_pkts;
  5295. /* number of TXBF directed NDPA */
  5296. A_UINT32 txbf_directed_ndpa_count;
  5297. /* number of TXBF retried NDPA */
  5298. A_UINT32 txbf_ndpa_retry_count;
  5299. /* total number of TXBF NDPA */
  5300. A_UINT32 txbf_total_ndpa_count;
  5301. /* must be set to 0x0 */
  5302. A_UINT32 reserved[3];
  5303. };
  5304. /*
  5305. * htt_dbg_stats_status -
  5306. * present - The requested stats have been delivered in full.
  5307. * This indicates that either the stats information was contained
  5308. * in its entirety within this message, or else this message
  5309. * completes the delivery of the requested stats info that was
  5310. * partially delivered through earlier STATS_CONF messages.
  5311. * partial - The requested stats have been delivered in part.
  5312. * One or more subsequent STATS_CONF messages with the same
  5313. * cookie value will be sent to deliver the remainder of the
  5314. * information.
  5315. * error - The requested stats could not be delivered, for example due
  5316. * to a shortage of memory to construct a message holding the
  5317. * requested stats.
  5318. * invalid - The requested stat type is either not recognized, or the
  5319. * target is configured to not gather the stats type in question.
  5320. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  5321. * series_done - This special value indicates that no further stats info
  5322. * elements are present within a series of stats info elems
  5323. * (within a stats upload confirmation message).
  5324. */
  5325. enum htt_dbg_stats_status {
  5326. HTT_DBG_STATS_STATUS_PRESENT = 0,
  5327. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  5328. HTT_DBG_STATS_STATUS_ERROR = 2,
  5329. HTT_DBG_STATS_STATUS_INVALID = 3,
  5330. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  5331. };
  5332. /**
  5333. * @brief target -> host statistics upload
  5334. *
  5335. * @details
  5336. * The following field definitions describe the format of the HTT target
  5337. * to host stats upload confirmation message.
  5338. * The message contains a cookie echoed from the HTT host->target stats
  5339. * upload request, which identifies which request the confirmation is
  5340. * for, and a series of tag-length-value stats information elements.
  5341. * The tag-length header for each stats info element also includes a
  5342. * status field, to indicate whether the request for the stat type in
  5343. * question was fully met, partially met, unable to be met, or invalid
  5344. * (if the stat type in question is disabled in the target).
  5345. * A special value of all 1's in this status field is used to indicate
  5346. * the end of the series of stats info elements.
  5347. *
  5348. *
  5349. * |31 16|15 8|7 5|4 0|
  5350. * |------------------------------------------------------------|
  5351. * | reserved | msg type |
  5352. * |------------------------------------------------------------|
  5353. * | cookie LSBs |
  5354. * |------------------------------------------------------------|
  5355. * | cookie MSBs |
  5356. * |------------------------------------------------------------|
  5357. * | stats entry length | reserved | S |stat type|
  5358. * |------------------------------------------------------------|
  5359. * | |
  5360. * | type-specific stats info |
  5361. * | |
  5362. * |------------------------------------------------------------|
  5363. * | stats entry length | reserved | S |stat type|
  5364. * |------------------------------------------------------------|
  5365. * | |
  5366. * | type-specific stats info |
  5367. * | |
  5368. * |------------------------------------------------------------|
  5369. * | n/a | reserved | 111 | n/a |
  5370. * |------------------------------------------------------------|
  5371. * Header fields:
  5372. * - MSG_TYPE
  5373. * Bits 7:0
  5374. * Purpose: identifies this is a statistics upload confirmation message
  5375. * Value: 0x9
  5376. * - COOKIE_LSBS
  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: LSBs of the opaque cookie specified by the host-side requestor
  5381. * - COOKIE_MSBS
  5382. * Bits 31:0
  5383. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5384. * message with its preceding host->target stats request message.
  5385. * Value: MSBs of the opaque cookie specified by the host-side requestor
  5386. *
  5387. * Stats Information Element tag-length header fields:
  5388. * - STAT_TYPE
  5389. * Bits 4:0
  5390. * Purpose: identifies the type of statistics info held in the
  5391. * following information element
  5392. * Value: htt_dbg_stats_type
  5393. * - STATUS
  5394. * Bits 7:5
  5395. * Purpose: indicate whether the requested stats are present
  5396. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  5397. * the completion of the stats entry series
  5398. * - LENGTH
  5399. * Bits 31:16
  5400. * Purpose: indicate the stats information size
  5401. * Value: This field specifies the number of bytes of stats information
  5402. * that follows the element tag-length header.
  5403. * It is expected but not required that this length is a multiple of
  5404. * 4 bytes. Even if the length is not an integer multiple of 4, the
  5405. * subsequent stats entry header will begin on a 4-byte aligned
  5406. * boundary.
  5407. */
  5408. #define HTT_T2H_STATS_COOKIE_SIZE 8
  5409. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  5410. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  5411. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  5412. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  5413. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  5414. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  5415. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  5416. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  5417. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  5418. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  5419. do { \
  5420. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  5421. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  5422. } while (0)
  5423. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  5424. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  5425. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  5426. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  5427. do { \
  5428. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  5429. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  5430. } while (0)
  5431. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  5432. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  5433. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  5434. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  5435. do { \
  5436. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  5437. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  5438. } while (0)
  5439. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  5440. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  5441. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  5442. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  5443. #define HTT_MAX_AGGR 64
  5444. #define HTT_HL_MAX_AGGR 18
  5445. /**
  5446. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  5447. *
  5448. * @details
  5449. * The following field definitions describe the format of the HTT host
  5450. * to target frag_desc/msdu_ext bank configuration message.
  5451. * The message contains the based address and the min and max id of the
  5452. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  5453. * MSDU_EXT/FRAG_DESC.
  5454. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  5455. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  5456. * the hardware does the mapping/translation.
  5457. *
  5458. * Total banks that can be configured is configured to 16.
  5459. *
  5460. * This should be called before any TX has be initiated by the HTT
  5461. *
  5462. * |31 16|15 8|7 5|4 0|
  5463. * |------------------------------------------------------------|
  5464. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  5465. * |------------------------------------------------------------|
  5466. * | BANK0_BASE_ADDRESS (bits 31:0) |
  5467. #if HTT_PADDR64
  5468. * | BANK0_BASE_ADDRESS (bits 63:32) |
  5469. #endif
  5470. * |------------------------------------------------------------|
  5471. * | ... |
  5472. * |------------------------------------------------------------|
  5473. * | BANK15_BASE_ADDRESS (bits 31:0) |
  5474. #if HTT_PADDR64
  5475. * | BANK15_BASE_ADDRESS (bits 63:32) |
  5476. #endif
  5477. * |------------------------------------------------------------|
  5478. * | BANK0_MAX_ID | BANK0_MIN_ID |
  5479. * |------------------------------------------------------------|
  5480. * | ... |
  5481. * |------------------------------------------------------------|
  5482. * | BANK15_MAX_ID | BANK15_MIN_ID |
  5483. * |------------------------------------------------------------|
  5484. * Header fields:
  5485. * - MSG_TYPE
  5486. * Bits 7:0
  5487. * Value: 0x6
  5488. * for systems with 64-bit format for bus addresses:
  5489. * - BANKx_BASE_ADDRESS_LO
  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: lower 4 bytes of MSDU_EXT bank physical / bus address
  5494. * - BANKx_BASE_ADDRESS_HI
  5495. * Bits 31:0
  5496. * Purpose: Provide a mechanism to specify the base address of the
  5497. * MSDU_EXT bank physical/bus address.
  5498. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  5499. * for systems with 32-bit format for bus addresses:
  5500. * - BANKx_BASE_ADDRESS
  5501. * Bits 31:0
  5502. * Purpose: Provide a mechanism to specify the base address of the
  5503. * MSDU_EXT bank physical/bus address.
  5504. * Value: MSDU_EXT bank physical / bus address
  5505. * - BANKx_MIN_ID
  5506. * Bits 15:0
  5507. * Purpose: Provide a mechanism to specify the min index that needs to
  5508. * mapped.
  5509. * - BANKx_MAX_ID
  5510. * Bits 31:16
  5511. * Purpose: Provide a mechanism to specify the max index that needs to
  5512. * mapped.
  5513. *
  5514. */
  5515. /** @todo Compress the fields to fit MAX HTT Message size, until then
  5516. * configure to a safe value.
  5517. * @note MAX supported banks is 16.
  5518. */
  5519. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  5520. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  5521. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  5522. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  5523. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  5524. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  5525. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  5526. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  5527. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  5528. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  5529. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  5530. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  5531. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  5532. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  5533. do { \
  5534. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  5535. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  5536. } while (0)
  5537. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  5538. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> \
  5539. HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  5540. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  5541. do { \
  5542. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value);\
  5543. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S);\
  5544. } while (0)
  5545. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  5546. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> \
  5547. HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  5548. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  5549. do { \
  5550. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  5551. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  5552. } while (0)
  5553. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  5554. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> \
  5555. HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  5556. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  5557. do { \
  5558. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  5559. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  5560. } while (0)
  5561. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  5562. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> \
  5563. HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  5564. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  5565. do { \
  5566. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  5567. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  5568. } while (0)
  5569. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  5570. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> \
  5571. HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  5572. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  5573. do { \
  5574. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  5575. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  5576. } while (0)
  5577. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  5578. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> \
  5579. HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  5580. /*
  5581. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  5582. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  5583. * addresses are stored in a XXX-bit field.
  5584. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  5585. * htt_tx_frag_desc64_bank_cfg_t structs.
  5586. */
  5587. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  5588. _paddr_bits_, \
  5589. _paddr__bank_base_address_) \
  5590. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  5591. /** word 0 \
  5592. * msg_type: 8, \
  5593. * pdev_id: 2, \
  5594. * swap: 1, \
  5595. * reserved0: 5, \
  5596. * num_banks: 8, \
  5597. * desc_size: 8; \
  5598. */ \
  5599. A_UINT32 word0; \
  5600. /* \
  5601. * If bank_base_address is 64 bits, the upper / lower
  5602. * halves are stored \
  5603. * in little-endian order (bytes 0-3 in the first A_UINT32,
  5604. * bytes 4-7 in the second A_UINT32). \
  5605. */ \
  5606. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  5607. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  5608. } POSTPACK
  5609. /* define htt_tx_frag_desc32_bank_cfg_t */
  5610. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  5611. /* define htt_tx_frag_desc64_bank_cfg_t */
  5612. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  5613. /*
  5614. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  5615. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  5616. */
  5617. #if HTT_PADDR64
  5618. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  5619. #else
  5620. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  5621. #endif
  5622. /**
  5623. * @brief target -> host HTT TX Credit total count update message definition
  5624. *
  5625. *|31 16|15|14 9| 8 |7 0 |
  5626. *|---------------------+--+----------+-------+----------|
  5627. *|cur htt credit delta | Q| reserved | sign | msg type |
  5628. *|------------------------------------------------------|
  5629. *
  5630. * Header fields:
  5631. * - MSG_TYPE
  5632. * Bits 7:0
  5633. * Purpose: identifies this as a htt tx credit delta update message
  5634. * Value: 0xe
  5635. * - SIGN
  5636. * Bits 8
  5637. * identifies whether credit delta is positive or negative
  5638. * Value:
  5639. * - 0x0: credit delta is positive, rebalance in some buffers
  5640. * - 0x1: credit delta is negative, rebalance out some buffers
  5641. * - reserved
  5642. * Bits 14:9
  5643. * Value: 0x0
  5644. * - TXQ_GRP
  5645. * Bit 15
  5646. * Purpose: indicates whether any tx queue group information elements
  5647. * are appended to the tx credit update message
  5648. * Value: 0 -> no tx queue group information element is present
  5649. * 1 -> a tx queue group information element immediately follows
  5650. * - DELTA_COUNT
  5651. * Bits 31:16
  5652. * Purpose: Specify current htt credit delta absolute count
  5653. */
  5654. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  5655. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  5656. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  5657. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  5658. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  5659. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  5660. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  5661. do { \
  5662. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  5663. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  5664. } while (0)
  5665. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  5666. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  5667. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  5668. do { \
  5669. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  5670. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  5671. } while (0)
  5672. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  5673. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  5674. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  5675. do { \
  5676. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  5677. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  5678. } while (0)
  5679. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  5680. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  5681. #define HTT_TX_CREDIT_MSG_BYTES 4
  5682. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  5683. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  5684. /**
  5685. * @brief HTT WDI_IPA Operation Response Message
  5686. *
  5687. * @details
  5688. * HTT WDI_IPA Operation Response message is sent by target
  5689. * to host confirming suspend or resume operation.
  5690. * |31 24|23 16|15 8|7 0|
  5691. * |----------------+----------------+----------------+----------------|
  5692. * | op_code | Rsvd | msg_type |
  5693. * |-------------------------------------------------------------------|
  5694. * | Rsvd | Response len |
  5695. * |-------------------------------------------------------------------|
  5696. * | |
  5697. * | Response-type specific info |
  5698. * | |
  5699. * | |
  5700. * |-------------------------------------------------------------------|
  5701. * Header fields:
  5702. * - MSG_TYPE
  5703. * Bits 7:0
  5704. * Purpose: Identifies this as WDI_IPA Operation Response message
  5705. * value: = 0x13
  5706. * - OP_CODE
  5707. * Bits 31:16
  5708. * Purpose: Identifies the operation target is responding to
  5709. * (e.g. TX suspend)
  5710. * value: = enum htt_wdi_ipa_op_code
  5711. * - RSP_LEN
  5712. * Bits 16:0
  5713. * Purpose: length for the response-type specific info
  5714. * value: = length in bytes for response-type specific info
  5715. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  5716. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  5717. */
  5718. PREPACK struct htt_wdi_ipa_op_response_t {
  5719. /* DWORD 0: flags and meta-data */
  5720. A_UINT32
  5721. msg_type:8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  5722. reserved1:8,
  5723. op_code:16;
  5724. A_UINT32
  5725. rsp_len:16,
  5726. reserved2:16;
  5727. } POSTPACK;
  5728. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  5729. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  5730. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  5731. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  5732. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  5733. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  5734. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> \
  5735. HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  5736. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  5737. do { \
  5738. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  5739. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  5740. } while (0)
  5741. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  5742. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> \
  5743. HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  5744. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  5745. do { \
  5746. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  5747. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  5748. } while (0)
  5749. enum htt_phy_mode {
  5750. htt_phy_mode_11a = 0,
  5751. htt_phy_mode_11g = 1,
  5752. htt_phy_mode_11b = 2,
  5753. htt_phy_mode_11g_only = 3,
  5754. htt_phy_mode_11na_ht20 = 4,
  5755. htt_phy_mode_11ng_ht20 = 5,
  5756. htt_phy_mode_11na_ht40 = 6,
  5757. htt_phy_mode_11ng_ht40 = 7,
  5758. htt_phy_mode_11ac_vht20 = 8,
  5759. htt_phy_mode_11ac_vht40 = 9,
  5760. htt_phy_mode_11ac_vht80 = 10,
  5761. htt_phy_mode_11ac_vht20_2g = 11,
  5762. htt_phy_mode_11ac_vht40_2g = 12,
  5763. htt_phy_mode_11ac_vht80_2g = 13,
  5764. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  5765. htt_phy_mode_11ac_vht160 = 15,
  5766. htt_phy_mode_max,
  5767. };
  5768. /**
  5769. * @brief target -> host HTT channel change indication
  5770. * @details
  5771. * Specify when a channel change occurs.
  5772. * This allows the host to precisely determine which rx frames arrived
  5773. * on the old channel and which rx frames arrived on the new channel.
  5774. *
  5775. *|31 |7 0 |
  5776. *|-------------------------------------------+----------|
  5777. *| reserved | msg type |
  5778. *|------------------------------------------------------|
  5779. *| primary_chan_center_freq_mhz |
  5780. *|------------------------------------------------------|
  5781. *| contiguous_chan1_center_freq_mhz |
  5782. *|------------------------------------------------------|
  5783. *| contiguous_chan2_center_freq_mhz |
  5784. *|------------------------------------------------------|
  5785. *| phy_mode |
  5786. *|------------------------------------------------------|
  5787. *
  5788. * Header fields:
  5789. * - MSG_TYPE
  5790. * Bits 7:0
  5791. * Purpose: identifies this as a htt channel change indication message
  5792. * Value: 0x15
  5793. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  5794. * Bits 31:0
  5795. * Purpose: identify the (center of the) new 20 MHz primary channel
  5796. * Value: center frequency of the 20 MHz primary channel, in MHz units
  5797. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  5798. * Bits 31:0
  5799. * Purpose: identify the (center of the) contiguous frequency range
  5800. * comprising the new channel.
  5801. * For example, if the new channel is a 80 MHz channel extending
  5802. * 60 MHz beyond the primary channel, this field would be 30 larger
  5803. * than the primary channel center frequency field.
  5804. * Value: center frequency of the contiguous frequency range comprising
  5805. * the full channel in MHz units
  5806. * (80+80 channels also use the CONTIG_CHAN2 field)
  5807. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  5808. * Bits 31:0
  5809. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  5810. * within a VHT 80+80 channel.
  5811. * This field is only relevant for VHT 80+80 channels.
  5812. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  5813. * channel (arbitrary value for cases besides VHT 80+80)
  5814. * - PHY_MODE
  5815. * Bits 31:0
  5816. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  5817. * and band
  5818. * Value: htt_phy_mode enum value
  5819. */
  5820. PREPACK struct htt_chan_change_t {
  5821. /* DWORD 0: flags and meta-data */
  5822. A_UINT32 msg_type:8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  5823. reserved1:24;
  5824. A_UINT32 primary_chan_center_freq_mhz;
  5825. A_UINT32 contig_chan1_center_freq_mhz;
  5826. A_UINT32 contig_chan2_center_freq_mhz;
  5827. A_UINT32 phy_mode;
  5828. } POSTPACK;
  5829. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  5830. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  5831. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  5832. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  5833. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  5834. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  5835. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  5836. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  5837. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  5838. do { \
  5839. HTT_CHECK_SET_VAL( \
  5840. HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value); \
  5841. (word) |= (value) << \
  5842. HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  5843. } while (0)
  5844. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  5845. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  5846. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  5847. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  5848. do { \
  5849. HTT_CHECK_SET_VAL( \
  5850. HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value); \
  5851. (word) |= (value) << \
  5852. HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  5853. } while (0)
  5854. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  5855. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  5856. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  5857. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  5858. do { \
  5859. HTT_CHECK_SET_VAL( \
  5860. HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value); \
  5861. (word) |= (value) << \
  5862. HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  5863. } while (0)
  5864. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  5865. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  5866. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  5867. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  5868. do { \
  5869. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value); \
  5870. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  5871. } while (0)
  5872. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  5873. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  5874. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  5875. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  5876. /**
  5877. * @brief rx offload packet error message
  5878. *
  5879. * @details
  5880. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  5881. * of target payload like mic err.
  5882. *
  5883. * |31 24|23 16|15 8|7 0|
  5884. * |----------------+----------------+----------------+----------------|
  5885. * | tid | vdev_id | msg_sub_type | msg_type |
  5886. * |-------------------------------------------------------------------|
  5887. * : (sub-type dependent content) :
  5888. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  5889. * Header fields:
  5890. * - msg_type
  5891. * Bits 7:0
  5892. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  5893. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  5894. * - msg_sub_type
  5895. * Bits 15:8
  5896. * Purpose: Identifies which type of rx error is reported by this message
  5897. * value: htt_rx_ofld_pkt_err_type
  5898. * - vdev_id
  5899. * Bits 23:16
  5900. * Purpose: Identifies which vdev received the erroneous rx frame
  5901. * value:
  5902. * - tid
  5903. * Bits 31:24
  5904. * Purpose: Identifies the traffic type of the rx frame
  5905. * value:
  5906. *
  5907. * - The payload fields used if the sub-type == MIC error are shown below.
  5908. * Note - MIC err is per MSDU, while PN is per MPDU.
  5909. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  5910. * with MIC err in A-MSDU case, so FW will send only one HTT message
  5911. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  5912. * instead of sending separate HTT messages for each wrong MSDU within
  5913. * the MPDU.
  5914. *
  5915. * |31 24|23 16|15 8|7 0|
  5916. * |----------------+----------------+----------------+----------------|
  5917. * | Rsvd | key_id | peer_id |
  5918. * |-------------------------------------------------------------------|
  5919. * | receiver MAC addr 31:0 |
  5920. * |-------------------------------------------------------------------|
  5921. * | Rsvd | receiver MAC addr 47:32 |
  5922. * |-------------------------------------------------------------------|
  5923. * | transmitter MAC addr 31:0 |
  5924. * |-------------------------------------------------------------------|
  5925. * | Rsvd | transmitter MAC addr 47:32 |
  5926. * |-------------------------------------------------------------------|
  5927. * | PN 31:0 |
  5928. * |-------------------------------------------------------------------|
  5929. * | Rsvd | PN 47:32 |
  5930. * |-------------------------------------------------------------------|
  5931. * - peer_id
  5932. * Bits 15:0
  5933. * Purpose: identifies which peer is frame is from
  5934. * value:
  5935. * - key_id
  5936. * Bits 23:16
  5937. * Purpose: identifies key_id of rx frame
  5938. * value:
  5939. * - RA_31_0 (receiver MAC addr 31:0)
  5940. * Bits 31:0
  5941. * Purpose: identifies by MAC address which vdev received the frame
  5942. * value: MAC address lower 4 bytes
  5943. * - RA_47_32 (receiver MAC addr 47:32)
  5944. * Bits 15:0
  5945. * Purpose: identifies by MAC address which vdev received the frame
  5946. * value: MAC address upper 2 bytes
  5947. * - TA_31_0 (transmitter MAC addr 31:0)
  5948. * Bits 31:0
  5949. * Purpose: identifies by MAC address which peer transmitted the frame
  5950. * value: MAC address lower 4 bytes
  5951. * - TA_47_32 (transmitter MAC addr 47:32)
  5952. * Bits 15:0
  5953. * Purpose: identifies by MAC address which peer transmitted the frame
  5954. * value: MAC address upper 2 bytes
  5955. * - PN_31_0
  5956. * Bits 31:0
  5957. * Purpose: Identifies pn of rx frame
  5958. * value: PN lower 4 bytes
  5959. * - PN_47_32
  5960. * Bits 15:0
  5961. * Purpose: Identifies pn of rx frame
  5962. * value:
  5963. * TKIP or CCMP: PN upper 2 bytes
  5964. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  5965. */
  5966. enum htt_rx_ofld_pkt_err_type {
  5967. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  5968. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  5969. };
  5970. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  5971. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  5972. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  5973. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  5974. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  5975. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  5976. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  5977. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  5978. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  5979. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  5980. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  5981. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  5982. do { \
  5983. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  5984. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  5985. } while (0)
  5986. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  5987. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> \
  5988. HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  5989. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  5990. do { \
  5991. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  5992. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  5993. } while (0)
  5994. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  5995. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  5996. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  5997. do { \
  5998. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  5999. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  6000. } while (0)
  6001. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  6002. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  6003. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  6004. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  6005. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  6006. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  6007. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  6008. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  6009. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  6010. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  6011. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  6012. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  6013. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  6014. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  6015. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  6016. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  6017. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  6018. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  6019. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  6020. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  6021. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  6022. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  6023. do { \
  6024. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  6025. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  6026. } while (0)
  6027. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  6028. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  6029. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  6030. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  6031. do { \
  6032. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  6033. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  6034. } while (0)
  6035. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  6036. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  6037. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  6038. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  6039. do { \
  6040. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  6041. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  6042. } while (0)
  6043. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  6044. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  6045. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  6046. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  6047. do { \
  6048. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  6049. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  6050. } while (0)
  6051. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  6052. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  6053. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  6054. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  6055. do { \
  6056. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  6057. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  6058. } while (0)
  6059. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  6060. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  6061. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  6062. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  6063. do { \
  6064. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  6065. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  6066. } while (0)
  6067. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  6068. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  6069. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  6070. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  6071. do { \
  6072. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  6073. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  6074. } while (0)
  6075. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  6076. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  6077. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  6078. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  6079. do { \
  6080. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  6081. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  6082. } while (0)
  6083. /**
  6084. * @brief peer rate report message
  6085. *
  6086. * @details
  6087. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  6088. * justified rate of all the peers.
  6089. *
  6090. * |31 24|23 16|15 8|7 0|
  6091. * |----------------+----------------+----------------+----------------|
  6092. * | peer_count | | msg_type |
  6093. * |-------------------------------------------------------------------|
  6094. * : Payload (variant number of peer rate report) :
  6095. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  6096. * Header fields:
  6097. * - msg_type
  6098. * Bits 7:0
  6099. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  6100. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  6101. * - reserved
  6102. * Bits 15:8
  6103. * Purpose:
  6104. * value:
  6105. * - peer_count
  6106. * Bits 31:16
  6107. * Purpose: Specify how many peer rate report elements are present in the payload.
  6108. * value:
  6109. *
  6110. * Payload:
  6111. * There are variant number of peer rate report follow the first 32 bits.
  6112. * The peer rate report is defined as follows.
  6113. *
  6114. * |31 20|19 16|15 0|
  6115. * |-----------------------+---------+---------------------------------|-
  6116. * | reserved | phy | peer_id | \
  6117. * |-------------------------------------------------------------------| -> report #0
  6118. * | rate | /
  6119. * |-----------------------+---------+---------------------------------|-
  6120. * | reserved | phy | peer_id | \
  6121. * |-------------------------------------------------------------------| -> report #1
  6122. * | rate | /
  6123. * |-----------------------+---------+---------------------------------|-
  6124. * | reserved | phy | peer_id | \
  6125. * |-------------------------------------------------------------------| -> report #2
  6126. * | rate | /
  6127. * |-------------------------------------------------------------------|-
  6128. * : :
  6129. * : :
  6130. * : :
  6131. * :-------------------------------------------------------------------:
  6132. *
  6133. * - peer_id
  6134. * Bits 15:0
  6135. * Purpose: identify the peer
  6136. * value:
  6137. * - phy
  6138. * Bits 19:16
  6139. * Purpose: identify which phy is in use
  6140. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  6141. * Please see enum htt_peer_report_phy_type for detail.
  6142. * - reserved
  6143. * Bits 31:20
  6144. * Purpose:
  6145. * value:
  6146. * - rate
  6147. * Bits 31:0
  6148. * Purpose: represent the justified rate of the peer specified by peer_id
  6149. * value:
  6150. */
  6151. enum htt_peer_rate_report_phy_type {
  6152. HTT_PEER_RATE_REPORT_11B = 0,
  6153. HTT_PEER_RATE_REPORT_11A_G,
  6154. HTT_PEER_RATE_REPORT_11N,
  6155. HTT_PEER_RATE_REPORT_11AC,
  6156. };
  6157. #define HTT_PEER_RATE_REPORT_SIZE 8
  6158. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  6159. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  6160. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  6161. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  6162. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  6163. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  6164. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  6165. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  6166. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  6167. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  6168. do { \
  6169. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  6170. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  6171. } while (0)
  6172. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  6173. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  6174. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  6175. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  6176. do { \
  6177. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  6178. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  6179. } while (0)
  6180. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  6181. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  6182. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  6183. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  6184. do { \
  6185. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  6186. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  6187. } while (0)
  6188. /**
  6189. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  6190. *
  6191. * @details
  6192. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  6193. * a flow of descriptors.
  6194. *
  6195. * This message is in TLV format and indicates the parameters to be setup a
  6196. * flow in the host. Each entry indicates that a particular flow ID is ready to
  6197. * receive descriptors from a specified pool.
  6198. *
  6199. * The message would appear as follows:
  6200. *
  6201. * |31 24|23 16|15 8|7 0|
  6202. * |----------------+----------------+----------------+----------------|
  6203. * header | reserved | num_flows | msg_type |
  6204. * |-------------------------------------------------------------------|
  6205. * | |
  6206. * : payload :
  6207. * | |
  6208. * |-------------------------------------------------------------------|
  6209. *
  6210. * The header field is one DWORD long and is interpreted as follows:
  6211. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  6212. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  6213. * this message
  6214. * b'16-31 - reserved: These bits are reserved for future use
  6215. *
  6216. * Payload:
  6217. * The payload would contain multiple objects of the following structure. Each
  6218. * object represents a flow.
  6219. *
  6220. * |31 24|23 16|15 8|7 0|
  6221. * |----------------+----------------+----------------+----------------|
  6222. * header | reserved | num_flows | msg_type |
  6223. * |-------------------------------------------------------------------|
  6224. * payload0| flow_type |
  6225. * |-------------------------------------------------------------------|
  6226. * | flow_id |
  6227. * |-------------------------------------------------------------------|
  6228. * | reserved0 | flow_pool_id |
  6229. * |-------------------------------------------------------------------|
  6230. * | reserved1 | flow_pool_size |
  6231. * |-------------------------------------------------------------------|
  6232. * | reserved2 |
  6233. * |-------------------------------------------------------------------|
  6234. * payload1| flow_type |
  6235. * |-------------------------------------------------------------------|
  6236. * | flow_id |
  6237. * |-------------------------------------------------------------------|
  6238. * | reserved0 | flow_pool_id |
  6239. * |-------------------------------------------------------------------|
  6240. * | reserved1 | flow_pool_size |
  6241. * |-------------------------------------------------------------------|
  6242. * | reserved2 |
  6243. * |-------------------------------------------------------------------|
  6244. * | . |
  6245. * | . |
  6246. * | . |
  6247. * |-------------------------------------------------------------------|
  6248. *
  6249. * Each payload is 5 DWORDS long and is interpreted as follows:
  6250. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  6251. * this flow is associated. It can be VDEV, peer,
  6252. * or tid (AC). Based on enum htt_flow_type.
  6253. *
  6254. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  6255. * object. For flow_type vdev it is set to the
  6256. * vdevid, for peer it is peerid and for tid, it is
  6257. * tid_num.
  6258. *
  6259. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  6260. * in the host for this flow
  6261. * b'16:31 - reserved0: This field in reserved for the future. In case
  6262. * we have a hierarchical implementation (HCM) of
  6263. * pools, it can be used to indicate the ID of the
  6264. * parent-pool.
  6265. *
  6266. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  6267. * Descriptors for this flow will be
  6268. * allocated from this pool in the host.
  6269. * b'16:31 - reserved1: This field in reserved for the future. In case
  6270. * we have a hierarchical implementation of pools,
  6271. * it can be used to indicate the max number of
  6272. * descriptors in the pool. The b'0:15 can be used
  6273. * to indicate min number of descriptors in the
  6274. * HCM scheme.
  6275. *
  6276. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  6277. * we have a hierarchical implementation of pools,
  6278. * b'0:15 can be used to indicate the
  6279. * priority-based borrowing (PBB) threshold of
  6280. * the flow's pool. The b'16:31 are still left
  6281. * reserved.
  6282. */
  6283. enum htt_flow_type {
  6284. FLOW_TYPE_VDEV = 0,
  6285. /* Insert new flow types above this line */
  6286. };
  6287. PREPACK struct htt_flow_pool_map_payload_t {
  6288. A_UINT32 flow_type;
  6289. A_UINT32 flow_id;
  6290. A_UINT32 flow_pool_id:16,
  6291. reserved0:16;
  6292. A_UINT32 flow_pool_size:16,
  6293. reserved1:16;
  6294. A_UINT32 reserved2;
  6295. } POSTPACK;
  6296. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  6297. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  6298. (sizeof(struct htt_flow_pool_map_payload_t))
  6299. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  6300. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  6301. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  6302. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  6303. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  6304. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  6305. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  6306. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  6307. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  6308. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  6309. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  6310. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  6311. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  6312. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  6313. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  6314. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  6315. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  6316. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  6317. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  6318. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  6319. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  6320. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  6321. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  6322. do { \
  6323. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  6324. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  6325. } while (0)
  6326. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  6327. do { \
  6328. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  6329. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  6330. } while (0)
  6331. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  6332. do { \
  6333. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  6334. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  6335. } while (0)
  6336. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  6337. do { \
  6338. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  6339. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  6340. } while (0)
  6341. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  6342. do { \
  6343. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  6344. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  6345. } while (0)
  6346. /**
  6347. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  6348. *
  6349. * @details
  6350. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  6351. * down a flow of descriptors.
  6352. * This message indicates that for the flow (whose ID is provided) is wanting
  6353. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  6354. * pool of descriptors from where descriptors are being allocated for this
  6355. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  6356. * be unmapped by the host.
  6357. *
  6358. * The message would appear as follows:
  6359. *
  6360. * |31 24|23 16|15 8|7 0|
  6361. * |----------------+----------------+----------------+----------------|
  6362. * | reserved0 | msg_type |
  6363. * |-------------------------------------------------------------------|
  6364. * | flow_type |
  6365. * |-------------------------------------------------------------------|
  6366. * | flow_id |
  6367. * |-------------------------------------------------------------------|
  6368. * | reserved1 | flow_pool_id |
  6369. * |-------------------------------------------------------------------|
  6370. *
  6371. * The message is interpreted as follows:
  6372. * dword0 - b'0:7 - msg_type: This will be set to
  6373. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  6374. * b'8:31 - reserved0: Reserved for future use
  6375. *
  6376. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  6377. * this flow is associated. It can be VDEV, peer,
  6378. * or tid (AC). Based on enum htt_flow_type.
  6379. *
  6380. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  6381. * object. For flow_type vdev it is set to the
  6382. * vdevid, for peer it is peerid and for tid, it is
  6383. * tid_num.
  6384. *
  6385. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  6386. * used in the host for this flow
  6387. * b'16:31 - reserved0: This field in reserved for the future.
  6388. *
  6389. */
  6390. PREPACK struct htt_flow_pool_unmap_t {
  6391. A_UINT32 msg_type:8,
  6392. reserved0:24;
  6393. A_UINT32 flow_type;
  6394. A_UINT32 flow_id;
  6395. A_UINT32 flow_pool_id:16,
  6396. reserved1:16;
  6397. } POSTPACK;
  6398. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  6399. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  6400. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  6401. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  6402. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  6403. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  6404. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  6405. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  6406. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  6407. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  6408. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  6409. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  6410. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  6411. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  6412. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  6413. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  6414. do { \
  6415. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  6416. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  6417. } while (0)
  6418. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  6419. do { \
  6420. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  6421. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  6422. } while (0)
  6423. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  6424. do { \
  6425. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  6426. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  6427. } while (0)
  6428. #endif